Create shortcuts depending on ALLUSERS value - wix

My installer works fine for installing to Program Files or AppData depending on the ALLUSERS value (which is set by the user). However, I can't get the icons to distribute to all users when ALLUSERS is set to 1 - currently they only show for the current user.
<Fragment>
<DirectoryRef Id="INSTALLDIR">
<Component Id="File1.exe" Guid="*">
<File Id="File1.exe" Name="File1.exe" DiskId="1" KeyPath="yes"
Source="Content\File1.exe" />
</Component>
</DirectoryRef>
<DirectoryRef Id="TARGETDIR">
<Component Id="shortcutFile1" Guid="*">
<Shortcut Id="shortcutFile1" Name="File1"
Target="[INSTALLDIR]File1.exe"
Directory="StartMenuAppFolder" Show="normal" />
<RemoveFolder Id="removeStartMenuAppFolder"
Directory="StartMenuAppFolder"
On="uninstall" />
<RegistryValue Root="HKCU" Key="Software\MyApp\shortcutID_0001"
KeyPath="yes" Type="string" Value="" />
</Component>
</DirectoryRef>
</Fragment>
Any help would be appreciated.

Related

Wix recreate deleted shortcut when reinstalling

I'm learning about shortcuts in Wix and have managed to create shortcuts on the desktop.
If I delete the shortcut and then run the installer again I would like the shortcut to be created again.
How can this behavior be achieved with Wix?
I have created shortcuts both with
<File Id="TestX.exe" Name="TestX.exe" Source="$(var.TestX_TargetDir)TestX.exe">
<Shortcut Id="desktopIcon" Directory="DesktopFolder" Name="TestX" WorkingDirectory='INSTALLFOLDER' Icon="IconTestX.exe" IconIndex="0" Advertise="yes" />
</File>
and
<Fragment>
<DirectoryRef Id="DesktopFolder">
<Component Id="DesktopShortcut"
Guid="1E0D1741-57F0-4E22-89FC-4A189E2BB7E0">
<Shortcut Id="desktopSC"
Name="MyProduct"
Description="MyProduct description"
Target="[INSTALLFOLDER]TestX.exe"
Icon="IconTestX.exe">
</Shortcut>
<RemoveFolder Id="RemoveDesktopFolder"
Directory="DesktopFolder"
On="uninstall" />
<RegistryValue Root="HKCU"
Key="Software\[Manufacturer]\[ProductName]"
Name="installed"
Type="integer"
Value="1"
KeyPath="yes" />
</Component>
</DirectoryRef>
</Fragment>
I solved this problem by using WixUI_InstallDir in the WixUI library, which added a GUI which includes the option to start a repair.
Links about the WixUI dialog library:
http://wixtoolset.org/documentation/manual/v3/wixui/wixui_dialog_library.html
http://wixtoolset.org/documentation/manual/v3/wixui/dialog_reference/wixui_installdir.html

WIX Parent folder not getting removed during uninstallation though no files are left

I have this MSI which is included in my burn bootstrap EXE. When I uninstall this MSI, and when there are no other MSIs left installed, uninstalling this MSI wouldn't remove the parent installation folder (testInstallDir). Below is my wix file.
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Name="MosquittoInstaller" Language="1033" Version="3.0.7.0" Manufacturer="Zone24x7" UpgradeCode="b2cb73e9-bce8-463f-986d-b3f8f13283dd">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" Platform="x64"/>
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." Schedule="afterInstallInitialize"/>
<MediaTemplate EmbedCab="yes"/>
<Feature Id="ProductFeature" Title="MosquittoInstaller" Level="1">
<ComponentGroupRef Id="MosquittoFilesGroup"/>
</Feature>
</Product>
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="INSTALLLOCATION">
<Directory Id="testInstallDir" Name="test2.0">
<Directory Id="MyProgramDir" Name="Mosquitto" />
</Directory>
</Directory>
</Directory>
<CustomAction Id='RunMosquitto' FileKey="fil7D28AEF774656849395A2FA20A5C963D" Execute="deferred" ExeCommand='-v' Return="asyncNoWait" HideTarget="no" Impersonate="no"/>
</Fragment>
<Fragment>
<DirectoryRef Id="MyProgramDir">
<Directory Id="dirC8FCCB6AC509A125EE3B37CC7E907774" Name="devel" />
</DirectoryRef>
</Fragment>
<Fragment>
<ComponentGroup Id="MosquittoFilesGroup">
<Component Id="cmp4D47D22EE0C10F2FE658B4D343E1153F" Directory="MyProgramDir" Guid="5458BA33-9B08-46E1-8EE7-DE516F2FEF64">
<File Id="filFC4C205CAB822D245B62422765716A32" KeyPath="yes" Source="../../../Setups/mosquitto/mosquitto/aclfile.example" />
</Component>
<Component Id="cmp3245A363F29E5F92EEFB67D8F4A466FD" Directory="MyProgramDir" Guid="1ED7F2BD-692C-4C96-8CF5-C2064B64BF8D">
<File Id="filB660EA30BBEBA21E457F2F3CA4811CC9" KeyPath="yes" Source="../../../Setups/mosquitto/mosquitto/ChangeLog.txt" />
</Component>
<Component Id="cmpA2A091D2A61C720ED9AE76DAF2674BE6" Directory="MyProgramDir" Guid="5F780D6F-F8BB-4BF6-84F6-EF8613404775">
<File Id="fil83340F4F2CEADCD75C02CB23AEE43E5B" KeyPath="yes" Source="../../../Setups/mosquitto/mosquitto/edl-v10" />
</Component>
<Component Id="cmp6F9F08890072C152F5FADAD0D513493C" Directory="MyProgramDir" Guid="BE80EDA6-28FC-4C0D-8BAC-94FA8AE5BB94">
<File Id="fil60C98E7B75120C739F33F0C7ABF52318" KeyPath="yes" Source="../../../Setups/mosquitto/mosquitto/epl-v10" />
</Component>
<Component Id="cmpB04A2DC39867DD744B3591AC2AFB49BC" Directory="MyProgramDir" Guid="236F6263-DCDB-42BC-8DA3-8D23189EC331">
<File Id="fil93F56A00DDA348881B22245DADDB4F5A" KeyPath="yes" Source="../../../Setups/mosquitto/mosquitto/libeay32.dll" />
</Component>
<Component Id="cmp3FA55FD836AD7B4095DAFD837A100110" Directory="MyProgramDir" Guid="7ED4C914-E66F-4F39-AC4E-A24123BF394C">
<File Id="fil711449631134E31C4C38DCA6C4FCD922" KeyPath="yes" Source="../../../Setups/mosquitto/mosquitto/libssl32.dll" />
</Component>
<Component Id="cmpBA00B50D8224C040011EC424B900FE43" Directory="MyProgramDir" Guid="EF6C19F7-CCC3-4C61-B5B8-DE01A0C6D55E">
<File Id="filA995207A6EF3FF0B4A1912B4627C6A9E" KeyPath="yes" Source="../../../Setups/mosquitto/mosquitto/mosquitto.conf" />
</Component>
<Component Id="cmp4587500C7F4126281D74E67979861A5F" Directory="MyProgramDir" Guid="E81C33BB-226C-40F2-AE05-6F0EDFEDEA00">
<File Id="filF89C2DB7028E205E7170A35A8F9520E6" KeyPath="yes" Source="../../../Setups/mosquitto/mosquitto/mosquitto.dll" />
</Component>
<Component Id="cmp59455E1C37B7879C4BC250DE3D60A2AD" Directory="MyProgramDir" Guid="179B4F4C-912B-4CA1-8F08-5E1B4ADFFD8B">
<File Id="fil7D28AEF774656849395A2FA20A5C963D" KeyPath="yes" Source="../../../Setups/mosquitto/mosquitto/mosquitto.exe" />
</Component>
<Component Id="cmpFC2AA06F4719D34513B7E5E9EB230B41" Directory="MyProgramDir" Guid="C9CD68F9-77B1-481B-91ED-21AC8A84C4D7">
<File Id="fil217773E50C3CCD997EE125E6B0195649" KeyPath="yes" Source="../../../Setups/mosquitto/mosquitto/mosquittopp.dll" />
</Component>
<Component Id="cmp783743C36FE8E1154B0AE9E72AC7D575" Directory="MyProgramDir" Guid="B5717FA1-FE2D-4617-814E-4492EA4D8807">
<File Id="filCB4D3062E6881D66561E91BD301B39EC" KeyPath="yes" Source="../../../Setups/mosquitto/mosquitto/mosquitto_passwd.exe" />
</Component>
<Component Id="cmpB524C33DDFC8EBC62B98F9EBFC7807D0" Directory="MyProgramDir" Guid="68E7A8B3-DC15-404F-98D1-20487419D254">
<File Id="fil5F8821D626DC542D506A561E82B226A6" KeyPath="yes" Source="../../../Setups/mosquitto/mosquitto/mosquitto_pub.exe" />
</Component>
<Component Id="cmp3F0A99A6FCDA4B694FD5CFAFDC8A80CF" Directory="MyProgramDir" Guid="7B83878B-3F39-4FFA-8FDC-FDFA88E882A5">
<File Id="fil4C12390E7E7C75828D70CEBED7733FCE" KeyPath="yes" Source="../../../Setups/mosquitto/mosquitto/mosquitto_sub.exe" />
</Component>
<Component Id="cmpEA7CE0C91970F57073BB84F8319AB6E9" Directory="MyProgramDir" Guid="34F20F13-0533-4029-87BE-C248FEBC8BC6">
<File Id="fil431A1BF1C3B5AC45CE630487A7C4F945" KeyPath="yes" Source="../../../Setups/mosquitto/mosquitto/pthreadVC2.dll" />
</Component>
<Component Id="cmp7501765F72B0586A968FAC0B19C630D3" Directory="MyProgramDir" Guid="4A041354-E31D-4074-83EA-5EB162E9088F">
<File Id="fil542FD8A849709E85C839FE825E8F7381" KeyPath="yes" Source="../../../Setups/mosquitto/mosquitto/pwfile.example" />
</Component>
<Component Id="cmp9AA04B6F826A4FBEDDADF82E79A761E1" Directory="MyProgramDir" Guid="B48E76CB-C1A4-4E33-8D1C-93F17CF02CEE">
<File Id="fil9A73011E316138ECF5FA538F5FFA4E65" KeyPath="yes" Source="../../../Setups/mosquitto/mosquitto/readme-windows.txt" />
</Component>
<Component Id="cmp32A4C8B2CEA9C2B249897CE3C6B247C6" Directory="MyProgramDir" Guid="584E5D69-990B-4CA7-808E-B0CB16061501">
<File Id="fil5ED5D6BCA1089DC259C7CBA92488771F" KeyPath="yes" Source="../../../Setups/mosquitto/mosquitto/readme.txt" />
</Component>
<Component Id="cmpC98F4A8F1680E1A63542439212B11AE5" Directory="MyProgramDir" Guid="6B20C0FB-1EF6-47FA-8CF7-6670388E1EE4">
<File Id="fil85C65E95EE6846B0F10A532F68143610" KeyPath="yes" Source="../../../Setups/mosquitto/mosquitto/ssleay32.dll" />
</Component>
<Component Id="cmp077EB2DAE856A91792B2F5D25E1657B1" Directory="MyProgramDir" Guid="380D7E34-F52D-495B-AD44-98496DA86C39">
<File Id="fil2C766C617C17E139FD0C4383EA2836C2" KeyPath="yes" Source="../../../Setups/mosquitto/mosquitto/Uninstall.exe" />
</Component>
<Component Id="cmp75F7F5A733463114C1AE70CEE007EF5B" Directory="MyProgramDir" Guid="87C8326B-F7BE-48F4-B8E6-3C328EE3699B">
<File Id="fil6EFD0D9154A77F9F83AD40E108ABC645" KeyPath="yes" Source="../../../Setups/mosquitto/mosquitto/websockets.dll" />
</Component>
<Component Id="cmpED679856D0F7640ABA659DEB9A01EB0C" Directory="dirC8FCCB6AC509A125EE3B37CC7E907774" Guid="B576C2B4-4157-469C-86E2-B869214CC64A">
<File Id="fil2AC1DBC8C2D9F23E430E4C762DCDE74D" KeyPath="yes" Source="../../../Setups/mosquitto/mosquitto/devel/mosquitto.h" />
</Component>
<Component Id="cmp6E8EC27B07C11656CE96CA872FF39F60" Directory="dirC8FCCB6AC509A125EE3B37CC7E907774" Guid="78387CDF-FE90-464A-8D3F-BDD42B89C26C">
<File Id="filEEC89BDE9E29C6E182307F4C6826890A" KeyPath="yes" Source="../../../Setups/mosquitto/mosquitto/devel/mosquitto.lib" />
</Component>
<Component Id="cmp85BF1685089A4DC262B71CEDC73FA6B3" Directory="dirC8FCCB6AC509A125EE3B37CC7E907774" Guid="F434B6D5-8A93-43CF-AC26-DE89F52E5A7E">
<File Id="fil7F5D72039158A30AF8EAA068868BBEF6" KeyPath="yes" Source="../../../Setups/mosquitto/mosquitto/devel/mosquittopp.h" />
</Component>
<Component Id="cmp8D747BA62B3F712D6A73536CB1C1EA26" Directory="dirC8FCCB6AC509A125EE3B37CC7E907774" Guid="BBF1DD11-F7C9-4823-ADC4-B31657B05ECF">
<File Id="filA474F6FBE224F895B1554D05DE2F419D" KeyPath="yes" Source="../../../Setups/mosquitto/mosquitto/devel/mosquittopp.lib" />
</Component>
<Component Id="cmpB2DF497560B4E99936D5598EE54D381B" Directory="dirC8FCCB6AC509A125EE3B37CC7E907774" Guid="B0A4C898-AC74-4329-A88E-9321381B0EB9">
<File Id="fil0F36E85111041DA1F5ABEFF409812AFA" KeyPath="yes" Source="../../../Setups/mosquitto/mosquitto/devel/mosquitto_plugin.h" />
</Component>
</ComponentGroup>
</Fragment>
</Wix>
What am I doing wrong here? There are no files left. Just the empty test2.0 folder remains. Please advice.
Ideally msiexec /x {ProductGUID} should remove all folders and files unless components are marked shared/permanent, if not it's an issue with your setup or something you're doing with your application. Please provide other details related to this.
As a last resort you can use REMOVEFILE to remove the directory during Uninstallation:
<Component Id="NEWCOMP" Guid="">
<RemoveFile Id="RemoveInstallFolder" Name="*" On="uninstall" Directory="INSTALLFOLDER" />
</Component>

Set shortcut targetpath Wix

I want to set the shortcut target path in wix for an advertised shortcut
This is the code that creates the shorcut now:
<Component Id="APP_EXE" Directory="INSTALLDIR" DiskId="1" Guid="XXXX-XXXX">
<File Id="AppExe" Name="app.exe" Source="$(var.ComponentSourceDir)\$(var.ExeName)" KeyPath="yes">
<Shortcut Id="desktopShortcut" Advertise="yes" Directory="DesktopFolder" Name="$(var.VersionedName)" WorkingDirectory="INSTALLDIR" Icon="MainIcon.exe" IconIndex="0" />
</File>
</Component>
The target in shortcut properties window is readonly now and it displayes the application name. I cannot change it.
I created a new component where I create the shortcut. I removed the previous one.
<Component Id="APP_EXE" Directory="INSTALLDIR" DiskId="1" Guid="XXXX-XXXX">
<File Id="AppExe" Name="app.exe" Source="$(var.ComponentSourceDir)\$(var.ExeName)" KeyPath="yes">
</File>
</Component>
<Component Id="APP_SHORTCUT" Directory="INSTALLDIR" DiskId="1" Guid="XXXX_XXXXX">
<RegistryValue Root="HKCU" Key="Software\APP\Installer" Name="desktopShortcut" Value="KeyPath" KeyPath="yes" Type="string" />
<Shortcut Id="desktopShortcut" Directory="DesktopFolder" Name="$(var.VersionedName)" WorkingDirectory="INSTALLDIR" Icon="MainIcon.exe" IconIndex="0" Target="[INSTALLDIR]app.exe"/>
</Component>

Shortcut Target is set to keyPath instead of parent file? (WIX documentation is wrong)

WIX documentatino on Shortcut element says about Target attribute:
The value will be defaulted to the parent File when nested under a File element.
But the code
<Component Guid="MY_GUID" Id="MyAppComponent">
<File Source="SomeDll.dll" Name="SomeDll.dll" Id="SomeDll.dll" KeyPath="yes" />
<File Source="MyDll.exe" Name="MyDll.exe" Id="MyDll.exe" />
<Shortcut Id="MyApp.Shortcut" Directory="ApplicationProgramMenuDir" WorkingDirectory="INSTALLDIR" Name="MyApp" Icon="ProgramIcon.ico" Advertise="yes" />
</File>
</Component>
does not work as expected - shortcut points to dll file and running it shows Windwos error message that it can't launch file with dll extention.
To fix that we need to make the only difference: set KeyPath="yes" attribute for exe file instead of dll:
<Component Guid="MY_GUID" Id="MyAppComponent">
<File Source="SomeDll.dll" Name="SomeDll.dll" Id="SomeDll.dll"/>
<File Source="MyDll.exe" Name="MyDll.exe" Id="MyDll.exe" KeyPath="yes" />
<Shortcut Id="MyApp.Shortcut" Directory="ApplicationProgramMenuDir" WorkingDirectory="INSTALLDIR" Name="MyApp" Icon="ProgramIcon.ico" Advertise="yes" />
</File>
</Component>
So WIX documentation contains mistake? Target is set not to the parent File element, but to the ancestor's Component's KeyPath?
Or is it my mistake and something wrong with my code?
Try to add a <RegistryValue> tag like this:
<Component Guid="MY_GUID" Id="MyAppComponent">
<File Source="SomeDll.dll" Name="SomeDll.dll" Id="SomeDll.dll"/>
<File Source="MyDll.exe" Name="MyDll.exe" Id="MyDll.exe" KeyPath="yes" />
<Shortcut Id="MyApp.Shortcut" Directory="ApplicationProgramMenuDir" WorkingDirectory="INSTALLDIR" Name="MyApp" Icon="ProgramIcon.ico" Advertise="yes" />
</File>
<RegistryValue Root="HKCU" Key="Software\[Manufacturer]\[ProductName]\setup" Name="Shortcut" Type="integer" Value="1" KeyPath="yes" />
</Component>
If your InstallScope is perUser, using HKCU
If your InstallScope is perMachine, using HKLM

WiX major upgrade refuses to replace existing file!

EDIT!
It's rough how a question on here seems to get seen when first posted, but when a question is asked, and then answered, for me it seems abandoned. I am still having this problem, and not sure what to do.
Hello! I have inherited this project with a WiX installer, and am required to make this version usefully upgrade the previous one! My problem comes in replacing the database files with new versions. No, the problem is not that they are locked, I can replace them manually, and in fact now ONE of them is replaced, while the other is not. Please, please tell me what I'm doing wrong here. I've tried several other solutions (including registry keys as KeyPath instead of CompanionFile) but nothing is quite working.
Here is (most of) the code of the .WXS file:
<Product Id='$(var.ProductCode)'
UpgradeCode='$(var.UpgradeCode)'
Name="Pathways"
Version='$(var.ProductVersion)'
Manufacturer='$(var.Manufacturer)'
Language='1033'>
<Package Id="*"
Description="Pathways Directory Software"
InstallerVersion="301"
Compressed="yes" />
<WixVariable Id="WixUILicenseRtf" Value="License.rtf" />
<Media Id="1" Cabinet="Pathways.cab" EmbedCab="yes" />
<Upgrade Id="$(var.UpgradeCode)">
<UpgradeVersion
OnlyDetect="no"
Maximum="$(var.ProductVersion)"
IncludeMaximum="no"
Language="1033"
Property="OLDAPPFOUND"
/>
<UpgradeVersion
Minimum="$(var.ProductVersion)"
IncludeMinimum="yes"
OnlyDetect="no"
Language="1033"
Property="NEWAPPFOUND"
/>
</Upgrade>
<Property Id="ALLUSERS">2</Property>
<!-- directories -->
<Directory Id="TARGETDIR" Name="SourceDir">
<!-- program files directory -->
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLDIR" Name="Pathways"/>
</Directory>
<!-- application data directory -->
<Directory Id="CommonAppDataFolder" Name="CommonAppData">
<Directory Id="CommonAppDataPathways" Name="Pathways" />
</Directory>
<!-- start menu program directory -->
<Directory Id="ProgramMenuFolder">
<Directory Id="ProgramsMenuPathwaysFolder" Name="Pathways" />
</Directory>
<!-- desktop directory -->
<Directory Id="DesktopFolder" />
</Directory>
<Icon Id="PathwaysIcon" SourceFile="\\Fileserver\Release\Pathways\Latest\Release\Pathways.exe" />
<!-- components in the reference to the install directory -->
<DirectoryRef Id="INSTALLDIR">
<Component Id="Application" Guid="EEE4EB55-A515-4872-A4A5-06D6AB4A06A6">
<File Id="pathwaysExe" Name="Pathways.exe" DiskId="1" Source="\\Fileserver\Release\Pathways\Latest\Release\Pathways.exe" Vital="yes" KeyPath="yes" Assembly=".net" AssemblyApplication="pathwaysExe" AssemblyManifest="pathwaysExe">
<!--<netfx:NativeImage Id="ngen_Pathways.exe" Platform="32bit" Priority="2"/> -->
</File>
<File Id="pathwaysChm" Name="Pathways.chm" DiskId="1" Source="\\fileserver\Release\Pathways\Dependencies\Pathways.chm" />
<File Id="publicKeyXml" ShortName="RSAPUBLI.XML" Name="RSAPublicKey.xml" DiskId="1" Source="\\fileserver\Release\Pathways\Dependencies\RSAPublicKey.xml" Vital="yes" />
<File Id="staticListsXml" ShortName="STATICLI.XML" Name="StaticLists.xml" DiskId="1" Source="\\fileserver\Release\Pathways\Dependencies\StaticLists.xml" Vital="yes" />
<File Id="axInteropMapPointDll" ShortName="AXMPOINT.DLL" Name="AxInterop.MapPoint.dll" DiskId="1" Source="\\fileserver\Release\Pathways\Dependencies\AxInterop.MapPoint.dll" Vital="yes" />
<File Id="interopMapPointDll" ShortName="INMPOINT.DLL" Name="Interop.MapPoint.dll" DiskId="1" Source="\\fileserver\Release\Pathways\Dependencies\Interop.MapPoint.dll" Vital="yes" />
<File Id="mapPointDll" ShortName="MAPPOINT.DLL" Name="MapPoint.dll" DiskId="1" Source="\\fileserver\Release\Pathways\Dependencies\Interop.MapPoint.dll" Vital="yes" />
<File Id="devExpressData63Dll" ShortName="DAAT63.DLL" Name="DevExpress.Data.v6.3.dll" DiskId="1" Source="\\fileserver\Release\Pathways\Dependencies\DevExpress.Data.v6.3.dll" Vital="yes" />
<File Id="devExpressUtils63Dll" ShortName="UTILS63.DLL" Name="DevExpress.Utils.v6.3.dll" DiskId="1" Source="\\fileserver\Release\Pathways\Dependencies\DevExpress.Utils.v6.3.dll" Vital="yes" />
<File Id="devExpressXtraBars63Dll" ShortName="BARS63.DLL" Name="DevExpress.XtraBars.v6.3.dll" DiskId="1" Source="\\fileserver\Release\Pathways\Dependencies\DevExpress.XtraBars.v6.3.dll" Vital="yes" />
<File Id="devExpressXtraNavBar63Dll" ShortName="NAVBAR63.DLL" Name="DevExpress.XtraNavBar.v6.3.dll" DiskId="1" Source="\\fileserver\Release\Pathways\Dependencies\DevExpress.XtraNavBar.v6.3.dll" Vital="yes" />
<File Id="devExpressXtraCharts63Dll" ShortName="CHARTS63.DLL" Name="DevExpress.XtraCharts.v6.3.dll" DiskId="1" Source="\\fileserver\Release\Pathways\Dependencies\DevExpress.XtraCharts.v6.3.dll" Vital="yes" />
<File Id="devExpressXtraEditors63Dll" ShortName="EDITOR63.DLL" Name="DevExpress.XtraEditors.v6.3.dll" DiskId="1" Source="\\fileserver\Release\Pathways\Dependencies\DevExpress.XtraEditors.v6.3.dll" Vital="yes" />
<File Id="devExpressXtraPrinting63Dll" ShortName="PRINT63.DLL" Name="DevExpress.XtraPrinting.v6.3.dll" DiskId="1" Source="\\fileserver\Release\Pathways\Dependencies\DevExpress.XtraPrinting.v6.3.dll" Vital="yes" />
<File Id="devExpressXtraReports63Dll" ShortName="REPORT63.DLL" Name="DevExpress.XtraReports.v6.3.dll" DiskId="1" Source="\\fileserver\Release\Pathways\Dependencies\DevExpress.XtraReports.v6.3.dll" Vital="yes" />
<File Id="devExpressXtraRichTextEdit63Dll" ShortName="RICHTE63.DLL" Name="DevExpress.XtraRichTextEdit.v6.3.dll" DiskId="1" Source="\\fileserver\Release\Pathways\Dependencies\DevExpress.XtraRichTextEdit.v6.3.dll" Vital="yes" />
<RegistryValue Id="PathwaysInstallDir" Root="HKLM" Key="Software\Tribal Data Resources\Pathways" Name="InstallDir" Action="write" Type="string" Value="[INSTALLDIR]" />
</Component>
</DirectoryRef>
<!-- application data components -->
<DirectoryRef Id="CommonAppDataPathways">
<Component Id="CommonAppDataPathwaysFolderComponent" Guid="087C6F14-E87E-4B57-A7FA-C03FC8488E0D">
<CreateFolder>
<Permission User="Everyone" GenericAll="yes" />
</CreateFolder>
<RemoveFolder Id="CommonAppDataPathways" On="uninstall" />
<!-- <RegistryValue Root="HKCU" Key="Software\TDR\Pathways" Name="installed" Type="integer" Value="1" KeyPath="yes" />-->
</Component>
<Component Id="Settings" Guid="A3513208-4F12-4496-B609-197812B4A953" NeverOverwrite="yes">
<File Id="settingsXml" KeyPath="yes" ShortName="SETTINGS.XML" Name="Settings.xml" DiskId="1" Source="\\fileserver\Release\Pathways\Dependencies\Settings\settings.xml" Vital="yes" />
</Component>
<Component Id="Database" Guid="1D8756EF-FD6C-49BC-8400-299492E8C65D" >
<!-- <RegistryValue Root="HKLM" Key="Software\TDR\Pathways\Database" Name="installed" Type="integer" Value="1" KeyPath="yes" /> -->
<File Id="pathwaysMdf" Name="Pathways.mdf" DiskId="1" Source="\\fileserver\Shared\Databases\Pathways\SystemDBs\Pathways.mdf" CompanionFile="pathwaysExe" Vital="yes"/>
<File Id="pathwaysLdf" Name="Pathways_log.ldf" DiskId="1" Source="\\fileserver\Shared\Databases\Pathways\SystemDBs\Pathways.ldf" CompanionFile="pathwaysExe" Vital="yes"/>
</Component>
<!--
<Component Id="MDF" Guid="FFB7CE02-B592-4c44-A315-99CF4828E3D9" >
<File Id="pathwaysMdf" KeyPath="yes" Name="Pathways.mdf" DiskId="1" Source="\\fileserver\Shared\Databases\Pathways\SystemDBs\Pathways.mdf" />
</Component>
<Component Id="LDF" Guid="9E4E3DCA-A067-47f4-9905-4AD5C35A8025" >
<File Id="pathwaysLdf" KeyPath="yes" Name="Pathways_log.ldf" DiskId="1" Source="\\fileserver\Shared\Databases\Pathways\SystemDBs\Pathways.ldf" />
</Component>
-->
</DirectoryRef>
<!-- shortcut components -->
<DirectoryRef Id="DesktopFolder">
<Component Id="DesktopShortcutComponent" Guid="1BF412BA-9C6B-460D-80ED-8388AC66703F">
<Shortcut Id="DesktopShortcut"
Target="[INSTALLDIR]Pathways.exe"
Name="Pathways"
Description="Pathways Tribal Directory"
Icon="PathwaysIcon"
Show="normal"
WorkingDirectory="INSTALLDIR" />
<RegistryValue Root="HKCU" Key="Software\TDR\Pathways" Name="installed" Type="integer" Value="1" KeyPath="yes"/>
</Component>
</DirectoryRef>
<DirectoryRef Id ="ProgramsMenuPathwaysFolder">
<Component Id="ProgramsMenuShortcutComponent" Guid="83A18245-4C22-4CDC-94E0-B480F80A407D">
<Shortcut Id="ProgramsMenuShortcut" Target="[INSTALLDIR]Pathways.exe" Name="Pathways" Icon="PathwaysIcon" Show="normal" WorkingDirectory="INSTALLDIR" />
<RemoveFolder Id="ProgramsMenuPathwaysFolder" On="uninstall"/>
<RegistryValue Root="HKCU" Key="Software\TDR\Pathways" Name="installed" Type="integer" Value="1" KeyPath="yes"/>
</Component>
</DirectoryRef>
<Feature Id="App" Title="Pathways Application" Level="1" Description="Pathways software" Display="expand" ConfigurableDirectory="INSTALLDIR" Absent="disallow" AllowAdvertise="no" InstallDefault="local">
<ComponentRef Id="Application" />
<ComponentRef Id="CommonAppDataPathwaysFolderComponent" />
<ComponentRef Id="Settings"/>
<ComponentRef Id="ProgramsMenuShortcutComponent" />
<Feature Id="Shortcuts" Title="Desktop Shortcut" Level="1" Absent="allow" AllowAdvertise="no" InstallDefault="local">
<ComponentRef Id="DesktopShortcutComponent" />
</Feature>
</Feature>
<Feature Id="Data" Title="Database" Level="1" Absent="allow" AllowAdvertise="no" InstallDefault="local">
<ComponentRef Id="Database" />
</Feature>
<UIRef Id ="WixUI_FeatureTree"/>
<UIRef Id="WixUI_ErrorProgressText"/>
<UI>
<Error Id="2000">There is a later version of this program installed.</Error>
</UI>
<CustomAction Id="NewerVersionDetected" Error="2000" />
<InstallExecuteSequence>
<RemoveExistingProducts After="InstallFinalize"/>
</InstallExecuteSequence>
</Product>
Running this installer attempting the upgrade from the previous version ALMOST WORKS. The file that is giving me trouble is the one called "PathwaysMdf". Even though it's Component code is EXACTLY the same as the PathwaysLdf file, that file is replaced, while the MDF is NOT. You can see, commented out, some of the other things I've attempted, some from suggestions on stackoverflow.
The entire log file from running the upgrade is located at:
http://pastebin.com/ppjhq6Wi
THANK YOU!
Joshua
Are you following the component rules?
Why are you not using one file per component? Multiple files in a component gets very ugly, very quickly.
(Note that this isn't really a WiX issue, but more likely to be a Windows Installer issue due to violation of component rules)
Why are you setting the CompanionFile attribute for those files to "pathwaysExe"? In doing so, you are asking Windows Installer to base the decision to update those files on whether or not "pathwaysExe" is also updated. Since the version of "pathwaysExe" has not changed (and thus Windows Installer won't updated it), the other files are likewise not updated.
By the way, you say that the .ldf file is updated...Are you sure? The log file you posted indicates otherwise.