|
|
#1 |
|
Junior Member
Join Date: Oct 2010
Posts: 17
|
How to read random variable name?
I want to save target installation directory in ini file.
So the installation directory could be $LOCALAPPDATA or $APPDATA etc. But how could I store variable name I want to use and then use it. It needs to be some way like that http://bg2.php.net/manual/en/languag...s.variable.php I hope you will understand my question
|
|
|
|
|
|
#2 |
|
Moderator
Join Date: Nov 2002
Location: Birmingham, England
Posts: 8,216
|
I would store a string/int and then on read do:
If you need to store a sub folder path/name then I'd use another INI key/value pair for it. The other option is to evaluate $$APPDATA (etc) from a read value using StrReplace (or WordFunc equiv) but IMO that is a bit messy/ugly.code: Edit: But why would you want to store the variable names? Why not just store the value of $INSTDIR. Otherwise, if on uninstall, say $APPDATA has changed then your evaluated $INSTDIR will not be valid. Stu Need an installer? http://www.afrowsoft.co.uk |
|
|
|
|
|
#3 |
|
Major Dude
Join Date: Jun 2001
Posts: 1,173
|
Usually you would store the full path in the ini file or the environment variable ( http://www.wilsonmar.com/1envvars.htm - see also: REG_EXPAND_SZ ) for the applicable part of the path. Storing NSIS variable names work as well, I suppose, but you can't read them out directly.
You'd have to use something like... PHP Code:
|
|
|
|
|
|
#4 |
|
Junior Member
Join Date: Oct 2010
Posts: 17
|
Thank you!I just thinking to do it that way
|
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|