Using a variable in Install Files
Hi Friedrich/anyone else,
What are the chances of someone checking this NG on a Sunday? Pretty low I
guess, but I'll give it a shot in the hope that I don't have to wait til
Tuesday <g>.
I'm in need of another pointer. I'm struggling to get a variable in the path
of the INstall Files command. If I use a constant in the command, the files
install fine, but it's not installing with a variable where the problem is.
I've made sure the variable is in caps, tried with [], %var% - I've set the
variable immediately before the Install File command, but nothing's coming
out. In the debug compile it uses the variable name - (instead of showing
the contents of the variable) - so I don't know whether the variable is set
correctly, or whether I'm doing something else wrong. From the help it seems
like you can use a variable in the Install Files command, I'm just missing
something. I guess to clarify, I'm referring to the INstall Files from
[VARIABLE] to [_SB_INSTALLDIR]. Both the source and the destination contain
variables.
Thanks in advance....
Geoff
Re: Using a variable in Install Files
Hi Geoff,
To be honest I don't think you can use a variable for your SOURCE.
Friedrich has invoked a Ctrl + Right-Click to bring up a list of all
current variables where variables are allowed. In this instance the
key combination is disabled suggesting that it isn't appropriate. Also
I don't see anything in the documentation to suggest that you can use
a variable for your SOURCE, only or the destination.
Best Regards,
Geoff Spillane
Data Down Under
Re: Using a variable in Install Files
Oh dear - that's not good news :(
Hmmm, that's a bit of a show-stopper.
Actually, I guess I could make a work around for this one, but it would make
life a whole lot easier to be able to use a variable there.
Thanks for the help.
--
Geoff
Capesoft - taking you higher and further
www.capesoft.com
Re: Using a variable in Install Files
>Oh dear - that's not good news :(
>Hmmm, that's a bit of a show-stopper.
>
>Actually, I guess I could make a work around for this one, but it would make
>life a whole lot easier to be able to use a variable there.
Just something that may work...
build a few separate .sbi include files with the hardcoded install paths.
Set your variable as you are doing
INCLUDE the appropriate .sbi file according the the variable value
Might work, but I have not tested..
John Griffiths
Back in Perth
Re: Using a variable in Install Files
John,
Yes - that is an idea. I checked the help (following Geoff's message) - and
it does specifically mention a variable in the example in the help (so I
wasn't going batty after all <g>).
Anyway - maybe Friedrich can shed some light.
--
Geoff
Capesoft - taking you higher and further
www.capesoft.com
Re: Using a variable in Install Files
Geoff,
Sorry, but I fear I do not understand the question :-(
Are you talking about the SOURCE PATH of a file (where the compiler
picks up the file and compiles it into the SETUp.EXE?
Friedrich
--
Friedrich Linder
CEO, Lindersoft
www.lindersoft.com
+1.954.252.3910
"point. click. ship" - that's SetupBuilder 5
Re: Using a variable in Install Files
Hi Geoff,
Re-read your message several times. Do you mean the target path of the
file?
For example:
Install File "C:\clarion6\bin\c60dosx.dll" to
%_SB_INSTALLDIR%\Bin\c60dosx.dll (Bin) [Uninstall]
BTW, [VARIABLE] are compiler variables, %VARIABLE% are runtime installer
variables.
For example, to make your project "portable", you can use:
[SOURCE] = c:\clarion6\bin
Install File "[SOURCE]\c60dosx.dll" to %_SB_INSTALLDIR%\Bin\c60dosx.dll
(Bin) [Uninstall]
If you have 4,000 source files on your office machine and the files are
located on another drive/folder on your home machine, you only have to
modify one compiler variable (instead of changing 4,000 source folder
fields) to compile the same script. Or let the compiler change the
compiler variable for different application editions (standard,
professional, demo, etc.).
Friedrich
--
Friedrich Linder
CEO, Lindersoft
www.lindersoft.com
+1.954.252.3910
"point. click. ship" - that's SetupBuilder 5
Re: Using a variable in Install Files
Friedrich,
> Are you talking about the SOURCE PATH of a file (where the compiler
> picks up the file and compiles it into the SETUp.EXE?
Yip - that's correct. Based on the command line parameter (when compiling a
SB project), I want to have the ability to set the SOURCE file path. Your
example in the helpfile shows using a variable in the source folder - that's
what I'm struggling with. Am I pushing the limits <g>?
BTW - thanks for all the pointers, they've made a huge difference.
--
Geoff
Capesoft - taking you higher and further
www.capesoft.com
Re: Using a variable in Install Files
Geoff,
No, you are not pushing the limits <bg>.
You can load a const# from the command line and then set the compiler
variable to the #const value.
For example, you have the [SOURCEPATH] compiler variable in your source
path. Then add the following in the code (e.g. "Initialize Setup" section
or before).
#const $SOURCEPATH$ = Get Value from compiler command line
#set compiler variable [SOURCEPATH] = $SOURCEPATH$
Set Variable %SOURCE% to [SOURCEPATH]
Then call the setup compiler from the command line with:
sbuilder.exe /C "c:\test.sb5" /SC SOURCEPATH "c:\test"
This will set [SOURCEPATH] to c:\test at compile time.
Does this help?
Friedrich
--
Friedrich Linder
CEO, Lindersoft
www.lindersoft.com
+1.954.252.3910
"point. click. ship" - that's SetupBuilder 5
Re: Using a variable in Install Files
Friedrich,
No - I've got the target path working fine (with a variable) - it's the
SOURCE path I'm needing as a variable as well.
--
Geoff
Capesoft - taking you higher and further
www.capesoft.com