mattwilkinson
3rd March 2005 13:43 UTC
Which came first the Chicken ot the Egg?
I am trying to resolve a circular argument problem in my script. The order of things is as follows
---------------
IsSectionFlagSet Macro
UninstallHelpFiles Macro (inserts my macro 'IsSectionFlagSet')
Section secHelpFiles (inserts UninstallHelpFiles Macro)
Uninstall Section (inserts UninstallHelpFiles macro)
.onInit Section (checks the Help Files check box if installed last time)
-------------------
The problem is that my UninstallHelpFiles macro need to be below the Section Definition so that when it is inserted {secHelpFiles} is set to the actual section number.
If this IS below the section definitions then the section cannot call the UninstallHelpFiles Macro because it hasn't been defined yet.
I am sure that my script is probably not very efficient but I'm a bit stuck as to how to resolve it - can anyone point me in the right direction?
Afrow UK
3rd March 2005 14:14 UTC
Can't you just move both macro's under your Sections or am I missing something?
-Stu
mattwilkinson
3rd March 2005 14:21 UTC
It is more complicated than that because my section inserts the UninstallHelpFiles macro so fails compilation because this is defined below it.
Afrow UK
3rd March 2005 14:26 UTC
Would you be able to attach your code?
-Stu
mattwilkinson
3rd March 2005 16:17 UTC
Here it is!
Afrow UK
3rd March 2005 17:58 UTC
Hmm yeh that is a problem.
The only way to get around this would be to replace:
!insertmacro IsSectionFlagSet ${secHelpFiles}
...with...
!insertmacro IsSectionFlagSet 1
If you like, make a new !define secHelpFilesIndex 1 and use that.
Currently your secHelpFiles section is the second section in your script, so its index is 1 (zero based)
-Stu
mattwilkinson
4th March 2005 09:27 UTC
I obviously wanted to avoid doing that so that maintaining the script would be easier but if that is the only way then so be it!
Thanks.