Archive: Compile time information from a single text file?


Compile time information from a single text file?
I've searched for a possible answer, but I don't know if i'm using the right context for searching, so forgive me if this has been asked before...

I've got some tutorials in HTML format that I use the NSIS installer to setup on other peoples computers. The tuts come in four parts, and I've got four NSIS compile scripts for each part ( one script for week one, week two, etc... ). Each script has defines and macros at the beginning to define the name of the install and directories for icons and directory naming. What I would like to accomplish ( with a minimal of effort, since i'm a lazy bum. ) is to have one text file that all four scripts read off of. Example...

My first weeks script has this

# Output Files Defines
!define OutFile "Create Butter Text in Photoshop"
!define OutDir "E:\temp\Releasing\"

# Macro
!macro setVars ;sets variables for the start page and the folder which contains the shortcut icon.
StrCpy $1 "Buttertext.htm" ;Sets the page to run in both the shortcut and after install.
StrCpy $2 "Buttertext_files\logo.ico" ;Sets the folder location for the desktop icon.
StrCpy $3 "Butter Text in Photoshop" ;Sets the name of the install dir.
StrCpy $4 "BuTxPS" ;Sets the name of the .ini file to be used for the update sets.
!macroend
And then I set outfile and outdirs to
# Installer attributes
OutFile "${OutDir}${OutFile} Week 1.exe"
InstallDir "$INSTDIR\$3"
The outfile defines are pretty self-explanatory, and the macros are just file pointers, except the last one which I use for an .ini file that I place instead of a registry string. No uninstaller, it's a simple setup used to keep the HTML structure intact.

Which is all fine and dandy because it keeps me from having to trudge all over my compile scripts just to replace those four instances of text. The only thing is, I have to change those defines and macros for each week, and sometimes I miss one bit because i'm in a hurry and the whole thing is shot. What I'd like to have is one text file with those setting in it, and the four compile scripts read from that text file. Is this possible without having to reinvent the wheel?

ThanQ for any help in advance. ;)

!include is your friend here, move the defines out of the script and into a new file included by all the scripts

it is also possible to pass(create) defines directly on the commandline as arguments for makensis.exe


Sweet. I'll check it out. ThanQ.

-=edit=- OMG, you rock! This is exactly what I needed. Again, thanQ. :D -=/edit=-