slickgoonie
5th August 2005 21:56 UTC
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.
JasonFriday13
6th August 2005 03:26 UTC
Yeah, I was also wondering why this has not been a feature. But then again the original installer does the same job (I think).
kichik
6th August 2005 08:35 UTC
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.
slickgoonie
22nd August 2005 19:33 UTC
hidding secitions in uninstaller.
Can you give me an example of how to hide sections in the unistaller??
thanks.
Afrow UK
22nd August 2005 23:20 UTC
Section "un.A Section" unSec01
...
SectionEnd
Function un.onInit
!insertmacro UnselectSection ${unSec01}
FunctionEnd
-Stu
slickgoonie
23rd August 2005 01:37 UTC
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.
Afrow UK
23rd August 2005 10:39 UTC
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:
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
slickgoonie
23rd August 2005 23:31 UTC
Thanks, it works!