Archive: Can't execute uninstaller from installer


Can't execute uninstaller from installer
I'm trying to uninstall the old version of my software (if installed) before installing the current version using
this code template

My code looks like:

uninst:
ClearErrors
MessageBox IDOK $R0 ; Shows correct uninstaller path
ExecWait '$R0 _?=$INSTDIR' ;Do not copy the uninstaller to a temp file

; ... some stuff cut out for brevity

section "Uninstall"

# Always delete uninstaller first
delete $INSTDIR\Remove${PROGRAM_BASE_FILENAME}.exe
; Verified same as $R0 above

Unfortunately when the uninstaller is executed via ExecWait I get the error:
NSIS Error
Error Launching Installer

If I just browse to the location held in $R0, I find the uninstaller and have no problem running it.

If I use Exec instead of ExecWait, the uninstaller and installer run at the same time.

I'm on Vista 32 bit.

Any ideas?

Thanks!

Eric


Exec and ExecWait use the exact same piece of code to create a new process. The only difference is the wait. So something else must be wrong and my bet goes to quotes. $R0 might contain spaces and should therefore be quoted.