How upgrade "secondary" executable using Wix? - wix

I have msi setup written in Wix 3. Nothing too fancy, couple executables + some registry manipulations.
We have 2 executables, the main application and watch dog application that is always running(it's started once user logs in).
I've released new version of our software, in wix we specify to upgrade without uninstalling first. When new version msi is ran, it upgrades main application but watchdog application is not upgraded(even if it's not running, so it's not "in-use" problem)
I pasted below my wxs file, hopefully you can help me spot the problem.
Thanks a lot in advance,
Jack
This is the wxs file:
<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<?include Properties.wxi?>
<Product Id="$(var.ProductCode)" Name="$(var.Title)" Language="1033" Version="$(var.ProductVersion)" Manufacturer="$(var.Manufacturer)" UpgradeCode="$(var.UpgradeCode)">
<Package Description="$(var.ProductName)" Comments="$(var.ProductName)" InstallerVersion="200" Compressed="yes" />
<Property Id="PREVIOUSVERSIONSINSTALLED" Secure="yes" />
<Upgrade Id="$(var.UpgradeCode)">
<UpgradeVersion OnlyDetect='yes' Property='NEWERFOUND' Minimum='$(var.ProductVersion)' IncludeMinimum='no' />
<UpgradeVersion OnlyDetect="no" Property="PREVIOUSFOUND" Minimum="0.0.0" IncludeMinimum="yes" Maximum="$(var.ProductVersion)" IncludeMaximum="no" />
</Upgrade>
<Media Id="1" Cabinet="product.cab" EmbedCab="yes" CompressionLevel="high"/>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder" Name="PFiles">
<Directory Id="ApplicationRootFolder" Name="$(var.ProductName)">
<Component Id="MyAppComponent" Guid="6657828D-0D3F-43A6-A2CB-375BFBB8A412">
<RemoveFolder Id="ApplicationRootFolder" On="uninstall" />
<File Id="MyAppMain" Name="MyApp.exe" Source="..\Release\MyApp.exe"/>
<File Id="FirstRunApp" Name="FirstRunApp.exe" Source="..\Release\FirstRunApp.exe"/>
<File Id="MyAppWatchDog" Name="MyAppWatchDog.exe" Source="..\Release\MyAppWatchDog.exe"/>
<!--File Id="CheckSniffer" Name="CheckSniffer.exe" Source="..\Release\CheckSniffer.exe"/-->
<File Id="License" Name="License.rtf" Source="License.rtf"/>
</Component>
</Directory>
</Directory>
<Directory Id="DesktopFolder" >
<Component Id="DesktopShortcuts" Guid="5567ED7E-03F8-4AB8-AFB5-F8074F4ED1B5">
<RegistryValue Id="RegShortcutDesktop" Root="HKCU" Key="Software\$(var.ProductName)" Name="DesktopSC" Value="1" Type="integer" KeyPath="yes" />
<Shortcut Id="DesktopShortcut" Name="$(var.ProductName)" Directory="DesktopFolder" Description="$(var.ProductName)" Target="[ApplicationRootFolder]$(var.Name).exe" Icon="Icon.exe" WorkingDirectory="ApplicationRootFolder" />
</Component>
</Directory>
<Directory Id="ProgramMenuFolder">
<Directory Id="ProjectMenuFolder" Name="$(var.ProductName)">
<Component Id="StartMenuShortcuts" Guid="5567ED7E-03F8-4AB8-AFB5-F8074F4ED1B4">
<RegistryValue Root="HKCU" Key="Software\$(var.ProductName)" Type="string" Value="[ApplicationRootFolder]" Name="InstallPath"/>
<RegistryValue Root="HKCU" Key="Software\Microsoft\Windows\CurrentVersion\Run" Type="string" Value="[#MyAppWatchDog]" Name="MyAppWatchdog"/>
<RegistryValue Root="HKCU" Key="Software\$(var.ProductName)" Type="string" Value="" />
<Shortcut Id="ProgramMenuShortcut" Name="$(var.ProductName)" Description="$(var.ProductName)" Target="[ApplicationRootFolder]$(var.Name).exe" Icon="Icon.exe" WorkingDirectory="ApplicationRootFolder" />
<Shortcut Id="UninstallProduct" Name="Uninstall" Description="Uninstalls the $(var.ProductName)" Target="[System64Folder]msiexec.exe" Arguments="/x {$(var.ProductCode)}" />
<RemoveFolder Id="ProgramMenuDir" On="uninstall" />
<RemoveRegistryKey Root="HKCU" Key="Software\$(var.ProductName)" Action="removeOnUninstall"/>
</Component>
</Directory>
</Directory>
</Directory>
<Feature Id="DefaultFeature" Title="$(var.Name)" Level="1">
<ComponentRef Id="MyAppComponent" />
<ComponentRef Id="StartMenuShortcuts" />
<ComponentRef Id="DesktopShortcuts" />
</Feature>
<Property Id="SEARCHWINPCAP">
<RegistrySearch Id="RegistrySearch" Root="HKLM" Key="SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\WinPcapInst" Name="VersionMajor" Type="raw"/>
</Property>
<Property Id="WIXUI_INSTALLDIR" Value="ApplicationRootFolder"/>
<Property Id="PRODUCTNAME" Value="$(var.ProductName)"/>
<!--Property Id="SNIFFER_CHECK_RESULT" Value="0"/-->
<WixVariable Id="WixUIBannerBmp" Value="logo.JPG" />
<WixVariable Id="WixUILicenseRtf" Value="License.rtf" />
<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" Value="Launch $(var.Title)" />
<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOX" Value="1" />
<Property Id="WixShellExecTarget" Value="[#MyAppMain]" />
<CustomAction Id="LaunchApplication" BinaryKey="WixCA" DllEntry="WixShellExec" Impersonate="yes" />
<CustomAction Id="SetLaunchWatchDogTarget" Property="WixShellExecTarget" Value="[#MyAppWatchDog]" />
<CustomAction Id="LaunchWatchDog" BinaryKey="WixCA" DllEntry="WixShellExec" Impersonate="yes" />
<Binary Id="BinBrowseForFile" SourceFile="tools\WinPcap_4_1_2.exe"/>
<CustomAction Id='LaunchWinPcapSetup' BinaryKey="BinBrowseForFile" ExeCommand="/Install" Execute="deferred" Impersonate="no" Return="check"/>
<CustomAction Id='NoDowngrade' Error='A later version of [ProductName] is already installed.'/>
<Property Id="CUSTOM_TITLE" Value="$(var.Title) Setup" />
<CustomAction Id='SetRepearTitle' Property='CUSTOM_TITLE' Value='Repair $(var.Title)'/>
<CustomAction Id='SetRemoveTitle' Property='CUSTOM_TITLE' Value='Remove $(var.Title)'/>
<!--debug-->
<Binary Id="BinCustomAction" SourceFile="bin\release\CustomActions.CA.dll"/>
<!--Binary Id="BinCheckSniffer" SourceFile="..\Release\CheckSniffer.exe"/-->
<Property Id="USER_GUID_PATH" Value="Software\Licenses"/>
<Property Id="USER_GUID" />
<Property Id="DUBUG_URL" Value="http://debug.myapp.com/service/"/>
<Property Id="DUBUG_STATE" Value="STARTED" />
<CustomAction Id='SendRequest' BinaryKey="BinCustomAction" DllEntry="SendRequest" Execute="immediate" Return="check" />
<CustomAction Id='SendRequest_WinPcap_Start' BinaryKey="BinCustomAction" DllEntry="SendRequest" Execute="immediate" Return="check" />
<CustomAction Id='SendRequest_WinPcap_Finish' BinaryKey="BinCustomAction" DllEntry="SendRequest" Execute="immediate" Return="check" />
<CustomAction Id='LicenseAgreement_Next' Property='DUBUG_STATE' Value='LICENSE_AGREED' />
<CustomAction Id='InstallDirDlg_Install' Property='DUBUG_STATE' Value='INSTALL' />
<CustomAction Id='Exit_Finish' Property='DUBUG_STATE' Value='FINISH' />
<CustomAction Id='WinPcap_Start' Property='DUBUG_STATE' Value='WINPCAP_STARTED' />
<CustomAction Id='WinPcap_Finish' Property='DUBUG_STATE' Value='WINPCAP_FINISHED' />
<CustomAction Id='Traffic_Failed' Property='DUBUG_STATE' Value='TRAFFIC_FAILED' />
<CustomAction Id='Traffic_Uninstalled' Property='DUBUG_STATE' Value='UNINSTALLED' />
<CustomAction Id='Shell_icacls' Directory='ApplicationRootFolder' ExeCommand='icacls FirstRunApp.exe /setintegritylevel Low' Return="ignore" Execute="commit" Impersonate="no"/>
<InstallExecuteSequence>
<Custom Action='NoDowngrade' After='FindRelatedProducts'>NEWERFOUND</Custom>
<Custom Action="WinPcap_Start" Before="SendRequest_WinPcap_Start" ><![CDATA[SEARCHWINPCAP < "4" AND NOT Installed]]></Custom>
<Custom Action="SendRequest_WinPcap_Start" Before="LaunchWinPcapSetup"><![CDATA[SEARCHWINPCAP < "4" AND NOT Installed]]></Custom>
<Custom Action="LaunchWinPcapSetup" Before="InstallFiles"><![CDATA[SEARCHWINPCAP < "4" AND NOT Installed]]></Custom>
<!-- disable currently Custom Action="CheckSniffer" Before="Shell_icacls">NOT Installed</Custom-->
<Custom Action="Shell_icacls" Before="InstallFinalize"><![CDATA[VersionNT >= 600 AND NOT Installed]]></Custom>
<!--Custom Action="Shell_RunWatchDog" After="InstallFinalize"><![CDATA[NOT Installed]]></Custom-->
<RemoveExistingProducts After="InstallFinalize"></RemoveExistingProducts>
<Custom Action="Traffic_Uninstalled" Before='SendRequest'>Installed AND NOT UPGRADINGPRODUCTCODE</Custom>
<Custom Action="SendRequest" After='InstallFinalize'>Installed AND NOT UPGRADINGPRODUCTCODE</Custom>
</InstallExecuteSequence>
<UI />
<UIRef Id="WixUI_Wizard" />
<PropertyRef Id="NETFRAMEWORK35" />
<Condition Message="This application requires .NET Framework 3.5 SP1.">Installed OR NETFRAMEWORK35</Condition>
<Icon Id="Icon.exe" SourceFile="..\MyApp\Resources\icon_main.ico" />
</Product>
</Wix>

The first thing that jumps at me from your Wix code is the fact that you are shipping all executables inside a single component but there is no KeyPath for the component. This is a very bad idea! It will definitely result in many servicing issues, such as the one you're experiencing with your watchdog.exe not updating.
Windows Installer considers a component the smallest installation unit. Furthermore, the Windows Installer will only look at the KeyPath to decide whether the component exists (or needs to be updated, etc.) Since the "MyAppComponent" has no keypath, the WI will default to using the Directory as your keypath. This means that during an upgrade, if WI finds your directory, it will assume the component is already installed and will not update any of the files in the component.
The rule of thumb to follow is that any .exe or .dll file must be the only file in the component, and it should also be the keypath for your component. I go as far as creating a component for each individual file in my setups, which will avoid many headaches in the future. Try replacing the MyAppComponent with these components instead:
<Directory Id="ApplicationRootFolder" Name="$(var.ProductName)">
<Component Id="MyApp.exe" Guid="INSERT_GUID_HERE">
<File Id="MyApp.exe" Name="MyApp.exe" Source="..\Release\MyApp.exe" KeyPath="yes"/>
</Component>
<Component Id="FirstRunApp.exe" Guid="INSERT_GUID_HERE">
<File Id="FirstRunApp.exe" Name="FirstRunApp.exe" Source="..\Release\FirstRunApp.exe" KeyPath="yes"/>
</Component>
<Component Id="MyAppWatchDog.exe" Guid="INSERT_GUID_HERE">
<File Id="MyAppWatchDog.exe" Name="MyAppWatchDog.exe" Source="..\Release\MyAppWatchDog.exe" KeyPath="yes"/>
</Component>
<Component Id="CheckSniffer.exe" Guid="INSERT_GUID_HERE">
<File Id="CheckSniffer.exe" Name="CheckSniffer.exe" Source="..\Release\CheckSniffer.exe" KeyPath="yes"/>
</Component>
<Component Id="License.rtf" Guid="INSERT_GUID_HERE">
<File Id="License.rtf" Name="License.rtf" Source="License.rtf" KeyPath="yes"/>
</Component>
</Directory>
This should resolve your updating issues. You may also want to conisder splitting your shortcut components into one shortcut per component, and setting an HKCU value as the keypath for each component.

Thanks to everyone trying to help.
#Cosmin Pirvu was the one with correct answer. We didn't update the version of watchdog application and thus it was not being installed.
Thank you

Related

Executing Custom Action after adding system variable in Wix

I am adding system variables and then i want to execute custom actions, that depends on those variables. The variables are being added correctly, but the scripts are exiting ( because at that time variables are not there yet ), depsite the fact I am using "After Install Files". Here is my code:
<?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="DataBaseds_Service_Installer" Language="1033" Version="1.0.0.0" Manufacturer="" UpgradeCode="3875ce89-3886-4cbf-b132-01f947ac7a08">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<MediaTemplate EmbedCab="yes" />
<CustomAction Id="NssmUnzip" Directory="INSTALLFOLDER" Execute="deferred" Impersonate="no" ExeCommand="cmd.exe /c "unzip.exe nssm-2.24.zip -d "%TANGO_ROOT%\bin" "" Return="ignore" />
<CustomAction Id="Tango_db" Directory="INSTALLFOLDER" Execute="deferred" Impersonate="no" ExeCommand="[INSTALLFOLDER]create-tangodb.bat" Return="ignore" />
<CustomAction Id ="Baseds_Service" Directory="INSTALLFOLDER" Execute="deferred" Impersonate="no" ExeCommand="[INSTALLFOLDER]Tango-DataBaseds.bat" Return="ignore" />
<CustomAction Id="UninstallService" Directory="INSTALLFOLDER" Execute="deferred" Impersonate="no" ExeCommand="[INSTALLFOLDER]Remove_Baseds_Service.bat" Return="ignore" />
<InstallExecuteSequence>
<Custom Action="NssmUnzip" After="InstallFiles">NOT Installed</Custom>
<Custom Action="Tango_db" After="NssmUnzip">NOT Installed</Custom>
<Custom Action="Baseds_Service" After="Tango_db">NOT Installed</Custom>
<Custom Action="UninstallService" After="InstallInitialize"> Installed and Not REINSTALL</Custom>
</InstallExecuteSequence>
<Property Id="DIRR">
<RegistrySearch Id="aaa" Root="HKCU"
Key="Software\corp\Tango"
Name="Directory"
Type="directory"/>
</Property>
<Feature Id="ProductFeature" Title="DataBaseds_Service_Installer" Level="1">
<ComponentRef Id="MYSQL_Path"/>
<ComponentRef Id="MYSQL_USER"/>
<ComponentRef Id="MYSQL_PASSWORD"/>
<ComponentGroupRef Id="Components" />
</Feature>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLFOLDER" Name="DataBaseds_Service_Installer" />
</Directory>
</Directory>
<ComponentGroup Id="Components" Directory="INSTALLFOLDER">
<Component Id="NSSM" Guid="54CEB76C-6974-4071-96E9-EF5AD1937BD4">
<File Source="nssm-2.24.zip" KeyPath="yes" />
<File Source="Tango-DataBaseds.bat" KeyPath="no"/>
<File Source="Remove_Baseds_Service.bat" KeyPath="no"/>
<File Source="create-tangodb.bat" KeyPath="no"/>
</Component>
<Component Id="unzip" Guid="E10EE17A-AA5A-416B-82DF-37532281116C">
<File Source="unzip.exe" KeyPath="yes"/>
</Component>
</ComponentGroup>
<DirectoryRef Id="TARGETDIR">
<Component Id="MYSQL_USER" Guid="D05C8155-8421-4AEB-9A19-5016DAFAED19">
<Environment Id="MYSQL_USER" Name="MYSQL_USER" Value="root" Permanent="no" Part="last" Action="set" System="yes" />
</Component>
<Component Id="MYSQL_PASSWORD" Guid="222C7887-1E4D-4DC2-B429-A3F18F707FA3">
<Environment Id="MYSQL_PASSWORD" Name="MYSQL_PASSWORD" Value="tango" Permanent="no" Part="last" Action="set" System="yes" />
</Component>
<Component Id="MYSQL_Path" Guid="34D14695-1803-4D7E-AD65-3C9011D019CE">
<Environment Id="PATH" Name="PATH" Value="[DIRR]bin" Permanent="no" Part="last" Action="set" System="yes" />
</Component>
</DirectoryRef>
</Product>
</Wix>
Am I doing something wrong?
Greetings
There are two general issues with environment variables in Windows Installer:
When they are set they don't just automatically show up for running programs because Windows Installer doesn't send the "environment variables have changed" broadcast message until the end of the install. If you run a program AFTER that it will pick up the new values.
There is no reason for any running processes to pick them up unless they have a message loop and are prepared to deal with the (I think) WM_WININICHANGE message and reload the environment.
So none of your custom actions are going to pick up the new variables because they haven't been broadcast to the system yet and "committed". And yes, it's better to find another way to pass the data to the programs.
Phil is not wrong.
But here is my solution, if anyone will ever have the same problem:
Even though as Phil says: "system variables are not set during an installation:
Windows Installer doesn't send the environment variables have changed broadcast message until the end of the install, they are stored inside variable ( "DIRR" in this example) when you are reading the registry:
<Property Id="DIRR">
<RegistrySearch Id="aaa" Root="HKCU"
Key="Software\corp\Tango"
Name="Directory"
Type="directory"/>
</Property>
So you can run a script and pass them as argument:
<CustomAction Id="Tango_db" Directory="INSTALLFOLDER" Execute="deferred" Impersonate="no" ExeCommand="[INSTALLFOLDER]create-tangodb.bat ****"[DIRR]bin"****" Return="ignore" />
These way your batch file has access to the system variables, despite the fact that ther are not yet set in the system.
Hope that this helps :)

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

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

Wix 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.

My Wix project is only showing up for me in Add/Remove but not other people?

We've been using Wix to create our website msi for awhile and it install fine.
Issue (Little annoyance) -
If I install my msi, it will show up in add/remove programs but if Person B goes on the server, my msi entry will not show up for them in Add/Remove programs.
I'm assuming it's a property to set in the wix product.wxs page but google hasn't been friendly to me in that regard.
I wasn't sure if it was a win2k3 issue only but we just did a test on a win2k8R2 and the same issue occured.
Here's my product.wxs file
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
xmlns:iis="http://schemas.microsoft.com/wix/IIsExtension">
<Product Id="*"
Name="!(loc.ProductName)"
Language="!(loc.LANG)"
Version="1.0.0.0"
Manufacturer="!(loc.CompanyName)"
UpgradeCode="1bf00ad4-a8a1-407b-8a07-0d3046cb7214">
<Package InstallerVersion="200" Compressed="yes" Manufacturer="!(loc.CompanyName)" Description="!(loc.Description)" />
<?include Settings.wxi ?>
<?include Conditions.wxi ?>
<?include WebSites.wxi ?>
<iis:WebAppPool Id="AppPool" Name="[APP_POOL_NAME]"/>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="IISMain" Name='WebSites'>
<Directory Id="WWWMain" Name='SigappsTest'
ComponentGuidGenerationSeed='5A8C3E4A-0AA2-488C-80EC-91921A1A36CC'>
<Directory Id='INSTALLLOCATION' Name='!(loc.VirtualDirectory)'>
<!-- The component to define the Virtual Directory.-->
<Component Id="WebVirtualDirComponent" Guid="8AD62CCC-3FD5-4121-8370-DFB466482E61">
<iis:WebVirtualDir Id="VDir" Alias="[VD]" Directory="INSTALLLOCATION" WebSite="SelectedWebSite">
<iis:WebApplication Id="MyWebAppApplication" WebAppPool="AppPool" Name="[VD]" />
</iis:WebVirtualDir>
<CreateFolder/>
<!-- Need to have to ensure created -->
</Component>
<Component Id="EnableASPNet4Extension" Permanent="yes" Guid="73FA6E54-2B0C-4AA7-A2A0-BDD432FECC62">
<CreateFolder/>
</Component>
<Component Id="PersistWebSiteValues" Guid="F249ADCB-B638-4E2B-9350-0421CEC5A803">
<RegistryKey Action="create" Root="HKLM" Key="SOFTWARE\!(loc.CompanyName)\!(loc.VirtualDirectory)\Install">
<RegistryValue Name="WebSiteDescription" Type="string" Value="[WEBSITE_DESCRIPTION]"/>
<RegistryValue Name="WebSiteID" Type="string" Value="[WEBSITE_ID]"/>
<RegistryValue Name="WebSitePath" Type="string" Value="[WEBSITE_PATH]"/>
<RegistryValue Name="WebSiteVD" Type="string" Value="[VD]"/>
<RegistryValue Name="WebSiteAppPoolName" Type="string" Value="[APP_POOL_NAME]"/>
</RegistryKey>
</Component>
</Directory>
</Directory>
</Directory>
</Directory>
<iis:WebSite Id='SelectedWebSite' Description='[WEBSITE_DESCRIPTION]' Directory='INSTALLLOCATION' SiteId='[WEBSITE_ID]'>
<!-- This element has to be here or WiX does not compile. -->
<iis:WebAddress Id="AllUnassigned" Port="80"/>
</iis:WebSite>
<!-- Define our custom actions -->
<Binary Id="IISCA" SourceFile="$(var.IISCA.TargetDir)$(var.IISCA.TargetName).CA.dll" />
<CustomAction Id="GetIISWebSites" BinaryKey="IISCA" DllEntry="GetWebSites" Execute="immediate" Return="check" />
<CustomAction Id="UpdatePropsWithSelectedWebSite" BinaryKey="IISCA" DllEntry="UpdatePropsWithSelectedWebSite" Execute="immediate" Return="check" />
<CustomAction Id="UpdateWebConfigFile" BinaryKey="IISCA" DllEntry="UpdateWebConfig" Execute="immediate" Return="check" />
<CustomAction Id="RegisterScriptMaps" BinaryKey="IISCA" DllEntry="RegisterScriptMaps" Execute="immediate" Return="check" />
<CustomAction Id="SetApplicationRootDirectory" Directory="INSTALLLOCATION" Value="[WEBSITE_PATH]\[VD]" />
<!-- Install UI Sequence - allows us to schedule custom action -->
<InstallUISequence>
<Custom Action="GetIISWebSites" After="CostFinalize" Overridable="yes">NOT Installed</Custom>
</InstallUISequence>
<InstallExecuteSequence>
<Custom Action="GetIISWebSites" After="CostFinalize" Overridable="yes">NOT Installed</Custom>
<Custom Action="UpdatePropsWithSelectedWebSite" After="GetIISWebSites">NOT Installed</Custom>
<Custom Action="SetApplicationRootDirectory" After="UpdatePropsWithSelectedWebSite">NOT Installed</Custom>
<Custom Action="UpdateWebConfigFile" After="InstallFinalize">NOT Installed</Custom>
<!--<Custom Action="UpdateWebAppMapping" After="InstallFinalize">NOT Installed</Custom>-->
<Custom Action="RegisterScriptMaps" After="InstallFinalize">NOT Installed</Custom>
</InstallExecuteSequence>
<Feature Id="ProductFeature" Title="!(loc.ProductName)" Level="1">
<ComponentRef Id='WebVirtualDirComponent' />
<ComponentRef Id='EnableASPNet4Extension'/>
<!--<ComponentGroupRef Id="WebSecurity.Web_Project" />-->
<ComponentGroupRef Id="Product.Generated" />
<ComponentRef Id="PersistWebSiteValues" />
</Feature>
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLLOCATION"/>
<UIRef Id="WixUI_WebUI" />
</Product>
</Wix>
Set the Package/#InstallScope attribute to perMachine. The default in Windows Installer is to create per-user packages.

Set WIXUI_INSTALLDIR to value from registry or default if that is blank?

I would like to be able to read a value from the registry and use it to set the WIXUI_INSTALLDIR before the dialog is displayed but if the value from the registry is blank I want to use a default folder.
I'm new to wix.
I've been reading tutorials, documentation, and questions/answers all day and my head is spinning. I think I'm close but I don't have all the pieces quite put together.
The code compiles and links fine but when I run the msi I get an error right before the browse for folder dialog is displayed the error is code 2819 "Control [3] on dialog [2] needs a property linked to it."
In summary what I want to do is:
Read previous install path from registry into a property named "PREVIOUSINSTALLFOLDER".
If "PREVIOUSINSTALLFOLDER" is blank, set WIXUI_INSTALLDIR to "INSTALLFOLDER" as defined in the Directory section.
If "PREVIOUSINSTALLFOLDER" is not blank set WIXUI_INSTALLDIR to "PREVIOUSINSTALLFOLDER".
What am I doing wrong?
Thanks,
Erik
Here's my current code:
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="EB907F6C-B193-4A40-BA3C-ADF8C069AF34" Name="LaserVault DMS" Language="1033" Version="10.0.0" Manufacturer="Electronic Storage Corp." UpgradeCode="43291cbc-3f74-44ba-ba14-31181bb654bf">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" Keywords="LaserVault DMS Server" Description="LaserVault DMS Server" />
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<MediaTemplate EmbedCab="yes" />
<UIRef Id="WixUI_InstallDir"/>
<Property Id="PREVIOUSINSTALLFOLDER">
<RegistrySearch Id="PreviousInstallDir" Root="HKLM" Key="Software\ESC" Name="LVDMSPath" Type="raw"></RegistrySearch>
</Property>
<CustomAction Id="SetToDefault" Property="WIXUI_INSTALLDIR" Value="[INSTALLFOLDER]" Execute="immediate" />
<CustomAction Id="SetToPrevious" Property="WIXUI_INSTALLDIR" Value="[PREVIOUSINSTALLFOLDER]" Execute="immediate" />
<InstallExecuteSequence>
<Custom Action="SetToDefault" After="AppSearch">PREVIOUSINSTALLDIR=""</Custom>
<Custom Action="SetToPrevious" After="AppSearch"><![CDATA[PREVIOUSINSTALLDIR <> ""]]></Custom>
</InstallExecuteSequence>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="LaserVault" Name="LaserVault">
<Directory Id="INSTALLFOLDER" Name="LVDMS" />
</Directory>
<Directory Id="ProgramMenuFolder" Name="Programs">
<Directory Id="ProgramMenuDir" Name="LaserVault DMS" />
</Directory>
<Directory Id="DesktopFolder" Name="Desktop" />
</Directory>
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
<Component Id="LVDMSServerConfig" Guid="D9428A16-ECB1-4373-B876-8CF05E7CE37F">
<File Id="LVDMSServerConfig" Source="C:\Projects\LVDMS10\LVDMSServerConfig\LVDMSServerConfig\bin\Debug\LVDMSServerConfig.exe" KeyPath="yes" />
</Component>
<Component Id="LVDMSCore10" Guid="2E956300-78FC-4AFA-8D5D-A2D07B6CB8AE">
<File Id="LVDMSCore10" Source="C:\Projects\LVDMS10\LVDMSServerConfig\LVDMSServerConfig\bin\Debug\LVDMSCore10.dll" KeyPath="yes" />
</Component>
<Component Id="LVDMSInstallationGuide" Guid="ECA2B30A-54CB-4DE4-A659-B429458BDF3A">
<File Id="LVDMSInstallationGuide" Source="\\192.168.0.211\development\HelpFiles\LaserVault_DMS_10\LaserVault_DMS_Installation_Guide\LaserVault_DMS_Installation_Guide.pdf" KeyPath="yes" />
</Component>
</ComponentGroup>
<ComponentGroup Id="Shortcuts" Directory="ProgramMenuDir">
<Component Id="LVDMSServerConfigShortCut">
<Shortcut Id="LVDMSServerConfigShortCut" Name="LVDMS Server Config" Description="LaserVault DMS Server Configuration" Target="[#LVDMSServerConfig]" WorkingDirectory="INSTALLFOLDER" />
<RemoveFolder Id="ProgramMenuDir" On="uninstall"/>
<RegistryValue Root="HKCU" Key="Software\LaserVault\LVDMS" Name="CurrentVersion" Type="string" Value="[ProductVersion]" KeyPath="yes" />
</Component>
</ComponentGroup>
<ComponentGroup Id="RegistryEntries">
<Component Id="RegistryLVDMSPath" Guid="9AE59D2B-EF16-4CAA-8A27-AA5BE00FAA07" Permanent="yes" Directory="TARGETDIR">
<RegistryKey Root="HKLM" Key="Software\ESC">
<RegistryValue Type="string" Name="LVDMSPath" Value="[INSTALLFOLDER]"/>
</RegistryKey>
</Component>
</ComponentGroup>
<Feature Id="Complete" Title="LaserVault DMS Server" Level="1">
<ComponentGroupRef Id="ProductComponents" />
<ComponentGroupRef Id="Shortcuts"/>
<ComponentGroupRef Id="RegistryEntries"/>
</Feature>
</Product>
For future reference it's enough to only have the following:
<!-- Determine the directory of a previous installation (if one exists) -->
<Property Id="INSTALLFOLDER">
<RegistrySearch Id="GetInstallDir" Type="raw" Root="HKLM" Key="Software\ESC" Name="LVDMSPath" />
</Property>
...
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLFOLDER" />
Neither of the custom actions are required.
I think you were on the right path. I solved it the following way (basically quite similar as you tried to, just the other way round, i.e. set the default value and overwrite it only if the value was found in the registry) using the following steps:
Set WIXUI_INSTALLDIR to the default value as defined by your directory structure:
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLDIR" />
Do a RegistrySearch for your previous installation folder:
<Property Id="PREVIOUSINSTALLFOLDER">
<RegistrySearch Id="GetPreviousInstallFolder" Root="HKLM" Key="SOFTWARE\ESC" Name="LVDMSPath" Type="raw" />
</Property>
Set INSTALLDIR only if a value was found:
<CustomAction Id="SetINSTALLDIR" Property="INSTALLDIR" Value="[PREVIOUSINSTALLFOLDER]" Execute="firstSequence" />
...
<InstallExecuteSequence>
<Custom Action="SetINSTALLDIR" After="AppSearch">PREVIOUSINSTALLFOLDER</Custom>
</InstallExecuteSequence>
<InstallUISequence>
<Custom Action="SetINSTALLDIR" After="AppSearch">PREVIOUSINSTALLFOLDER</Custom>
</InstallUISequence>