Archive: Quick compile time question


Quick compile time question
Hello all. What I would like to know, is there a way to have a command that is executed at compile time, and not run time, that is like the IfFileExists command? I checked the compile time section of the help documentation, but did not see anything. I have an installer that has a button that I would like disabled if I don't include a file, so I need a command like this (where C:\NsisBuilds\MaybeFileMaybeNot\file.txt is on MY pc at compile time):


IfFileExists C:\NsisBuilds\MaybeFileMaybeNot\file.txt 0 +2
!insertmacro MUI_INSTALLOPTIONS_WRITE "Menu.ini" "Field 3" "Flags" "DISABLED"

Basically, I’m just being lazy, and don't want to have to worry about commenting this line out when I’m not sending file.txt. Thanks all.

!system 'IF EXIST "C:\NsisBuilds\MaybeFileMaybeNot\file.txt" ECHO !insertmacro MUI_INSTALLOPTIONS_WRITE "Menu.ini" "Field 3" "Flags" "DISABLED">"%TEMP%\Temp$$$.nsh"'
!include "$%TEMP%\Temp$$$.nsh"
!system 'DEL "%TEMP%\Temp$$$.nsh"'

Thanks!