【问题标题】:NSIS Uninstaller conflicting with anti-virus (Trend Micro): Unable to uninstallNSIS 卸载程序与防病毒 (Trend Micro) 冲突:无法卸载
【发布时间】:2017-11-22 22:43:27
【问题描述】:

这里是 NSIS 新手。

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

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

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

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

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

由于它是客户端系统,我们无法禁用防病毒(该选项已被排除)。请有人可以帮我解决这个问题。在此先感谢

【问题讨论】:

  • 这个 ExecWait 调用在哪里?在安装程序或卸载程序中?发布更多代码。
  • 嗨安德斯,它在安装程序检查以前安装的应用程序期间被调用,如果找到任何版本,则调用此命令。
  • 如果您在从安装程序运行卸载程序时使用 _?=,则卸载程序不会被复制到 %temp%。
  • Anders ,是的,即使我一直想知道是什么让我的卸载程序在我使用 _?= 时创建了临时文件,而且这只发生在我们测试过的少数系统中,其余代码完美运行美好的。除了杀毒软件,我还有什么需要注意的吗? NSIS 是否与任何系统进程冲突?我对此有点困惑,因为用户无法从他的系统中卸载应用程序
  • 当用户从控制面板运行它时,它会被复制到 temp,_?= 仅适用于在旧版本之上安装新版本的用户。

标签: installation nsis uninstallation antivirus


【解决方案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% 并不是很特别,用户可以写到其他地方。

【讨论】:

  • 我会尝试实现这个并会回复你谢谢
猜你喜欢
  • 2018-10-23
  • 1970-01-01
  • 2012-01-26
  • 2014-06-29
  • 2012-02-12
  • 1970-01-01
  • 2011-02-18
  • 2017-11-15
  • 2011-07-25
相关资源
最近更新 更多