Archive: Throwing Compile Time Error


Throwing Compile Time Error
!define SRC_DIR "D:\Path2Src\"

If the Source File directory doesn't exists when I compile the .nsi file, how can I throw an error and exit the compilation?

How can I invoke the !error command in the above case.
Any help is appreciated.
TIA.


You could probably use the !system and some combination of command line tools to check for the existence of the directory. The help file for NSIS has a pretty wacky example of using the !system command that might give you some ideas.

I personally prefer to use nant for build logic/verification. You can have nant pass in things to the nsis compiler like defines using the /D switch, or have it check for the existance of files.


if that source dir contains files you'd be installing anyway, then any "File" command referencing a file therein should be sufficient - that will throw an error if the source file specified does not exist (unless you specified "/nonfatal" with that command)