cai_sebas
31st December 2004 19:37 UTC
Components section sequence
First i will try to explain what i want to achieve. And then the way i think to do it, but i got stuck there.
I have a prog, with many regstrings. I want to have an option (checkbox in the components page) so people can choose to clean the reg before installing the program. (in the setup (new) regstrings are added)
So a I made an section for the Components page in which the reg is cleaned (not the first section, it has to be the last section), but this way the reg wont be cleaned before the setup install the other sections (when new regstrings are added).
Who can help me to solve this, 'hard for me to explain'?
Thanks
Afrow UK
1st January 2005 13:47 UTC
In your first section, do this:
SectionGetFlags ${SECNAME} $R0
StrCmp $R0 1 0 NoCleanReg
...
NoCleanReg:
-Stu
cai_sebas
3rd January 2005 15:51 UTC
I have tried, and i failed. I'm defiantly not a pro in NSIS. Could you explain it a bit.
To make my question clearer. My last section needs to be executed before section#1.
Anyway Thanks
Afrow UK
3rd January 2005 17:42 UTC
The code a posted gets the state of ${SECNAME}. If it's checked, then it will run the code below it. You need to put it in your first Section:
Section ""
SectionGetFlags ${CLEANREG} $R0
StrCmp $R0 1 0 NoCleanReg
...
NoCleanReg:
SectionEnd
Now you just need a dummy section with the title "Clean registry" and id of CLEANREG:
Section "Clean registry" CLEANREG
SectionEnd
-Stu
cai_sebas
3rd January 2005 21:28 UTC
Unfortunatly i get an error message.
Error: could not resolve label "NoCleanReg" in install section "Blokje1" (0)
Error - aborting creation process
:confused:
And i got an small question. i have used many, many variables in my setup. I have used the $0-9 and $R0-R9 variables. Is there any way to use more? (Not i am aware of).
Thanks
Sebas
Afrow UK
4th January 2005 10:28 UTC
As the message rightly says, you are missing the label "NoCleanReg" in your Section. See my snippet of code again... "NoCleanReg:" is the label.
You can create new variables by using Var VarName
-Stu