Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WiX installer conditional compilation?

I have two builds of my main executable: standard and premium. For simplicity of development they are built from a single solution in Visual Studio by changing a special #define variable.

Now I'm curious if it's possible to do the same with the WiX installer for this project?

I basically need to control the inclusion of only one of the following xml nodes:

1: For standard version MSI:

<Product Name='Foobar 1.0 - Standard' 
    Id='8E9CF27F-B92F-4CB3-BBA0-0AAE5376D5EB' 
    UpgradeCode='20A89269-D206-490D-9134-349594662619'
    Language='1033' 
    Codepage='1252' 
    Version='1.0.0' 
    Manufacturer='Acme Ltd.'>

and later:

<Component Id='MainExecutable' Guid='E1FE2BBE-C72D-4F27-A66D-78417F597D7A'>
 <File Id='FoobarEXE' Name='FoobarAppStandardl10.exe' DiskId='1' Source='FoobarApplStandard10.exe' KeyPath='yes'>

2: For premium version MSI:

<Product Name='Foobar 1.0 - Premium' 
    Id='8E9CF27F-B92F-4CB3-BBA0-0AAE5376D5EC' 
    UpgradeCode='20A89269-D206-490D-9134-34959466261A'
    Language='1033' 
    Codepage='1252' 
    Version='1.0.0' 
    Manufacturer='Acme Ltd.'>

and then:

<Component Id='MainExecutable' Guid='E1FE2BBE-C72D-4F27-A66D-78417F597D7B'>
 <File Id='FoobarEXE' Name='FoobarAppPremiuml10.exe' DiskId='1' Source='FoobarApplPremium10.exe' KeyPath='yes'>

PS. I can obviously make 2 WiX projects... I'm seeking a way to do it in one.

like image 218
c00000fd Avatar asked Oct 15 '25 04:10

c00000fd


1 Answers

I found it. Here it is for whoever else is interested.

like image 137
c00000fd Avatar answered Oct 17 '25 20:10

c00000fd



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!