WiX Conditional Registry Entries - wix

I'm working on my first ever WiX project and I'm having a tough time getting some registry entries to work properly.
My requirements are, to have an option in the setup to choose whether the software will be installed on a desktop computer, or on an aircraft. Since there isn't really any way to detect it automatically, I've created an additional UI screen with some radio buttons. (this is in a separate file)
<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<UI>
<Dialog Id="AircraftDesktopDlg_Custom"
Width="370"
Height="270"
Title="!(loc.InstallDirDlg_Title)">
<Control Type="RadioButtonGroup"
Property="InstallType_Prop"
Id="InstallType"
Width="200"
Height="42"
X="20"
Y="110">
<RadioButtonGroup Property="InstallType_Prop">
<RadioButton Text="Aircraft"
Height="17"
Value="0"
Width="50"
X="0"
Y="0" />
<RadioButton Text="Desktop"
Height="17"
Value="1"
Width="200"
X="0"
Y="20" />
</RadioButtonGroup>
</Control>
</Dialog>
</UI>
</Fragment>
</Wix>
Code Listing 1 - Radio Buttons
Then, over in my main Product.wxs file, I have the following.
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product>
<Property Id="InstallType_Prop"
Value="0"/>
.
.
.
<DirectoryRef Id="TARGETDIR">
<Component Id="AircraftRegistryEntries"
Guid="E251C37B-2A4F-46D4-8E9F-24C66FB107E9">
<Condition>InstallType_Prop = 0</Condition>
<RegistryKey Root="HKLM"
Key="Software\Company\Product\v1.0"
Action="createAndRemoveOnUninstall">
<RegistryValue Type="integer"
Name="OfflineMode"
Value="0"/>
<RegistryValue Type="integer"
Name="Simulator"
Value="0"/>
</RegistryKey>
</Component>
<Component Id="DesktopRegistryEntries"
Guid="CACDBBB6-BCAA-4B71-92BE-C762325580A3">
<Condition>InstallType_Prop = 1</Condition>
<RegistryKey Root="HKLM"
Key="Software\Company\Product\v1.0"
Action="createAndRemoveOnUninstall">
<RegistryValue Type="integer"
Name="OfflineMode"
Value="1"/>
<RegistryValue Type="integer"
Name="Simulator"
Value="0"/>
</RegistryKey>
</Component>
</DirectoryRef>
.
.
.
<Feature Id='Complete'
Level='1'>
<ComponentRef Id='AircraftRegistryEntries'/>
<ComponentRef Id='DesktopRegistryEntries'/>
</Feature>
</Product>
</Wix>
Code Listing 2 - Property and Registry Entry
So as you can see, the radio button is tied to the InstallType_Prop.
What I am trying to accomplish is to install the appropriate registry entry depending on which radio button is selected. I inserted those conditions in the registry components, but they don't seem to be doing anything.
I don't even really have to do it this way - I just need OfflineMode to be set to 1 if Desktop is selected, and set to 0 if Aircraft is selected.
I'm at a loss right now, and I think the solution lies somewhere with a custom action or with the order in which the conditions are evaluated, but I'm not entirely sure.
Any help is appreciated.

IMO the usual way to do this is to group the various components into (say) two features, one per type of system, then the users see the standard feature tree where they choose the appropriate one. In the case of registry entries, you'd have a component (for the registry entry) for each type of install, one would be in one feature, the other in the other.

Related

How do I make a 64 bit MSI?

I've specified:
-arch x64 when running candle.exe.
Platform=x64 on the Package.
ProgramFiles64Folder as the Directory id where things get installed.
and still, when the app gets installed, it goes to C:\Program Files (x86).
There are some other wxs generated by heat.exe. I tried adding -platform x64 and -platform win64 to the calls to heat.exe, but it made no difference.
I read
https://msdn.microsoft.com/en-us/library/gg513929.aspx
The section on 64 bit installer in the Wix Cookbook
How do I get WiX to generate a 64-bit MSI?
and I think I'm doing everything that was described there.
What am I missing?
I've came up with a minimum case that looks like this:
<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Name="Project X" Manufacturer="X LLC" Language="1033" Version="1.0.0.0"
UpgradeCode="5bf2131c-4068-4cb3-adac-bc9c79ed8ce3">
<Package InstallerVersion="301" Compressed="yes" InstallScope="perMachine" Platform="x64"/>
<Property Id="ApplicationFolderName" Value="Project X"/>
<Property Id="WixAppFolder" Value="WixPerMachineFolder"/>
<UI>
<UIRef Id="WixUI_Advanced"/>
</UI>
</Product>
</Wix>
and I compile it like this:
candle.exe -arch x64 -ext WixUIExtension -ext WixUtilExtension ProjectX.wxs
light.exe -ext WixUIExtension -ext WixUtilExtension -out ProjectX-1.0.0-beta.3-win64.msi ProjectX.wixobj
It obviously complaints about the media table being empty:
> candle.exe -arch x64 -ext WixUIExtension -ext WixUtilExtension ProjectX.wxs
Windows Installer XML Toolset Compiler version 3.11.0.1701
Copyright (c) .NET Foundation and contributors. All rights reserved.
ProjectX.wxs
> light.exe -ext WixUIExtension -ext WixUtilExtension -out ProjectX-1.0.0-beta.3-win64.msi ProjectX.wixobj
Windows Installer XML Toolset Linker version 3.11.0.1701
Copyright (c) .NET Foundation and contributors. All rights reserved.
C:\Users\pupeno\AppData\Local\Temp\h1k0echv\ProjectX-1.0.0-beta.3-win64.msi : warning LGHT1076 : ICE71: The Media table has no entries.
But the installer is still generated and it still points to C:\Program Files (x86):
The full .wxs looks like this:
<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
<Product Id="*" Name="ProjectX" Manufacturer="X Inc" Language="1033"
Version="$(var.MSIProductVersion)" UpgradeCode="">
<Package InstallerVersion="301" Compressed="yes" InstallScope="perMachine" Platform="x64"/>
<MediaTemplate EmbedCab="yes"/>
<Icon Id="Icon_ProjectX.ico" SourceFile="src\main\installer\ProjectX.ico"/>
<WixVariable Id="WixUISupportPerUser" Value="0"/>
<Property Id="ApplicationFolderName" Value="X Inc\ProjectX"/>
<Property Id="WixAppFolder" Value="WixPerMachineFolder"/>
<Property Id="ARPPRODUCTICON" Value="Icon_ProjectX.ico"/>
<WixVariable Id="WixUILicenseRtf" Value="src\main\installer\eula.rtf"/>
<WixVariable Id="WixUIBannerBmp" Value="src\main\installer\WixUIBannerBmp.bmp"/>
<WixVariable Id="WixUIDialogBmp" Value="src\main\installer\WixUIDialogBmp.bmp"/>
<Property Id="AUTO_CONNECT_TO">
<RegistrySearch Id="AutoConnectTo" Root="HKLM" Key="Software\X Inc\ProjectX" Name="AutoConnectTo"
Type="raw"/>
</Property>
<Property Id="RUN_ProjectX_ON_EXIT" Value="true"/>
<Property Id="INSTALL_SCREENSAVER_ON_EXIT" Value="true"/>
<Property Id="STAGING_DIR" Value="undefined"/>
<Property Id="ARCH" Value="undefined"/>
<UI>
<UIRef Id="DM_WixUI_Advanced"/>
<Publish Dialog="DM_ExitDialog" Control="Finish" Event="DoAction" Value="CA_Run_ProjectX">
RUN_ProjectX_ON_EXIT and <![CDATA[&Ftr_Configurator=3]]> and NOT Installed
</Publish>
<Publish Dialog="DM_ExitDialog" Control="Finish" Event="DoAction" Value="CA_Install_Screensaver">
INSTALL_SCREENSAVER_ON_EXIT and <![CDATA[&Ftr_Screensaver=3]]> and NOT Installed
</Publish>
<Dialog Id="DM_ExitDialog" Width="370" Height="270" Title="!(loc.ExitDialog_Title)">
<Control Id="Finish" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes" Cancel="yes"
Text="!(loc.WixUIFinish)"/>
<Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Disabled="yes"
Text="!(loc.WixUICancel)"/>
<Control Id="Bitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="234" TabSkip="no"
Text="!(loc.ExitDialogBitmap)"/>
<Control Id="Back" Type="PushButton" X="180" Y="243" Width="56" Height="17" Disabled="yes"
Text="!(loc.WixUIBack)"/>
<Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="0"/>
<Control Id="Description" Type="Text" X="135" Y="70" Width="220" Height="40" Transparent="yes"
NoPrefix="yes"
Text="Thank you for choosing ProjectX. We sincerely hope it satisfies your needs."/>
<Control Id="Title" Type="Text" X="135" Y="20" Width="220" Height="60" Transparent="yes" NoPrefix="yes"
Text="!(loc.ExitDialogTitle)"/>
<Control Id="RunProjectXCheckBox" Type="CheckBox" X="135" Y="150" Width="220" Height="40" Hidden="yes"
Property="RUN_ProjectX_ON_EXIT" CheckBoxValue="1" Text="Run ProjectX Configurator">
<Condition Action="show"><![CDATA[&Ftr_Configurator=3]]></Condition>
</Control>
<Control Id="InstallScreensaverCheckBox" Type="CheckBox" X="135" Y="190" Width="220" Height="40"
Hidden="yes" Property="INSTALL_SCREENSAVER_ON_EXIT" CheckBoxValue="1"
Text="Install ProjectX as your screensaver">
<Condition Action="show"><![CDATA[&Ftr_Screensaver=3]]></Condition>
</Control>
</Dialog>
<InstallUISequence>
<Show Dialog="DM_ExitDialog" OnExit="success" Overridable="yes"/>
</InstallUISequence>
<AdminUISequence>
<Show Dialog="DM_ExitDialog" OnExit="success" Overridable="yes"/>
</AdminUISequence>
</UI>
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed."/>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFiles64Folder">
<Directory Id="APPLICATIONFOLDER">
<Directory Id="Dir_jre" Name="jre"/>
<Directory Id="Dir_jars" Name="jars"/>
</Directory>
</Directory>
<Directory Id="ProgramMenuFolder">
<Directory Id="Dir_Menu_ProjectX" Name="ProjectX"/>
</Directory>
<Component Id="Cmp_Auto_Connect_to" Win64="yes">
<RegistryValue Root="HKLM" Key="Software\X Inc\ProjectX" Name="AutoConnectTo" Type="string"
Value="[AUTO_CONNECT_TO]"/>
</Component>
<Directory Id="SystemFolder"/>
</Directory>
<DirectoryRef Id="APPLICATIONFOLDER">
<Component Id="Cmp_ProjectX_Configurator_exe" Guid="" Win64="yes">
<File Id="File_FT_D_ProjectX_Configurator_exe"
Source="$(var.STAGING_DIR)\ProjectX Configurator.exe" KeyPath="yes">
<Shortcut Id="Shrt_ProjectX_Configurator" Name="ProjectX Configurator" Directory="Dir_Menu_ProjectX"
Advertise="yes" Icon="Icon_ProjectX.ico"/>
</File>
<RemoveFolder Id="Rm_Menu_ProjectX_1" Directory="Dir_Menu_ProjectX" On="uninstall"/>
</Component>
<Component Id="Cmp_ProjectX_Displayer_exe" Guid="" Win64="yes">
<File Id="File_FT_D_ProjectX_Displayer_exe" Source="$(var.STAGING_DIR)\ProjectX Displayer.exe"
KeyPath="yes">
<Shortcut Id="Shrt_ProjectX_Displayer" Name="ProjectX Displayer" Directory="Dir_Menu_ProjectX"
Advertise="yes" Icon="Icon_ProjectX.ico"/>
</File>
<RemoveFolder Id="Rm_Menu_ProjectX_2" Directory="Dir_Menu_ProjectX" On="uninstall"/>
</Component>
<Component Id="Cmp_ProjectX_Renderer_exe" Guid="" Win64="yes">
<File Id="File_FT_D_ProjectX_Renderer_exe" Source="$(var.STAGING_DIR)\ProjectX Renderer.exe"
KeyPath="yes">
<Shortcut Id="Shrt_ProjectX_Renderer" Name="ProjectX Renderer" Directory="Dir_Menu_ProjectX"
Advertise="yes" Icon="Icon_ProjectX.ico"/>
</File>
<RemoveFolder Id="Rm_Menu_ProjectX_3" Directory="Dir_Menu_ProjectX" On="uninstall"/>
</Component>
<Component Id="Cmp_Prosaver_scr" Guid="" Win64="yes">
<File Id="File_FT_D_Prosaver_scr" Source="$(var.STAGING_DIR)\Prosaver.scr" KeyPath="yes"/>
</Component>
<Component Id="Cmp_Icon" Guid="" Win64="yes">
<File Id="File_Icon" Source="src\main\installer\ProjectX.ico" KeyPath="yes"/>
</Component>
</DirectoryRef>
<DirectoryRef Id="Dir_Menu_ProjectX">
<Component Id="Cmp_Install_Screensaver" Guid="" Win64="yes">
<Shortcut Id="Shrt_Install_Screensaver" Name="Install ProjectX Screensaver"
WorkingDirectory="SystemFolder" Icon="Icon_ProjectX.ico"
Target="[SystemFolder]rundll32.exe"
Arguments="desk.cpl,InstallScreenSaver [#File_FT_D_Prosaver_scr]"/>
<RemoveFolder Id="Rm_Menu_ProjectX_4" On="uninstall"/>
<RegistryValue Root="HKCU" Key="Software\X Inc\ProjectX" Name="installed" Type="integer"
Value="1" KeyPath="yes"/>
</Component>
<Component Id="Cmp_ProjectX_Support" Guid="" Win64="yes">
<util:InternetShortcut Id="IShrt_ProjectX_Support" Name="ProjectX Support" IconFile="[#File_Icon]"
Target="https://support.ProjectX.tech"/>
<RemoveFolder Id="Rm_Menu_ProjectX_5" On="uninstall"/>
<RegistryValue Root="HKCU" Key="Software\X Inc\ProjectX" Name="installed" Type="integer"
Value="1" KeyPath="yes"/>
</Component>
</DirectoryRef>
<CustomAction Id="CA_Run_ProjectX" Directory="APPLICATIONFOLDER" Return="asyncNoWait"
ExeCommand="[#File_FT_D_ProjectX_Configurator_exe]"/>
<CustomAction Id="CA_Install_Screensaver" Directory="SystemFolder" Return="asyncNoWait"
ExeCommand="[SystemFolder]rundll32.exe desk.cpl,InstallScreenSaver [#File_FT_D_Prosaver_scr]"/>
<Feature Id="ProductFeature" Title="ProjectX" Level="1" Display="expand"
Description="ProjectX.">
<ComponentGroupRef Id="ComGrp_JRE"/>
<ComponentGroupRef Id="ComGrp_JARS"/>
<ComponentRef Id="Cmp_Auto_Connect_to"/>
<ComponentRef Id="Cmp_ProjectX_Support"/>
<ComponentRef Id="Cmp_Icon"/>
<Feature Id="Ftr_Configurator" Title="Configurator" Level="1"
Description="This is the application you use to register a new account as well as configure what websites are displayed, what displayers and renderers have access, etc. You need this in at least one computer to control your account.">
<ComponentRef Id="Cmp_ProjectX_Configurator_exe"/>
</Feature>
<Feature Id="Ftr_Displayer" Title="Displayer" Level="1"
Description="This is what displays web sites. You need this (or the screensaver) on all the computers connected to screens that displays web sites.">
<ComponentRef Id="Cmp_ProjectX_Displayer_exe"/>
</Feature>
<Feature Id="Ftr_Renderer" Title="Renderer" Level="1"
Description="This accesses your websites and generates the screenshots for the displayers. You need at least one of these although the Configurator can also act as a Renderer.">
<ComponentRef Id="Cmp_ProjectX_Renderer_exe"/>
</Feature>
<Feature Id="Ftr_Screensaver" Title="Screensaver" Level="1"
Description="This is what displays web sites as the screensaver. You need this (or the displayer) on all the computers connected to screens that displays web sites.">
<ComponentRef Id="Cmp_Prosaver_scr"/>
<ComponentRef Id="Cmp_Install_Screensaver"/>
</Feature>
</Feature>
</Product>
</Wix>
The summary information for the generated MSI looks like this (GUID changed):
and the directory points to the use of ProgramFiles64Folder. I can't find anything wrong:
%ProgramFiles% still points to the correct place:
>echo %ProgramFiles%
C:\Program Files
and I also had this fail on two separate computers in the same way (installing to C:\Program Files (x86)).
If I change the Directory to be ProgramFilesFolder instead of ProgramFiles64Folder, then, I get the expected errors:
error LGHT0204 : ICE80: This 64BitComponent cmpCBBF8379128F087B61BD92F8113C95D6 uses 32BitDirectory dir451F8F132CB17CBF5649679474428CE4
Just in case, I open the registry editor and removed all mentions of C:\Program Files (x86)\X LCC. That made no difference :(
I tried specifying a name to the directory, as an experiment:
<Directory Id="ProgramFiles64Folder" Name="Program Files">
and that made no difference either.
Very rushed: In your compiled MSI, maybe try to change the below entry in the Custom Action table first (use Orca to hotfix after compilation):
change:
WixSetDefaultPerMachineFolder, 51, WixPerMachineFolder, [ProgramFilesFolder], [ApplicationFolderName]
into:
WixSetDefaultPerMachineFolder, 51, WixPerMachineFolder, [ProgramFiles64Folder], ApplicationFolderName]
I don't have time to test the above properly, but if you look in the CustomAction table you will see that WixSetDefaultPerMachineFolder assigns [ProgramFilesFolder][ApplicationFolderName] to WixPerMachineFolder. Then you have lots of stuff going on in the ControlEvent table with WixAppFolder = "WixPerMachineFolder" etc... Quite confusing. Then it looks like WixPerMachineFolder is assigned to APPLICATIONFOLDER. The actual property used in the dialog seems to be WIXUI_INSTALLDIR. Can't track it all right now - please try the simple hack above (just set the path to ProgramFiles64Folder) - it might yank the paths into submission. Then test the whole thing to death in all installation mode (install, repair, self-repair, modify, uninstall, major upgrade, patch, admin install, etc...).
Sorry for the rush, good luck.
What does your directory table look like? Are you using ProgramFilesFolder or ProgramFilesFolder64?
You'll also need to mark your components as 64 bit. Since the media table is complaining I'm guessing you don't have any component data yet.

WiX service don't start: service failed to start verify that you have sufficient privileges

I have a java application. I have made an scansol-agent-app.exe file from that i need to make an installer with WiX. Below there is a code of scansol-agent.wxs file. I need to install this app as windows service. Servise installs well, but don't starts. Windows shows me an error: “Service failed to start - Verify that you have sufficient privileges to start system services”
I tried all variants that could find, but no any results. How can i start this service?
<?xml version="1.0"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*"
UpgradeCode="{EB6B8302-C06E-4bec-ADAC-932C68A3A98D}"
Name="Scansol Agent Application Service"
Version="0.0.1"
Manufacturer="ScienceSoft"
Language="1033">
<Package InstallerVersion="200" Compressed="yes" Comments="Windows Installer Package" Manufacturer="ScienceSoft"/>
<Media Id="1" Cabinet="product.cab" EmbedCab="yes"/>
<Property Id="WHSLogo">1</Property>
<WixVariable Id="WixUILicenseRtf" Value="license.rtf" />
<UI>
<Property Id="ApplicationFolderName" Value="WiX Demo" />
<Property Id="WixAppFolder" Value="WiXxperMachineFolder" />
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLDIR" />
<UIRef Id="WixUI_InstallDir" />
<!-- Skip license dialog -->
<Publish Dialog="WelcomeDlg"
Control="Next"
Event="NewDialog"
Value="InstallDirDlg"
Order="2">1</Publish>
<Publish Dialog="InstallDirDlg"
Control="Back"
Event="NewDialog"
Value="WelcomeDlg"
Order="2">1</Publish>
<!--<Property Id="DefaultUIFont">DlgFont8</Property>-->
<TextStyle Id="DlgFont8" FaceName="Tahoma" Size="8" />
<TextStyle Id="DlgTitleFont" FaceName="Tahoma" Size="8" Bold="yes" />
<Dialog Id="InstallDlg" Width="370" Height="270" Title="[ProductName] Setup" NoMinimize="yes">
<Control Id="Title" Type="Text" X="15" Y="6" Width="200" Height="15" Transparent="yes" NoPrefix="yes">
<Text>{\DlgTitleFont}Ready to Install</Text>
</Control>
<Control Id="Install" Type="PushButton" X="304" Y="243" Width="56" Height="17"
Default="yes" Text="Install">
<Publish Event="EndDialog" Value="Return" />
</Control>
</Dialog>
</UI>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder" Name="PFiles">
<Directory Id="INSTALLDIR" Name="ScansolAgent">
<Component Id="ApplicationServiceInstall" Guid="{908B7199-DE2A-4dc6-A8D0-27A5AE444FEA}">
<File Id='ApplicationFile1' Source="scansol-agent-app.exe" DiskId='1' KeyPath='yes' Vital='yes'/>
<File Id="ApplicationFile2" Source="config.cfg" DiskId='1' KeyPath='no' Vital='yes'/>
<ServiceInstall
Id="ServiceInstaller"
Type="ownProcess"
Vital="yes"
Name="ScansolAgentService"
DisplayName="Scansol Agent Application Service"
Description="File Monitoring and Loading to server"
Start="auto"
Account="LocalSystem"
ErrorControl="ignore"
Interactive="no"
>
</ServiceInstall>
<ServiceControl Id="StartService" Start="install" Stop="both" Remove="uninstall" Name="ScansolAgentService" Wait="yes" />
</Component>
</Directory>
</Directory>
</Directory>
<Feature Id="DefaultFeature" Level="1" Title="ScansolAgentAppService">
<ComponentRef Id="ApplicationServiceInstall" />
</Feature>
</Product>
</Wix>
The reasons could be many and vast majority of those were addressed, however, I had a case that none of the answers or suggestions were applicable to it. At the end I found the reason for my case: in the ServiceInstall tag there is an attribute named Account, which in my case was LocalService, however, in my project for the Windows Service, in the generated file I assigned for my service the account to be LocalSystem. So if the service account set in the windows service project does not match to what you later specify in your WiX source file under the ServiceInstall's Account attribute, then the Windows Installer will successfully install your service, however, will fail on starting it. Conclusion, make sure the service accounts match at both places. And again, this might not be your case, but is worth to double check.
Please see this answer: https://stackoverflow.com/a/65342252/6657445. For this case, because this is not a domain or local user account, try flipping "Interactive" to "yes". I have other services installed this way without issue.

Wix remove appdata folder on uninstall

I am using Wix 3.11 and have tried a number of different ways and methods and can't seem to be able to figure out why Wix isn't removing my ApplicationDataFolder folder. During install I create the folder in the ApplicationDataFolder location for the user.
My application uses logging and stores it along with a few other things in the directory. During uninstall everything in the application folder is removed but the appdata folder with the logs and other files are left untouched.
I can't figure out why or what I am missing.
WXS Template
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
<Product Id="*" UpgradeCode="9e578e3d-0119-425c-8633-f54ffaaa4929" Name="#product.name#" Version="#product.version#" Manufacturer="#product.company#" Language="1033">
<Package InstallerVersion="400" Compressed="yes" InstallScope="perMachine" Comments="#product.version#" Description="#product.description#"/>
<Media Id="1" Cabinet="SomeApp.cab" EmbedCab="yes" />
<!-- Installer Properties -->
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLDIR" />
<PropertyRef Id="WIX_IS_NETFRAMEWORK_46_OR_LATER_INSTALLED"/>
<!-- Installer Resources -->
<Icon Id="ApplicationIcon" SourceFile="SomeApp 4\SomeApp 4_vista.ico"/>
<Property Id="ARPPRODUCTICON" Value="ApplicationIcon" />
<Property Id="INSTALLDIR">
<RegistrySearch Key="SOFTWARE\Acme\SomeApp"
Root="HKCU" Type="raw"
Id="APPLICATIONFOLDER_REGSEARCH" Name="installation-path" />
</Property>
<WixVariable Id="WixUILicenseRtf" Value="SomeApp 4\license.rtf" />
<WixVariable Id="WixUIBannerBmp" Value="WixUIBannerBmp.bmp" />
<WixVariable Id="WixUIDialogBmp" Value="WixUIDialogBmp.bmp" />
<!-- Check Existing Install -->
<Upgrade Id="9e578e3d-0119-425c-8633-f54ffaaa4929">
<UpgradeVersion Minimum="#product.version#" OnlyDetect="yes" Property="NEWERVERSIONDETECTED"/>
<UpgradeVersion Minimum="0.0.0" Maximum="#product.version#" IncludeMinimum="yes" IncludeMaximum="no" Property="OLDERVERSIONBEINGUPGRADED"/>
</Upgrade>
<Condition Message="A newer version of this software is already installed.">NOT NEWERVERSIONDETECTED</Condition>
<!-- Prerequisites -->
<Condition Message="This application requires .NET Framework 4.6 or newer. Please install the .NET Framework then run this installer again.">
<![CDATA[Installed OR WIX_IS_NETFRAMEWORK_46_OR_LATER_INSTALLED]]>
</Condition>
<Condition Message="This application requires at least Windows 7 or Windows Server 2008 R2. Please upgrade your computer to a supported operating system and run this installer again.">
<![CDATA[Installed OR (VersionNT >= 601)]]>
</Condition>
<!-- Define the directory structure -->
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder" Name="ProgramFiles">
<Directory Id="INSTALLDIR" Name="#product.company#">
#product.applicationfiles#
#product.servicefiles#
</Directory>
</Directory>
<Directory Id="ProgramMenuFolder">
<Directory Id="ApplicationProgramsFolder" Name="#product.name#"/>
<Directory Id="ServiceProgramsFolder" Name="#product.name#"/>
</Directory>
<Directory Id="DesktopFolder" Name="Desktop" />
<Directory Id="LocalAppDataFolder">
<Directory Id="ApplicationDataFolder" Name="Acme" />
</Directory>
</Directory>
<DirectoryRef Id="ApplicationProgramsFolder">
<Component Id="ApplicationShortcut" Guid="1e578e4d-0229-425c-8633-f54ffaaa4901">
<Shortcut Id="ApplicationStartMenuShortcut"
Name="SomeApp 4.6"
Description="#product.company# #product.name# #product.version#"
Target="[INSTALLDIR]SomeApp 4\SomeApp.UserInterface.exe"
WorkingDirectory="INSTALLDIR"
Icon ="ApplicationIcon"/>
<Shortcut Id="ApplicationStartMenuShortcut2"
Name="SomeApp 4.6 (Multiple Instances)"
Description="#product.company# #product.name# #product.version#"
Target="[INSTALLDIR]SomeApp 4\SomeApp.UserInterface.exe"
Arguments="MultipleInstance=True"
WorkingDirectory="INSTALLDIR"
Icon ="ApplicationIcon"/>
<Shortcut Id="ApplicationStartMenuShortcut3"
Name="SomeApp 4.6 (Notifications)"
Description="#product.company# #product.name# #product.version#"
Target="[INSTALLDIR]SomeApp 4\SomeApp.UserInterface.exe"
Arguments="Notifications=True"
WorkingDirectory="INSTALLDIR"
Icon ="ApplicationIcon"/>
<Shortcut Id="HelpStartMenuShortcut"
Name="SomeApp 4.6 Help"
Target="[INSTALLDIR]SomeApp 4\Documentation\SomeApp.chm"
WorkingDirectory="INSTALLDIR"/>
<Shortcut Id="UninstallProduct"
Name="Uninstall SomeApp 4.6"
Target="[SystemFolder]msiexec.exe"
Arguments="/x [ProductCode]"
Description="Uninstall #product" />
<Shortcut Id="desktopshortcut"
Directory="DesktopFolder"
Name="SomeApp 4.6"
WorkingDirectory="INSTALLDIR"
Target="[INSTALLDIR]SomeApp 4\SomeApp.UserInterface.exe" />
<RemoveFolder Id="ApplicationProgramsFolder" On="uninstall"/>
<util:RemoveFolderEx On="uninstall" Property="ApplicationDataFolder" />
</Component>
</DirectoryRef>
<DirectoryRef Id="ServiceProgramsFolder">
<Component Id="ServiceShortcut" Guid="9e578e3d-0229-425c-8633-f54ffaaa4901">
<Shortcut Id="ServiceStartMenuShortcut"
Name="#product.name# Reporting Service"
Description="#product.name# Reporting Service"
Target="[INSTALLDIR]Reporting\SomeApp.ReportingService.exe"
WorkingDirectory="INSTALLDIR"
Icon ="ApplicationIcon"/>
<RemoveFolder Id="ServiceProgramsFolder" On="uninstall"/>
<RegistryValue Root="HKCU" Key="Software\Microsoft\Acme\SomeApp" Name="service-installed" Type="integer" Value="1" KeyPath="yes"/>
</Component>
</DirectoryRef>
<DirectoryRef Id="INSTALLDIR">
<Component Id="CleanupMainApplicationFolder" Guid="*">
<RegistryValue Root="HKCU" Key="SOFTWARE\Acme\SomeApp" Name="installation-path" Type="string" Value="[INSTALLDIR]" KeyPath="yes" />
<util:RemoveFolderEx On="uninstall" Property="INSTALLDIR" />
<util:RemoveFolderEx On="uninstall" Property="ApplicationDataFolder" />
</Component>
</DirectoryRef>
<!-- Feature: SomeApp Application -->
<Feature Id="Feature.Application"
Title="SomeApp 4 - Application"
Description="SomeApp is an asset management and maintenance application designed to optimize asset value and improve manufacturing productivity."
ConfigurableDirectory="INSTALLDIR"
Level="1"
AllowAdvertise="no">
#product.applicationcomponents#
<ComponentRef Id="ApplicationShortcut" />
<ComponentRef Id="CleanupMainApplicationFolder" />
</Feature>
<!-- Feature: Reporting Service -->
<Feature Id="Feature.Service"
Title="SomeApp 4 - Reporting Service"
Description="This service generates and delivers reports that have been scheduled in the SomeApp Maintenance Management System."
ConfigurableDirectory="INSTALLDIR"
Level="3"
AllowAdvertise="no">
#product.servicecomponents#
<ComponentRef Id="ServiceShortcut" />
<Component Id="ReportingServiceInstaller" Guid="B72CAA3F-F2DB-48D2-90DD-061209AB2CE5" Directory="INSTALLDIR">
<CreateFolder />
<File Id="ReportingService.exe" Name="ReportingService.exe" KeyPath="yes" Source="#product.sourcedir#\Reporting\SomeApp.ReportingService.exe"/>
<ServiceInstall Id="ReportingServiceInstaller"
Type="ownProcess"
Vital="yes"
Name="SomeApp Reporting Service"
DisplayName="SomeApp - Reporting Service"
Description="This service generates and delivers reports that have been scheduled in the SomeApp Maintenance Management System."
Start="auto"
Account="NT AUTHORITY\LocalService"
ErrorControl="ignore"
Interactive="no" />
</Component>
</Feature>
<CustomAction Id="Cleanup_logfile" Directory="INSTALLDIR"
ExeCommand="cmd /C "rmdir %LOCALAPPDATA%\Acme /s /q""
Execute="deferred" Return="ignore" HideTarget="no" Impersonate="no" />
<InstallExecuteSequence>
<Custom Action="Cleanup_logfile" After="RemoveFiles" >
REMOVE="ALL"
</Custom>
</InstallExecuteSequence>
<InstallExecuteSequence>
<RemoveExistingProducts After="InstallValidate"/>
</InstallExecuteSequence>
<UIRef Id="WixUI_FeatureTree" />
<UI>
<DialogRef Id="FilesInUse" />
<DialogRef Id="MsiRMFilesInUse" />
<!-- Add the GUI logic for installation -->
</UI>
</Product>
</Wix>
I have one project that uses util:RemoveFolderEx where it is working properly. The only difference I can see is that I explicitly set a property at runtime to the value of the install directory. My guess is that "INSTALLDIR" and "ApplicationDataFolder" are not actually properties since they are stored in the Directory table of your msi and not the property table. (Checked using ORCA)
Try doing
<SetProperty Id='AcmeAppDataFolderToRemove' Value='[ApplicationDataFolder]' After='AppSearch'/>
and then change your util:RemoveFolderEx to
<util:RemoveFolderEx On="uninstall" Property="AcmeAppDataFolderToRemove" />
and see if that works. (You might need to use Value='ApplicationDataFolder' without the []'s not sure.)
In response to your edit I went and looked at the RemoveFolderEx page and this looks important
The custom action that implements RemoveFolderEx does so by writing temporary rows to the RemoveFile table for each subfolder of the root folder you specify. Because it might dramatically affect Windows Installer's File Costing, the temporary rows must be written before the CostInitialize standard action. Unfortunately, MSI doesn't create properties for the Directory hierarchy in your package until later, in the CostFinalize action.
I figured setting it to the directory would work but apparently these directories don't have values yet when RemoveFolderEx action actually executes. So, when this tries to resolve the properties or set the properties they are actually just empty.
A difference in what I said my installer does and what it actually does is that I get the value I set the property to through a RegistrySearch.
<Property Id="INSTALLDIR">
<RegistrySearch
Id='InstallDirRegistrySearch'
Type='raw'
Root='HKLM'
Key='SOFTWARE\$(var.OEMRegistryRootKeyName)'
Name='SDKPath' />
</Property>
<SetProperty Id='SDKFolderToRemove' Value='[INSTALLDIR]\$(var.OEMProduct) SDK' After='AppSearch'/>
So I would try writing the appdata dir to a registry key and getting the value into a property via registry search then using that property in your removefolderex, you probably don't need the setproperty, I just used it because I needed a folder under INSTALLDIR but in your case you can just have the registry key be the right folder.

How can I execute a custom action in wix just before service installation?

This my Product.wxs:
In the custom action, I want to make changes in the httpd.conf file before Apache 2.4 service is installed, actually the Apache 2.4 Service takes Configuration parameters from httpd.conf, so its mandatory for the code that the changes should be made before installation of service, If any idea help me on this ?
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:util='http://schemas.microsoft.com/wix/UtilExtension'>
<Product Id="*" Name="MyExampleProject" Language="1033" Version="1.0.0.0" Manufacturer="Mq" UpgradeCode="08bd3c48-deef-4370-ab94-f8b4d49406e3">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" InstallPrivileges="elevated"/>
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<MediaTemplate />
<!--System Configuration Condition - Installation install only above Windows XP-->
<Condition Message="This application is only supported on Windows XP, or higher.">
<![CDATA[Installed OR (VersionNT >= 501)]]>
</Condition>
<Directory Id='TARGETDIR' Name='SourceDir'>
<Directory Id='ProgramFilesFolder' Name='PFiles'>
<Directory Id='INSTALLDIR' Name='AgentFramework'>
<Directory Id='INSTALLBIN' Name='bin'/>
<Directory Id='INSTALLCONF' Name='conf'/>
<Directory Id='INSTALLMODULES' Name='modules'/>
</Directory>
</Directory>
</Directory>
<Feature
Id = "ProductFeature1"
Title = "AgentFramework"
Level = "1"
Absent="allow">
<ComponentRef Id='libapr_dll'/>
<ComponentRef Id='libapriconv_dll'/>
<ComponentRef Id='libaprutil_dll'/>
<ComponentRef Id='libhttpd_dll'/>
<ComponentRef Id='Pcre_dll'/>
<ComponentRef Id='Configurationfile'/>
<ComponentRef Id='Authzmodule'/>
<ComponentRef Id='Dirmodule'/>
<ComponentRef Id='ServiceComponent'/>
</Feature>
<DirectoryRef Id='INSTALLCONF'>
<Component Id='Configurationfile' Guid='2E0D2957-10EB-463A-A4FC-62B9062FE8A3'>
<File Id='Configurationfile' Name='httpd.conf' DiskId='1' Source='$(sys.CURRENTDIR)\httpd.conf' KeyPath='yes'>
</File>
</Component>
</DirectoryRef>
<DirectoryRef Id='INSTALLMODULES'>
<Component Id='Authzmodule' Guid='62AA97B6-7821-4CB4-9F89-B2A8FF0CC6BD'>
<File Id='Authzmodule' Name='mod_authz_core.so' DiskId='1' Source='$(sys.CURRENTDIR)\mod_authz_core.so' KeyPath='yes'>
</File>
</Component>
<Component Id='Dirmodule' Guid='9966BB3B-8296-43B9-A6DC-712561303329'>
<File Id='Dirmodule' Name='mod_dir.so' DiskId='1' Source='$(sys.CURRENTDIR)\mod_dir.so' KeyPath='yes'>
</File>
</Component>
</DirectoryRef>
<DirectoryRef Id='INSTALLBIN'>
<Component Id='libapr_dll' Guid='FB82D093-0B32-465B-8D8B-08B3127EB414'>
<File Id='libapr_dll' Name='libapr-1.dll' DiskId='1' Source='$(sys.CURRENTDIR)\libapr-1.dll' KeyPath='yes'>
</File>
</Component>
<Component Id='libapriconv_dll' Guid='667D6D5B-6FE4-4A6B-827F-C496239628E2'>
<File Id='libapriconv_dll' Name='libapriconv-1.dll' DiskId='1' Source='$(sys.CURRENTDIR)\libapriconv-1.dll' KeyPath='yes'>
</File>
</Component>
<Component Id='libaprutil_dll' Guid='72C688D2-8E25-49D9-9E76-F6BDBC33D394'>
<File Id='libaprutil_dll' Name='libaprutil-1.dll' DiskId='1' Source='$(sys.CURRENTDIR)\libaprutil-1.dll' KeyPath='yes'>
</File>
</Component>
<Component Id='libhttpd_dll' Guid='8946D5B1-0EA2-443E-8C20-CD8D877ACF75'>
<File Id='libhttpd_dll' Name='libhttpd.dll' DiskId='1' Source='$(sys.CURRENTDIR)\libhttpd.dll' KeyPath='yes'>
</File>
</Component>
<Component Id='Pcre_dll' Guid='0466BB2A-137C-4A95-A510-43E7A274F834'>
<File Id='Pcre_dll' Name='pcre.dll' DiskId='1' Source='$(sys.CURRENTDIR)\pcre.dll' KeyPath='yes'>
</File>
</Component>
<Component Id ="ServiceComponent" Guid="8A1BF3F0-8A84-456E-816A-5907B40B2DDB" >
<File Id='Applicationfile' Name='httpd.exe' DiskId='1' Source='$(sys.CURRENTDIR)\httpd.exe' KeyPath='yes'>
</File>
<ServiceInstall Id="ServiceComponent" Type="ownProcess" Name="Apache2.4"
DisplayName="Apache2.4" Description="Service"
Arguments="-k runservice" Start="auto" Account="LocalSystem" ErrorControl="normal"
Vital="yes" >
<util:PermissionEx User="Everyone" ServicePauseContinue="yes" ServiceQueryStatus="yes"
ServiceStart="yes" ServiceStop="yes" ServiceUserDefinedControl="yes" /> </ServiceInstall>
<ServiceControl Id="ServiceComponent" Start="install" Stop="both"
Remove="uninstall" Name="Apache2.4" Wait="yes" />
</Component>
</DirectoryRef>
<UIRef Id="CustomizeDlg" />
<UI Id="MyWixUI_Mondo">
<UIRef Id="WixUI_Mondo" />
<UIRef Id="WixUI_ErrorProgressText" />
<DialogRef Id="UserRegistrationDlg" />
<Publish Dialog="LicenseAgreementDlg" Control="Next" Event="NewDialog" Value="UserRegistrationDlg" Order="3">LicenseAccepted = "1"</Publish>
<Publish Dialog="SetupTypeDlg" Control="Back" Event="NewDialog" Value="UserRegistrationDlg">1</Publish>
</UI>
<Property Id="PIDTemplate"><![CDATA[1234<####-####-####-####>####]]></Property>
<CustomAction Id='CheckLogLevel' BinaryKey='CheckLogLevel' DllEntry='CustomAction1' />
<Binary Id ='CheckLogLevel' SourceFile='$(sys.CURRENTDIR)\MqAgent_LogLevel.dll'/>
<WixVariable Id="WixUIBannerBmp" Value="C:\Image\style39_banner.bmp" />
<WixVariable Id="WixUIDialogBmp" Value="C:\Image\style39_dialog.bmp" />
</Product>
</Wix>
Here's CustomizeDlg.wxs :
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<UI Id ="CustomizeDlg">
<ComboBox Property="SETUPLOGLEVEL">
<ListItem Text="Debug" Value="1" />
<ListItem Text="info" Value="2" />
<ListItem Text="warn" Value="3" />
</ComboBox>
<Dialog Id="UserRegistrationDlg" Width="370" Height="270" Title="[ProductName] Setup" NoMinimize="yes">
<Control Id="NameEdit" Type="ComboBox" X="52" Y="48" Width="156" Height="10" ComboList="yes"
Property="SETUPLOGLEVEL" Sorted="no" RightToLeft="yes"/>
<Control Id="CDKeyLabel" Type="Text" X="45" Y="147" Width="50" Height="10" TabSkip="no">
<Text>CD &Key:</Text>
</Control>
<Control Id="CDKeyEdit" Type="MaskedEdit" X="45" Y="159" Width="250" Height="16" Property="PIDKEY" Text="[PIDTemplate]" />
<Control Id="Back" Type="PushButton" X="180" Y="243" Width="56" Height="17" Text="&Back">
<Publish Event="NewDialog" Value="LicenseAgreementDlg">1</Publish>
</Control>
<Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Cancel="yes" Text="Cancel">
<Publish Event="SpawnDialog" Value="CancelDlg">1</Publish>
</Control>
<Control Id="BannerBitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="44" TabSkip="no" Text="WixUI_Bmp_Banner" />
<Control Id="Description" Type="Text" X="25" Y="23" Width="280" Height="15" Transparent="yes" NoPrefix="yes">
<Text>Please mention the log level</Text>
</Control>
<Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="0" />
<Control Id="Title" Type="Text" X="15" Y="6" Width="200" Height="15" Transparent="yes" NoPrefix="yes">
<Text>{\WixUI_Font_Title}Select Log Level</Text>
</Control>
<Control Id="BannerLine" Type="Line" X="0" Y="44" Width="370" Height="0" />
</Dialog>
</UI>
</Fragment>
</Wix>
What I've done before was put all my custom action's logic in an executable and then call the executable, which worked nicely. It turns out that WiX provides various Custom Action Projects within Visual Studio that remove the need to create a stand alone executable, see here for a nice example by James Schaffer.
As for controlling when the custom action is executed, you control this by adding an entry in the InstallExecuteSequence node of the *.wxs file, like this...
<InstallExecuteSequence>
<Custom Action="CheckLogLevel" Before="InstallServices" />
</InstallExecuteSequence>
... where CheckLogLevel is my custom action, and it's being directed to be run before the InstallServices action.
mattyB gets a big thumbs up.
To better understand this problem though I think it's important to view the MSI in Orca. Orca is a MS product which can view the lifecycle of MSI files. It also allows you to directly edit the MSI file.
Below is a screenshot of the "jobs" which will be run by the installer in sequence order. mattyB mentioned the "InstallServices" job, which I have highlighted in the screenshot below. We need to make sure all of our custom actions occur BEFORE this job runs. From here it's as simple as setting the "Before" attribute in the "Custom" tag to a value of "InstallServices."
Hopefully this helps to further demystify WiX.

How to pass the Parameters to custom action method in wix

I am new to create MSI installer using wix tool,here i have a query please help me how to resolve this .
My query is : I have create a custom UI , in this i have a combo box control and i have bind the combo box values as dynamically using custom Action method it's working fine . Now, i want pass the parameters(combo box selected value) to custom action method,i don't know how to pass parameters .I goggled but i did not get answer please help me.
Here is my code
<Binary Id="CustomActions" SourceFile="D:\WIX Projects\ExampleSetup\CustomAction1\bin\Debug\CustomAction1.CA.dll" />
<CustomAction Id='Action1' BinaryKey='CustomActions' DllEntry='FillServerInstances' Execute='immediate' Return='check' />
<UI>
<Dialog Id="CustomWelcomeEulaDlg" Width="600" Height="450" Title="!(loc.WelcomeEulaDlg_Title)">
<Control Id="Bitmap" Type="Bitmap" X="0" Y="44" Width="600" Height="380" TabSkip="no" Text="MainImage" />
<Control Id="Next" Type="PushButton" X="290" Y="430" Width="60" Height="17" Default="yes" Text="Next">
<Publish Event="DoAction" Value="Action1">1</Publish>
<Publish Event="NewDialog" Value="LicenseAgreementDlgs"><![CDATA[1]]></Publish>
<Publish Event="ReinstallMode" Value="ecmus"><![CDATA[Installed = 1]]></Publish>
</Control>
<Control Id="Cancel" Type="PushButton" X="350" Y="430" Width="56" Height="17" Cancel="yes" Text="Cancel">
<Publish Event="SpawnDialog" Value="CancelDlg">1</Publish>
</Control>
<Control Id="Title" Type="Text" X="15" Y="6" Width="300" Height="15" Transparent="yes" NoPrefix="yes">
<Text>[DlgTitleFont]Welcome to the [ProductName] [Wizard]</Text>
</Control>
<Control Id="BannerLine" Type="Line" X="0" Y="44" Width="600" Height="0" />
</Dialog>
Latest Code
<Product Id="22d32870-651b-4eee-a622-27b2daaade8c" Name="Small Business" Language="1033" Version="1.0.0.0" Manufacturer="Small Business Manufacturing" UpgradeCode="01b2dc2f-61f3-4ff0-a0ba-94dd4cb0829d">
<Package InstallerVersion="200" Compressed="yes" />
<Property Id="MSIFASTINSTALL" Value="3" />
<Binary Id="BIN_CustomAction" SourceFile="D:\WIX Projects\ExampleSetup\CustomAction1\bin\Debug\CustomAction1.CA.dll"/>
<Binary Id="myAction" SourceFile="D:\WIX Projects\ExampleSetup\CustomAction1\bin\Debug\CustomAction1.CA.dll"/>
<UIRef Id="WixUI_CustomMinimal" />
<Media Id="1" Cabinet="media1.cab" EmbedCab="yes" />
<Property Id="FILEPATH" />
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLLOCATION" Name="Small Business Manufacturing">
<Component Id="Component" Guid="af10d5b4-5d25-474f-8360-13b6c0cd7a53">
<File Id="Component" Source="D:\WIX Projects\Small Business Manufacturing\Small Business Manufacturing\bin\Debug\Myproject.exe" Compressed="yes" KeyPath="yes" Checksum="yes" />
</Component>
</Directory>
</Directory>
</Directory>
<Feature Id="ProductFeature" Title="Installation Target" Level="1">
<ComponentRef Id="Component" />
</Feature>
<InstallExecuteSequence>
<Custom Action="myActionId" After="InstallFinalize"></Custom>
</InstallExecuteSequence>
<CustomAction Id="SetCustomActionDataValue" Return="check" Property="myActionId" Value="AnotherValue=[Sqlinstaces]" />
<UI>
<ProgressText Action="RunEXE">Configuring Foo... (this may take a few minutes).</ProgressText>
</UI>
</Product>
As far as I am aware you can't pass parameters to custom actions. You can set a property in Wix and use WcaGetProperty to access that.
I use a listbox which is similar like so:
<!--This will be populated via the custom action-->
<Control Id="ListBoxID" Type="ListBox" Property="COMPORT" Width="80" Height="40" X="80" Y="165" Indirect="no">
<ListBox Property="COMPORT">
</ListBox>
</Control>
And in my C++ Custom Action:
hr = WcaGetFormattedProperty(L"COMPORT",&szComport);
ExitOnFailure(hr, "failed to get Com Port");
EDIT:
Ok so I am assuming your ComboBox is something like this:
<Control Id="DummyComboBox" Hidden="yes" Type="ComboBox" Sorted="yes" ComboList="yes" Property="DUMMYPROPERTY" X="65" Y="60" Width="150" Height="18">
<ComboBox Property="DUMMYPROPERTY">
</ComboBox>
Make sure your property is is defined like so(ensure capital letters):
<Property Id="DUMMYPROPERTY" Secure="yes"></Property>
You do not need a custom action to send the value of the property. All you have to do is use:
LPWSTR dummyText = NULL;
hr = WcaGetProperty(L"DUMMYPROPERTY", &dummyText);
ExitOnFailure(hr, "failed to get Dummy Text");
That is for a C++ Custom Action not sure what you are using but a quick google search would tell you the relevant code to use.