首页 文章

NSIS卸载程序与防病毒冲突(趋势科技):无法卸载

提问于
浏览
0

这是NSIS的新手 .

我正在使用ExecWait命令调用我的卸载程序,因为我在卸载之前已经预先定义了自定义页面 .

ExecWait '"$R6\Uninstall.exe" _?=$R6' ;Do not copy the uninstaller to a temp file

$ R6是我的安装目录路径 .

但这是在Windows临时文件夹中卸载期间复制文件,防病毒软件阻止卸载这些文件并破坏uninstaller.exe

如何在卸载过程中停止创建这些临时文件?即使我从控制面板卸载它,我也面临着这个问题 .

由于它是客户端系统,我们无法禁用反病毒(该选项被排除在外) . 请有人帮我解决这个问题 . 提前致谢

1 回答

  • 1

    Trend Micro报告误报 .

    如果你想避免%Temp%,那么你可以使用一个小的卸载启动器:

    !define UNBINNAME "Uninst.bin"
    !define UNHLPNAME "Uninst.exe"
    !ifndef UNHELPER ; Main script:
    OutFile "MySetup.exe"
    RequestExecutionLevel Admin
    Name "MySetup"
    InstallDir "$ProgramFiles\MyApp"
    
    Page Directory
    Page InstFiles
    
    Section
    SetOutPath $InstDir
    WriteUninstaller "$InstDir\${UNBINNAME}" ; Real uninstaller
    !makensis '-DUNHELPER "${__FILE__}"' = 0 ; Compile helper (NSIS v3+)
    File "${UNHLPNAME}" ; Uninstall launcher
    ; TODO: Write uninstall registry entries here
    SectionEnd
    
    Section Uninstall
    Delete "$InstDir\${UNBINNAME}"
    Delete "$InstDir\${UNHLPNAME}"
    RMDir "$InstDir"
    SectionEnd
    
    !else ; Helper:
    OutFile "${UNHLPNAME}"
    RequestExecutionLevel Admin
    SilentInstall silent
    Name "UnHelper"
    Icon "${NSISDIR}\Contrib\Graphics\Icons\classic-uninstall.ico"
    Section
    System::Call "OLE32::CoCreateGuid(g.r0)" ; Note: This will create a .dll in %Temp%, use a unique name instead if this is a problem.
    StrCpy $0 "$LocalAppData\Un$0.exe"
    CopyFiles /SILENT /FILESONLY "$ExeDir\${UNBINNAME}" "$0"
    Exec '"$0" _?=$ExeDir'
    Quit
    SectionEnd
    !endif
    

    如果这个工作,那么AV是相当愚蠢的,%Temp%并不是特别的,用户可以写到其他地方 .

相关问题