Archive: About File Function


About File Function
I want to do several builds according to a Defined value "Vendor" at the command line, and for each build there is a directory which contains some thing not universe. So I use a section of codes like this:
!ifdef Vendor
IfFileExists "..\${Vendor}\${file}" 0 +2
File "..\${Vendor}\${file}"
!endif
at my main section. Only some of the builds contains the file "${file}" and during compiling the one without this file recevied a error. The Function IfFileExists seemed not work.
So how should I do to compress the file only if it exists? Great thanks.


IfFileExists is a run time instruction, so the IfFileExists code will only be executed when the installer is executed.

NSIS really needs a compile time !iffileexists
For now you'll need to write another installer to write your NSIS code depending on if the files exist or not.

http://nsis.sourceforge.net/Invoking...n_compile-time

-Stu