Archive: give a variable to script and build it automaticly


give a variable to script and build it automaticly
i copy my files every night to a specific folder and than i want to build the installer. filenames and directory names and filestructure are the same.

now i want to give the installerscript the specific path where my files are and then i want to start the script to build the installer.

how i can give the path to the script to use them?


Try this:

!define MY_PATH "C:\My Path"
...
File ${MY_PATH}\*.*

(Still not interested in my replies? ;))


Make sure ${MY_PATH}\*.* is in quotes or you will get a compile error (assuming the path contains spaces).

Stu


automatic.bat


Java My_copytool.jar "Path where my Files be copied"
NSIS installer.nsi "Path where my Files be copied"


installer.nsi

!define MY_PATH "here i want to use 'Path where my Files be copied'"



i dont want to change my installer.nsi, if i change the path, where my files are.

You don't need to change your script, use parameter /D when calling makensis command. Reading documentation is a good idea before posting here on forum - http://nsis.sourceforge.net/Docs/Chapter3.html#3.1


so is this correct?


Java My_copytool.jar "c:\example\copy"
makensis.exe /D !define MY_PATH "c:\example\copy" myscript.nsi


myscript.nsi

SetOutPath '$INSTDIR$\bin'
File '${MY_PATH}\bin\test.cfg'

No, it isn't.


makensis.exe /DUSE_UPX /DVERSION=1.337 /DNO_IMAGES myscript.nsi

this is the example

but what means this?

1 !define USE_UPX VERSION=1.337 NO_IMAGES

or

2 !define USE_UPX
!define VERSION=1.337
!define NO_IMAGES


1. It produces compiler error, it is wrong.
2. These three lines are equivalent to your (correct) makensis syntax on first line of your last post.


so is this correct?


Java My_copytool.jar "c:\example\copy"
makensis.exe /DMY_PATH "c:\example\copy" myscript.nsi


myscript.nsi

SetOutPath '$INSTDIR$\bin'
File '${MY_PATH}\bin\test.cfg'

It seems to be so.


so prospec, it is not correct

c:\programme\nsis\makensis.exe /DMy_Var="myPath" "my_script.nsi"


Yes you need the =. This is all documented!!

Stu


Posts deleted. Please don't argue chaps!

Stu


I think if your path contains spaces, you must do it like this:

makensis.exe /DMYVAR="C:\Some Folder\Some File.foo" Installer.nsi


However when passing arguments to the installer itself, you must do it like this:

Installer.exe "/MYARG=C:\Some Folder\Some File.foo"