faisal
faisal

Reputation: 63

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

An NSIS newbie here.

I am invoking my Uninstaller with ExecWait command as i have pre defined custom pages before the uninstallation takes place.

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

$R6 is my install dir path.

but this is copying files during uninstallation in windows temp folder and the anti-virus software is blocking these files from uninstallation and corrupting the uninstaller.exe

How can i stop the creation of these temp files during uninstallation?? I am facing this problem even while i am uninstalling it from control panel.!?

As it is clients system, we cannot disable the anti virus (that option is ruled out). Please can someone help me out with this. thanks in advance

Upvotes: 1

Views: 872

Answers (1)

Anders
Anders

Reputation: 101756

Report false positives to Trend Micro.

If you want to avoid %Temp% then you can use a little uninstall launcher:

!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

If this works then the AV is rather silly, %Temp% is not really special, the user can write to other places.

Upvotes: 1

Related Questions