can't show dialog in WiX installer - wix

I'm modifying default FireBreath WiX script to show simple message after installation is complete. Because sometimes it is so quick, user doesn't get a chance to notice it.
I have this wxs file
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" ">
<Package ... />
<Upgrade Id="{369b048a-9f97-5e15-8ce3-c983fa5764d3}">
<UpgradeVersion
Property="OLD_VERSION_FOUND"
Minimum="0.0.1" IncludeMinimum="yes"
Maximum="0.3.3.3" IncludeMaximum="yes"
OnlyDetect="no" IgnoreRemoveFailure="yes"
MigrateFeatures="yes" />
</Upgrade>
<Property Id="MSIRESTARTMANAGERCONTROL" Value="Disable" />
<InstallExecuteSequence>
<RemoveExistingProducts After="InstallInitialize" />
<InstallExecute After="RemoveExistingProducts" />
</InstallExecuteSequence>
<Directory Id="TARGETDIR" Name="SourceDir">
...
</Directory>
<Feature Id="MainPluginFeature" Title="Plugin" Level="1">
<ComponentRef Id="InstallDirComp"/>
<ComponentRef Id="PluginNameDirComp"/>
<ComponentRef Id="CompanyDirComp"/>
<ComponentGroupRef Id="PluginDLLGroup"/>
</Feature>
<UI>
<Property Id="DefaultUIFont">DlgFont10</Property>
<TextStyle Id="DlgFont10" FaceName="Tahoma" Size="10" />
<Dialog Id="CompleteDlg"
Width="370"
Height="270"
Title="Plugin installed">
<Control Id="Description"
Type="Text"
X="50"
Y="70"
Width="220"
Height="80"
Text="Installation complete, return to web browser." />
<Control Id="Finish"
Type="PushButton"
X="180"
Y="243"
Width="56"
Height="17"
Default="yes"
Cancel="yes"
Text="OK">
<Publish Event="EndDialog" Value="Exit" />
</Control>
</Dialog>
<InstallUISequence>
<Show Dialog="CompleteDlg" OnExit="success" />
</InstallUISequence>
<AdminUISequence>
<Show Dialog="CompleteDlg" OnExit="success" />
</AdminUISequence>
</UI>
</Product>
</Wix>
but when I build it, I get these error messages
Error 2 error LGHT0204 : ICE20: Standard Dialog: 'FilesInUse' not found in Dialog table
Error 3 error LGHT0204 : ICE20: ErrorDialog Property not specified in Property table. Required property for determining the name of your ErrorDialog
Error 4 error LGHT0204 : ICE20: FatalError dialog/action not found in 'InstallUISequence' Sequence Table.
Error 5 error LGHT0204 : ICE20: FatalError dialog/action not found in 'AdminUISequence' Sequence Table.
Error 6 error LGHT0204 : ICE20: UserExit dialog/action not found in 'InstallUISequence' Sequence Table.
Error 7 error LGHT0204 : ICE20: UserExit dialog/action not found in 'AdminUISequence' Sequence Table.
I don't need any other dialogs, only this one. How to fix this? Can I just ignore these messages?

If a package has any dialogs, Windows Installer requires that it have a minimum set to show UI, mostly under error conditions. The ICE20 documentation has the full list.

Related

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>

WIX Template Edit Control

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.

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.

WiX Error LGHT0130 In InstallScopeDlg when modifying Wix_Advanced UI

I am using WiX 3.6.
I am using the WIX_Advanced user interface and I want to replace the InstallScopeDlg with my own version (called InstallScopeDlgDsktp) which includes a checkbox for adding a Desktop shortcut.
When I do this, I take all the references to the old InstallScopeDlg in the WixUI_Advanced.wxs file, and override them in my main file to instead reference my custom InstallScopeDlgDsktp module.
However, when I try compiling, I get an error which seems to indicate there is a clash with a RadioButton table which means both my InstallScopeDlgDsktp and the original InstallScopeDlg must be adding a RadioButton based on the same property (WixAppFolder).
light Cryptobot.wixobj InstallScopeDlgDsktp.wixobj -ext WixUIExtension -out Cryptobot.msi
Microsoft (R) Windows Installer Xml Linker version 3.6.2221.0
<snip>wixlib\InstallScopeDlg.wxs(24): error LGHT0130 :
The primary key 'WixAppFolder/1' is duplicated in table 'RadioButton'. Please remove one of the entries or rename a part of the primary key to avoid the collision.
I can't seem to get around this. My question is, why is it even linking in the original InstallScopeDlg module when I am not even referencing it any more? How do I stop the original InstallScopeDlg from adding the RadioButton?
Code provided for reference:
Main WXS file (UI stuff is at the bottom - can see I replaced all instances of InstallScopeDlg with InstallScopeDlgDsktp):
<?xml version="1.0" encoding="windows-1252"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<!-- Defines -->
<?define ProductName="Cryptobot" ?>
<?define ProductVersion="1.1.1" ?>
<Product Name="$(var.ProductName) $(var.ProductVersion)" Id="*"
UpgradeCode="MY-UPGRADE-GUID"
Language="1033" Codepage="1252" Version="$(var.ProductVersion)" Manufacturer="Crafted From Code">
<!-- The Package GUID must be changed EVERY timeyou build a new .msi. The asterisk makes this happen automatically. -->
<Package Id="*" Keywords="Installer"
Description="$(var.ProductName) $(var.ProductVersion) Setup"
Manufacturer="Crafted From Code"
InstallerVersion="200" Languages="1033" Compressed="yes" />
<Media Id="1" Cabinet="$(var.ProductName).cab" EmbedCab="yes" />
<!-- Components to install -->
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="CraftedFromCode" Name="Crafted From Code">
<Directory Id="APPLICATIONFOLDER" Name="$(var.ProductName)">
<Component Id="MainExecutable" Guid="MY-GUID">
<File Id="CryptobotEXE" Name="Cryptobot.exe" Source="..\Cryptobot\bin\Release\Cryptobot.exe" KeyPath="yes">
<Shortcut Id="CryptobotProgramMenuShortcut" Directory="ProgramMenuDir"
Name="$(var.ProductName)" Icon="Cryptobot.ico" IconIndex="0" Advertise="yes" />
<Shortcut Id="CryptobotDesktopShortcut" Directory="DesktopFolder"
Name="$(var.ProductName)" Icon="Cryptobot.ico" IconIndex="0" Advertise="yes" />
</File>
<RemoveFolder Id="APPLICATIONFOLDER" On="uninstall" />
</Component>
</Directory>
</Directory>
</Directory>
<!-- Start Menu Shortcut(s) -->
<Directory Id="ProgramMenuFolder" Name="Programs">
<Directory Id="ProgramMenuDir" Name="$(var.ProductName)">
<Component Id="ProgramMenuShortcut" Guid="MY-GUID" >
<RegistryValue Root="HKCU" Key="Software\Crafted From Code\Cryptobot" Name="installed" Type="integer" Value="1" KeyPath="yes" />
<RemoveFolder Id="ProgramMenuDir" On="uninstall" />
</Component>
</Directory>
</Directory>
<!-- Desktop Shortcut -->
<Directory Id="DesktopFolder">
<Component Id="DesktopShortcut" Guid="MY-GUID">
<Condition>INSTALLDESKTOPSHORTCUT</Condition>
<RegistryValue Root="HKCU" Key="Software\Crafted From Code\Cryptobot" Name="installed" Type="integer" Value="1" KeyPath="yes" />
</Component>
</Directory>
</Directory> <!-- End of TARGETDIR root directory -->
<Icon Id="Cryptobot.ico" SourceFile="Cryptobot.ico" />
<Feature Id="Complete" Level="1" Title="$(var.ProductName)"
Description="The complete package." Display="expand"
ConfigurableDirectory="APPLICATIONFOLDER">
<ComponentRef Id="MainExecutable" />
<ComponentRef Id="ProgramMenuShortcut" />
<ComponentRef Id="DesktopShortcut" />
</Feature>
<!-- Upgrade rules: If a newer version is found, don't allow installation of an older version (downgrading).
Otherwise, if an older version is already installed, remove it before installing the current version -->
<Upgrade Id="MY-UPGRADE-GUID">
<UpgradeVersion OnlyDetect="yes" Property="NEWERPRODUCTFOUND" Minimum="$(var.ProductVersion)" IncludeMinimum="no" />
<!-- Setting IncludeMaximum to yes generates a linker warning, but it means that we can install over the
same version without necessarily having to change the version number. -->
<UpgradeVersion OnlyDetect="no" Property="PREVIOUSVERSIONINSTALLED" Minimum="1.0.0" IncludeMinimum="yes" Maximum="$(var.ProductVersion)" IncludeMaximum="yes" />
</Upgrade>
<CustomAction Id='PreventDowngrading' Error='A newer version of $(var.ProductName) is already installed.' />
<InstallExecuteSequence>
<Custom Action='PreventDowngrading' After='FindRelatedProducts'>NEWERPRODUCTFOUND</Custom>
<RemoveExistingProducts After="InstallFinalize" />
</InstallExecuteSequence>
<InstallUISequence>
<Custom Action='PreventDowngrading' After='FindRelatedProducts'>NEWERPRODUCTFOUND</Custom>
</InstallUISequence>
<!-- User Interface: Use the Advanced WiX interface, which will allow 1-click installation or
per user/per machine installation & install directory to be specified -->
<UIRef Id="WixUI_Advanced" />
<UIRef Id="WixUI_ErrorProgressText" />
<Property Id="ApplicationFolderName" Value="Crafted From Code\Cryptobot" />
<Property Id="WixAppFolder" Value="WixPerUserFolder" /> <!-- Defaults to install for all users -->
<Property Id="INSTALLDESKTOPSHORTCUT" Value="1" /> <!-- Support for a desktop shortcut -->
<!-- Add a checkbox to launch the application when the installer exits -->
<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" Value="Launch $(var.ProductName) when setup exits." />
<!-- Have it ticked by default -->
<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOX" Value="1" />
<CustomAction Id="StartAppOnExit" FileKey="CryptobotEXE" ExeCommand="" Execute="immediate" Impersonate="yes" Return="asyncNoWait" />
<UI Id="WixUI_AdvancedCrypto">
<UIRef Id="WixUI_Advanced" />
<DialogRef Id="InstallScopeDlgDsktp" />
<Publish Dialog="AdvancedWelcomeEulaDlg" Control="Advanced" Event="NewDialog" Value="InstallScopeDlgDsktp" Order="1">!(wix.WixUISupportPerMachine) AND !(wix.WixUISupportPerUser)</Publish>
<Publish Dialog="InstallScopeDlgDsktp" Control="Back" Event="NewDialog" Value="AdvancedWelcomeEulaDlg">1</Publish>
<!-- override default WixAppFolder of WixPerMachineFolder as standard user won't be shown the radio group to set WixAppFolder -->
<Publish Dialog="InstallScopeDlgDsktp" Control="Next" Property="WixAppFolder" Value="WixPerUserFolder" Order="1">!(wix.WixUISupportPerUser) AND NOT Privileged</Publish>
<Publish Dialog="InstallScopeDlgDsktp" Control="Next" Property="ALLUSERS" Value="{}" Order="2">WixAppFolder = "WixPerUserFolder"</Publish>
<Publish Dialog="InstallScopeDlgDsktp" Control="Next" Property="ALLUSERS" Value="1" Order="3">WixAppFolder = "WixPerMachineFolder"</Publish>
<Publish Dialog="InstallScopeDlgDsktp" Control="Next" Property="APPLICATIONFOLDER" Value="[WixPerUserFolder]" Order="4">WixAppFolder = "WixPerUserFolder"</Publish>
<Publish Dialog="InstallScopeDlgDsktp" Control="Next" Property="APPLICATIONFOLDER" Value="[WixPerMachineFolder]" Order="5">WixAppFolder = "WixPerMachineFolder"</Publish>
<Publish Dialog="InstallScopeDlgDsktp" Control="Next" Event="NewDialog" Value="FeaturesDlg" Order="6">WixAppFolder = "WixPerUserFolder"</Publish>
<Publish Dialog="InstallScopeDlgDsktp" Control="Next" Event="NewDialog" Value="InstallDirDlg" Order="7">WixAppFolder = "WixPerMachineFolder"</Publish>
<Publish Dialog="FeaturesDlg" Control="Back" Event="NewDialog" Value="InstallScopeDlgDsktp">NOT Installed AND WixAppFolder = "WixPerUserFolder"</Publish>
<Publish Dialog="InstallDirDlg" Control="Back" Event="NewDialog" Value="InstallScopeDlgDsktp">!(wix.WixUISupportPerUser)</Publish>
<!-- Add the check box for launching the app on completion -->
<Publish Dialog="ExitDialog" Control="Finish" Order="1" Event="DoAction" Value="StartAppOnExit">WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 AND NOT Installed</Publish>
</UI>
</Product>
</Wix>
And the InstallScopeDlgDsktp file is just a copy of InstallScopeDlg with a checkbox added and the name changed:
<snip>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<UI>
<Dialog Id="InstallScopeDlgDsktp" Width="370" Height="270" Title="!(loc.InstallScopeDlg_Title)" KeepModeless="yes">
<Control Id="BannerBitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="44" TabSkip="no" Text="!(loc.InstallScopeDlgBannerBitmap)" />
<Control Id="BannerLine" Type="Line" X="0" Y="44" Width="370" Height="0" />
<Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="0" />
<Control Id="Description" Type="Text" X="25" Y="23" Width="280" Height="20" Transparent="yes" NoPrefix="yes" Text="!(loc.InstallScopeDlgDescription)" />
<Control Id="Title" Type="Text" X="15" Y="6" Width="200" Height="15" Transparent="yes" NoPrefix="yes" Text="!(loc.InstallScopeDlgTitle)" />
<Control Id="BothScopes" Type="RadioButtonGroup" X="20" Y="55" Width="330" Height="120" Property="WixAppFolder" Hidden="yes">
<RadioButtonGroup Property="WixAppFolder">
<RadioButton Value="WixPerUserFolder" X="0" Y="0" Width="295" Height="16" Text="!(loc.InstallScopeDlgPerUser)" />
<RadioButton Value="WixPerMachineFolder" X="0" Y="60" Width="295" Height="16" Text="!(loc.InstallScopeDlgPerMachine)" />
</RadioButtonGroup>
<Condition Action="show">Privileged AND (!(wix.WixUISupportPerUser) AND !(wix.WixUISupportPerMachine))</Condition>
</Control>
<Control Id="PerUserDescription" Type="Text" X="33" Y="70" Width="300" Height="36" Hidden="yes" NoPrefix="yes" Text="!(loc.InstallScopeDlgPerUserDescription)">
<Condition Action="show">!(wix.WixUISupportPerUser)</Condition>
</Control>
<Control Id="NoPerUserDescription" Type="Text" X="33" Y="70" Width="300" Height="36" Hidden="yes" NoPrefix="yes" Text="!(loc.InstallScopeDlgNoPerUserDescription)">
<Condition Action="show">NOT !(wix.WixUISupportPerUser)</Condition>
</Control>
<Control Id="PerMachineDescription" Type="Text" X="33" Y="131" Width="300" Height="36" Hidden="yes" NoPrefix="yes" Text="!(loc.InstallScopeDlgPerMachineDescription)">
<Condition Action="show">Privileged</Condition>
</Control>
<Control Id="DesktopShortcutCheckBox" Type="CheckBox" X="20" Y="160" Width="290" Height="17" Property="INSTALLDESKTOPSHORTCUT" CheckBoxValue="1" Text="Create a shortcut on the desktop." />
<Control Id="Back" Type="PushButton" X="180" Y="243" Width="56" Height="17" Text="!(loc.WixUIBack)" />
<Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes" Text="!(loc.WixUINext)" />
<Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Cancel="yes" Text="!(loc.WixUICancel)">
<Publish Event="SpawnDialog" Value="CancelDlg">1</Publish>
</Control>
</Dialog>
</UI>
</Fragment>
</Wix>
You are still referencing the original WixUI_Advanced UI.
<UI Id="WixUI_AdvancedCrypto">
<UIRef Id="WixUI_Advanced" />
<DialogRef Id="InstallScopeDlgDsktp" />
This pulls in the InstallScopeDlg and will be causing your conflict. Take a copy of the WixUI_Advanced wxs from the wix sources and include in your project renaming it so that it doesn't conflict and then modify it to use your new InstallScopeDlgDsktop.

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>