Compile Variable Question

Got a problem you cannot solve? Try here.
Post Reply
Arthur
Posts: 12
Joined: Thu Sep 13, 2012 12:40 pm

Compile Variable Question

Post by Arthur »

We are a Wise shop and are evaulating InstallAware. I have a question with Compile Variables and wondering if someone can assist.

In Wise we add the following entries in the "Compiler Variables" section.
1.png
1.png (14.89 KiB) Viewed 6030 times
In the "Build Settings", we type the following entry in the "Installation .EXE Name" section.
2.png
2.png (16.18 KiB) Viewed 6030 times
When we click the 'Compile' button, we are presented with the following message box.
3.png
3.png (13.66 KiB) Viewed 6030 times
Wise creates an EXE with the name Test_QA.EXE or Test_Prod.EXE

How do I do the same thing in InstallAware using Native Engine or MSI?

Thanks.
FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: Compile Variable Question

Post by FrancescoT »

Dear Arthur,

InstallAware offers compiler variables in addition to regular, script variables. Compiler variables may be thought of as IFDEF statements available in traditional programming languages. The Compiler Variable If, Compiler Variable Else, and Compiler Variable End statements allow conditional compilation.
In addition, much like constants, compiler variables may be used in the script to represent unchanging values.

You can always use compiler variables where regular string expressions are allowed, even if regular (script) variables have been prohibited.

Compiler variables can be used without problem with MSI or NATVIVE ENGINE.

For example:
use a compiler variable to hold your file name. Define the compiler variable in Project/Options... (CTRL+SHIFT+F11).

Then go to build settings and set an output filename based on your compiler variable.

#MYFILENAME_COMPVAR#

For more detailed information about Compiler Variables please refer to InstallAware documentation (just press F1 in IA IDE).

Hope this helps you.

Regards
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
Arthur
Posts: 12
Joined: Thu Sep 13, 2012 12:40 pm

Re: Compile Variable Question

Post by Arthur »

Thank you for reply. Is it possible to provide me a sample script that does what you wrote? F1 was no help. It just talked about Compile Variable IF, ELSE, & END which I already know about.
christ23
Posts: 82
Joined: Mon Jan 16, 2012 4:51 am

Re: Compile Variable Question

Post by christ23 »

Arthur,

Just do the steps suggested by Francesco - he gave you the complete receipe step by step ;).
I have tried it myself, because i did not know, that i can build conditional filenames trough the compiler variabkes.

Give it a try :)
Arthur
Posts: 12
Joined: Thu Sep 13, 2012 12:40 pm

Re: Compile Variable Question

Post by Arthur »

I must be on something because the instructions are just not helping me out. It would be greatly appreciated if you can show me. Thank you.
FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: Compile Variable Question

Post by FrancescoT »

Dear Arthur,

I'll try to be more clear even if seems to me that I was already enough clear.

Open your project and then define your compiler variable in Project/Options.
To display the Project Option dialog press CTRL+SHIFT+F11 and from the dialog node select "Compiler Variable".
Select the ADD button and define the variable as you like.

Once defined, through the same Project Option dialog, select the output node and set the output filename field entering your compiler variable.
If for example, you have defined a Compiler variable as MYFILENAME_COMPVAR, you must refere to it as: #MYFILENAME_COMPVAR#.

I may suggest you to have a look at our white papers "MSIcode Scripting Technology for Windows Installer" and "Using InstallAware to Deploy Microsoft .NET Framework Applications" available at: http://www.installaware.com/publication ... papers.htm.

Hope this helps you.

Regards
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
Post Reply