Page 1 of 1

Include files conditionally with compiler variables

Posted: Fri Aug 24, 2007 11:47 am
by maurix
I'd like to use a compiler variable to add files in the setup conditionally. The MSI code attached is what I did, but in the setup there are both files. It seems that the compiler variable I defined in the Project Options is ignored, though I see WEBDEMO = true when building the setup.
What's my error?

This is the MSI code:

[DEFINE REGION: Perform First Time or Maintenance Installation]
Comment: Install/Re-Install product
[OFFLINE CONTENT]
[compiler if Variable WEBDEMO Equals (Ignore Case) TRUE]
Install Files X:\\DEMO\\MyApp.exe to $TARGETDIR$
[compiler else]
Install Files X:\\FULL\\MyApp.exe to $TARGETDIR$
[compiler end]
....

Posted: Fri Aug 24, 2007 1:25 pm
by pfennig
From this code snippet alone it looks fine. Do you have the same files somewhere installed
with different conditions? Sometimes, if you're not careful, you can have files included more
often than you intended.

Posted: Fri Aug 24, 2007 1:40 pm
by maurix
Ok thank you very much. The problem was due to files included more than once.

Now it's working properly.