Custom variables do not resolve

Got a problem you cannot solve? Try here.
kai.damm
Posts: 3
Joined: Tue Sep 26, 2017 3:32 am

Custom variables do not resolve

Postby kai.damm » Mon Nov 09, 2020 10:11 am

I try to select a source path for a helper program from a variable:

Code: Select all

Set Variable MyVersion to 0.8
...
Install Files #PROJDIR#\..\Helper-$MyVersion$\helper.exe to $TargetDir$\helper


But the setup build bails out with

No files matching pattern <TempDir>\Helper-$MyVersion$\helper.exe


Can't I use custom variables like that?

Thanks!

FrancescoT
Site Admin
Posts: 5360
Joined: Sun Aug 22, 2010 4:28 am

Re: Custom variables do not resolve

Postby FrancescoT » Mon Nov 09, 2020 10:53 am

The Install File "Source Files" parameter gets resolved at compile time, and consequently script variables are not allowed.
You may eventually use a Custom Compiler Variable with this field.

Hope this helps you.
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE

kai.damm
Posts: 3
Joined: Tue Sep 26, 2017 3:32 am

Re: Custom variables do not resolve

Postby kai.damm » Tue Nov 10, 2020 4:39 am

Thanks. Compiler Variables were actually the first thing I tried: I need to set another version value depending on another compiler variable:

(#MyVersion# is set to 0.8 in project options)

Code: Select all

[compiler if Variable CUSTOMER Equals FOO]
  Set Variable #MyVersion# to 0.9
[compiler end]
Install Files #PROJDIR#\..\Helper-#MyVersion#\helper.exe to $TargetDir$\helper


I'm not sure about the way to set #MyVersion#, but I can't seem to find how to do it in script, and there is no command "compiler variable set" or "set compiler variable".

The result with above code is: It still resolves to "0.8".

FrancescoT
Site Admin
Posts: 5360
Joined: Sun Aug 22, 2010 4:28 am

Re: Custom variables do not resolve

Postby FrancescoT » Tue Nov 10, 2020 12:54 pm

With the script code you can define a SCRIPT VARIABLE and NOT a COMPILER VARIABLE.
Compiler variables (identically as it is with any other development tool) must be defined with the project (SHIFT+CTRL+F11).
prj_options.png
prj_options.png (11.24 KiB) Viewed 2057 times

For more details, please search for compiler variable in the IA documentation.

Hope this helps you.
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE

kai.damm
Posts: 3
Joined: Tue Sep 26, 2017 3:32 am

Re: Custom variables do not resolve

Postby kai.damm » Wed Nov 11, 2020 5:09 am

Thanks, I will duplicate the code paths for the two versions then.


Return to “Technical Support”

Who is online

Users browsing this forum: AlejandroNehring, Baidu [Spider] and 45 guests