![]() |
Varibles in File
Hi,
Just a quick question are you able to use variables in File. For example PHP Code:
File: "$DISTRIBUTION_CD_LOCATION"bbRadCLI.exe"" -> no files found. Usage: File [/nonfatal] [/a] ([/r] [/x filespec [...]] filespec [...] | /oname=outfile one_file_only) Error in script "C:\Documents and Settings\james\workspace\bbRad installer\setup.nsi" on line 75 -- aborting creation process Is it that you must specify the whole dir to the file when using File, or have I just done something wrong with the var side of things.... Thanks James |
It is that you can't use variables at compile time, instead try to !define DISTRIBUTION_CD_LOCATION
|
What just like this,
code: Because if thats correct im still getting the same error :( |
!define DISTRIBUTION_CD_LOCATION "D:\My Local Path"
File: "${DISTRIBUTION_CD_LOCATION}\bbRadCLI.exe" |
You legend. Thanks a lot :D that works brill
|
Keeping to a similar topic. Is it possible to use a variable in an unistall part.
For example : code: Thanks |
Yes but its value won't be magically copied from the installer to the uninstaller. You need to store its value in the registry or an INI file.
If its value does not change then use a !define instead. -Stu |
Quote:
|
Quote:
Cheers for the help peeps :D |
!define makes a compile time constant. Once your installer is compiled, it's value is sustained in a static form wherever it's used. Variables on the other hand are used if your value needs to change while the installer is being executed by the end user. If your value will never change, then use a constant (define) and not a variable. Once you've created a constant, you can use it anywhere in your script whether it's inside or outside sections and functions.
-Stu |
Well the value I want to use is acctually enter by the user in the installation config. So im guessing that I cant used !define.
Is it fairly easy to store the values into the Registry? Or would you recommend storing them in an ini file instead? James |
Quote:
|
The registry is probably your safest bet. Use WriteRegStr and ReadRegStr.
There are pros and cons for using the registry or initialisation files, but most people would rather use the registry simply because you don't need to worry about a particular file on the hard drive. -Stu |
Cheers mate. Ill try it out and see what I can do.
Ill post back if I get anymore problems, which I probably will :D |
| All times are GMT. The time now is 04:38. |
Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.