NSIS 卸载程序与防病毒软件 (Trend Micro) 冲突:无法卸载

NSIS Uninstaller conflicting with anti-virus (Trend Micro): Unable to uninstall

这里是 NSIS 新手。

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

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

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

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

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

由于是客户端系统,我们无法关闭杀毒软件(该选项被排除)。请有人帮我解决这个问题。提前致谢

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 [=10=] "$LocalAppData\Un[=10=].exe"
CopyFiles /SILENT /FILESONLY "$ExeDir${UNBINNAME}" "[=10=]"
Exec '"[=10=]" _?=$ExeDir'
Quit
SectionEnd
!endif

如果这可行,那么 AV 就相当愚蠢,%Temp% 并不特别,用户可以写入其他地方。