Archive: Exit code of Uninst.exe /S


Exit code of Uninst.exe /S
Hi,
I'm working on a "silent" uninstall. I call the self generated Uninst.exe through another program, it executes well and does cleanly uninstall.
I get its exit code and instead of 0 or 1 (like the exit code of the installer in /S mode) I've got 4407346

Is there something special to do in the "Unsinstall" section ?
Or am I wrong elsewhere ?


Without getting into too many details, the solution is the same as it is for this FAQ item:

http://nsis.sourceforge.net/support/...&tx_faq_faq=14


Indeed, I tested this option in a Win32 console program :

...
CreateProcess (NULL, "C:\\Temp\\Uninst.exe _?=C:\\Temp /S", NULL, NULL, FALSE, CREATE_NO_WINDOW, NULL, NULL, &si, &pi);
...
DWORD dwExitCode = 0;
GetExitCodeProcess (pi.hProcess, &dwExitCode);
...

And it works !
I have got a 0 in dwExitCode when it's ok
and a 1 when it's failed
(I just made a fake Uninst.exe with an Abort in it)

Thank's for the tip ;-)


Are you sure it works as should? The /S switch should be set before _?=.


New FAQ location
The actual FAQ answer that answers this is:

[B]When I use ExecWait uninstaller.exe it doesn't wait for the uninstaller[B]

A precis of the answer is: because what you think is the uninstaller only runs for a fraction of a second: it copies itself to a temporary area and runs from there. This system can be defeated

And the FAQ itself is (currently) at http://nsis.sourceforge.net/When_I_u...he_uninstaller