Archive: Building File Exclude list at compile time


Building File Exclude list at compile time
Hello Everyone,

This is my first post here. Have been reading and benefiting from the forum and plug-ins since long. Thanks all! Thanks kichick, Afro/Stu and others.

I am trying to build an exclusion file argument list for "File" command, at compile time. Consider this script snippet,

Section "Rock Maker" RM_APPLICATION

StrCpy $Component_RM_ExcludeFiles "*.bat;*.config"

Call BackUpBinaries
SetOverwrite on

SetOutPath "$INSTDIR\RockMaker"

File /r ..\RockMaker\bin\Debug\*.*

SectionEnd

Now I want to tokenize value of Component_RM_ExcludeFiles on semicolon and make the "file" command look something like this:

File /r /x *.bat /x *.config ..\RockMaker\bin\Debug\*.*

The value of Component_RM_ExcludeFiles can even be "*.bat;*.config;docs\*.txt".

My expereince is that File command needs its values to be hard-coded and the switch values are not allowed to be taken from a variable.

Any thoughts how I can vary "File" switch values at compile time depending on the value of Component_RM_ExcludeFiles. Any pointers?

Note: I am starting efforts to add some additional automation to installer development. Probably, I will make a GUI based application, where developer can make different components/sections and their logical properties, e.g, a draft of the "Rock Maker" component properties:

StrCpy $Component_RM_Name "Rock Maker"
StrCpy $Component_RM_ExcludeFiles "*.bat;*.config"
StrCpy $Component_RM_SourcePath "..\RockMaker\bin\Debug\"
StrCpy $Component_RM_TargetFolderName "RockMaker"
StrCpy Component_RM_TargetPath "$INSTDIR\$Component_RM_TargetFolderName\"


The generator application will generate different .nsi files for different components/sections, which should be compiled in a sequence to get resultant installer. ( one thought to break down a big .nsi file to smaller ones to make it little structured)

Ofcourse, developer will have to do some tweaks to the generated code.

Any initial thoughts? Suggestions? Pointers?

Thank you in anticipation.
Atiq ul Hassan


You cannot use run time instructions such as StrCpy and variables such as $R0 at compile time. You need to write a separate executable to process your string and create the code. Seems a lot of work though for such a little task.

http://nsis.sourceforge.net/Invoking...n_compile-time

Stu