PDA

View Full Version : use of user vars in install file



NewsArchive
03-09-2009, 03:23 AM
Friedrich,

The construct at the highlighted line in the pic does not compile... says
file not found or locked.
Substituting with the hard-wired file name does work.

Why is the use of the user variable failing here?
Should it not work?

Steve

NewsArchive
03-09-2009, 03:23 AM
Steve,

> The construct at the highlighted line in the pic does not compile...
> says file not found or locked.
> Substituting with the hard-wired file name does work.
>
> Why is the use of the user variable failing here?
> Should it not work?

It does not work because you are using an installer runtime variable at
compile time!

%TSCR_UPGRADE_FILE% is a RUNTIME variable, only available in the
installer -- but you are trying to use it at COMPILE time from within the
compiler.

Does this help?

Friedrich

--
Friedrich Linder
Lindersoft
www.lindersoft.com
+1.954.252.3910

SetupBuilder "point. click. ship"
Create Windows Vista ready installations in minutes

-- Official Comodo Code Signing and SSL Certificate Partner

NewsArchive
03-09-2009, 03:23 AM
> Does this help?
Unfortunately, yes! <g>.... I see what you mean.

I should therefore use a compiler variable?


Is there a fundamental difference in the *naming* style/conventions of
compiler and runtime vars?..... or is all just in the context of their use?

Steve

NewsArchive
03-09-2009, 03:24 AM
Hi Steve,

>> Does this help?
> Unfortunately, yes! <g>.... I see what you mean.

:)

>
> I should therefore use a compiler variable?
>

Yes!

> Is there a fundamental difference in the *naming* style/conventions of
> compiler and runtime vars?..... or is all just in the context of their
> use?

Compiler variables are enclosed in square brackets [].

You can set the value of compiler variables in the "Compiler Variables"
Visualizer or using the "#set compiler variable..." compiler directive.
Compiler variables are resolved at compile time (when you generate your
setup.exe).

For example:

#set compiler variable [TSCR_UPGRADE_FILE] = "TSCR_5.503_upgrade.exe"

Then in your Install File(s) function, use:

C:\Clarion55\TCS\TSCR5\_install\RSCR_5.503_Upgrade \[TSCR_UPGRADE_FILE]

Or this:

#set compiler variable [TSCR_UPGRADE_FILE] = "TSCR_5.503_upgrade.exe"

#set compiler variable [TSCR_UPGRADE_PATH] =
"C:\Clarion55\TCS\TSCR5\_install\RSCR_5.503_Upgrade"

Then in your Install File(s) function:

[TSCR_UPGRADE_PATH]\[TSCR_UPGRADE_FILE]

Runtime variables in SetupBuilder always begin and end with a percent sign
%. Runtime variables are resolved at installer runtime to whatever value is
appropriate for the user's system.

For example:

Set Variable %FREE_DISK_SPACE% to FUNCTION:Get System Info(Free Disk Space)

Friedrich

--
Friedrich Linder
Lindersoft
www.lindersoft.com
+1.954.252.3910

SetupBuilder "point. click. ship"
Create Windows Vista ready installations in minutes

-- Official Comodo Code Signing and SSL Certificate Partner

NewsArchive
03-10-2009, 02:51 AM
Ok... that works for me.

Tx,
Steve

NewsArchive
03-10-2009, 02:52 AM
Yep, works like a charm!... see attached.

One very small 'glitch' - if I update a compiler variable in the Script
Editor page, then switch to Compile Variable listing, the revised value
*may* not be displayed until I double-click and edit it in Compiler Variable
list... (almost as if it needs a "DISPLAY()" (to use Clarion terminology).

HTH
Steve

NewsArchive
03-10-2009, 02:53 AM
>
> Yep, works like a charm!... see attached.
>

Cool.

> One very small 'glitch' - if I update a compiler variable in the
> Script Editor page, then switch to Compile Variable listing, the
> revised value *may* not be displayed until I double-click and
> edit it in Compiler Variable list... (almost as if it needs a
> "DISPLAY()" (to use Clarion terminology).

Yes, that's by design. In fact, the "Compiler Variables" Visualizer never
knows what the "real" value of a compiler variable is if you
programmatically change it in the script.

For example:

#ifcompvar [PRODUCT_SUITE] Equals "Demo" Then
#set compiler variable [APP_FILE] = "Test_Demo.exe"
#endif

#ifcompvar [PRODUCT_SUITE] Equals "Full" Then
#set compiler variable [APP_FILE] = "Test_Full.exe"
#endif

#ifcompvar [PRODUCT_SUITE] Equals "Custom" Then
#set compiler variable [APP_FILE] = "Test_CompanyA.exe"
#endif

So what's the value of [APP_FILE]? In this case, it depends on the value of
[PRODUCT_SUITE] at compile time. You can't see the real value at design
time.

Or if it is set by a "Release" compile if you set compiler variables from a
"Release". Or from the new "SKU Management" in SetupBuilder 7. Then the
value of compiler variables are set when you click through the SKU
Management wizard:

http://www.lindersoft.com/forums/showthread.php?t=11316

Friedrich

--
Friedrich Linder
Lindersoft
www.lindersoft.com
+1.954.252.3910

SetupBuilder "point. click. ship"
Create Windows Vista ready installations in minutes

-- Official Comodo Code Signing and SSL Certificate Partner