Is it possible to Include Files based on Compiler Variable ?

For all your non-technical questions.
Post Reply
BenCour
Posts: 4
Joined: Fri Jan 12, 2007 10:09 am

Is it possible to Include Files based on Compiler Variable ?

Post by BenCour »

Here is my problem

With the same Installation project I want to generate 2 different output based on compiler variable.

Let say that for my project1 I want to instal the following files

File1,
File2, (Readme located at c:\\Readme1\\Readme.txt)
File3,

For My project 2 I want to install the following files
File 1,
File2, (Readme located at c:\\Readme2\\Readme.txt)


I found out how not to install File3 in my second output based on a compiler variable but the problem is that the file is still being included in the resulting installation executable. Basically what I want is to prevent the file # 3 from being included in the resulting setup based on a Compiler variable. I absolutly need to do this in order to reduce the size of my second output. Is it possible to do this ? if yes how ? where should I put the code.

Also how can I change the source path of a file based on a compiler variable. As stated for file # 2 in my sample. I want to change the path of my readme file based on a compiler variable.

Is there anyway to achieve this ?

I hope Im clear enough

Thanks in advance for your help,

Ben
Gizm0
Posts: 339
Joined: Wed Nov 09, 2005 8:47 pm

Post by Gizm0 »

You should use the Install Files with proper exclusions.

Check the variable you want and include the proper install files command something like

if VAR is TRUE
Install Files 1 (with readme 1, 2)
else
Install Files 2 (without readme 2)
end
Panagiotis Kefalidis
Software Design Team Lead
\"In order to succeed, your desire for success should be greater than your fear of failure\"
Install[b]Aware[/b] Software Corporation
BenCour
Posts: 4
Joined: Fri Jan 12, 2007 10:09 am

Post by BenCour »

Thanks Gizmo,

Thats what I did but the problem is that the file is still being included in the resulting setup.exe. Its not being installed but its present.

I would like for my second setup to exclude the file3 from the package in order to reduce the size.


Thanks,

Ben
CandiceJones
Posts: 904
Joined: Thu Dec 22, 2005 7:03 pm
Contact:

Post by CandiceJones »

If you want to exclude using a compiler variable, the syntax is very similar to the If syntax that Gizm0 has shown, except you will need to use Compiler Variable If, Compiler Variable Else, and Compiler Variable End commands, in place of If/Else/End commands.

You can also use the Web Media Block command to download-on-demand the effected files. This way you do not need to build multiple setups (but of course, compiler variables are still handy).

So just go to the Project Options window, define your custom compiler variable there, edit your MSIcode to use the Compiler Variable commands, and you're set!
Candice Jones
Install[b]Aware[/b]
[i]Home of The Next Generation MSI Installer[/i]
Get your free copy today - http://www.installaware.com/
BenCour
Posts: 4
Joined: Fri Jan 12, 2007 10:09 am

Post by BenCour »

It works, thanks for your help.
Post Reply