View Single Post
Old 8th April 2016, 23:14   #11
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,218
First off I would like to say that I think this %temp% restriction is silly. Malware can just search the disks for a place where it is allowed to write.

The uninstaller is hardcoded to use %temp% to store a copy of itself (so you can delete the one in $instdir). The only way around it is to start it with the special _?= parameter. You could perhaps create a little app that copies the real uninstaller to $localappdata and then starts it with that parameter: Exec '"$localappdata\uninsthack.exe" _?=$exedir'

Edit:

The mini uninstaller might look something like this:

PHP Code:
!define MyTemp "$LocalAppData\MyTempHack"
SilentInstall silent
InstallDir $ExeDir


Section
CopyFiles 
/SILENT "$ExeDir\Uninst.bin" "${MyTemp}\Uninst.exe" Uninst.bin comes from WriteUninstaller in your installer
Exec 
'"${MyTemp}\Uninst.exe" /whatever _?=$ExeDir'
Quit
SectionEnd 

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote