WIX Template Edit Control - wix

im trying to create a custom installer Setup, using wix-template.
Everything works fine, except the use of the 'edit' control in a custom dialog.
Heres the code of the Dialog file:
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<UI Id="InstallDlg_UI" >
<TextStyle Id="Tahoma_Regular" FaceName="Tahoma" Size="8" />
<Property Id="DefaultUIFont" Value="Tahoma_Regular" />
<Property Id="TEST" Value="test" Secure="yes"/>
<Dialog Id="InstallDlg" Width="320" Height="180" NoMinimize="yes" Title="RC Proxy Service" >
<Control Id="CRMServerTxt" Type="Text" Width="80" Height="17" X="5" Y="5" Text="CRM-Server:"/>
<Control Id="CRM" Type="Edit" Width="100" Height="17" X ="90" Y="5" Indirect="yes" Property="TEST"/>
<Control Id="SQLServerTxt" Type="Text" Width="80" Height="17" X="5" Y="25" Text="SQL-Server:" />
<Control Id="Install" Type="PushButton" X="150" Y="155" Width="80" Height="17" Text="Install" />
<Control Id="Cancel" Type="PushButton" X="235" Y="155" Width="80" Height="17" Text="Cancel"/>
</Dialog>
<InstallUISequence>
<Show Dialog="InstallDlg" Before="ExecuteAction"/>
</InstallUISequence>
</UI>
And this is the product.wxs file that references the dialog.
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Name="TestInstaller" Language="1033" Version="1.0.0.0" Manufacturer="test" UpgradeCode="b5c70750-4fdb-4ff1-8e0f-0bb8bcd47d9e">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
<MajorUpgrade DowngradeErrorMessage="A newer version of TestInstaller is already installed." />
<MediaTemplate />
<Feature Id="ProductFeature" Title="TestSetup" Level="1">
<ComponentGroupRef Id="ProductComponents" />
</Feature>
<UIRef Id="InstallDlg_UI"/>
</Product>
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLFOLDER" Name="TestSetup" />
</Directory>
</Directory>
</Fragment>
<Fragment>
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
<Component>
<File Source="$(var.SetupSample.TargetPath)" />
</Component>
</ComponentGroup>
</Fragment>
</Wix>
Im always getting error code 2228 when i try to execute the msi file. Without the 'edit' control everything works.
Im using Visual Studio 2013 and the Wix-Toolset v3.9 R2.
Someone any ideas?
Thanks Andree

It seem to me that the problem is resolved.
I have missed to add the basic dialogs that are needed for the setup.
After adding the progress and the finished dialog all works fine.

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.

How to detect whether office installed or not & notify the user using wix?

I'm using wix recently and I want to detect whether office is installed or not using wix & show a dialog if it's not.
I wrote the below code and it doesn't show the dialog.
Any ideas?
<?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="SetupProject1" Language="1033" Version="1.0.0.0" Manufacturer="Microsoft" UpgradeCode="f91c0ad9-0bbd-446d-9869-74801966e922">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
</Product>
<Fragment>
<util:RegistrySearch Id="Path"
Variable="OfficeSearchResult"
Root="HKLM"
Key="SOFTWARE\Microsoft\Office\14.0\Common\InstallRoot"
/>
<InstallUISequence>
<Show Dialog="OfficeWarningDlg" After="ExecuteAction">
<![CDATA[(OfficeSearchResult == "")]]>
</Show>
</InstallUISequence>
<UI>
<Dialog Id="OfficeWarningDlg" Width="284" Height="73" Title="QuickTime Note" NoMinimize="yes">
<Control Id="ctrl_dialog" Type="Text" X="38" Y="8" Width="240" Height="40" TabSkip="no">
<Text>Microsoft office is required.</Text>
</Control>
<Control Id="OK" Type="PushButton" X="114" Y="52" Width="56" Height="17" Default="yes" Cancel="yes" Text="OK">
<Publish Event="EndDialog" Value="Return">1</Publish>
</Control>
</Dialog>
</UI>
</Fragment>
</Wix>
Couldn't you just use a <Condition> element which will show a small dialog (and abort the installation) if its condition is not met? Then you could axe the UI/InstallUISequence stuff in your example.
<Wix ...>
<Product ...>
<Package ... />
<Property Id="OFFICEISINSTALLED">
<RegistrySearch Id="OfficeRegistryRegKey"
Root="HKLM" Key="SOFTWARE\Microsoft\Office\14.0\Common\InstallRoot" />
</Property>
<Condition Message="Microsoft office is required to install this product">
<![CDATA[Installed OR OFFICEISINSTALLED]]>
</Condition>
</Product>
</Wix>

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.

Wix prorperies value don't value is not changed after radioButton section

I want to select in the office version, the default is 32 bits. But when being installed and checked the properties to copy files, select the default value, without considering my choice. How to fix it?
Product.wxs
<?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="{95B5E9E1-AB21-4947-A047-74C169B1D1F2}" Name="Xproduct" Language="1033" Version="1.0.0.0" Manufacturer="X Limited" UpgradeCode="af9969f2-fb9c-44c7-b207-e89f1d900a91">
<Package InstallerVersion="301" Compressed="yes" InstallPrivileges="elevated" InstallScope="perMachine" AdminImage="yes" Manufacturer="X Limited" />
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<MediaTemplate />
<Property Id="officeVersion" Value="32"/>
<UI Id="MyWebUI">
<UIRef Id="WixUI_FeatureTree" />
<UIRef Id="WixUI_ErrorProgressText" />
<DialogRef Id="CheckVersion"/>
<Publish Dialog="LicenseAgreementDlg" Control="Next"
Event="NewDialog" Value="CheckVersion"
Order="3">LicenseAccepted = "1"</Publish>
</UI>
<Feature Id="CommonFuture" Title="xInstaller" Level="1">
<ComponentGroupRef Id="ShotcutComponents"/>
<ComponentGroupRef Id="xComponents"/>
<ComponentGroupRef Id="PocketSoapComponent"/>
<ComponentGroupRef Id="SystemComponentsWinX86" />
<ComponentGroupRef Id="SystemComponentsWinX64"/>
<ComponentGroupRef Id="SystemComponentsWinX64Office64"/>
</Feature>
</Product>
<Fragment>
<Condition Message="You need to be an administrator to install this product.">
Privileged
</Condition>
</Fragment>
<Fragment>
<InstallExecuteSequence>
<Custom Action='MyProcess.TaskKill' Before='InstallValidate'>NOT Installed</Custom>
</InstallExecuteSequence>
<Property Id="System32WindowsFolder" Value="C:\Windows\System32"/>
<Property Id="QtExecCmdLine" Value='"[WindowsFolder]\System32\taskkill.exe" /F /IM EXCEL.EXE'/>
<CustomAction Id="MyProcess.TaskKill" BinaryKey="WixCA" DllEntry="CAQuietExec" Execute="immediate" Return="ignore"></CustomAction>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="SystemFolder" />
<Directory Id="System32WindowsFolder"/>
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLFOLDER" Name="xAddin"/>
</Directory>
<Directory Id="ProgramMenuFolder">
<Directory Id="xShorcutsDir" Name="xAddin"/>
</Directory>
<Directory Id="AppDataFolder">
<Directory Id="Microsoft" Name="Microsoft">
<Directory Id="AddIns" Name="AddIns"/>
</Directory>
</Directory>
</Directory>
</Fragment>
<Fragment>
<ComponentGroup Id="SystemComponentsWinX64" Directory="SystemFolder">
<Component Id="SystemDLL" Guid="{5CC58B1B-CF05-412B-A9DC-89C4D9DDA8E3}" >
<File Id="FILE_xXIDLL" Source="dll/system/xXlFunctions.dll" KeyPath="yes"/>
<Condition>officeVersion = 32 AND %PROCESSOR_ARCHITECTURE="AMD64"</Condition>
</Component>
</ComponentGroup>
</Fragment>
<Fragment>
<ComponentGroup Id="SystemComponentsWinX86" Directory="SystemFolder">
<Component Id="SystemDLLx86" Guid="{8F3B689F-EC06-43C9-AF87-47DB8534EC9D}" >
<File Id="FILE_xXIDLLx86" Source="dll/system/xXlFunctions.dll" KeyPath="yes"/>
<Condition>officeVersion = 32 AND %PROCESSOR_ARCHITECTURE="x86"</Condition>
</Component>
</ComponentGroup>
</Fragment>
<Fragment>
<ComponentGroup Id="SystemComponentsWinX64Office64" Directory="System32WindowsFolder">
<Component Id="SystemDLLx64" Guid="{569E68EB-9C6D-4B72-A811-429A6901B05A}" >
<File Id="FILE_xXIDLLx64" Source="dll/system/x64/xXlFunctions.dll" KeyPath="yes"/>
<Condition>officeVersion = 64 AND %PROCESSOR_ARCHITECTURE="AMD64"</Condition>
</Component>
</ComponentGroup>
</Fragment>
<Fragment>
<ComponentGroup Id="xComponents" Directory="AddIns">
<Component Id="xXLA" Guid="{BBDA689A-B48D-4B61-8A9F-50CB0B4BC9AA}" >
<File Id="FILE_xXLA" Source="xla/x.xla"/>
<RegistryValue Id="RegKeyxAddin" Root="HKCU"
Key="Software\Microsoft\Office\Excel\AddIns\aqillaaddin"
Name="xAddin"
Value="x Excel Add-In"
Type="string" KeyPath="yes" />
<RemoveFolder Id="RemoveAddInsFolder" On="uninstall" Directory="AddIns"/>
</Component>
</ComponentGroup>
</Fragment>
<Fragment>
<ComponentGroup Id="ShotcutComponents" Directory="xShorcutsDir">
<Component Id="UninstallShorcut" Guid="{BEECAC18-779F-4F6A-8D0B-2545626FD80A}">
<Shortcut Id="UninstallShorcut"
Name="Uninstall x Addin"
Description="Uninstall x Addin and all of its components"
Target="[System64Folder]msiexec.exe"
Arguments="/x [ProductCode]" />
<RemoveFolder Id="RemoveMyApplication" On="uninstall"/>
<RegistryValue Root="HKCU"
Key="Software\Microsoft\xAddin"
Name="installed"
Type="integer"
Value="1"
KeyPath="yes"/>
</Component>
</ComponentGroup>
</Fragment>
</Wix>
ChecKVersion.wxs
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<UI>
<Dialog Id="CheckVersion" Width="370" Height="270" Title="[ProductName]" NoMinimize="yes" >
<!-- Virtual Dir prompt -->
<Control Id="Office32" Type="RadioButtonGroup" Property="officeVersion" Height="100" Width="200" X="50" Y="50">
<RadioButtonGroup Property="officeVersion">
<RadioButton Value="32" Text="Microsot Office Version 32bit" Height="17" Width="200" X="0" Y="0"/>
<RadioButton Value="64" Text="Microsot Office Version 64bit" Height="17" Width="200" X="0" Y="20"/>
</RadioButtonGroup>
</Control>
<!-- Back button -->
<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="Install" Type="PushButton" X="236" Y="243"
Width="56" Height="17" Default="yes" Text="&Install" ElevationShield="yes">
<Publish Event="EndDialog" Value="Return" Order="1">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 select Microsoft Office Version</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}Microsoft Office select version</Text>
</Control>
<Control Id="BannerLine" Type="Line" X="0" Y="44" Width="370" Height="0" />
</Dialog>
</UI>
</Fragment>
</Wix>
And another problem when the system is 64 bit I can not copy the file to C:\Windows\System32. The system automatically overrides the folder in C: \ WINDOWS \ SysWOW64 \
Transformed into public property and it was considered
Use attribute “Secure” to denote that the Property can be passed to the server side when doing a managed installation with elevated privileges.
<Property Id="OFFICEVERSION" Secure="yes" Value="32"/>

Web application install with initial IIS settings; using WiX, need upgrade files, NOT changing IIS settings

I have a WiX install project that includes IIS setings for virtual directory and application settings with an application pool. After initial install, the customer will change the application pool identity from default network service set in wxs.
How can I build an update installer that can update web files, but not change the IIS settings, application pool identity back to network service?
ComponentGroupRef Id="WebPublishCmp" is the initial heat output of the web files to publish.
I have tried to build a minor upgrade using Torch and Pyro, but I am having issues with Torch diff not detecting changes (this is another issue for another Stack Overflow question).
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
xmlns:iis="http://schemas.microsoft.com/wix/IIsExtension">
<?include Config.wxi ?>
<Product
Id="E3105F82-0460-4C3C-8F6C-778405E81F61"
Name="Website"
Language="1033"
Version="1.0.0.1"
Manufacturer="Website"
UpgradeCode="E3105F82-0460-4C3C-8F6C-778405E81F61">
<Package
InstallerVersion="200" Compressed="yes" />
<Media
Id="1"
Cabinet="media1.cab"
EmbedCab="yes" />
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLLOCATION" />
<UIRef Id="CustomWixUI_InstallDir"/>
<FeatureRef Id="InitialFeature"/>
</Product>
<Fragment>
<Feature Id="InitialFeature" Title="Initial (Full)" Level="1">
<ComponentGroupRef Id="WebPublishCmp"/>
<ComponentRef Id="IIS.Component"/>
</Feature>
<Feature Id="WebFilesFeature" Title="Website (Files)" Level="1">
<ComponentGroupRef Id="WebPublishCmp"/>
</Feature>
</Fragment>
<Fragment>
<Component Id="IIS.Component" Guid="6FAD9EC7-D2B0-4471-A657-C8AF5F6F707F" KeyPath="yes" Directory="INSTALLLOCATION">
<iis:WebSite Id="DefaultWebSite" Description="$(var.WebSiteName)" Directory="INSTALLLOCATION" >
<iis:WebAddress Id="AllUnassigned" Port="80"/>
</iis:WebSite>
<iis:WebAppPool Id="WebsiteAppPool" Name="App" Identity="networkService" />
<iis:WebVirtualDir Id="My.VirtualDir" Alias="App" Directory="INSTALLLOCATION" WebSite="DefaultWebSite">
<iis:WebApplication Id="Application" Name="App" WebAppPool="WebsiteAppPool"/>
</iis:WebVirtualDir>
</Component>
</Fragment>
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLLOCATION" Name="Website">
</Directory>
</Directory>
</Directory>
</Fragment>
</Wix>
I am using:
WiX 3.5, 3.6
Visual Studio 2010
I apologize ahead of time for the long answer:
I recommend keeping your Website and Content in two separate features and then giving them the option of supplying any variables needed for installation via UI or command line parameters. If you use the "Remember Property" pattern, then you can recall the variables used when changing or upgrading an installation (read all the way through the last comments, there is a slightly simpler way of doing it).
This allows the person installing the product to set up everything with the given variables or set up the IIS website on their own and install only website content.
This also jives well with MajorUpgrades. I don't currently see upgrade information in code you provided, so you should look into MajorUpgrades vs patches (major upgrades are much easier)
<MajorUpgrade AllowDowngrades="no" AllowSameVersionUpgrades="yes" Schedule="afterInstallInitialize" DowngradeErrorMessage="A later version of of this product is already installed. Setup will now exit."/>
Remember, variables accessed by $(var.name) are used at MSI compile time, whereas public variables accessed via brackets [MY_VARIABLE] are used at install time. Public variables can be exposed through the MSI UI, or provided to msiexec via command line (I use this for silent installs and/or specifying a log file)
Here is a summary of the examples included below:
Configuration.wxi - This file implements the "remembered" properties
Product.wxs - Mostly like yours, but also includes MajorUpgrades, separate features for the website and content, and an inclusion of the UiFlow
IISConfiguration.wxs - A fragment containing the IIS Website, AppPool, and AppPool User using variables supplied at install time
UIFlow.wxs - Defining the flow of the UI to use, it's using the WixUI FeatureTree plugin, you may require something else for your UI
UIDialogs.wxs - This is where the variables used in installation are exposed to the UI
Configuration.wxi:
<?xml version="1.0" encoding="utf-8" ?>
<Include xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:iis="http://schemas.microsoft.com/wix/IIsExtension"
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension" xmlns:netfx="http://schemas.microsoft.com/wix/NetFxExtension">
<!-- The RegistrySearch elements will populate these properties with values from the registry IF they exist there, otherwise the default values will be used -->
<Property Id="REG_WEBSITE_NAME" Value="WebsiteName" >
<RegistrySearch Id="WEB_WEBSITE_NAME_Remembered" Root="HKLM" Key="SOFTWARE\PRODUCT_NAME" Name="Website_Name" Type="raw" />
</Property>
<Property Id="REG_WEB_APP_POOL_NAME" Value="PoolName" >
<RegistrySearch Id="WEB_APP_POOL_NAME_Remembered" Root="HKLM" Key="SOFTWARE\PRODUCT_NAME" Name="WebApp_PoolName" Type="raw" />
</Property>
<Property Id="REG_WEB_APP_POOL_IDENTITY_DOMAIN">
<RegistrySearch Id="WEB_APP_POOL_IDENTITY_DOMAIN_Remembered" Root="HKLM" Key="SOFTWARE\PRODUCT_NAME" Name="WebApp_PoolIdentityDomain" Type="raw" />
</Property>
<Property Id="REG_WEB_APP_POOL_IDENTITY_USERNAME" Value="NetworkService" >
<RegistrySearch Id="WEB_APP_POOL_IDENTITY_USERNAME_Remembered" Root="HKLM" Key="SOFTWARE\PRODUCT_NAME" Name="WebApp_PoolIdentityUsername" Type="raw" />
</Property>
<!-- Notice that the password is NOT stored in the registry and is hidden so it's not shown in logs -->
<Property Id="WEB_APP_POOL_IDENTITY_PWD" Hidden="yes" />
<!-- This is the compnent that actually writes the values to the registry on install -->
<Component Id="C_RegistryEntries" Directory="INSTALLLOCATION">
<RegistryValue Root="HKLM" Key="SOFTWARE\ProviderWebsites" Name="Website_Name" Type="string" Value="[WEBSITE_NAME]"/>
<RegistryValue Root="HKLM" Key="SOFTWARE\ProviderWebsites" Name="WebApp_PoolName" Type="string" Value="[WEB_APP_POOL_NAME]"/>
<RegistryValue Root="HKLM" Key="SOFTWARE\ProviderWebsites" Name="WebApp_PoolIdentityDomain" Type="string" Value="[WEB_APP_POOL_IDENTITY_DOMAIN]"/>
<RegistryValue Root="HKLM" Key="SOFTWARE\ProviderWebsites" Name="WebApp_PoolIdentityUsername" Type="string" Value="[WEB_APP_POOL_IDENTITY_USERNAME]"/>
</Component>
<!-- These CustomActions set the property that are used for the install from the registry values (These actions are only run under the conditions in the sequences below) -->
<CustomAction Id='SetWebAppName' Property='WEBSITE_NAME' Value='[REG_WEBSITE_NAME]'/>
<CustomAction Id='SetWebAppPoolName' Property='WEB_APP_POOL_NAME' Value='[REG_WEB_APP_POOL_NAME]'/>
<CustomAction Id='SetWebAppPoolIdentityDomain' Property='WEB_APP_POOL_IDENTITY_DOMAIN' Value='[REG_WEB_APP_POOL_IDENTITY_DOMAIN]'/>
<CustomAction Id='SetWebAppPoolIdentityUsername' Property='WEB_APP_POOL_IDENTITY_USERNAME' Value='[REG_WEB_APP_POOL_IDENTITY_USERNAME]'/>
<!-- The CustomActions above that set the variables used in the installation are only run if they were not supplied by the command line -->
<InstallUISequence>
<Custom Action='SetWebAppName' After='AppSearch'>REG_WEBSITE_NAME AND (NOT WEBSITE_NAME)</Custom>
<Custom Action='SetWebAppPoolName' After='AppSearch'>REG_WEB_APP_POOL_NAME AND (NOT WEB_APP_POOL_NAME)</Custom>
<Custom Action='SetWebAppPoolIdentityDomain' After='AppSearch'>REG_WEB_APP_POOL_IDENTITY_DOMAIN AND (NOT WEB_APP_POOL_IDENTITY_DOMAIN)</Custom>
<Custom Action='SetWebAppPoolIdentityUsername' After='AppSearch'>REG_WEB_APP_POOL_IDENTITY_USERNAME AND (NOT WEB_APP_POOL_IDENTITY_USERNAME)</Custom>
</InstallUISequence>
<InstallExecuteSequence>
<!-- After='RemoveExistingProducts' is used under this sequence because of the use of MajorUpgrades -->
<Custom Action='SetWebAppName' After='RemoveExistingProducts'>REG_WEBSITE_NAME AND (NOT WEBSITE_NAME)</Custom>
<Custom Action='SetWebAppPoolName' After='RemoveExistingProducts'>REG_WEB_APP_POOL_NAME AND (NOT WEB_APP_POOL_NAME)</Custom>
<Custom Action='SetWebAppPoolIdentityDomain' After='RemoveExistingProducts'>REG_WEB_APP_POOL_IDENTITY_DOMAIN AND (NOT WEB_APP_POOL_IDENTITY_DOMAIN)</Custom>
<Custom Action='SetWebAppPoolIdentityUsername' After='RemoveExistingProducts'>REG_WEB_APP_POOL_IDENTITY_USERNAME AND (NOT WEB_APP_POOL_IDENTITY_USERNAME)</Custom>
</InstallExecuteSequence>
</Include>
Product.wxs:
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:iis="http://schemas.microsoft.com/wix/IIsExtension"
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension" xmlns:netfx="http://schemas.microsoft.com/wix/NetFxExtension">
<!--NEVER EVER EVER EVER CHANGE THE UPGRADE CODE!!!!!!!!!!!!!!! -->
<?define UpgradeCode="PUT-GUID-HERE" ?>
<Product Id="*" Name="ProductName" Language="1033" Version="X.X.X.X" Manufacturer="XYZ" UpgradeCode="$(var.UpgradeCode)">
<Package InstallerVersion="200" Compressed="yes" />
<!-- This includes our properties that implement the "Remember Property" pattern -->
<?include Configuration.wxi ?>
<Media Id="1" Cabinet="media.cab" EmbedCab="yes" />
<MajorUpgrade AllowDowngrades="no" AllowSameVersionUpgrades="yes" Schedule="afterInstallInitialize"
DowngradeErrorMessage="A later version of this product is already installed. Setup will now exit."/>
<!-- Creating default directory structure (INSTALLLOCATION be override by user, but it starts in Program Files) -->
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id='ProgramFilesFolder' Name='PFiles'>
<Directory Id="INSTALLLOCATION" Name="TheDefaultInstallFolderName">
</Directory>
</Directory>
</Directory>
<Feature Id="F_Content" Title="Content" Level="1" Description="The website content" ConfigurableDirectory="INSTALLLOCATION">
<ComponentRef Id="C_RegistryEntries"/>
<!-- The C_WebAppContent can either be generated by the WiX tool "heat", or a hand-crafted set of content, this component is not included in this example -->
<ComponentGroupRef Id="C_WebAppContent" />
</Feature>
<Feature Id="F_IISWebsite" Title="IIS Website" Description="The IIS website and application pool" Level="1">
<ComponentRef Id="C_IISWebsite" />
</Feature>
<InstallExecuteSequence>
</InstallExecuteSequence>
<!-- Specify UI -->
<UIRef Id="UIFlow" />
</Product>
</Wix>
IISConfiguration.wxs:
<?xml version="1.0" encoding="utf-8" ?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:iis="http://schemas.microsoft.com/wix/IIsExtension"
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
<Fragment>
<DirectoryRef Id="INSTALLLOCATION">
<Component Id="C_IISWebsite" Guid="{PUT-GUID-HERE}" KeyPath="yes">
<!-- This does not create a user, it's just an object that's referenced by the WebAppPool component -->
<util:User Id="WebAppPoolUser" CreateUser="no" Name="[WEB_APP_POOL_IDENTITY_USERNAME]"
Password="[WEB_APP_POOL_IDENTITY_PWD]" Domain="[WEB_APP_POOL_IDENTITY_DOMAIN]"/>
<!-- The "Identity" attritbute below needs to be set to "other" to use the util:User defined above -->
<iis:WebAppPool Id="WebAppPool" Name="[WEB_APP_POOL_NAME]" Identity="other" User="WebAppPoolUser"/>
<iis:WebSite Id="DefaultWebSite" Description="[WEBSITE_NAME]" Directory="INSTALLLOCATION" >
<iis:WebAddress Id="AllUnassigned" Port="80"/>
</iis:WebSite>
<iis:WebVirtualDir Id="My.VirtualDir" Alias="App" Directory="INSTALLLOCATION" WebSite="DefaultWebSite">
<iis:WebApplication Id="Application" Name="App" WebAppPool="WebAppPool"/>
</iis:WebVirtualDir>
</Component>
</DirectoryRef>
</Fragment>
</Wix>
UIFlow.wxs:
<?xml version="1.0" encoding="utf-8" ?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<UI Id="UIFlow">
<!-- This uses the WixUI plugin -->
<UIRef Id="WixUI_FeatureTree" />
<UIRef Id="WixUI_ErrorProgressText" />
<!-- Injection of custom UI. -->
<DialogRef Id="IisSetupDlg" />
<Publish Dialog="LicenseAgreementDlg" Control="Next" Event="NewDialog" Value="IisSetupDlg" Order="3">LicenseAccepted = "1"</Publish>
<Publish Dialog="CustomizeDlg" Control="Back" Event="NewDialog" Value="PoolSettingsDlg">1</Publish>
</UI>
</Fragment>
</Wix>
UIDialogs.wxs:
<?xml version="1.0" encoding="utf-8" ?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<UI>
<Dialog Id="IisSetupDlg" Width="370" Height="270" Title="IIS Settings - [ProductName]" NoMinimize="yes">
<!-- Web App details prompt -->
<Control Id="WebsiteNameLabel" Type="Text" X="45" Y="53" Width="100" Height="15" TabSkip="no" Text="&Website Name:" />
<Control Id="WebsiteNameEdit" Type="Edit" X="45" Y="65" Width="220" Height="18" Property="WEBSITE_NAME" Text="{80}" />
<!-- Back button -->
<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="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes" Text="&Next">
<Publish Event="NewDialog" Value="PoolSettingsDlg">
<!--if settings are correct, allow next dialog-->
<![CDATA[WEBSITE_NAME <> ""]]>
</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 enter IIS Configuration</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}IIS Settings</Text>
</Control>
<Control Id="BannerLine" Type="Line" X="0" Y="44" Width="370" Height="0" />
</Dialog>
<Dialog Id="PoolSettingsDlg" Width="370" Height="300" Title="Application Pool Settings - [ProductName]" NoMinimize="yes">
<!-- name of the application pool -->
<Control Id="PoolNameLabel" Type="Text" X="45" Y="53" Width="100" Height="15" TabSkip="no" Text="&Pool name:" />
<Control Id="PoolNameEdit" Type="Edit" X="45" Y="65" Width="220" Height="18" Property="WEB_APP_POOL_NAME" Text="{80}" />
<!-- domain -->
<Control Id="DomainPoolLabel" Type="Text" X="45" Y="85" Width="100" Height="15" TabSkip="no" Text="&Domain for AppPool:" />
<Control Id="DomainPoolEdit" Type="Edit" X="45" Y="97" Width="220" Height="18" Property="WEB_APP_POOL_IDENTITY_DOMAIN" Text="{80}" />
<!-- Login -->
<Control Id="LoginPoolLabel" Type="Text" X="45" Y="117" Width="100" Height="15" TabSkip="no" Text="&Login for AppPool:" />
<Control Id="LoginPoolEdit" Type="Edit" X="45" Y="129" Width="220" Height="18" Property="WEB_APP_POOL_IDENTITY_USERNAME" Text="{80}" />
<!-- Password -->
<Control Id="PasswordPoolLabel" Type="Text" X="45" Y="149" Width="100" Height="15" TabSkip="no" Text="&Password for AppPool:" />
<Control Id="PasswordPoolEdit" Type="Edit" X="45" Y="161" Width="220" Height="18" Property="WEB_APP_POOL_IDENTITY_PWD" Text="{80}" Password="yes" />
<!-- Back button -->
<Control Id="Back" Type="PushButton" X="180" Y="264" Width="56" Height="17" Text="&Back">
<Publish Event="NewDialog" Value="IisSetupDlg">1</Publish>
</Control>
<Control Id="Next" Type="PushButton" X="236" Y="264" Width="56" Height="17" Default="yes" Text="&Next">
<Publish Event="NewDialog" Value="CustomizeDlg">
<!--if settings are correct, allow next dialog-->
<![CDATA[WEB_APP_POOL_NAME <> ""
or WEB_APP_POOL_IDENTITY_DOMAIN <> ""
or WEB_APP_POOL_IDENTITY_USERNAME <> ""
or WEB_APP_POOL_IDENTITY_PWD <> ""]]>
</Publish>
</Control>
<Control Id="Cancel" Type="PushButton" X="304" Y="264" 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 enter AppPool Configuration for IIS</Text>
</Control>
<Control Id="BottomLine" Type="Line" X="0" Y="255" 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}Application Pool Settings</Text>
</Control>
<Control Id="BannerLine" Type="Line" X="0" Y="44" Width="370" Height="0" />
</Dialog>
</UI>
</Fragment>
</Wix>