Skip to content
⌘ NSIS Forum Archive

Silent Uninstall

14 posts

goldy1064#

Silent Uninstall

Here's the problem, I previously post this and used the solution from there. Now, though, the start /wait uninst.exe /S doesn't wait, it immediately returns control back. I was wondering if there was a way to accomplish this with the uninstaller as well?
Afrow UK#
This should help you:
Are you a developer who uses NSIS to distribute your application? Are you a Winamp plug-in developer who wants to use NSIS to distribute your plug-in? Have suggestions for other people like you? This is the place.


-Stu
goldy1064#
So do I have to use the syntax uninst.exe /S _?=bla even from the commmand-line when I'm not trying to uninstall before installing?
Afrow UK#
uninst.exe /S should work in most cases, but when using ExecWait (through NSIS) it will not wait unless you pass the
_? parameter (install dir path).
If no _? parameter is used, the $INSTDIR is set to the uninstallers $EXEDIR.

-Stu
goldy1064#
Ok, I got it working from within the installer, but it still won't work by just invoking a silent uninstall from the command-line when using the start command. Here's what I'm doing: start /WAIT uninst.exe /S and it will return control immediately (I even put in a message box to see if it just was executing too fast, but it wasn't).
Afrow UK#
I would have though that:
start /WAIT uninst.exe /S
would take /S as another parameter for start, when you need it for uninst.exe?
Shouldn't it be:
start /WAIT "uninst.exe /S"

-Stu
goldy1064#
No, that's not it. The parameters for start (that I'm passing) are /wait and then it takes the command that it should execute (uninst.exe) and the parameters to pass to that command (/S). This doesn't seem to work with uninst.exe, only with Setup.exe. Any ideas?
goldy1064#
No, that didn't work either. Here's the command that I tried: C:\>start /WAIT /D"C:\Program Files\My App" uninst.exe /S "_?=C:\Program Files\My App"

This just seems like it should work...

*Edit: I have a messagebox in the uninstaller so I'll know that control was returned to the command prompt before the execution was finished.
goldy1064#
Here was something that I just thought of. I know that I've read somewhere about the uninstaller being copied somewhere before executing. Does that always happen? Or does that only happen in certain instances?
pkonduru#
This works:

start /WAIT /D"C:\Program Files\My App" uninst.exe "/S _?=C:\Program Files\My App"

But it leaves behind the uninst.exe
Anders#
Yes, you must manually delete the uninstaller after it has executed when using the _?= parameter because a Windows program cannot delete itself while it is still running.