Page 1 of 1
Many compiler variables (rebrand of a product)
Posted: Thu Mar 12, 2009 5:07 am
by Erik
Hello,
I want to be able to build installers for multiple rebrands of one of our products (ie. same product, different name basically) and would like to be able to use the same installaware project for this. This in theory should be possible to do using compiler variables for all the things in the "Project options" tab and normal variables for most everything else however I have lots of these that need to be set as compiler variables, almost everything in the project options needs to be customized. Setting them all on the command line doesn't seem like a very nice solution, if in fact even possible (isn't there some limit to how long a command line can be?).
What is the preferred way of handling this? I want to be able to build from the command line and would like to be able to pass as few compiler variables on the command line as possible, ideally I'd like to be able to only pass one variable on the command line specifying which rebrand I'm building.
I'm using IA version 8 if that matters.
Thanks,
Erik
Posted: Thu Mar 12, 2009 6:13 am
by bokkie
Erik,
I wonder if you have not answered your question indirectly?
Could you not set one compiler variable and use its value to control what you build?
For example:
BRAND=CompanyX or
BRAND=CompanyY and then set buildtime variables in response to the value that's defined?
Posted: Thu Mar 12, 2009 7:25 am
by Erik
bokkie wrote:Erik,
I wonder if you have not answered your question indirectly?
Could you not set one compiler variable and use its value to control what you build?
For example:
BRAND=CompanyX or
BRAND=CompanyY and then set buildtime variables in response to the value that's defined?
Thanks for your reply.
What you are suggesting is exactly what I'd like to do, the problem is that I haven't been able to do it. I guess I haven't figured out how to set compile time variables from a script. How would one do that? I've found the "compiler if variable" statement but no "compiler set variable" and the normal "set variable" doesn't seem to be doing the trick for me.
Thanks,
Erik
Posted: Thu Mar 12, 2009 7:34 am
by ulrichard
Hi Erik,
I don't think compiler variables can be set from the script.
Are you sure the commandline is too short to set all your options?
If it works over the commandline, you can use batch files to build certain configurations, or even better a build tool like FinalBuilder.
If the commandline is indeed too short, you could start playing around with the project file. Either have multiple copies of it, or write directly into it to set the default values for the compiler variables. But that's where it starts to get messy.
Rgds
Richard
Posted: Thu Mar 12, 2009 8:42 am
by bokkie
Erik wrote:...Thanks for your reply.
What you are suggesting is exactly what I'd like to do, the problem is that I haven't been able to do it. I guess I haven't figured out how to set compile time variables from a script. How would one do that? I've found the "compiler if variable" statement but no "compiler set variable" and the normal "set variable" doesn't seem to be doing the trick for me.
Thanks,
Erik
In the IDE you can only set the compiler variables using the project settings dialog. You can assign a different value to it in the MSIcode if you want and while you think it has changed the value it does not! Likewise, you cannot use user variables in the
compiler if statements. The syntax allows you to enter a non-compiler variable name but again, its value does not participate. In general, use variable names that are available in the respective dropdown lists. That way, you'll know you are using legitimate variables names in the correct context.
Posted: Thu Mar 12, 2009 10:36 am
by Erik
ulrichard wrote:
I don't think compiler variables can be set from the script.
Are you sure the commandline is too short to set all your options?
If it works over the commandline, you can use batch files to build certain configurations, or even better a build tool like FinalBuilder.
If the commandline is indeed too short, you could start playing around with the project file. Either have multiple copies of it, or write directly into it to set the default values for the compiler variables. But that's where it starts to get messy.
Rgds
Richard
I was afraid of that. I guess I'll see if I can get it to fit on the command line. I would've much rather had it in some include file but if it can't be done then it can't be done. Modifying the files directly was my last resort solution but as I'm sure you understand I really want to avoid that.
Thanks!
Posted: Thu Mar 12, 2009 10:38 am
by Erik
bokkie wrote:In the IDE you can only set the compiler variables using the project settings dialog. You can assign a different value to it in the MSIcode if you want and while you think it has changed the value it does not! Likewise, you cannot use user variables in the compiler if statements. The syntax allows you to enter a non-compiler variable name but again, its value does not participate. In general, use variable names that are available in the respective dropdown lists. That way, you'll know you are using legitimate variables names in the correct context.
Yes, that's pretty much what I thought, I was just hoping that there was some way I could set compiler variables other than the command line.
Thank you.
Posted: Thu Mar 12, 2009 11:41 am
by MichaelNesmith
Another idea is keeping identical MPR (project) files for each of your configurations, wherein they differ only in compiler variable declarations and default values.
Posted: Thu Mar 12, 2009 1:49 pm
by bokkie
MichaelNesmith wrote:Another idea is keeping identical MPR (project) files for each of your configurations, wherein they differ only in compiler variable declarations and default values.
Erik,
What Michael writes is good. It's much easier to do what he suggests with IA than with a another well known installer product.

Posted: Fri Mar 13, 2009 7:47 am
by Erik
bokkie wrote:MichaelNesmith wrote:Another idea is keeping identical MPR (project) files for each of your configurations, wherein they differ only in compiler variable declarations and default values.
Erik,
What Michael writes is good. It's much easier to do what he suggests with IA than with a another well known installer product.

Thanks for your suggestion. I'll look into this, it might be a feasible suggestion.
Erik