I wrote this patch based on the idea in this thread: http://forums.winamp.com/showthread.php?t=399106.
Basically it allows the uninstaller to be finalized outside of makensis before being added to the installer.
I wrote this on ubuntu 12.04. I refactored most of !tempfile so that I can use it for the uninstaller as well. I also refactored the postbuild commands so that it can be called for both the installer and the uninstaller.
I've only tested a few output installers to check the operation, I haven't compiled the source code on windows yet so that side will have to be checked.
So upx mangles the exe and causes a crc failure when used on !finalize and !unfinalize, at least it's consistent, haha. The uninstaller in temp is also mangled before it goes back in to makensis :(.
Anyway, I used trunk SVN r7025 for this patch, and I tested with solid compression just to check that side too.
After reading through the diff a few times, I noticed a few tweaks I could make. Here is another diff. Also, if this patch is accepted, I might also make a patch that adds !unpackhdr as well, which builds on top of this patch.
I made another tweak, in the exehead it helps if I close the file handle properly after writing the uninstaller :).
Also, it probably isn't worth working on !unpackhdr, because in build.cpp !packhdr is called before the uninstaller is generated, which means uninstall_generate gets the packed version of the exehead anyway.
Hi there. Has this patch been merged?
I've updated this patch for 3.05, and I make a tiny tweak related to preprocessor mode only.
Also, I have changed the name to !uninstfinalize for this patch, to make it more explicit about what the command does.
Hi All, Has this patch been released in the latest version? I installed the 3.07 version(so far latest), but nsis still can't recognize this command '!uninstfinalize'. But can find this command on the online doc.
Last edit: Roy 2021-09-01
It was recently added into trunk, so it will be released with the next version of NSIS. Or you could compile the code if you can't wait.
You can try the preview build posted on the forum. A full release is coming soon.
The online documentation is clearly labeled as a pre-release version and you can see in the history section it has no date assigned...
Last edit: Anders 2021-09-01