Wix Optimization - optimization

I was reviewing some statements which came from the dark.exe decompiled output of an installshield msi file.
One section, for an example:
<Directory Id='INSTALLDIR' Name="$(var.BasicProductName)">
...
<Component Id="Comp1" Guid="xx" KeyPath="yes" SharedDllRefCount="yes" Win64="$(var.Win64)">
<CreateFolder Directory="INSTALLDIR" />
...
</Component>
<Component Id="Comp2" Guid="xx" KeyPath="yes" SharedDllRefCount="yes" Win64="$(var.Win64)">
<CreateFolder Directory="INSTALLDIR" />
...
</Component>
<Directory Id="UHDDRIVER" Name="UHDDriver">
<Component Id="MyUHD" Guid="xx" SharedDllRefCount="yes" Win64="$(var.Win64)">
<File Id="MyUHD.inf" Name="MyUHD.inf" KeyPath="yes" Vital="no" DiskId="1" Source="$(var.WIN64BINARIES)\UHDDriver\MyUHD.inf" />
<File Id="MyUHD_.cat" Name="MyUHD_.cat" Vital="no" DiskId="1" Source="$(var.WIN64BINARIES)\UHDDriver\MyUHD_.cat" />
<Driver AddRemovePrograms="no" DeleteFiles="yes" Legacy="yes" PlugAndPlayPrompt="no" Sequence="2" xmlns="http://schemas.microsoft.com/wix/DifxAppExtension" />
</Component>
<Component Id="UHDDriver_Dir" Guid="xx" KeyPath="yes" SharedDllRefCount="yes" Win64="$(var.Win64)">
<CreateFolder Directory="UHDDRIVER" />
</Component>
<Directory Id="AMD644" Name="AMD64">
<Component Id="MyUHD_AMD64" Guid="xx" KeyPath="yes" SharedDllRefCount="yes" Win64="$(var.Win64)">
<File Id="MyUHD.sys1" Name="MyUHD.sys" Vital="no" DiskId="1" Source="$(var.WIN64BINARIES)\UHDDriver\AMD64\MyUHD.sys" />
</Component>
</Directory>
<Directory Id="X864" Name="x86">
<Component Id="MyUHD_x86" Guid="xx" KeyPath="yes" SharedDllRefCount="yes" Win64="$(var.Win64)">
<File Id="MyUHD.sys" Name="MyUHD.sys" Vital="no" DiskId="1" Source="$(var.WIN64BINARIES)\UHDDriver\X86\MyUHD.sys" />
</Component>
</Directory>
</Directory>
</Directory>
Wondering if I can optimize the CreateFolder tags as follows:
<Directory Id='INSTALLDIR' Name="$(var.BasicProductName)">
...
<Component Id="Comp1" Guid="xx" KeyPath="yes" SharedDllRefCount="yes" Win64="$(var.Win64)">
<CreateFolder />
...
</Component>
<Component Id="Comp2" Guid="xx" KeyPath="yes" SharedDllRefCount="yes" Win64="$(var.Win64)">
...
</Component>
<Directory Id="UHDDRIVER" Name="UHDDriver">
<Component Id="MyUHD" Guid="xx" SharedDllRefCount="yes" Win64="$(var.Win64)">
<CreateFolder />
<File Id="MyUHD.inf" Name="MyUHD.inf" KeyPath="yes" Vital="no" DiskId="1" Source="$(var.WIN64BINARIES)\UHDDriver\MyUHD.inf" />
<File Id="MyUHD_.cat" Name="MyUHD_.cat" Vital="no" DiskId="1" Source="$(var.WIN64BINARIES)\UHDDriver\MyUHD_.cat" />
<Driver AddRemovePrograms="no" DeleteFiles="yes" Legacy="yes" PlugAndPlayPrompt="no" Sequence="2" xmlns="http://schemas.microsoft.com/wix/DifxAppExtension" />
</Component>
<Directory Id="AMD644" Name="AMD64">
<Component Id="MyUHD_AMD64" Guid="xx" KeyPath="yes" SharedDllRefCount="yes" Win64="$(var.Win64)">
<File Id="MyUHD.sys1" Name="MyUHD.sys" Vital="no" DiskId="1" Source="$(var.WIN64BINARIES)\UHDDriver\AMD64\MyUHD.sys" />
</Component>
</Directory>
<Directory Id="X864" Name="x86">
<Component Id="MyUHD_x86" Guid="xx" KeyPath="yes" SharedDllRefCount="yes" Win64="$(var.Win64)">
<File Id="MyUHD.sys" Name="MyUHD.sys" Vital="no" DiskId="1" Source="$(var.WIN64BINARIES)\UHDDriver\X86\MyUHD.sys" />
</Component>
</Directory>
</Directory>
</Directory>
Note that I removed the component Id UHDDriver_Dir and replaced it with a CreateFolder tag in the first component, thinking that an empty CreateFolder simply operates on the last known Directory tag - is that correct? Am I okay for install/uninstall to remove that component, or do I need a defined component and guid for each dir I create?
Are there other optimizations I am missing here?

Related

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>

WiX Installer does not add Application to Programs and Features

I have a VB.net based WiX installer which seems to function as required in that it copies all the relevent files to the target folders on the machine, however for some reason the installer does not appear to present the application in Programs and Features. I am a relative newbie to WiX and based this WiX Installer project on a previous Windows Service project that I developed, which worked properly. Hoping someone can point out to me where I am going wrong. Code detailed below, please note all registry entries and GUIDs have been hashed-out for security purposes:
<?xml version="1.0" encoding="UTF-8"?>
<?define SourceDir = "..\..\Bin\Debug" ?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
<Product Id="*" Name="PSALERTSClient" Language="1033" Version="1.0.0.0" Manufacturer="Iberdrola, S.A." UpgradeCode="a6fd9179-efe6-47d1-bd8f-aec182d36c8b">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<MediaTemplate EmbedCab="yes" />
<Feature Id="ProductFeature" Title="PSALERTS Client" Level="1">
<ComponentRef Id="cmpDirQuery" />
<ComponentRef Id="cmpDirQueryOutput" />
<ComponentRef Id="cmpQueryExe" />
<ComponentRef Id="cmpQueryPdb" />
<ComponentRef Id="cmpBusinessLogicDll" />
<ComponentRef Id="cmpBusinessLogicPdb" />
<ComponentRef Id="cmpBusinessObjectDll" />
<ComponentRef Id="cmpBusinessObjectPdb" />
<ComponentRef Id="cmpCommonDll" />
<ComponentRef Id="cmpCommonPdb" />
<ComponentRef Id="cmpDataAccessDll" />
<ComponentRef Id="cmpDataAccessPdb" />
<ComponentRef Id="cmpDPAPIHelperDll" />
<ComponentRef Id="cmpDPAPIHelperPdb" />
<ComponentRef Id="cmpLoggerDll" />
<ComponentRef Id="cmpLoggerPdb" />
<ComponentRef Id="cmpPSALERTSIni" />
<ComponentRef Id="cmpPSALERTSXltm" />
<ComponentRef Id="cmpPSALERTSUserGuideChm" />
</Feature>
</Product>
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="dirSPEnergyNetworks" Name="SP Energy Networks">
<!-- <Component Id="cmpDirSPEnergyNetworks" Guid="{####################################}" Transitive="yes" /> -->
<Directory Id="dirPSALERTS" Name="PSALERTS">
<!-- <Component Id="cmpDirPSALERTS" Guid="{####################################}" Transitive="yes" /> -->
<Directory Id="dirQuery" Name="Query">
<Component Id="cmpDirQuery" Guid="{####################################}" KeyPath="yes">
<CreateFolder Directory="dirQuery" />
<RemoveFile Id="PurgeQuery" Name="*.*" On="uninstall" />
<RemoveFolder Id="idDirQuery" On="uninstall" Directory="dirQuery" />
</Component>
<Directory Id="dirQueryOutput" Name="QueryOutput">
<Component Id="cmpDirQueryOutput" Guid="{####################################}">
<CreateFolder Directory="dirQueryOutput" />
<RemoveFile Id="PurgeQueryOutput" Name="*.*" On="uninstall" />
<RemoveFolder Id="idDirQueryOutputRemove" On="uninstall" Directory="dirQueryOutput" />
</Component>
</Directory>
<Component Id="cmpQueryExe" Guid="*">
<File Id="filQueryExe" KeyPath="yes" Source="$(var.SourceDir)\Query.exe" />
<RemoveRegistryKey Id="RemoveQueryRegKey" Root="HKLM" Key="####################################" Action="removeOnUninstall" />
</Component>
<Component Id="cmpQueryPdb" Guid="*">
<File Id="filQueryPdb" KeyPath="yes" Source="$(var.SourceDir)\Query.pdb" />
</Component>
<Component Id="cmpBusinessLogicDll" Guid="*">
<File Id="filBusinessLogicDll" KeyPath="yes" Source="$(var.SourceDir)\BusinessLogic.dll"/>
</Component>
<Component Id="cmpBusinessLogicPdb" Guid="*">
<File Id="filBusinessLogicPdb" KeyPath="yes" Source="$(var.SourceDir)\BusinessLogic.pdb" />
</Component>
<Component Id="cmpBusinessObjectDll" Guid="*">
<File Id="filBusinessObjectDll" KeyPath="yes" Source="$(var.SourceDir)\BusinessObject.dll" />
</Component>
<Component Id="cmpBusinessObjectPdb" Guid="*">
<File Id="filBusinessObjectPdb" KeyPath="yes" Source="$(var.SourceDir)\BusinessObject.pdb" />
</Component>
<Component Id="cmpCommonDll" Guid="*">
<File Id="filCommonDll" KeyPath="yes" Source="$(var.SourceDir)\Common.dll" />
</Component>
<Component Id="cmpCommonPdb" Guid="*">
<File Id="filCommonPdb" KeyPath="yes" Source="$(var.SourceDir)\Common.pdb" />
</Component>
<Component Id="cmpDataAccessDll" Guid="*">
<File Id="filDataAccessDll" KeyPath="yes" Source="$(var.SourceDir)\DataAccess.dll" />
</Component>
<Component Id="cmpDataAccessPdb" Guid="*">
<File Id="filDataAccessPdb" KeyPath="yes" Source="$(var.SourceDir)\DataAccess.pdb" />
</Component>
<Component Id="cmpDPAPIHelperDll" Guid="*">
<File Id="filDPAPIHelperDll" KeyPath="yes" Source="$(var.SourceDir)\DPAPIHelper.dll" />
</Component>
<Component Id="cmpDPAPIHelperPdb" Guid="*">
<File Id="filDPAPIHelperPdb" KeyPath="yes" Source="$(var.SourceDir)\DPAPIHelper.pdb" />
</Component>
<Component Id="cmpLoggerDll" Guid="*">
<File Id="filLoggerDll" KeyPath="yes" Source="$(var.SourceDir)\Logger.dll" />
</Component>
<Component Id="cmpLoggerPdb" Guid="*">
<File Id="filLoggerPdb" KeyPath="yes" Source="$(var.SourceDir)\Logger.pdb" />
</Component>
<Component Id="cmpPSALERTSIni" Guid="*">
<File Id="filPSALERTSIni" KeyPath="yes" Source="$(var.SourceDir)\PSALERTS.ini" />
</Component>
<Component Id="cmpPSALERTSXltm" Guid="*">
<File Id="filPSALERTSXltm" KeyPath="yes" Source="$(var.SourceDir)\PSALERTS.xltm" />
</Component>
<Component Id="cmpPSALERTSUserGuideChm" Guid="*">
<File Id="filPSALERTSUserGuideChm" KeyPath="yes" Source="$(var.SourceDir)\PSALERTSUserGuide.Chm" />
</Component>
</Directory>
</Directory>
</Directory>
</Directory>
</Directory>
</Fragment>
<Fragment>
</Fragment>
</Wix>
Set the ARPSYSTEMCOMPONENT to 0. You can add the following line under your < Package ... > line.
<Property Id="ARPSYSTEMCOMPONENT">0</Property>
https://msdn.microsoft.com/en-us/library/windows/desktop/aa367750(v=vs.85).aspx

create msi using wix

I am developing a wix code to create a msi. i have added all the components and libraries to my wix project.But,i am not able to create a msi as i need.Please help me out.Here is my code,
<?xml version='1.0' encoding='UTF-8'?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Name='SmartViewer'
Id="*"
Language='1033'
Codepage='1252'
Version='1.0.0'
UpgradeCode='9C5E4073-EFDE-419B-935D-CE2632BC560E'>
<Package Keywords='Installer,MSI'
InstallerVersion='100'
Languages='1031'
Compressed='yes'
SummaryCodepage='1252' />
<Media Id="1" Cabinet="myapp.cab" EmbedCab="yes" />
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="MyProgramDir" Name="myproject" >
<Directory Id="INSTALLFOLDER" Name="proj1" />
</Directory>
</Directory>
<DirectoryRef Id="INSTALLFOLDER">
<Component Id='MainExecutable' Guid='*'>
<File Id='ExecutableFile' Name='mv.exe' DiskId='1' Source='mv.exe' KeyPath='yes'/>
</Component>
<Directory Id="imageformats" Name="imageformats">
<Component Id='jpeg4Library' Guid='*'>
<File Id='jpeg4' Name='jpeg4.dll' DiskId='1' Source='jpeg4.dll' KeyPath='yes' />
</Component>
</Directory>
<Component Id='Network4Library' Guid='*'>
<File Id='Network4' Name='Network4.dll' DiskId='1' Source='Network4.dll' KeyPath='yes' />
</Component>
<Component Id='Multimedia4Library' Guid='*'>
<File Id='Multimedia4' Name='Multimedia4.dll' DiskId='1' Source='Multimedia4.dll' KeyPath='yes' />
</Component>
<Component Id='QtGui4Library' Guid='*'>
<File Id='Gui4' Name='Gui4.dll' DiskId='1' Source='Gui4.dll' KeyPath='yes' />
</Component>
<Component Id='Designer4Library' Guid='*'>
<File Id='Designer4' Name='Designer4.dll' DiskId='1' Source='Designer4.dll' KeyPath='yes' />
</Component>
<Component Id='Core4Library' Guid='*'>
<File Id='Core4' Name='Core4.dll' DiskId='1' Source='Core4.dll' KeyPath='yes' />
</Component>
<Component Id='libmfxsw32Library' Guid='*'>
<File Id='libmfxsw32' Name='libmfxsw32.dll' DiskId='1' Source='libmfxsw32.dll' KeyPath='yes' />
</Component>
<Component Id='libiomp5mdLibrary' Guid='*'>
<File Id='libiomp5md' Name='libiomp5md.dll' DiskId='1' Source='libiomp5md.dll' KeyPath='yes' />
</Component>
<Component Id='ippcore7.1Library' Guid='*'>
<File Id='ippcore7.1' Name='ippcore-7.1.dll' DiskId='1' Source='ippcore-7.1.dll' KeyPath='yes' />
</Component>
<Component Id='ippccw77.1Library' Guid='*'>
<File Id='ippccw77.1' Name='ippccw7-7.1.dll' DiskId='1' Source='ippccw7-7.1.dll' KeyPath='yes' />
</Component>
<Component Id='ippccv87.1Library' Guid='*'>
<File Id='ippccv87.1' Name='ippccv8-7.1.dll' DiskId='1' Source='ippccv8-7.1.dll' KeyPath='yes' />
</Component>
<Component Id='ippccs87.1Library' Guid='*'>
<File Id='ippccs87.1' Name='ippccs8-7.1.dll' DiskId='1' Source='ippccs8-7.1.dll' KeyPath='yes' />
</Component>
<Component Id='ippccp87.1Library' Guid='*'>
<File Id='ippccp87.1' Name='ippccp8-7.1.dll' DiskId='1' Source='ippccp8-7.1.dll' KeyPath='yes' />
</Component>
<Component Id='ippccg97.1Library' Guid='*'>
<File Id='ippccg97.1' Name='ippccg9-7.1.dll' DiskId='1' Source='ippccg9-7.1.dll' KeyPath='yes' />
</Component>
<Component Id='ippcc7.1Library' Guid='*'>
<File Id='ippcc7.1' Name='ippcc-7.1.dll' DiskId='1' Source='ippcc-7.1.dll' KeyPath='yes' />
</Component>
<Component Id='EULALibrary' Guid='*'>
<File Id='EULA' Name='EULA.rtf' DiskId='1' Source='EULA.rtf' KeyPath='yes' />
</Component>
</DirectoryRef>
<Directory Id="ProgramFilesFolder">
<Directory Id="MyProgramDir" Name="myproj" >
<Directory Id="INSTALLFOLDER" Name="proj1" /
<Component Id="TextFileComponent" Guid="*">
<File Id="TextFile" Name="Logs.txt" DiskId="1"
Source="Logs.txt" KeyPath="yes" />
</Component>
</Directory>
</Directory>
<Directory Id="DesktopFolder">
<Component Id="ExecutableFileShortcutComponent" Guid="*">
<Shortcut Id="ExecutableFileShortcut" Name="smart viewer"
Description="Shortcut To Executable File"
Target="[INSTALLFOLDER]mv.exe" />
</Directory>
<Directory Id="ProgramMenuFolder">
<Directory Id="MyProgramDir" Name="myproj">
<Component Id="ExecutableFileShortcutComponent" Guid="*">
<Shortcut Id="ExecutableFileShortcut" Name="smart viewer"
Description="Shortcut To Executable File"
Target="[INSTALLFOLDER]mv.exe" />
</Component>
</Directory>
</Product>
</Wix>
The components are not getting the dll path.I tried passing the path to source in file id,still i find the same issue.Looking forward for a good suggestion.
You need to reference the full path to the files:
<File Id="Microsoft.Practices.Unity"
Name="jpeg4.dll"
Source="$(var.BuildOutputDir)\jpeg4.dll" />
where $(var.BuildOutputDir) is the full path to a folder. If these files are in the output of another referenced project then you can use $(var.OtherProject.TargetDir)
Your file does not contain valid XML. The following fragment is broken.
<Directory Id="ProgramFilesFolder">
<Directory Id="MyProgramDir" Name="myproj" >
<Directory Id="INSTALLFOLDER" Name="proj1" /
<Component Id="TextFileComponent" Guid="*">
<File Id="TextFile" Name="Logs.txt" DiskId="1"
Source="Logs.txt" KeyPath="yes" />
</Component>
</Directory>
</Directory>
The line
<Directory Id="INSTALLFOLDER" Name="proj1" /
should be
<Directory Id="INSTALLFOLDER" Name="proj1" >
There is one </Directory> missing. You should also add </Component> at two positions. Try WiXEdit that points to invalid XML when it loads a .WXS file.
Additionally you should add a <feature>.

Replacing unversioned files in WiX major upgrade

Okay, further examination and experimentation is showing that the problematic file, the pathwaysMdf file, IS being installed! However, after being installed, it's being REMOVED, by a RemoveFiles action!
I imagine it's doing this because that file is part of the original install, so it's doing it's job uninstalling and cleaning up. ARGH! What can I do?!
I am still having this problem. This is the closest I have come to a solution that works, and yet it doesn't quite work. Here is (most of) the code:
<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="yes"
Language="1033"
Property="NEWAPPFOUND"
/>
</Upgrade>
<!-- 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" />
<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" CompanionFile="pathwaysExe" Name="Pathways.mdf" DiskId="1" Source="\\fileserver\Shared\Databases\Pathways\SystemDBs\Pathways.mdf" Vital="yes"/>
<File Id="pathwaysLdf" CompanionFile="pathwaysExe" Name="Pathways_log.ldf" DiskId="1" Source="\\fileserver\Shared\Databases\Pathways\SystemDBs\Pathways.ldf" Vital="yes"/>
</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" />
<!--<ComponentRef Id="MDF"/>
<ComponentRef Id="LDF"/>-->
</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>
The problem I am having is that I need the two files in the Database component to replace the previous copies. Since these files are unversioned, I have attempted to use the CompanionFile tag set to the PathwaysExe since that is the main executable of the application, and it IS being updated, even if the log says it isn't! The strangest thing about this is that the PathwaysLdf file IS BEING UPDATED CORRECTLY, and the PathwaysMdf file IS NOT. The log seems to indicate that the "Existing file is of an equal version (Checked using version of companion)". This is very strange because that file is being replaced just fine.
The only idea I have left is that this problem has to do with the install sequence, and I'm not sure how to proceed! I have the InstallExecuteSequence set like I do because of the SettingsXml file, and my need to NOT overwrite that file, which is actually working now, so whatever solution works for the database files can't break the working settings file!
The full log is located at:
http://pastebin.com/HFiGKuKN
Try early scheduling of RemoveExistingProducts, instead of late scheduling and you should be OK.
<RemoveExistingProducts After="InstallInitialize" />

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.