Archive: Automatic section uninstall


Automatic section uninstall
It would be nice if there were an uninstall instruction to automatically delete only those files that were installed by a specific section. So lets say that SecA installed the following:

File /r ..\mySecAFiles\*.*

It would be great to just:

Uninstall SecA

in the Uninstall section, without having to specify which files to delete, saving me from having to keep track of which specific files and folders I need to uninstall.


It would only work if the NSIS installer would keep track of the files being installed. Apart from generating a big overhead by doing that, you are unable to specify which items you want to preserve.
For example, the settings file of a program, or the runtime libraries.


It would depend on the implementation, whether you would make use of such a feature. Generally you would not want to preserve anything other than User settings which the program would save in the user's home dir (assuming a multi-user env). I don't see how there would be more overhead required.. in the one case (the old case) I would just file by file list the files I wish to remove in the uninstall section, in the other case the uninstaller does this implicitly through one instruction. If the implementer does not use this instruction, then uninstaller would not need to keep track of the installed files. If you really did want to separate program settings and dlls as far as your uninstaller is concirned.. all you would need to do is put the two in differnt sections, or not use this feature.


I plan to create a plug-in that will help you achieve such a behavior once I add plug-ins support for the compiler.


Any movement on this front?


Not yet, and I'm afraid it won't be any time soon.


In fact, this is a logical problem for those who come from Innosetup.
Innosetup is very less powerful than NSIS but the scripts are very small and easier to create.
When I try to convice them to change IS for NSIS, they answer me that NSIS is too complex and that it is boring to specify each file twice (one time for install and one time ofr uninstall): the program should be able to calculate automatically the uninstall section from the other sections.