Archive: NSIS Error: Error launching installer


NSIS Error: Error launching installer
I have an installer that asks the user if they wish to uninstall the previous version of this application. When they click "Yes" they get the popup error "NSIS Error: Error launching installer". There is no other information. If they click OK the uninstaller continues without any problems.

If they run the uninstaller from the shortcut in the start menu, there is no error and the uninstaller runs correctly.

The error only appears when the installer calls the uninstaller.

I read the uninstaller for the last version from the registry:
ReadRegStr $R0 HKLM \
"Software\Microsoft\Windows\CurrentVersion\Uninstall\Application\
"UninstallString"
StrCmp $R0 "" done

Then I run it:
ExecWait '$R0 _?=${PreviousInstLocation}'

I took this from sample code found on the forums and the sourceforge site...

Has anyone seen something similar to this before? As I said, the uninstaller works without error when run from the start menu shortcut; it is only when the installer calls the uninstaller that the error appears.

Thanks for any help you can give me...


I'd suggest copy/paste that part of code from the included example makensis.nsi


OK - my bad - I figured this out - between the time that I read from the registry into R0 and the time that I used the R0 registry value, I was calling another function that stomped on the value.

oops! thanks Red Wine for responding.


Which is another reason why having local variables would be REALLY handy. =)


Functions should save all variables/registers they want to overwrite on the stack first. And then restore those variables/registers from the stack before returning...