Archive: /Unchecked?


/Unchecked?
I'm working on an installer that you can use while the program is installed to do things like add or remove components.

Right now I can detect what components are installed, but I have no way of unchecking them from the components list.

Is there any chance of adding a /Unchecked switch to the Section line?

Section 'Section Name' /Unchecked
That way, I can do something like define SN as /Unchecked, and do something like this:

Function .onInit

IfFileExists $INSTDIR\File.ext DoneCheck
!Define SN /Unchecked

DoneCheck:
FunctionEnd

!IfNDef SN
!Define SN ''
!EndIf

Section 'Section Name' ${SN}

; ...

SectionEnd

Hi

I don't know how to uncheck section but I do know that your code will not work even if there were an option to uncheck sections.
!define and !ifndef are used by the compiler on compilation process. Much like #'s in C/C++. !define's are not inserted into the exe, they are used only by the compiler on your machine in the compilation time, and not on run-time on the client machine.

Here is a quote from the docs:

Compiler defines/conditional compilation:

The compiler maintains a list of defined symbols, which can be defined using !define or the /D command line switch. These defined symbols can be used for conditional compilation (using !ifdef) or for symbol replacement (a simple form of macros). To replace a symbol with its value, use ${SYMBOL} (if SYMBOL is not defined, no translation will occur). The translation is first-come-first-served, meaning if you do:
!define symbol1 ${symbol2}
if symbol2 is defined when that line occurs, it will be replaced. Otherwise, any replacing will occur when ${symbol1} is referenced.

Bugger.

Anyone know a way of doing this? How about making variables usable outside sections? Then I could just set $0 or $1 instead of ${SN}.


I'm afraid I don't entirely understand petersa, but if you need acces to variables outside of sections, why not use the registry for that purpose?

Just create flags in the registry that you can read and write to as you please,e.g.

WriteRegStr HKLM SOFTWARE\MyApp "Flag1" "1"

Wait a second. I guess you'd only be able to read from or write to the registry from inside a function or section. :rolleyes: