Archive: branching installation


branching installation
  i'm having a problem trying to branch my installation instructions depending on something the user defined earlier in the script.

if the user is packing a 'full' release (${REL_TYPE} == 'Full'), one set of installation instructions should be used, if the user defined it as an 'update' release another set would be used.

the problem is that both use the same instructions, except only the 'update' branch uses the /nonfatal switch. basically if any files are missing when compiling a 'full' release i want it to error out, but when compiling an 'update' release i want it to just display the warning.

how can i do this? currently it's displaying errors on the 'full' set of instructions when compiling an 'update' release because files are missing.

is it even possible to do what i'm attempting?

${If} ${REL_TYPE} == 'Full'

File file1.exe
File file2.exe
>${Else}
File /nonfatal file1.exe
File/nonfatal file1.exe
>${EndIf}
File: "file1.exe" -> no files found.
(line number was from the 'full' branch!)

although finding a solution may not sound important, actually it is. the 'full' install also needs to copy dll's to system32, dll's which won't be included in 'update' releases (quite large).

LogicLib is suitable for runtime, won't help you in compile time.
Instead you may use !ifdef e.g.
!ifdef UPDATE
File .....
File .....
!else ifdef FULL
File .....
File .....
!endif
And pass the selected definition either update or full to the compiler through the /D swich.
You may even organize your files in a macro with parameters so you'll have not to retype the same code twice.


awesome, thanks @Red Wine

i suspected it would be something like that. i replaced ${If} with !if and it works :D