Archive: blocking options in uninstaller


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.


Yeah, I was also wondering why this has not been a feature. But then again the original installer does the same job (I think).


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.


hidding secitions in uninstaller.
Can you give me an example of how to hide sections in the unistaller??

thanks.


Section "un.A Section" unSec01
...
SectionEnd

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

-Stu


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.


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

Thanks, it works!