Go Back   Winamp Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 5th August 2005, 20:56   #1
slickgoonie
Junior Member
 
Join Date: May 2005
Posts: 36
blocking options in uninstaller

Hi:

Here is what i would like to do:

I have 3 sections, a, b, c. In the uninstaller the user have the options to remove option, a, b or c...so what i would like to have is that whenever the user removes option a, and run the uninstaller again...option a should be marked as deleted so only b and c will appear. Same as if in the installer he only choose to install option a, when running the uninstaller option a should be the only one available to uninstall.

Last, the uninstall.exe sits on the root directory(where folder a, b, c are) so whenever the user uninstall the last section and there is nothing else to uninstall, it should remove the uninstall.exe from the root directory as well.

thanks.
slickgoonie is offline   Reply With Quote
Old 6th August 2005, 02:26   #2
JasonFriday13
Senior Member
 
JasonFriday13's Avatar
 
Join Date: May 2005
Location: Taranaki, New Zealand
Posts: 400
Yeah, I was also wondering why this has not been a feature. But then again the original installer does the same job (I think).
JasonFriday13 is offline   Reply With Quote
Old 6th August 2005, 07:35   #3
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,337
Write some values to registry specifying what's left and act accordingly in the uninstaller. To hide sections, use the macros in Include\Sections.nsh.

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 22nd August 2005, 18:33   #4
slickgoonie
Junior Member
 
Join Date: May 2005
Posts: 36
hidding secitions in uninstaller.

Can you give me an example of how to hide sections in the unistaller??

thanks.
slickgoonie is offline   Reply With Quote
Old 22nd August 2005, 22:20   #5
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Birmingham, England
Posts: 8,203
Section "un.A Section" unSec01
...
SectionEnd

Function un.onInit
!insertmacro UnselectSection ${unSec01}
FunctionEnd

-Stu

Need an installer? http://www.afrowsoft.co.uk
Afrow UK is offline   Reply With Quote
Old 23rd August 2005, 00:37   #6
slickgoonie
Junior Member
 
Join Date: May 2005
Posts: 36
First of all. Thanks for all your help! It seems that I'm not getting what I wanna do tho. The piece of code you provided me only unchecked the option, but it doesn't hide it or block it(so the user cant select it again), so is there any way I can do that?

Also, How do can I keep tracking of what the user has installed/uninstalled and what not?? Using comparing with the registry? how can that be done??

Thanks.
slickgoonie is offline   Reply With Quote
Old 23rd August 2005, 09:39   #7
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Birmingham, England
Posts: 8,203
Function un.onInit
SectionSetText ${unSec01} ""
FunctionEnd

Edit: As for your second question, use WriteRegStr in each section of your installer, e.g.
WriteRegStr HKLM "Software\myApp\Installed" "A" "1"

Then in un.onInit:
code:
Function un.onInit
Push $R0

ReadRegStr $R0 HKLM "Software\myApp\Installed" "A"
StrCmp $R0 1 +2
SectionSetText ${unSec01} ""

ReadRegStr $R0 HKLM "Software\myApp\Installed" "B"
StrCmp $R0 1 +2
SectionSetText ${unSec02} ""

...etc...

Pop $R0
FunctionEnd


-Stu

Need an installer? http://www.afrowsoft.co.uk
Afrow UK is offline   Reply With Quote
Old 23rd August 2005, 22:31   #8
slickgoonie
Junior Member
 
Join Date: May 2005
Posts: 36
Thanks, it works!
slickgoonie is offline   Reply With Quote
Reply
Go Back   Winamp 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