Wix uninstall not removing files, always assumes program files\myApp folder - wix

I'm having a problem with the Wix installer and don't know what specifically I'm missing.
I have enabled the dialog to allow user pick their own installation folder over the default of
If I run the install and just leave the default of "Program Files\MyApp", the app installs no problem. If I then uninstall, all the files and folders properly get deleted.
If I run the install and change the default to something like c:\TestFolder\MyApp, it installs no problem to that location and includes the subfolder for the Java64bit and Java64bit/lib folders with respective content.
Then, if I immediately do an uninstall, it properly removes the Java stuff completely, but leaves all the files within the c:\TestFolder\MyApp root.
Looking into the registry after install, it DOES show the proper install directory location. What else can I provide to help resolve this.
Here is the full (with GUIDs removed) install of different files
File for the main (sample) product
<?xml version="1.0" encoding="utf-32BE"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product
Name="AMyApp"
Manufacturer="Testing"
Language="1033"
Version="1.0.1.0"
Id="*"
UpgradeCode="{GUID1}" >
<?include AMyApp_Define_Paths.wxi ?>
<Package
Id="*"
InstallerVersion="200"
Platform="x64"
Compressed="yes"
Languages="1033"
SummaryCodepage="1252"
Comments="AMyApp Package Comments area"
Description ="AMyApp"
InstallScope="perMachine" />
<MajorUpgrade
AllowDowngrades="no"
AllowSameVersionUpgrades="yes"
DowngradeErrorMessage="A newer version of AMyApp is already installed." />
<Property Id="PREVIOUSVERSIONSINSTALLED" Secure="yes" />
<Upgrade Id="{GUID1}">
<UpgradeVersion
Minimum="4.0.0.0" Maximum="99.0.0.0"
Property="PREVIOUSVERSIONSINSTALLED"
IncludeMinimum="yes" IncludeMaximum="no" />
</Upgrade>
<Media Id="1"
Cabinet="AMyApp.cab"
EmbedCab="yes" />
<WixVariable Id="ALLUSERS" Value="2" />
<WixVariable Id="MSIINSTALLPERUSER" Value="" />
<!-- see if location from a previously installed instance. -->
<Property Id="INSTALLDIR" >
<RegistrySearch Id="AMYAPP" Type="raw"
Root="HKLM" Key="SOFTWARE\AMYAPP" Name="InstallDir" />
</Property>
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLDIR" />
<!-- Search registry for previous installed location -->
<Property Id="PREVIOUSINSTALLFOLDER">
<RegistrySearch Id="GetPreviousInstallFolder" Root="HKLM"
Key="SOFTWARE\AMYAPP" Name="INSTALLDIR" Type="raw" />
</Property>
<CustomAction Id="SetINSTALLDIR" Property="INSTALLDIR"
Value="[PREVIOUSINSTALLFOLDER]" Execute="firstSequence" />
<CustomAction Id="SetWIXUI_INSTALLDIR" Property="WIXUI_INSTALLDIR"
Value="[PREVIOUSINSTALLFOLDER]" Execute="firstSequence" />
<InstallExecuteSequence>
<Custom Action="SetINSTALLDIR"
After="AppSearch">PREVIOUSINSTALLFOLDER</Custom>
<Custom Action="SetWIXUI_INSTALLDIR"
After="AppSearch">PREVIOUSINSTALLFOLDER</Custom>
</InstallExecuteSequence>
<InstallUISequence>
<Custom Action="SetINSTALLDIR"
After="AppSearch">PREVIOUSINSTALLFOLDER</Custom>
<Custom Action="SetWIXUI_INSTALLDIR"
After="AppSearch">PREVIOUSINSTALLFOLDER</Custom>
</InstallUISequence>
<Directory Id="TARGETDIR" Name="SourceDir" >
<!-- The directories "DesktopFolder", "FontsFolder", "ProgramFilesFolder"
are all pre-defined common names via the installer and reference the
actual windows locations respectively -->
<Directory Id="DesktopFolder" />
<Directory Id="FontsFolder" />
<Directory Id="ProgramFiles64Folder" >
<!-- The "ID" is the name internally that refers to the folder when
trying to install files, etc... the "Name" is what the actual name
will be at actual install time as viewed by Windows Explorer -->
<Directory Id="INSTALLDIR" Name="AMYAPP" >
<Component Id="C_HKLM_AMyAppUsage" Guid="{GUID2}">
<RegistryKey Root="HKLM" Key="SOFTWARE\AMyApp" >
<RegistryValue Name="IsSomeKey" Type="string" Value="YES" KeyPath="yes" />
</RegistryKey>
</Component>
<Directory Id="Java64BitDIR" Name="Java64Bit" >
<Directory Id="Java64BitLibDIR" Name="Lib" />
</Directory>
</Directory>
</Directory>
</Directory>
<Feature Id="AMyApp_Features"
Title="AMyApp (Wix Testing)"
Level="1"
ConfigurableDirectory="INSTALLDIR" >
<ComponentRef Id="C_HKLM_AMyAppUsage" />
<ComponentRef Id="AMyApp_CORE" />
<ComponentRef Id="AMyApp_Shortcuts" />
<ComponentRef Id="JAVA64BIT_Support" />
<ComponentRef Id="JAVA64BITLIB_Support" />
</Feature>
<UI>
<UIRef Id="WixUI_InstallDir" />
<!-- Skip license dialog -->
<Publish Dialog="WelcomeDlg"
Control="Next"
Event="NewDialog"
Value="InstallDirDlg"
Order="2">1</Publish>
<Publish Dialog="InstallDirDlg"
Control="Back"
Event="NewDialog"
Value="WelcomeDlg"
Order="2">1</Publish>
<Publish Dialog="InstallDirDlg"
Control="Next"
Event="NewDialog"
Value="VerifyReadyDlg"
Order="2">1</Publish>
<Publish Dialog="VerifyReadyDlg"
Control="Back"
Event="NewDialog"
Value="WelcomeDlg"
Order="2">1</Publish>
</UI>
<Property Id="LAUNCHAPPONEXIT" Value="1" />
</Product>
</Wix>
Fragment file for the Java Subfolders sample
<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<?include AMyApp_Define_Paths.wxi ?>
<DirectoryRef Id="Java64BitDIR">
<Component Id="JAVA64BIT_Support" Guid="{GUID1a}">
<File Id="_64_javax.comm.properties" Source="$(var.Path_Java64Bit)\javax.comm.properties" />
</Component>
</DirectoryRef>
<DirectoryRef Id="Java64BitLibDIR">
<Component Id="JAVA64BITLIB_Support" Guid="{GUID2a}">
<File Id="_64_HardwireDriver.jar" Source="$(var.Path_Java64BitLib)\HardwireDriver.jar" />
</Component>
</DirectoryRef>
</Fragment>
</Wix>
Fragment file for the common stuff installed at root folder
<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" >
<Fragment>
<DirectoryRef Id="INSTALLDIR">
<Component Id="AMyApp_CORE" Guid="{GUID1c}" Win64="yes">
<?include AMyApp_Define_Paths.wxi ?>
<RegistryKey
Root="HKLM"
Key="SOFTWARE\AMyApp"
ForceCreateOnInstall="yes"
ForceDeleteOnUninstall="yes" >
<RegistryValue Type="string" Name="InstallDir" Value="[INSTALLDIR]"/>
<RegistryValue Type="string" Name="MyAppContext" Value="Testing"/>
</RegistryKey>
<RemoveFile Id="RemoveAllMyAppFiles" Name="*.*" On="uninstall" />
<RemoveFolder Id="INSTALLDIR" On="uninstall" />
<File Id="MyApp.exe" Source="$(var.Path_MyAppReleaseFolder)\MyApp.exe" />
</Component>
</DirectoryRef>
</Fragment>
</Wix>

Here is a simplified work-around I came up with, but don't know why it does what it does under the hood, but works.
During the declaration of the <UI> segment, I just changed both "Welcome" and "MaintenanceWelcome" dialogs to both go to the "Install Directory" dialog. It apparently bypasses the route for "Repair" / "Uninstall" but WILL allow the installer to handle it's own delete of original and re-publish the new files from the installer.
<UI>
<UIRef Id="WixUI_InstallDir" />
<!--<Property Id="WixUI_Mode" Value="InstallDir" />-->
<!-- Skip license dialog -->
<Publish Dialog="WelcomeDlg"
Control="Next"
Event="NewDialog"
Value="InstallDirDlg"
Order="2">1</Publish>
<!-- Send the MAINTENANCE Dialog to the same Install Dir dialog -->
<Publish Dialog="MaintenanceWelcomeDlg"
Control="Next"
Event="NewDialog"
Value="InstallDirDlg"
Order="2">1</Publish>
...
</UI>

Related

ERROR: One or more files referenced by .inf file cannot be found in the package (wix)

I have created a wix installation project for an inf driver that outputs an msi. I have included the cat, sys and inf files as components shown below. When I run the msi it stops prematurely and the log file shows this error:
ERROR: One or more files referenced by .inf file cannot be found in the package.
I'm building it for 64 bit (for now) and have added the reference to difxapp_64. Can all inf files be packaged into an msi or is something else needed?
The main wxs:
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
xmlns:difx="http://schemas.microsoft.com/wix/DifxAppExtension"
xmlns:util='http://schemas.microsoft.com/wix/UtilExtension'>
<?if $(var.Platform)=x64 ?>
<?define ProductCode="{938775bb-4577-453d-8373-f03869bd2f37}" ?>
<?else?>
<?define ProductCode="{9e5fa76f-c865-4956-8651-f864dd5536f3}" ?>
<?endif?>
<?define ProductUpgradeCode = "5677d653-cc0d-4473-8ad4-89c8910524a5"?>
<Product
Id="$(var.ProductCode)"
Name="!(loc.ProductName_$(var.Platform))"
Manufacturer="!(loc.CompanyName)"
Version="0.0.1.0"
Language="1033"
UpgradeCode="$(var.ProductUpgradeCode)"
>
<Package
Manufacturer="!(loc.CompanyName)"
Description="!(loc.ProductName_$(var.Platform)) Installer"
Compressed="yes"
InstallerVersion="200"
Platform="$(var.Platform)"
InstallPrivileges='elevated'
InstallScope='perMachine'/>
<?include Settings.wxi ?>
<Property Id="DiskPrompt" Value="!(loc.ProductName_$(var.Platform)) Installation" />
<Property Id="ARPCONTACT" Value="!(loc.CompanyName)" />
<Property Id="ARPURLINFOABOUT" Value="https://www.sitename.com" />
<Property Id="ARPCOMMENTS">
!(loc.CompanyName) - !(loc.ProductName_$(var.Platform))
</Property>
<MajorUpgrade DowngradeErrorMessage="!(loc.DowngradeErrorMessage)"/>
<Media Id='1' Cabinet='Drivers.cab' EmbedCab='yes' DiskPrompt='DirFilter Media' />
<Feature Id='ProductFeature' Title='Drivers' Level='1'>
<ComponentGroupRef Id='ProductComponents' />
</Feature>
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLDIR" />
<UIRef Id="WixUI_InstallDir" />
<UI>
<Publish
Dialog="WelcomeDlg"
Control="Next"
Event="NewDialog"
Value="InstallDirDlg"
Order="5">1</Publish>
<Publish
Dialog="InstallDirDlg"
Control="Back"
Event="NewDialog"
Value="WelcomeDlg"
Order="5">1</Publish>
</UI>
</Product>
</Wix>
Directories wxs:
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<?if $(var.Platform)=x64 ?>
<Directory Id="ProgramFiles64Folder">
<Directory Id="Company" Name="!(loc.CompanyName)">
<Directory Id="INSTALLDIR" Name="!(loc.ProductShortName)" />
</Directory>
</Directory>
<?else?>
<Directory Id="ProgramFilesFolder">
<Directory Id="Company" Name="!(loc.CompanyName)">
<Directory Id="INSTALLDIR" Name="!(loc.ProductShortName)" />
</Directory>
</Directory>
<?endif?>
</Directory>
</Fragment>
Components wxs:
<Fragment>
<ComponentGroup Id="ProductComponents" Directory="INSTALLDIR">
<ComponentRef Id='sttube_Win10_64' />
</ComponentGroup>
<DirectoryRef Id='INSTALLDIR'>
<Component Id="sttube_Win10_64" Guid="cd92a990-1783-477f-87c9-9da93a5c14ac" Win64="yes"
DiskId="1" >
<File Id="sttube.cat_Win10_64" Source="Driver\Win10\" Name="sttube.cat" />
<File Id="STtube.inf_Win10_64" Source="Driver\Win10\" Name="STtube.inf" />
<File Id="STTub30.sys_Win10_64" Source="Driver\Win10\x64\" Name="STTub30.sys"
KeyPath="yes" />
<difx:Driver AddRemovePrograms="yes" PlugAndPlayPrompt="no" Sequence='1' />
</Component>
</DirectoryRef>
</Fragment>

How do I make a 64 bit MSI?

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

How to run multiple installed exe's using wix installer?

I'm trying to run multiple exe's after installation. This code creates single msi that deploy both exe's but run the first.
I haven't found a single example for it at the whole internet. This is my code (Don't mind the "put guid here"):
<?xml version="1.0" encoding="UTF-8"?>
<<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*"
UpgradeCode="PUT-GUID-HERE"
Version="1.0.0.0"
Language="1033"
Name="My Application Name"
Manufacturer="My Manufacturer Name">
<Package InstallerVersion="300" Compressed="yes"/>
<Media Id="1" Cabinet="myapplication.cab" EmbedCab="yes" />
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="APPLICATIONROOTDIRECTORY" Name="My Application Name"/>
</Directory>
</Directory>
<DirectoryRef Id="APPLICATIONROOTDIRECTORY">
<Component Id="Installs" Guid="PUT-GUID-HERE">
<File Id="myapplication.exe" Source="MySourceFiles\MyApplication.exe" KeyPath="yes" Checksum="yes"/>
<File Id="myapplication2.exe" Source="MySourceFiles\MyApplication.exe2" KeyPath="yes" Checksum="yes"/>
</Component>
</DirectoryRef>
<Feature Id="MainApplication" Title="Main Application" Level="1">
<ComponentRef Id="Installs" />
</Feature>
<UI>
<UIRef Id="WixUI_Minimal" />
<Publish Dialog="ExitDialog"
Control="Finish"
Event="DoAction"
Value="LaunchApplication">WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 and NOT Installed</Publish>
</UI>
<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" Value="Launch My Application Name" />
<Property Id="WixShellExecTarget" Value="[#myapplication.exe]" />
<CustomAction Id="LaunchApplication"
BinaryKey="WixCA"
DllEntry="WixShellExec"
Impersonate="yes" />
</Product>
</Wix>
But it only installs the first exe upon completing setup. Ideas?
Best Regards.
A component can't have multiple keypaths. Each EXE file should be the keypath of it's own component per Windows Installer component rules.
I don't see how anything would launch. [#myapplication.exe] is a formatted expression that's not valid until after ConstFinalize. You'd need a SetProperty custom action scheduled appropriately to work. You'd need more then one also to call LaunchApplication over and over for each EXE you want to launch. Or create a single custom EXE who's sole purpose is to launch the others.
You can just do it 2 times: First set the property "WixShellExecTarget" and then call "WixShellExec". I.e. try replacing with custom actions to set the property:
<UI>
<UIRef Id="WixUI_Minimal" />
<!-- set property and launch the first exe -->
<Publish Dialog="ExitDialog" Control="Finish" Event="DoAction" Value="PrepareLaunchApplication1">WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 and NOT Installed</Publish>
<Publish Dialog="ExitDialog" Control="Finish" Event="DoAction" Value="LaunchApplication1">WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 and NOT Installed</Publish>
<!-- set property and launch the second exe -->
<Publish Dialog="ExitDialog" Control="Finish" Event="DoAction" Value="PrepareLaunchApplication2">WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 and NOT Installed</Publish>
<Publish Dialog="ExitDialog" Control="Finish" Event="DoAction" Value="LaunchApplication2">WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 and NOT Installed</Publish>
</UI>
<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" Value="Launch My Application Name" />
<CustomAction Id="PrepareLaunchApplication1" Property="WixShellExecTarget" Value="[#myapplication.exe]" />
<CustomAction Id="LaunchApplication1"
BinaryKey="WixCA"
DllEntry="WixShellExec"
Impersonate="yes" />
<CustomAction Id="PrepareLaunchApplication2" Property="WixShellExecTarget" Value="[#myapplication2.exe]" />
<CustomAction Id="LaunchApplication2"
BinaryKey="WixCA"
DllEntry="WixShellExec"
Impersonate="yes" />
If you want for programs to be run sequentially and wait for the second one to exit and check it's exit code, you can use "ExeCommand" instead of "WixShellExec". If you don't care about exit code, you'll need to configure ExeCommand correspondingly (check the docs).
<UI>
<UIRef Id="WixUI_Minimal" />
<Publish Dialog="ExitDialog" Control="Finish" Event="DoAction" Value="LaunchApplication1">WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 and NOT Installed</Publish>
<Publish Dialog="ExitDialog" Control="Finish" Event="DoAction" Value="LaunchApplication2">WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 and NOT Installed</Publish>
</UI>
<CustomAction Id="LaunchApplication1" FileKey="myapplication1.exe" ExeCommand="" Impersonate="yes" />
<CustomAction Id="LaunchApplication2" FileKey="myapplication2.exe" ExeCommand="" Impersonate="yes" />

Wix Run App After Install Not Working

What is wrong in my code. I can't run app after I check"EXITDIALOGOPTIONALCHECKBOX" on "ExitDialog".
<UI>
<UIRef Id='WixUI_Minimal'/>
<Publish Dialog="ExitDialog" Control="Finish" Order="1" Event="DoAction" Value="LaunchInstalledExe">LAUNCH_APP_ON_EXIT</Publish>
</UI>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="APPLICATIONROOTDIRECTORY">
<Directory Id="ProgramMenuFolder">
<Directory Id="ApplicationProgramsFolder" />
</Directory>
<Directory Id="DesktopFolder" />
</Directory>
</Directory>
<DirectoryRef Id="APPLICATIONROOTDIRECTORY">
<Component Id="Test.exe" Guid="EF2B3E63-B797-47E6-A1AD-8221F13B6959">
<File Id="Test.exe" Source="ApplicationFiles\Test.exe" KeyPath="yes" Checksum="yes"/>
</Component>
</DirectoryRef>
<Feature Id="MainApplication" Title="Main Application" Level="1">
<ComponentRef Id="Test.exe" />
<ComponentRef Id="ApplicationShortcut" />
<ComponentRef Id="ApplicationDesktopShortcut" />
</Feature>
<InstallExecuteSequence>
<Custom Action='ChangeDir' After='CostFinalize' >NOT Installed</Custom>
</InstallExecuteSequence>
<Fragment>
<CustomAction Id="ChangeDir" Directory="APPLICATIONROOTDIRECTORY" Value="C:\\SampleFolder\" />
<CustomAction Id="LaunchApplication" FileKey="Test.exe" ExeCommand="" Execute="immediate" Impersonate="yes" Return="asyncNoWait" />
<CustomAction Id="LaunchInstalledExe"
FileKey="Test.exe"
ExeCommand=""
Execute="immediate"
Impersonate="yes"
Return="asyncNoWait" >
</CustomAction>
</Fragment>
<Fragment>
<DirectoryRef Id="ApplicationProgramsFolder">
<Component Id="ApplicationShortcut" Guid="FBE47082-5FC5-4861-B113-96BA9D30821F">
<Shortcut Id="ApplicationStartMenuShortcut"
Name="Test"
Description="opis"
Icon="logo.ico"
Target="[APPLICATIONROOTDIRECTORY]\Test.exe"
WorkingDirectory="APPLICATIONROOTDIRECTORY"/>
<RemoveFolder Id="ApplicationProgramsFolder" On="uninstall"/>
<RegistryValue Root="HKCU" Key="Software\Test" Name="Test" Type="integer" Value="1" KeyPath="yes"/>
<!-- Uninstall Shortcut-->
<Shortcut Id="UninstallProduct"
Name="Uninstall Test"
Target="[SystemFolder]msiexec.exe"
Arguments="/x [ProductCode]"
Description="Uninstall Test" />
</Component>
</DirectoryRef>
<!-- desktop shortcut-->
<DirectoryRef Id="DesktopFolder">
<Component Id="ApplicationDesktopShortcut" Guid="5c9b9050-3846-49c3-8484-910f49d4eddf">
<Shortcut Id="desktopSC" Target="[APPLICATIONROOTDIRECTORY]\Test.exe"
Directory="DesktopFolder" Name="Test" IconIndex="0" WorkingDirectory="APPLICATIONFOLDER" Icon="logo.ico" Advertise="no" />
<RemoveFolder Id="ApplicationDesktopFolder" Directory="DesktopFolder" On="uninstall"/>
<RegistryValue Root="HKCU" Key="SOFTWARE\Test" Name="Test" Value="1" Type="integer" KeyPath="yes" />
</Component>
</DirectoryRef>
</Fragment>
When I rem line with 'Custom Action='ChangeDir'' app will lunch. I really need this Custom Action becouse in other custom action I run (below code) to change 'APPLICATIONROOTDIRECTORY'
<CustomAction Id="LicenseInfoCustomAction" BinaryKey="CustomActionBinary" DllEntry="ShowLicenseInfo" Execute="immediate" Return="check" HideTarget="yes" />
<Binary Id="CustomActionBinary" SourceFile="$(var.MyCustomAction.TargetDir)$(var.MyCustomAction.TargetName).CA.dll"/>
.
Please help.
Update:
Finally I find solution in this documentation:
wix documentation
App starts even with administrator privileges.
From the Dizzy Monkey
Conditionally launching the application after installation
There are two ways to add a checkbox to the final page of an installation in order to conditionally launch an application. The first is supported in WiX 3 without needing any changes to the original dialogs, but it has a major limitation.
The final dialog box (ExitDialog) has an optional checkbox that can be displayed, and the property tied to this checkbox can be used to conditionally launch the application. The following entries in the setup file will add this checkbox
<CustomAction Id="StartAppOnExit" FileKey="YourAppExeId" ExeCommand="" Execute="immediate" Impersonate="yes" Return="asyncNoWait" />
<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" Value="Launch Sample App 1.0 when setup exits." />
<UI>
<Publish Dialog="ExitDialog" Control="Finish" Order="1" Event="DoAction" Value="StartAppOnExit">WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT</Publish>
</UI>
After looking at your code, you seem to have two custom actions that start your Application, you will only need one (LaunchApplication).
In this part
<UI>
<UIRef Id='WixUI_Minimal'/>
<Publish Dialog="ExitDialog" Control="Finish" Order="1" Event="DoAction" Value="LaunchInstalledExe">LAUNCH_APP_ON_EXIT</Publish>
</UI>
Change the Publish dialog for:
<Publish Dialog="ExitDialog" Control="Finish" Order="1" Event="DoAction" Value="LaunchApplication">WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT</Publish>

Uninstall of wix installer seems to do a repair instead of uninstalling

I have a project which uses wix to generate an install package. The install works fine, but when one tries to uninstall the project, everything looks nice - but after the unistall finishes the product ist still there (still functioning). The entry in add/remove programs disappears when uninstalled from there, but comes back after a refresh (F5). Testers have found that everything looks like the uninstall actually does a repair.
What are we doing wrong (the project otherwise only generates further component fragment files with "heat" (with HeatDirectory-Entries in the wixproj), and defines a few preprocessor variables)?
Here's the product.wxs. Sorry, I know thats a lot of code, but I do not know what I can safely omit to find the problem...:
<?xml version="1.0" encoding="UTF-8"?>
<?define ProductVersion=1.1.0.0?>
<?define UpgradeCode=$(var.UpdateCode)?>
<?define ProductName=$(var.PV) Name?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Name="$(var.ProductName)" Language="1033" Version="$(var.ProductVersion)" Manufacturer="xyz" UpgradeCode="$(var.UpgradeCode)">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" InstallPrivileges="elevated" />
<SetProperty Id="REINSTALL" Value="ALL" After="FindRelatedProducts" >Installed AND Remove<>"ALL"</SetProperty>
<SetProperty Id="REINSTALLMODE" Value="vamus" After="FindRelatedProducts">Installed AND Remove<>"ALL"</SetProperty>
<MajorUpgrade DowngradeErrorMessage="A newer version of $(var.ProductName) is already installed." />
<MediaTemplate EmbedCab="yes" />
<Feature Id="ProductFeature" Title="XY Installer" Level="1" ConfigurableDirectory="INSTALLLOCATION">
<ComponentGroupRef Id="ProductComponents" />
<ComponentGroupRef Id="DesktopShortcutComponentGroup"/>
<ComponentGroupRef Id="StartmenuShortcuts"/>
</Feature>
<CustomAction Id="RestoreDatabase" Directory="INSTALLLOCATION" ExeCommand="[INSTALLLOCATION]initial_db\BURestore.exe $(var.Sport)_$(var.Project) D:\$(var.Sport)\initial_db\db.bak" Execute="deferred" Return="ignore" HideTarget="no" Impersonate="no" />
<CustomAction Id="RenameFormatFilesFolder" Directory="LISTTOOLLOCATION" ExeCommand="cmd /c "mv FormatFiles fmt"" Return="ignore" Impersonate="yes"></CustomAction>
<InstallExecuteSequence>
<Custom Action="RestoreDatabase" Before="InstallFinalize">NOT REMOVE</Custom>
<Custom Action="RenameFormatFilesFolder" After="InstallFinalize">NOT REMOVE</Custom>
</InstallExecuteSequence>
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLLOCATION"/>
<UI>
<UIRef Id="WixUI_InstallDir"/>
<Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="InstallDirDlg" Order="2">1</Publish>
<Publish Dialog="InstallDirDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg" Order="2">1</Publish>
</UI>
</Product>
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ROOTDIR" Name="D"/>
<Directory Id="INSTALLLOCATION" Name="$(var.PV)">
<Directory Id="CONF" Name="conf">
<Directory Id="LISTTOOLLOCATION" Name="PRINT"></Directory>
</Directory>
</Directory>
<Directory Id="DesktopFolder" />
<Directory Id="ProgramMenuFolder">
<Directory Id="ProgramMenuSubfolder" Name="ST">
<Directory Id="ApplicationFolder" Name="$(var.ProductName)" />
</Directory>
</Directory>
</Directory>
</Fragment>
<Fragment>
<ComponentGroup Id="ProductComponents" Directory="INSTALLLOCATION">
<ComponentGroupRef Id="RootFiles" />
<ComponentGroupRef Id="ListToolFiles" />
<ComponentGroupRef Id="inis" />
</ComponentGroup>
<ComponentGroup Id="DesktopShortcutComponentGroup">
<Component Id="DesktopShortcutComponent" Guid="{C54B....}" Directory="DesktopFolder">
<Shortcut Id="ApplicationDesktopShortcut"
Name="$(var.ProductName)"
Description="$(var.ProductName) Application"
Target="[INSTALLLOCATION]RO.exe"
WorkingDirectory="INSTALLLOCATION"/>
<RemoveFolder Id="DesktopFolder" On="uninstall"/>
<RegistryValue Root="HKCU" Key="Software\ST\$(var.ProductName)" Name="installed" Type="integer" Value="1" KeyPath="yes"/>
</Component>
</ComponentGroup>
<ComponentGroup Id="StartmenuShortcuts" Directory="ApplicationFolder">
<Component Id="StartmenuShortcutComp" Guid="{ACD9...}">
<Shortcut Id="StartmenuShortcut" Name="$(var.ProductName)" Description="$(var.ProductName) Application" Target="[INSTALLLOCATION]RO.exe" WorkingDirectory="INSTALLLOCATION" />
<Shortcut Id="UninstallProduct" Name="Uninstall $(var.ProductName)" Target="[SystemFolder]msiexec.exe" Arguments="/x [ProductCode]" Description="Uninstalls $(var.ProductName)" />
<RemoveFolder Id="RemoveProgramMenuSubfolder" Directory="ProgramMenuSubfolder" On="uninstall"/>
<RemoveFolder Id="RemoveApplicationFolder" Directory="ApplicationFolder" On="uninstall"/>
<RegistryValue Root="HKCU" Key="Software\ST\$(var.ProductName)" Name="installed" Type="integer" Value="1" KeyPath="yes"/>
</Component>
</ComponentGroup>
</Fragment>
</Wix>
The below two lines are making this issue.
<SetProperty Id="REINSTALL" Value="ALL" After="FindRelatedProducts" >Installed AND Remove<>"ALL"</SetProperty>
<SetProperty Id="REINSTALLMODE" Value="vamus" After="FindRelatedProducts">Installed AND Remove<>"ALL"</SetProperty>
That condition become true because Remove will be set ALL in Uninstall after InstallValidate action in Install execute sequence. Please check below link for more details.
https://msdn.microsoft.com/en-us/library/aa368013(v=vs.85).aspx