views:

37

answers:

1

Using NSIS, I want to launch an uninstaller and wait for it to finish before proceeding with my installer. The problem is the uninstaller is returning immediately, even though I'm using ExecWait.

I saw this page here: http://nsis.sourceforge.net/When_I_use_ExecWait,_it_doesn%27t_wait which mentions why it's happening, and then offers some suggestions, but I can't get mine to work.

The code I'm trying is:

ExecWait '"C:\path\to\uninstall.exe" /NCRC' $0
MessageBox MB_OK "uninstaller returned $0"

Which shows the message box displaying "uninstaller returned 0" at the same time the uninstaller is launched. Has anyone gotten around this?

Thanks

+2  A: 

The page you linked to talks about ExecWait in general, but it also links to When I use ExecWait uninstaller.exe it doesn't wait for the uninstaller, that is the NSIS specific info you are looking for ( _?=c:\theinstalldir tells nsis uninstaller not to copy itself to %temp% and execute a new (non waiting) copy there)

Anders
Worked like a charm, thanks!
Cuga