SectionGroup and StrCmp
I'm working on an installer that will install different files depending on the OS the installer is running on. With the "Examples" section I'm having a hard time figuring out a way to work.
With the paired down script below I get the compiler error "StrCmp not valid outside section or function" which is understandable (I guess) but I'm not sure how to work around it.
If "Examples" is selected, running under NT/2000/XP/2003, contents of "C" and "VB" are installed, if running on 9x/ME only a text file is installed. I'm looking for a better way to get the behavior I want. ANy ideas?
My Sections/SectionGroups goes as follows:
- Device
|
- DLLs
|
- Drivers
|
- Examples
|
- C
|
- VB
-- script example --
SectionGroup /e "DEVICE"
SetOverwrite try
Section "Dlls"
SetOutPath "$INSTDIR\Device\Dlls"
File "..\Foo1.dll"
File "..\Foo2.dll"
File "..\Foo3.dll"
SectionEnd
Section "Drivers"
SetOutPath "$INSTDIR\Device\Drivers"
File "..\Foo1.sys"
File "..\Foo2.sys"
File "..\Foo1.vxd"
SectionEnd
SectionGroup "Examples"
; "strOS" is either "9X" or "NT", this is done in .ioInit
StrCmp $strOS "9X" 0 NT_EXAMPLES
SetOutPath "$INSTDIR\Device\Example"
File "..\9x.Examples.txt"
Goto EXAMPLES_END
NT_EXAMPLES:
Section "C"
; examples for NT/2000/XP
SetOutPath "$INSTDIR\Device\Example\C\Bus"
File "..\example.c"
File "..\Device.h"
File "..\Device.lib"
SectionEnd
Section "VB6"
; examples for NT/2000/XP
SetOutPath "$INSTDIR\Device\Example\VB\Bus"
File "..\Example.FRM"
File "..\Example.VBP"
File "..\Example.VBW"
File "..\Readme.txt"
File "..\Device.BAS"
SectionEnd
EXAMPLES_END:
SectionGroupEnd ; End of Examples group
SectionGroupEnd ; End of Device group