Archive: Multiple Uninstall Sections


Multiple Uninstall Sections
Hi,

I am wondering how can I have multiple uninstall sections.

My application has client and server part. During installation I do provide an option to install only client or server or both. This is working perfect! Now with the installation of client and server I want to have respective uninstallers for the installed client and servers.

I dont know how to do this. Can I even have multiple uninstaller sections?

Any response will be highly appreciated.

Niben


Section "un.First uninstall section"
SectionEnd

Section "un.Second uninstall section"
SectionEnd

The code I have is given below. It did not work for me. My client uninstaller does the same thing as server installer.

----------------------------

;;
;; Section #1
;;
Section "Server Program" Server
;Create uninstaller
WriteUninstaller "$INSTDIR\UninstallClient.exe"
SectionEnd

;;
;; Section #2
;;
Section "Client Program" Client
;Create uninstaller
WriteUninstaller "$INSTDIR\UninstallServer.exe"
SectionEnd

Section "un.Server"
SectionEnd

Section "un.Client"
SectionEnd


The multiple uninstaller section go into the same uninstaller. WriteUninstaller can't write two different uninstallers. You'll have to add a value somewhere to tell the uninstaller which item it should uninstall. You can use the registry, an INI file or even the uninstaller itself (append to it using FileWrite).


Hi!

Can someone please post a link to examples of uninstallers with multiple sections using either the ini, reg or in the uninstaller methods mentioned above?

Thanks

-remedy


Originally posted by remedy
Can someone please post a link to examples of uninstallers with multiple sections using either the ini, reg or in the uninstaller methods mentioned above?
I am joining the request. I just tried multiple install sections for the first time and it proved disasterous.

Could someone please help clarify how a single uninstaller is registered for multiple install sections? This is very confusing to me.

Thanks,
Victor

It's very simple. Nothing is registered, nothing is done. You can have multiple sections in the installer and you can have multiple sections in the uninstaller. Deciding which will do what is up to you. If you want to create an uninstaller section for each installer section and have it uninstall what its corresponding section installed, you have to do the math in the script. You can check in un.onInit which sections are still installed and select or unselect the uninstaller sections accordingly.