Archive: Dynamic variables paths to files


Dynamic variables paths to files
I would like to be able to build an install where I can change the path to an exe without having to edit the script. So for instance if I where to use a bat file to compile my script and inside the bat file it contained all the paths that i needed for all the resources that I want to include, that would be ideal. Does anybody know if this can be done?


In the batch file use 'echo' commands to create a header file that contains !define commands. Include the header and your paths will be defined.

echo !define MYPATH C:\OurApp\Data > .\myNSIS.nsh
echo !define ANOTHERPATH 'C:\Path 2' >> .\myNSIS.nsh

Don


Great thanks. When I do the

!echo !define TempPath "c:\hello" > %HEADER_PATH%

in the bat file, somehow in the script it's appending the path of my nsi file. Thus when I echo from the script, it looks like this

c:\hello (C:\program files\nsis\mynsi.nsi:158)

Any ideas as to why?


do not !echo within the bat, just echo without !
Just follow the above provided by Don example to build a nsis header named myNSIS.nsh in the same dir where bat resides.
All it needs is to change MYPATH C:\OurApp\Data to MYPATH <actual_path_on_system_compiling_the_script>.