Old 3rd February 2005, 17:46   #1
nibensingh
Guest
 
Posts: n/a
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
  Reply With Quote
Old 3rd February 2005, 18:19   #2
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
code:
Section "un.First uninstall section"
SectionEnd

Section "un.Second uninstall section"
SectionEnd


NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 3rd February 2005, 19:01   #3
nibensingh
Guest
 
Posts: n/a
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
  Reply With Quote
Old 3rd February 2005, 19:05   #4
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
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).

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 14th February 2006, 12:38   #5
remedy
Guest
 
Posts: n/a
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
  Reply With Quote
Old 12th July 2007, 03:12   #6
vc6
Junior Member
 
Join Date: Feb 2007
Posts: 48
Quote:
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
vc6 is offline   Reply With Quote
Old 12th July 2007, 16:51   #7
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
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.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump