Archive: Script that only makes uninstaller


Script that only makes uninstaller
Is it possible to make a script that only generates an uninstaller? That is, it must be able to self-delete, and should have the default uninstaller icon and text, etc.

The reason is that I am trying to make a patch/update for my program, and it must be able to update the uninstaller. When I try to just place the uninstall script in the update and use WriteUninstaller, then the uninstaller is full of text that says "Uninstall MyProg Update" when it really completely uninstalls MyProg. So I figure the way to get around that is to generate the uninstaller separately and extract it using a File command.


Using the Delete in the proper way... why not?


Because you can't use an ordinary installer to delete itself.


After reboot? ;)


You can always do the copy and Delete /REBOOTOK yourself. You cna also simply create a temporary installer, have it create your uninstaller and use just that.


Here's what I ended up doing (just in case anyone else wants to use it):

... in install.nsi ...
!system "${NSISDIR}\makensis uninstall.nsi" = 0
!system "GenerateUninstall" = 0
File "/oname=$INSTDIR\Uninstall.exe" "Uninstall.exe"

... in uninstall.nsi ...
OutFile "GenerateUninstall.exe"
SilentInstall silent
Section ""
WriteUninstaller "$EXEDIR\Uninstall.exe"
SectionEnd

Section "Uninstall"
...