View Single Post
Old 23rd November 2015, 20:50   #1
dolu
Junior Member
 
Join Date: Nov 2015
Posts: 1
ExecWait and run uninstall elevated

Hi all,
I'm trying to get an installer which uninstall previous version if needed.
So, everything is ok when the windows user is admin
But for a classical user, install part works well, but ExecWait never returns.

code:
...
!include "UAC.nsh"
...
RequestExecutionLevel admin
...
Function .onInit
!insertmacro UAC_RunElevated
...
MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION "$msgAlreadyInstalled" IDOK uninst
Abort
;Run the uninstaller
uninst:
ClearErrors
ExecWait '$R0 _?=$INSTDIR'
IfErrors no_remove_uninstaller done
no_remove_uninstaller:
...
done:
FunctionEnd
...



What's wrong ?
Is there another way to call the uninstaller inside the installer ?
Thanks.
dolu is offline   Reply With Quote