PDA

View Full Version : Using a variable in Install Files



NewsArchive
01-23-2006, 05:41 AM
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

NewsArchive
01-23-2006, 05:41 AM
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

NewsArchive
01-23-2006, 05:41 AM
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

NewsArchive
01-23-2006, 05:41 AM
>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

NewsArchive
01-23-2006, 05:42 AM
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

NewsArchive
01-23-2006, 05:42 AM
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

NewsArchive
01-23-2006, 05:42 AM
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

NewsArchive
01-23-2006, 08:34 AM
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

NewsArchive
01-23-2006, 08:34 AM
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

NewsArchive
01-23-2006, 08:34 AM
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

NewsArchive
01-23-2006, 08:35 AM
Geoff,

Yes, the target path can have both compiler [] and runtime %% variables.

Of course, the source path can only have compiler [] variables because
runtime %% variables are only available at installer runtime. Source
path is where your original file on your development machine (to be
included in the setup.exe) is located.

For example, if you have Time = Clock() in your Clarion source code then
the Time variable is only available if you *run* the program. It's not
available when you *compile* the program.

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

NewsArchive
01-24-2006, 01:30 AM
Friedrich,

> Does this help?
Big time. Thanks very much for the detailed explanation - I'm getting there.
I think this was my last hurdle (I think I've said this before <g>) - so we
should be headed down the home-straight now. I guess I should give it a
whirl before I get too excited, but it looks like you've hit the nail on the
head.

Geoff