Archive: Selective Uninstalling


Selective Uninstalling
I'm not quite sure how to impliment this, so here I am asking :)


I currently have a meta-installer that, when they are selected as components for installation, runs individual installers for each component.

Now, when it comes to uninstalling, I'd like to be able to have the user:

1) Be able to select which components to uninstall and have the uninstaller find the location for each component's uninstaller by looking in the registry and run each uninstaller exe for each component.

2) Have the uninstaller not be deleted unless all elements are selected for uninstallation. Either that or ask a question at the beginning of the uninstaller asking if the user wants to remove all or just some of the components.

I've found things like MUI_UNPAGE_COMPONENTS but I can't make out how it actually works nor if I can do what I want to do.

Any help you be greatly appreciated.


You can use sections for the uninstaller just like the uninstaller. Use the un. prefix for the section name.


OK, good. I've got sections working in the uninstaller.

I do have one last problem though - is there any way of only having the sections that were installed to be shown in the uninstaller?

I can check reg entries to see if a section was installed, but I've no idea how to choose which sections will appear on my components list :(


example from one of my scripts

!include "Sections.nsh"

Function .onInit
ReadRegStr $NSIS HKLM "Software\NSIS" ""
IfFileExists "$NSIS\NSIS.chm" +1 PostNSIS2
!insertmacro UnSelectSection "${NSIS2}"
PostNSIS2:
FunctionEnd


whereas NSIS2 is my section

That looks great but I can't get it to work for unselecting more than one section in a row without strange results :(


have a look at this.

i am not using separate installers, but this works. it's not the best solution but for me it's working. this is MY solution. maybe it's a little outdated...