Archive: conditional execution based on whether File was valid?


conditional execution based on whether File was valid?
here we go...

Let's say you want to install for multiple applications.. say, Internet Explorer and FireFox.

Your installer grabs files from somepath\IE\ and somepath\FF\ using the File command.

Now, sometimes you'll build your main program only for the FF edition. So you use File /nonfatal to make sure it doesn't die on the empty somepath\IE\ folder.

However, how can you then - at runtime - detect that indeed that folder was empty / File failed?

Using File /nonfatal doesn't appear to set the error flag if no files were encountered - ditto ReserveFile.

Should I be using File etc. in the beginning for say a single file, extracting it to a temp location, and then check if that file exists?

The above is a simplified example - the actual installer may be installing for up to 15 applications (different versions of a host application), and being able to do this at runtime would be preferred over command-line variable shenanigans.

Thanks in advance for any tips :)


Extracting to a temporary directory would work but the best solution is to create installer build configurations. Use !ifdef's and build your installer with the correct !define's for each edition.


after much wrangling with Apache ANT, I think I've got something that allows me to do so. ANT makes NSIS look like C.