WIX; How can I pass the [installfolder] as argument in an ExePackage - wix

I am creating a WIX bundle which calls an executable.
In that call I'm trying to pass the installfolder as an argument but for some reason this doesn't seem to work.
The bundle:
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
xmlns:bal="http://schemas.microsoft.com/wix/BalExtension"
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
<Bundle Name="$(var.Department) $(var.ProductName)"
Version="!(bind.packageVersion.Database.CLI.Verify)"
Manufacturer="$(var.Company) $(var.Department)"
UpgradeCode="5fc4dc21-0202-4e28-b8a4-b87f972ae32e"
DisableRemove="yes"
DisableModify="yes"
IconSourceFile="Database.ico">
<util:RegistrySearchRef Id='VerifyDotnetVersion' />
<Variable Name="InstallFolder" Type="string" Value="c:\$(var.Company)"/>
<BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.HyperlinkLicense">
<!-- LicenseUrl intentionally empty. -->
<bal:WixStandardBootstrapperApplication LicenseUrl=""
LogoFile="Database.png"
SuppressOptionsUI="no"
SuppressRepair="yes"/>
</BootstrapperApplicationRef>
<Chain>
<PackageGroupRef Id="SqlServer2019ExpressLocalDB" />
<PackageGroupRef Id="Database.CLI"/>
</Chain>
</Bundle>
<Fragment>
<util:FileSearch Id='VerifyDotnetVersion'
Variable="DotnetVersion"
Path="dotnet.exe"
Result="version" />
<bal:Condition Message="This installer requires at least dotnet version 6.">
DotnetVersion >= v6
</bal:Condition>
</Fragment>
</Wix>
And the part that is calling the ExePackage:
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
<Fragment>
<PackageGroup Id="Database.CLI">
<ExePackage Id="Database.CLI.Verify"
DisplayName="Check whether SqlLocalDb has been installed."
SourceFile="$(var.SourceFile)"
InstallCommand="verify"
UninstallCommand="remove"
Vital="yes"
Compressed="no"
PerMachine="yes"
Permanent="no">
<ExitCode Value="0" Behavior="success" />
<ExitCode Value="1" Behavior="error" />
<ExitCode Value="5" Behavior="error" />
<ExitCode Value="31" Behavior="error" />
<ExitCode Value="183" Behavior="success" />
<ExitCode Value="574" Behavior="error" />
<ExitCode Value="3010" Behavior="forceReboot" />
</ExePackage>
<ExePackage Id="Database.CLI.Attach"
DisplayName="Attach database to the SqlLocalDb instance."
SourceFile="$(var.SourceFile)"
InstallCommand="attach Target="[INSTALLFOLDER]\$(var.Department)\$(var.ProductName)""
Vital="yes"
Compressed="no"
PerMachine="yes">
<ExitCode Value="0" Behavior="success" />
<ExitCode Value="1" Behavior="error" />
<ExitCode Value="5" Behavior="error" />
<ExitCode Value="31" Behavior="error" />
<ExitCode Value="183" Behavior="success" />
<ExitCode Value="574" Behavior="error" />
<ExitCode Value="3010" Behavior="forceReboot" />
</ExePackage>
</PackageGroup>
</Fragment>
</Wix>
When I look in the logs I see as argument:
[7A60:546C][2022-06-16T16:44:15]i301: Applying execute package: Database.CLI.Attach, action: Install, path: C:\ProgramData\Package Cache\0FD93FB1FD9BBE5B46CC123351ECE9DBCEC54E9D\Database.CLI.exe, arguments: '"C:\ProgramData\Package Cache\0FD93FB1FD9BBE5B46CC123351ECE9DBCEC54E9D\Database.CLI.exe" attach Target="\Analytics\Database"'
But I'm missing the contents of the [INSTALLFOLDER] so what I expect should be something like Target="c:\temp\Analytics\Database".
What am I missing here?
p.s. Is it also possible to provide an INSTALLFOLDER when launching the setup-bundle for silent installs? Like Database.Setup.exe InstallLocation=c:\temp
Many thanks in advance.

Burn variables are case-sensitive, so use [InstallFolder], not [INSTALLFOLDER].

Related

WIX Burn Bootstrapper, installing .net framework as payload

What I want to do:
Make a wix burn bundle bootstrapper that 1st installs the .net 4.8 framework if necessary and then after that, install our custom MSI
the custom MSI is all good and working.
I want a single file, which I understand will be 100,000 K big and we're fine with that (once you package in the .net 4.8 installer)
Then just have the bootstrapper auto unpackage and run the .net framework install if needed, but everything I've tried doesn't work. Either it wants to download it (we don't want to count on internet access), or a Open File Dialog shows wanting to get pointed to the .net framework install.
all code below:
<?xml version="1.0" encoding="UTF-8" ?>
<Wix
xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Bundle
Name="OurSoftwareName"
Version="1.0.0.0"
Manufacturer="Our Company name"
UpgradeCode="deleted guid here so no one accidentally uses it">
<BootstrapperApplicationRef
Id="WixStandardBootstrapperApplication.RtfLicense" />
<!--
<PayloadGroup Id="NetFx48RedistPayload">
<Payload Name="redist\ndp48-x86-x64-allos-enu.exe"
SourceFile=".\Files\ndp48-x86-x64-allos-enu.exe"/>
</PayloadGroup>
-->
<Chain>
<PackageGroupRef
Id="NetFx48RedistPayload" />
<MsiPackage
After="NetFx48Redist"
SourceFile="$(var.ReferenceToOurMsi.Setup.TargetPath)" />
</Chain>
</Bundle>
</Wix>
And I've copied and altered the .net 4.8 version of wix code from and made some customizations:
https://github.com/wixtoolset/wix3/blob/develop/src/ext/NetFxExtension/wixlib/NetFx48.wxs
<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
<!--
copied from:
https://github.com/wixtoolset/wix3/blob/develop/src/ext/NetFxExtension/wixlib/NetFx48.wxs
-->
<Wix
xmlns="http://schemas.microsoft.com/wix/2006/wi"
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
<!--
.NET Framework installation state properties
Official documentation can be found at the following location:
.NET Framework 4.5.x/4.6.x/4.7.x/4.8.x - http://msdn.microsoft.com/en-us/library/w0x726c2(v=vs.110).aspx
-->
<?define NetFx48MinRelease = 528040 ?>
<?define NetFx48WebLink = https://go.microsoft.com/fwlink/?LinkId=2085155 ?>
<?define NetFx48RedistLink = https://go.microsoft.com/fwlink/?LinkId=2088631 ?>
<?define NetFx48EulaLink = https://referencesource.microsoft.com/license.html ?>
<Fragment>
<PropertyRef
Id="WIXNETFX4RELEASEINSTALLED" />
<Property
Id="WIX_IS_NETFRAMEWORK_48_OR_LATER_INSTALLED"
Secure="yes" />
<SetProperty
Id="WIX_IS_NETFRAMEWORK_48_OR_LATER_INSTALLED"
Value="1"
After="AppSearch">
WIXNETFX4RELEASEINSTALLED >= "#$(var.NetFx48MinRelease)"
</SetProperty>
</Fragment>
<Fragment>
<util:RegistrySearchRef
Id="NETFRAMEWORK45" />
<WixVariable
Id="WixMbaPrereqPackageId"
Value="NetFx48Web" />
<WixVariable
Id="WixMbaPrereqLicenseUrl"
Value="$(var.NetFx48EulaLink)"
Overridable="yes" />
<WixVariable
Id="NetFx48WebDetectCondition"
Value="NETFRAMEWORK45 >= $(var.NetFx48MinRelease)"
Overridable="yes" />
<WixVariable
Id="NetFx48WebInstallCondition"
Value=""
Overridable="yes" />
<WixVariable
Id="NetFx48WebPackageDirectory"
Value="redist\"
Overridable="yes" />
<PackageGroup
Id="NetFx48Web">
<ExePackage
InstallCommand="/q /norestart /ChainingPackage "[WixBundleName]" /log "[NetFx48WebLog].html""
RepairCommand="/q /norestart /repair /ChainingPackage "[WixBundleName]" /log "[NetFx48WebLog].html""
UninstallCommand="/uninstall /q /norestart /ChainingPackage "[WixBundleName]" /log "[NetFx48WebLog].html""
PerMachine="yes"
DetectCondition="!(wix.NetFx48WebDetectCondition)"
InstallCondition="!(wix.NetFx48WebInstallCondition)"
Id="NetFx48Web"
Vital="yes"
Permanent="yes"
Protocol="netfx4"
DownloadUrl="$(var.NetFx48WebLink)"
LogPathVariable="NetFx48WebLog"
Compressed="no"
Name="!(wix.NetFx48WebPackageDirectory)ndp48-web.exe">
<RemotePayload
CertificatePublicKey="F49F9B33E25E33CCA0BFB15A62B7C29FFAB3880B"
CertificateThumbprint="ABDCA79AF9DD48A0EA702AD45260B3C03093FB4B"
Description="Microsoft .NET Framework 4.8 Setup"
Hash="4181398AA1FD5190155AC3A388434E5F7EA0B667"
ProductName="Microsoft .NET Framework 4.8"
Size="1439328"
Version="4.8.4115.0" />
</ExePackage>
</PackageGroup>
</Fragment>
<Fragment>
<util:RegistrySearchRef
Id="NETFRAMEWORK45" />
<WixVariable
Id="WixMbaPrereqPackageId"
Value="NetFx48Redist" />
<WixVariable
Id="WixMbaPrereqLicenseUrl"
Value="$(var.NetFx48EulaLink)"
Overridable="yes" />
<WixVariable
Id="NetFx48RedistDetectCondition"
Value="NETFRAMEWORK45 >= $(var.NetFx48MinRelease)"
Overridable="yes" />
<WixVariable
Id="NetFx48RedistInstallCondition"
Value=""
Overridable="yes" />
<WixVariable
Id="NetFx48RedistPackageDirectory"
Value="redist\"
Overridable="yes" />
<PackageGroup
Id="NetFx48Redist">
<ExePackage
InstallCommand="/q /norestart /ChainingPackage "[WixBundleName]" /log "[NetFx48RedistLog].html""
RepairCommand="/q /norestart /repair /ChainingPackage "[WixBundleName]" /log "[NetFx48RedistLog].html""
UninstallCommand="/uninstall /q /norestart /ChainingPackage "[WixBundleName]" /log "[NetFx48RedistLog].html""
PerMachine="yes"
DetectCondition="!(wix.NetFx48RedistDetectCondition)"
InstallCondition="!(wix.NetFx48RedistInstallCondition)"
Id="NetFx48Redist"
Vital="yes"
Permanent="yes"
Protocol="netfx4"
DownloadUrl="$(var.NetFx48RedistLink)"
LogPathVariable="NetFx48RedistLog"
Compressed="no"
Name="!(wix.NetFx48RedistPackageDirectory)ndp48-x86-x64-allos-enu.exe">
<RemotePayload
CertificatePublicKey="F49F9B33E25E33CCA0BFB15A62B7C29FFAB3880B"
CertificateThumbprint="ABDCA79AF9DD48A0EA702AD45260B3C03093FB4B"
Description="Microsoft .NET Framework 4.8 Setup"
Hash="E322E2E0FB4C86172C38A97DC6C71982134F0570"
ProductName="Microsoft .NET Framework 4.8"
Size="117380440"
Version="4.8.4115.0" />
</ExePackage>
</PackageGroup>
</Fragment>
<Fragment>
<util:RegistrySearchRef
Id="NETFRAMEWORK45" />
<WixVariable
Id="WixMbaPrereqPackageId"
Value="NetFx48Redist" />
<WixVariable
Id="WixMbaPrereqLicenseUrl"
Value="$(var.NetFx48EulaLink)"
Overridable="yes" />
<WixVariable
Id="NetFx48RedistDetectCondition"
Value="NETFRAMEWORK45 >= $(var.NetFx48MinRelease)"
Overridable="yes" />
<WixVariable
Id="NetFx48RedistInstallCondition"
Value=""
Overridable="yes" />
<WixVariable
Id="NetFx48RedistPackageDirectory"
Value="redist\"
Overridable="yes" />
<PackageGroup
Id="NetFx48RedistPayload">
<ExePackage
InstallCommand="/q /norestart /ChainingPackage "[WixBundleName]" /log "[NetFx48RedistLog].html""
RepairCommand="/q /norestart /repair /ChainingPackage "[WixBundleName]" /log "[NetFx48RedistLog].html""
UninstallCommand="/uninstall /q /norestart /ChainingPackage "[WixBundleName]" /log "[NetFx48RedistLog].html""
PerMachine="yes"
DetectCondition="!(wix.NetFx48RedistDetectCondition)"
InstallCondition="!(wix.NetFx48RedistInstallCondition)"
Id="NetFx48Redist"
Vital="yes"
Permanent="yes"
Protocol="netfx4"
LogPathVariable="NetFx48RedistLog"
Compressed="no"
SourceFile=".\Files\ndp48-x86-x64-allos-enu.exe">
<Payload Name="ndp48-x86-x64-allos-enu.exe"
SourceFile=".\Files\ndp48-x86-x64-allos-enu.exe"/>
</ExePackage>
</PackageGroup>
</Fragment>
</Wix>
I never found this this on any google hunts, but apparently setting the compressed to "yes" was the key, and no need for a payload when doing that. Worked exactly as I want at this point. Single (large) file and auto-extracts and runs.
<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
<!--
copied from:
https://github.com/wixtoolset/wix3/blob/develop/src/ext/NetFxExtension/wixlib/NetFx48.wxs
-->
<Wix
xmlns="http://schemas.microsoft.com/wix/2006/wi"
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
<!--
.NET Framework installation state properties
Official documentation can be found at the following location:
.NET Framework 4.5.x/4.6.x/4.7.x/4.8.x - http://msdn.microsoft.com/en-us/library/w0x726c2(v=vs.110).aspx
-->
<?define NetFx48MinRelease = 528040 ?>
<?define NetFx48WebLink = https://go.microsoft.com/fwlink/?LinkId=2085155 ?>
<?define NetFx48RedistLink = https://go.microsoft.com/fwlink/?LinkId=2088631 ?>
<?define NetFx48EulaLink = https://referencesource.microsoft.com/license.html ?>
<Fragment>
<PropertyRef
Id="WIXNETFX4RELEASEINSTALLED" />
<Property
Id="WIX_IS_NETFRAMEWORK_48_OR_LATER_INSTALLED"
Secure="yes" />
<SetProperty
Id="WIX_IS_NETFRAMEWORK_48_OR_LATER_INSTALLED"
Value="1"
After="AppSearch">
WIXNETFX4RELEASEINSTALLED >= "#$(var.NetFx48MinRelease)"
</SetProperty>
</Fragment>
<!-- removed other fragments because they didn't matter -->
<Fragment>
<util:RegistrySearchRef
Id="NETFRAMEWORK45" />
<WixVariable
Id="WixMbaPrereqPackageId"
Value="NetFx48Redist" />
<WixVariable
Id="WixMbaPrereqLicenseUrl"
Value="$(var.NetFx48EulaLink)"
Overridable="yes" />
<WixVariable
Id="NetFx48RedistDetectCondition"
Value="NETFRAMEWORK45 >= $(var.NetFx48MinRelease)"
Overridable="yes" />
<WixVariable
Id="NetFx48RedistInstallCondition"
Value=""
Overridable="yes" />
<WixVariable
Id="NetFx48RedistPackageDirectory"
Value="redist\"
Overridable="yes" />
<PackageGroup
Id="NetFx48RedistPayload">
<ExePackage
InstallCommand="/q /norestart /ChainingPackage "[WixBundleName]" /log "[NetFx48RedistLog].html""
RepairCommand="/q /norestart /repair /ChainingPackage "[WixBundleName]" /log "[NetFx48RedistLog].html""
UninstallCommand="/uninstall /q /norestart /ChainingPackage "[WixBundleName]" /log "[NetFx48RedistLog].html""
PerMachine="yes"
DetectCondition="!(wix.NetFx48RedistDetectCondition)"
InstallCondition="!(wix.NetFx48RedistInstallCondition)"
Id="NetFx48Redist"
Vital="yes"
Permanent="yes"
Protocol="netfx4"
LogPathVariable="NetFx48RedistLog"
Compressed="yes"
SourceFile=".\Files\ndp48-x86-x64-allos-enu.exe" />
</PackageGroup>
</Fragment>
</Wix>

Wix bootstrapper doesn't call the msi file during uninstall if DisplayInternalUI="yes"

I have an existing wix msi project with full fledged UI. I created a wix bundle and referenced the msi project in this bootstrapper project.It installs the msi perfectly but during uninstall it doesn't call the msi when DisplayInternalUI="yes" for the msi package.But when the DisplayInternalUI="no" for msi, it uninstalls correctly by calling the msi package.How to get around this issue.As, I can't set the DisplayInternalUI to no, as I want msi UI to be displayed during install.Is there a way to turn DisplayInternalUI to no during uninstall and to yes during install.Here is my bundle code:
<Bundle Name="$(var.ProductName)" Version="$(var.ProductVersion)" Manufacturer="Name" UpgradeCode="GUID" >
<BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense" >
<bal:WixStandardBootstrapperApplication SuppressOptionsUI="yes" LicenseUrl="" />
</BootstrapperApplicationRef>
<util:RegistrySearch Id="Office2007_Installed" Variable="OFFICE2007" Root="HKLM" Key="Software\Microsoft\Office\12.0\Outlook\InstallRoot" Result="exists" />
<util:RegistrySearch Id="VSTOR_Installed" Variable="VSTOR40" Root="HKLM" Key="SOFTWARE\Microsoft\VSTO Runtime Setup\v4R" Result="exists" />
<util:RegistrySearch Id="VSTOR_Installed1" Variable="VSTOR40_1" Root="HKLM" Key="SOFTWARE\Microsoft\VSTO Runtime Setup\v4" Result="exists" />
<util:RegistrySearch Id="VSTOR_Installed2" Variable="VSTOR40_2" Root="HKLM" Key="SOFTWARE\Wow6432Node\Microsoft\VSTO Runtime Setup\v4" Result="exists" />
<util:RegistrySearch Id="VSTOR_Installed3" Variable="VSTOR40_3" Root="HKLM" Key="SOFTWARE\Wow6432Node\Microsoft\VSTO Runtime Setup\v4R" Result="exists" />
<Chain>
<!-- TODO: Define the list of chained packages. -->
<!-- <MsiPackage SourceFile="path\to\your.msi" /> -->
<ExePackage Id="INSTALLVSTO" SourceFile="vstor_redist.exe" Vital="yes" Compressed="no" Permanent="yes"
DownloadUrl="http://go.microsoft.com/fwlink/?LinkId=158917"
InstallCommand="/q /norestart"
DetectCondition="VSTOR40 OR VSTOR40_1 OR VSTOR40_2 OR VSTOR40_3"
InstallCondition="NOT (VSTOR40 OR VSTOR40_1 OR VSTOR40_2 OR VSTOR40_3)" />
<RollbackBoundary />
<MsiPackage Compressed="yes" SourceFile="$(var.Msi Project name.TargetPath)" Vital="yes" DisplayInternalUI="yes" Cache="no">
</MsiPackage>
</Chain>
</Bundle>
And here is the Product.wxs file.
<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:netfx="http://schemas.microsoft.com/wix/NetFxExtension">
<?define ProductName = "Outlook Plug-In"?>
<?define ProductVersion = "4.0.8.7"?>
<Product Id="81f4a93f-ee3f-438d-a836-741666112715" Name="$(var.ProductName)" Language="1033" Version="$(var.ProductVersion)" Manufacturer="ABC" UpgradeCode="{B9080C51-8F85-4D5B-9387-DE942A43C985}" >
<!--InstallScope to hide Administrator login on installation-->
<Package Id="*" InstallerVersion="200" Compressed="yes" InstallScope="perMachine"/>
<Binary Id="SummaryA" SourceFile="Bitmap\Summary.bmp" />
<Binary Id="CustomAction_OutlookPlugin" SourceFile="..\..\CustomPane_outlookAddIn\Installer_CustomActions\bin\$(var.Configuration)\Installer_CustomActions.CA.dll" />
<Binary Id="SummaryB" SourceFile="Bitmap\MaintienanceSum.bmp" />
<Binary Id="Bmp_Install" SourceFile="Bitmap\Destination.bmp" />
<Binary Id="LicdialogBmp" SourceFile="Bitmap\License.bmp" />
<Binary Id="Banner" SourceFile="Bitmap\bannrbmp.bmp" />
<Binary Id="ProgressA" SourceFile="Bitmap\Installation.bmp" />
<Binary Id="ProgressB" SourceFile="Bitmap\MaintienancePro.bmp" />
<Binary Id="VerifyReadyDlgA" SourceFile="Bitmap\InstallationType.bmp" />
<Binary Id="VerifyReadyDlgB" SourceFile="Bitmap\MaintienanceIns.bmp" />
<Binary Id="Bmp_Dialog" SourceFile="Bitmap\Introduction.bmp" />
<Binary Id="Maintienance" SourceFile="Bitmap\Maintienance.bmp" />
<Icon Id="icon.ico" SourceFile="..\..\CustomPane_outlookAddIn\CustomPane_outlookAddIn\Resources\ECM_Icon_v1.ico"/>
<Property Id="ARPPRODUCTICON" Value="icon.ico" />
<Property Id="OFFICE2007" Value="0"/>
<Property Id="SectionName"/>
<Property Id="OFFICE_2007_32" >
<RegistrySearch Id="Office32" Win64="no" Name ="Path" Root="HKLM" Key="Software\Microsoft\Office\12.0\Outlook\InstallRoot" Type="raw" />
</Property>
<Property Id="OFFICE_2007_64">
<RegistrySearch Id="Office64" Win64="yes" Name="Path" Root="HKLM" Key="Software\Microsoft\Office\12.0\Outlook\InstallRoot" Type="raw" >
</RegistrySearch>
</Property>
<Property Id="PluginVersion" Value="$(var.ProductVersion)"/>
<Property Id="PluginDescription" Value="Outlook Plug-In"/>
<Property Id="FriendlyName" Value="Outlook Addin($(var.ProductVersion))"/>
<Property Id="VSTOName" Value="CustomPane_outlookAddIn.vsto|vstolocal"/>
<!--Property Section-->
<!--To Check NETFRAMEWORK-->
<PropertyRef Id="NETFRAMEWORK45" />
<Condition Message='This setup requires Microsoft .NET Framework 4.5 package or greater needs to be installed for this installation to continue.'>
<![CDATA[Installed OR NETFRAMEWORK45]]>
</Condition>
<!--To Check Upgrade-->
<Property Id="PREVIOUSVERSIONSINSTALLED" Secure="yes" />
<Property Id="NEWERPRODUCTFOUND" Secure="yes" />
<!--For LocalAppData-->
<Property Id="REMEMBERME">
<RegistrySearch Id="RememberProperty" Root="HKCU"
Key="SOFTWARE\Wix\DemoRememberProperty"
Name="Remembered" Type="raw"/>
</Property>
<Property Id="REMEMBERME1">
<RegistrySearch Id="RememberProperty1" Root="HKCU"
Key="SOFTWARE\Wix\DemoRememberProperty1"
Name="Remembered1" Type="raw"/>
</Property>
<!--Set Initial directory browseproperty-->
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLLOCATION"/>
<Property Id="SETALLUSERS"/>
<!--<SetProperty Id="SETALLUSERS" Before="AppSearch" Value="{}">
</SetProperty>-->
<!-- Default configuration values -->
<Property Id="SERVICEURL">Server Url/Environment</Property>
<Property Id="GETALLUSERS">
<RegistrySearch Id="GETALLUSERSRegistry" Type="raw"
Root='HKLM' Key='Software\Microsoft\Office\Outlook\AddIns\OutlookAddin' Name='Manifest'/>
</Property>
<Property Id="GETPERUSERS">
<RegistrySearch Id="GETPERUSERSRegistry" Type="raw"
Root='HKCU' Key='Software\Microsoft\Office\Outlook\AddIns\OutlookAddin' Name='Manifest'/>
</Property>
<Feature Id="CustomPane_outlookAddIn" Title="Outlook Addin" Level="1" >
<Component Id="FOLDER" Guid="*" DiskId="1" Directory="ABC" >
<RegistryValue Root="HKCU" Key="SOFTWARE\Wix\DemoRememberProperty" Name="Remembered1" Value="[REMEMBERME1]" Type="string" KeyPath="yes"/>
<RemoveFolder Id="CleanupFolder" On="uninstall" />
</Component>
<Component Id="ProductFiles" Guid="9bb98af7-870b-4ce6-b2be-fd42203528ec" DiskId="1" Directory='INSTALLLOCATION' >
<CreateFolder Directory="INSTALLLOCATION">
<Permission User="Everyone" GenericAll="yes" />
</CreateFolder>
<File Id="CustomPane_outlookAddIn_dll" Name="CustomPane_outlookAddIn.dll" Source="..\..\CustomPane_outlookAddIn\CustomPane_outlookAddIn\bin\$(var.Build)\CustomPane_outlookAddIn.dll" />
<File Id="CustomPane_outlookAddIn_dll_manifest" Name="CustomPane_outlookAddIn.dll.manifest" Source="..\..\CustomPane_outlookAddIn\CustomPane_outlookAddIn\bin\$(var.Build)\CustomPane_outlookAddIn.dll.manifest" />
<File Id="CustomPane_outlookAddIn_vsto" Name="CustomPane_outlookAddIn.vsto" Source="..\..\CustomPane_outlookAddIn\CustomPane_outlookAddIn\bin\$(var.Build)\CustomPane_outlookAddIn.vsto" />
<File Id="libeay32_dll" Name="libeay32.dll" Source="..\..\CustomPane_outlookAddIn\Third Party Libs\libeay32.dll" />
<File Id="libgcc_s_dw2_1_dll" Name="libgcc_s_dw2-1.dll" Source="..\..\CustomPane_outlookAddIn\Third Party Libs\libgcc_s_dw2-1.dll" />
<File Id="ssleay32_dll" Name="ssleay32.dll" Source="..\..\CustomPane_outlookAddIn\Third Party Libs\ssleay32.dll" />
<File Id="wkhtmltopdf_exe" Name="wkhtmltopdf.exe" Source="..\..\CustomPane_outlookAddIn\Third Party Libs\wkhtmltopdf.exe" />
<File Id="OutlookGridControl_dll" Name="OutlookGridControl.dll" Source="..\..\CustomPane_outlookAddIn\CustomPane_outlookAddIn\bin\$(var.Build)\OutlookGridControl.dll" />
<File Id="UtilityClassess_dll" Name="UtilityClasses.dll" Source="..\..\CustomPane_outlookAddIn\CustomPane_outlookAddIn\bin\$(var.Build)\UtilityClasses.dll" />
<File Id="OneDriveAPI_dll" Name="OneDriveAPI.dll" Source="..\..\CustomPane_outlookAddIn\CustomPane_outlookAddIn\bin\$(var.Build)\OneDriveAPI.dll" />
<File Id="BoxAPI_dll" Name="BoxAPI.dll" Source="..\..\CustomPane_outlookAddIn\CustomPane_outlookAddIn\bin\$(var.Build)\BoxAPI.dll" />
<File Id="ZIP_dll" Name="Ionic.Zip.dll" Source="..\..\CustomPane_outlookAddIn\CustomPane_outlookAddIn\bin\$(var.Build)\Ionic.Zip.dll" />
<File Id="DropBoxAPI_dll" Name="DropBoxLibrary.dll" Source="..\..\CustomPane_outlookAddIn\CustomPane_outlookAddIn\bin\$(var.Build)\DropBoxLibrary.dll" />
<File Id="ProjectFolderOrder_xml" Name="ProjectFolderOrders.xml" Source="..\..\CustomPane_outlookAddIn\Third Party Libs\ProjectFolderOrders.xml" />
<File Id="Outlook_4_Utilities_dll" Name="Microsoft.Office.Tools.Outlook.v4.0.Utilities.dll" Source="..\..\CustomPane_outlookAddIn\CustomPane_outlookAddIn\bin\$(var.Build)\Microsoft.Office.Tools.Outlook.v4.0.Utilities.dll" />
<File Id="Common_4_Utilities_dll" Name="Microsoft.Office.Tools.Common.v4.0.Utilities.dll" Source="..\..\CustomPane_outlookAddIn\CustomPane_outlookAddIn\bin\$(var.Build)\Microsoft.Office.Tools.Common.v4.0.Utilities.dll" />
<!--<File Id="RestSharp_dll" Name="RestSharp.dll" Source="..\..\CustomPane_outlookAddIn\CustomPane_outlookAddIn\bin\$(var.Build)\RestSharp.dll" />-->
<File Id="JSON_dll" Name="Newtonsoft.Json.dll" Source="..\..\CustomPane_outlookAddIn\CustomPane_outlookAddIn\bin\$(var.Build)\Newtonsoft.Json.dll" />
<File Id="VSDNETCFG_dll" Name="VSDNETCFG.dll.config" Source=".\Binaryf\VSDNETCFG.dll.config" />
<File Id="CUSTOMPANE_OUTLOOKADDIN_DLL_CONFIG" Name="CustomPane_outlookAddIn.dll.config" Source="..\..\CustomPane_outlookAddIn\CustomPane_outlookAddIn\bin\$(var.Build)\CustomPane_outlookAddIn.dll.config"/>
<File Id="shell32_dll" Name="Interop.Shell32.dll" Source="..\..\CustomPane_outlookAddIn\CustomPane_outlookAddIn\bin\$(var.Build)\Interop.Shell32.dll" />
<RegistryValue Root="HKCU" Key="SOFTWARE\Wix\DemoRememberProperty" Name="Remembered" Value="[REMEMBERME]" Type="string" KeyPath="yes"/>
<RemoveFolder Id="CleanupApplicationFolder" On="uninstall" />
</Component>
<Component Id="CurrentMachineEntry" Guid="*" Directory="TARGETDIR">
<Condition>NOT SETALLUSERS</Condition>
<RegistryKey Root="HKCU" Key="Software\Microsoft\Office\Outlook\AddIns\OutlookAddin" Action="createAndRemoveOnUninstall">
<RegistryValue Type="string" Name="Description" Value="[PluginDescription]" />
<RegistryValue Type="string" Name="FriendlyName" Value="[FriendlyName]" />
<RegistryValue Type="integer" Name="LoadBehavior" Value="3" />
<RegistryValue Type="string" Name="Manifest" Value="[INSTALLLOCATION][VSTOName]" />
<RegistryValue Type="string" Name="TEst" Value="[INSTALLLOCATION][VSTOName]" />
</RegistryKey>
</Component>
<Component Id="LocalMachineEntry" Guid="*" Directory="TARGETDIR" >
<Condition > SETALLUSERS AND NOT(OFFICE_2007_32 OR OFFICE_2007_64) </Condition>
<RegistryKey Root="HKLM" Key="Software\Microsoft\Office\Outlook\AddIns\OutlookAddin" Action="createAndRemoveOnUninstall">
<RegistryValue Type="string" Name="Description" Value="[PluginDescription]" />
<RegistryValue Type="string" Name="FriendlyName" Value="[FriendlyName]" />
<RegistryValue Type="integer" Name="LoadBehavior" Value="3" />
<RegistryValue Type="string" Name="Manifest" Value="[INSTALLLOCATION][VSTOName]" />
</RegistryKey>
</Component>
</Feature>
<!--Remove older versions but do not overwrite newer versions.-->
<Upgrade Id="{B9080C51-8F85-4D5B-9387-DE942A43C985}">
<UpgradeVersion Minimum="1.0.0" Maximum="$(var.ProductVersion)" Property="PREVIOUSVERSIONSINSTALLED" OnlyDetect="no" IncludeMinimum="yes" IncludeMaximum="no"/>
<UpgradeVersion Minimum="$(var.ProductVersion)" Property="NEWERPRODUCTFOUND" OnlyDetect="yes" IncludeMinimum="no" />
</Upgrade>
<CustomAction Id="CANCELNEWERVERSION" Error="Unable to install because a newer version of this product is already installed." />
<InstallExecuteSequence>
<Custom Action="CANCELNEWERVERSION" After="FindRelatedProducts">NEWERPRODUCTFOUND AND NOT Installed</Custom>
<RemoveExistingProducts Before="InstallInitialize" />
</InstallExecuteSequence>
<!--Check the PRogram File in installation directory path.-->
<CustomAction Id="Verify_INSTALLDIR" Script="vbscript">
<![CDATA[
Dim properties
properties = Split(Session.Property("INSTALLLOCATION"), "\")
If properties(1)="Program Files" Or properties(1)="Program Files (x86)" Then
MsgBox "You have selected Program Files as installation base folder."
End If
]]>
</CustomAction>
<CustomAction Id="ALLUSERVerify" Script="vbscript">
<![CDATA[
Dim prop
prop = Session.Property("SETALLUSERS")
If prop="1" Then
MsgBox "You must be an Administrator for this option to install correctly."
End If
]]>
</CustomAction>
<!--Run Installer Class.-->
<!--<Binary Id="InstallUtil" SourceFile="$(env.windir)\Microsoft.NET\Framework\v2.0.50727\InstallUtilLib.dll" />
<CustomAction Id="Install" BinaryKey="InstallUtil" DllEntry="ManagedInstall" Execute="deferred" Impersonate="no" />-->
<!--<CustomAction Id="InstallSetPro" Property="Install" Value='/installtype=notransaction /action=install /LogFile= /sectionName="Install" /serviceUrl="[SERVICEURL]" "[#CustomPane_outlookAddIn_dll]" "[#VSDNETCFG_dll]"' />-->
<!--<CustomAction Id="Uninstall" BinaryKey="InstallUtil" DllEntry="ManagedInstall" Execute="deferred" Impersonate="no" />-->
<CustomAction Id="UninstallSetPro" Execute="immediate" Property="SectionName" Value="Uninstall" />
<CustomAction Id="InstallSetPro" Execute="immediate" Property="SectionName" Value="Install" />
<CustomAction Id="Install" Return="check" Execute="immediate" BinaryKey="CustomAction_OutlookPlugin" DllEntry="RegistryInstall" />
<CustomAction Id="Uninstall" Return="check" Execute="immediate" BinaryKey="CustomAction_OutlookPlugin" DllEntry="RegistryInstall" />
<CustomAction Id="CopyOrderingFile" Return="check" Execute="immediate" BinaryKey="CustomAction_OutlookPlugin" DllEntry="CopyOrderingFile" />
<!--<CustomAction Id="CheckForOffice2007" Return="check" Execute="immediate" BinaryKey="CustomAction_OutlookPlugin" DllEntry="isOffice2007" />-->
<InstallExecuteSequence>
<!--<Custom Action="CheckForOffice2007" Before="AllocateRegistrySpace" >$ProductFiles>2</Custom>-->
<Custom Action="InstallSetPro" After="WriteRegistryValues" >$ProductFiles>2</Custom>
<Custom Action="Install" After="InstallSetPro">$ProductFiles>2</Custom>
<Custom Action="CopyOrderingFile" After="InstallFinalize">NOT Installed</Custom>
<!--<Custom Action="UninstallSetPro" After="MsiUnpublishAssemblies">$ProductFiles=2</Custom>-->
<Custom Action="UninstallSetPro" After="MsiUnpublishAssemblies" > $ProductFiles=2</Custom>
<Custom Action="Uninstall" After="UninstallSetPro">$ProductFiles=2</Custom>
</InstallExecuteSequence>
<CustomAction Id="SetProductName" Property="ProductName" Value="Outlook Plug-In" Execute="immediate" />
<InstallExecuteSequence>
<Custom Action="SetProductName" Before="FindRelatedProducts">1</Custom>
</InstallExecuteSequence>
<CustomAction Id="CANCELPERUSER" Error="Product with same name already installed with per-machine setting.You are installing with per-user setting which is not allowed.Please uninstall the installed version and retry." />
<CustomAction Id="CANCELALLUSER" Error="Product with same name already installed with per-user setting.You are installing with per-machine setting which is not allowed.Please uninstall the installed version and retry." />
<CustomAction Id="CANCELALLUSERWITHOUT" Error="You need administrative rights to Install with 'ALL Users' setting."/>
<CustomAction Id="SETALLUSERSATREMOVE" Property="ALLUSERS" Value="1" Execute="immediate" />
<CustomAction Id="SETPERUSERSATREMOVE" Property="ALLUSERS" Value="{}" Execute="immediate" />
<InstallUISequence>
<Custom Action="SETALLUSERSATREMOVE" After="CostFinalize">GETALLUSERS AND Installed</Custom>
<Custom Action="SETPERUSERSATREMOVE" After="SETALLUSERSATREMOVE">GETPERUSERS AND Installed</Custom>
</InstallUISequence>
<UIRef Id="My_InstallDir" />
</Product>
<Fragment>
<Media Id="1" Cabinet="simple.cab" EmbedCab="yes" />
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="ABC" Name="AC">
<Directory Id="INSTALLLOCATION" Name="Outlook Plug-In"/>
</Directory>
</Directory>
</Directory>
</Fragment>
</Wix>
WiX suppresses the internal MSI UI during uninstallation or repair. It by default shows a basic UI. However, it should still uninstall correctly.

Wix Installer : verify that you have sufficient privileges to install system services

I have installed windows service using Installutil.exe maually , now on top of that now i am tring to install using wix.
I am trying to install Windows service using WIX.
My intention is First Stop the service, install the service then start the service.
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Name="GPAT-PricingInactivateService" Language="1033" Version="1.0.0.0" Manufacturer="American Express" UpgradeCode="6b4cf27d-6504-4e24-803e-d26491b21b3d">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" InstallPrivileges="elevated" />
<Upgrade Id="6b4cf27d-6504-4e24-803e-d26491b21b3d">
<UpgradeVersion Minimum="0.0.0.0"
IncludeMinimum="yes"
OnlyDetect="no"
Maximum="1.0.0.0"
IncludeMaximum="yes"
Property="PREVIOUSFOUND" />
</Upgrade>
<InstallExecuteSequence>
<RemoveExistingProducts After="InstallValidate"/>
</InstallExecuteSequence>
<Feature Id="ProductFeature" Title="GPAT-PricingInactivateService" Level="1">
<ComponentGroupRef Id="ServiceComponents" />
</Feature>
<Media Id="1" Cabinet="Components.cab" EmbedCab="yes" />
<Property Id="TARGETDIR">C:\Test\</Property>
</Product>
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="INSTALLFOLDER" Name="GPATPriceInactiveService"/>
</Directory>
</Fragment>
<Fragment>
<ComponentGroup Id="ServiceComponents">
<Component Id="Axp.Gcpt.Gpat.Worker.Library" Directory="INSTALLFOLDER" Guid="{E1810FA9-5620-4739-9FE2-2726CC2CA6F4}">
<File Id="FileService" Name="Axp.Gcpt.Gpat.Worker.exe" Source="$(var.Axp.Gcpt.Gpat.Worker.TargetDir)\Axp.Gcpt.Gpat.Worker.exe" KeyPath='yes' />
<ServiceInstall Id="GPATService" Type="ownProcess" Name="Axp.Gcpt.Gpat.Worker" DisplayName="Axp.Gcpt.Gpat.Worker"
Description="Axp.Gcpt.Gpat.Worker description" Start="auto" Account="LocalSystem" ErrorControl="normal" Interactive="yes" Vital="yes" >
<ServiceControl Id="GPATServiceStart" Name="Axp.Gcpt.Gpat.Worker" Stop="both" Start="both" Wait="yes" />
</Component>
Don't specify
Account="LocalSystem"
in your ServiceInstall-block, if you want LocalSystem-Account to be used.
You could specify your windows user.
<u:User Id="UpdateUserLogonAsService" UpdateIfExists="yes" CreateUser="no" Name="[USERNAME]" LogonAsService="yes" RemoveOnUninstall="no"/>
<ServiceInstall
Id="GPATService"
Type="ownProcess"
Name="Axp.Gcpt.Gpat.Worker"
DisplayName="Axp.Gcpt.Gpat.Worker"
Description="Axp.Gcpt.Gpat.Worker description"
Start="auto"
ErrorControl="normal"
Account='[USERNAME]'
Password='[PASSWORD]'/>

WiX Uninstall functionality with StandardBootstrapperApplication

I've built a very basic installer for a bundle of applications with dependencies and that handles a restart for a .NET package. What I'm running into now, however, is the problem where the uninstall action only uninstalls the installer itself, which shows up in the program list. All of the other .exe files that run installation processes remain installed. Is there any simple way to handle this installation? I'm still very new to the WiX toolset and didn't want to dive really deep into a custom installer. Here is my bundle:
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
xmlns:netfx="http://schemas.microsoft.com/wix/NetFxExtension"
xmlns:bal="http://schemas.microsoft.com/wix/BalExtension"
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
<Bundle Name="Visible EP Installer" Version="1.0.0.0" Manufacturer="VEP" UpgradeCode="8d1a4e2a-be3f-4b51-824b-75652ae98bad">
<BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense" >
<bal:WixStandardBootstrapperApplication
LicenseFile="..\VisibleEP EULA-ver2.rtf"
LogoFile="..\VEPLogo_HeartOnlyBlack(50x50).png"
/>
</BootstrapperApplicationRef>
<?define NetFx45MinRelease = 378389?>
<util:RegistrySearch
Id="NETFRAMEWORK45"
Variable="NETFRAMEWORK45"
Root="HKLM"
Key="SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full"
Value="Release"
Result="value" />
<Chain>
<ExePackage Id="NetFx45Redist" Cache="no" Compressed="yes" PerMachine="yes" Permanent="yes" Vital="yes" InstallCommand="/q /norestart" RepairCommand="/q"
SourceFile="..\VEP Deploy\Setup Files\dotNetFx45_Full_setup.exe"
DetectCondition="NETFRAMEWORK45 >= $(var.NetFx45MinRelease)"
InstallCondition="(NOT NETFRAMEWORK45 >= $(var.NetFx45MinRelease))">
<ExitCode Value="1641" Behavior="forceReboot"/>
<ExitCode Value="3010" Behavior="forceReboot"/>
<ExitCode Value="0" Behavior="success"/>
<ExitCode Behavior="error"/>
</ExePackage>
<ExePackage
SourceFile="..\VEP Deploy\Setup Files\Encoder_en.exe"
Permanent="no"
InstallCommand="/q"
RepairCommand="/q">
<ExitCode Behavior="success"/>
</ExePackage>
<ExePackage
SourceFile="..\VEP Deploy\Setup Files\vcredist_x86.exe"
Permanent="no"
InstallCommand="/q"
RepairCommand="/q">
<ExitCode Behavior="success"/>
</ExePackage>
<ExePackage
SourceFile="..\VEP Deploy\Setup Files\vcredist_x64.exe"
Permanent="no"
InstallCommand="/q"
RepairCommand="/q">
<ExitCode Behavior="success"/>
</ExePackage>
<ExePackage
SourceFile="..\VEP Deploy\Setup Files\vep_setup.exe"
Permanent="no">
<ExitCode Behavior="success"/>
</ExePackage>
</Chain>
</Bundle>
</Wix>
I know that handling the exit codes for the last few is a bit hackish but I'm not all that concerned with that at the moment so long as it isn't impacting my other problem.
You have to supply UninstallCommand attribute values so Burn knows how to uninstall the .exes.

WiX Extended Bootstrapper Application: How to determine which radio button is selected?

Here's my setup:
Compiling at .NET 4.0 (this cannot change)
Using WiX 3.7
Using the WiX Extended Bootstrapper Application extension
So I'm creating a bootstrapper installation project and though I've got it working, I feel like there is a much more clean and easy way to do it.
Basically, I need to have the user select which environment they wish to use when they install the product. To do this, I use the WiX Extended Bootstrapper Application extension to allow me to put some radio buttons on the first install screen.
Getting that all setup was fine, but then I realized that I don't know how to easily determine which radio button has been selected. So as I work around I just listed the MSI three times in the bundle and put install conditions on each one.
Is there a way to determine which radio button has been selected with just one property? (For example, when I pass the InstallFolder property to my MSI as seen in the code below.) And if there isn't a way to do this currently, is there a way for me to do this without adding my MSI three times to the bundle?
Here's my code (Notice how I list essentially the same MsiPackage three times):
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
xmlns:bal="http://schemas.microsoft.com/wix/BalExtension"
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
<?include Properties.wxi ?>
<Bundle Name="!(loc.Product.Name)" Version="$(var.Version)" Manufacturer="!(loc.Product.Manufacturer)" UpgradeCode="$(var.UpgradeCode)" Condition="VersionNT >= v5.1">
<BootstrapperApplicationRef Id="WixExtendedBootstrapperApplication.Hyperlink2License">
<bal:WixExtendedBootstrapperApplication SuppressRepair="yes" LicenseUrl="" ThemeFile="$(var.Bundle.ExtTheme.RadioBtns.Path)" LocalizationFile="$(var.Bundle.ExtTheme.RadioBtns.l10n.Path)" />
</BootstrapperApplicationRef>
<WixVariable Id="WixMbaPrereqPackageId" Value="Netfx4Full" />
<Variable Name="InstallFolder" Type="string" Value="$(var.InstallFolder.Value)" />
<Variable Name="RadioButton1" Type="numeric" Value="0" />
<Variable Name="RadioButton2" Type="numeric" Value="0" />
<Variable Name="RadioButton3" Type="numeric" Value="1" />
<Chain>
<!-- Other Package References Here -->
<MsiPackage Id="DBConnections_Dev"
SourceFile="$(var.MSI.Path)"
Visible="no"
Vital="yes"
InstallCondition="RadioButton1 = 1">
<MsiProperty Name="INSTALLFOLDER" Value="[InstallFolder]" />
<MsiProperty Name="SELECTED_ENV" Value="1" />
</MsiPackage>
<MsiPackage Id="DBConnections_Stage"
SourceFile="$(var.MSI.Path)"
Visible="no"
Vital="yes"
InstallCondition="RadioButton2 = 1">
<MsiProperty Name="INSTALLFOLDER" Value="[InstallFolder]" />
<MsiProperty Name="SELECTED_ENV" Value="2" />
</MsiPackage>
<MsiPackage Id="DBConnections_Prod"
SourceFile="$(var.MSI.Path)"
Visible="no"
Vital="yes"
InstallCondition="RadioButton3 = 1">
<MsiProperty Name="INSTALLFOLDER" Value="[InstallFolder]" />
<MsiProperty Name="SELECTED_ENV" Value="3" />
</MsiPackage>
</Chain>
</Bundle>
</Wix>
I also asked this question on the project's CodePlex site and the developer responded as follows (here is a link to the full discussion: http://wixextba.codeplex.com/discussions/432341):
This can now be done using the custom actions feature.
I've tested his response and found it to be correct! This functionality is available as of version 3.7.4791.32058. There is also an example included in the source code demonstrating how this is done. I've posted the pertinent code below:
Needed in Custom Action c++ code:
STDMETHODIMP OnPlanCustomAction()
{
...
if (SUCCEEDED(BalGetNumericVariable(L"RadioButton1", &llValue)) && llValue)
{
m_pEngine->SetVariableNumeric(L"RadioButton", 1);
BalExitOnFailure(hr, "Failed to set variable.");
}
else if (SUCCEEDED(BalGetNumericVariable(L"RadioButton2", &llValue)) && llValue)
{
m_pEngine->SetVariableNumeric(L"RadioButton", 2);
BalExitOnFailure(hr, "Failed to set variable.");
}
else if (SUCCEEDED(BalGetNumericVariable(L"RadioButton3", &llValue)) && llValue)
{
m_pEngine->SetVariableNumeric(L"RadioButton", 3);
BalExitOnFailure(hr, "Failed to set variable.");
}
else if (SUCCEEDED(BalGetNumericVariable(L"RadioButton4", &llValue)) && llValue)
{
m_pEngine->SetVariableNumeric(L"RadioButton", 4);
BalExitOnFailure(hr, "Failed to set variable.");
}
else
{
m_pEngine->SetVariableNumeric(L"RadioButton", 0);
BalExitOnFailure(hr, "Failed to set variable.");
}
...
Needed in WiX XML (from examples that come with downloaded DLL):
<Variable Name="RadioButton1" Type="numeric" Value="0" />
<Variable Name="RadioButton2" Type="numeric" Value="1" />
<Variable Name="RadioButton3" Type="numeric" Value="0" />
<Variable Name="RadioButton4" Type="numeric" Value="0" />
<Chain DisableSystemRestore="yes">
<PackageGroupRef Id="NetFx40Redist" />
<MsiPackage
Id="Setup"
Compressed="yes"
SourceFile="Setup.msi"
Vital="yes">
<MsiProperty Name="APPLICATIONFOLDER" Value="[InstallFolder]" />
<MsiProperty Name="RadioButton" Value="[RadioButton]" />
</MsiPackage>
</Chain>
Check out the links in the text for the original examples from which these code samples were taken. Hope this helps others in the future.