Wix , Install windows service insufficient privellages error - wix

I want to install a windows service , so I followed all the recommendations by adding a user with privilege , but while starting the service give error check if you have sufficient privilege , below is the wix part I use
<Fragment>
<ComponentGroup Id="MedecxService_ServiceComponents">
<Component Id="MedecxService_ServiceComponent" Directory="MedecxService_INSTALLFOLDER" Guid="ab621e57-b52d-4bbe-853e-a5f0ca312a73">
<File Id="fil1DBD278DE49E2EF052BB6AD6321F3F88" Source="$(var.SourceOutput)\BarcodeLib.dll" Vital="yes" />
<File Id="filC2A7B546D16126D43DBD2D104D432F8E" Source="$(var.SourceOutput)\BouncyCastle.Crypto.dll" Vital="yes" />
<File Id="fil7DFD2A683DC5DD9AE627D7E981F10CF0" Source="$(var.SourceOutput)\EntityFramework.dll" Vital="yes" />
<File Id="filA912EE64A53B15C1D42E5728EB204CE7" Source="$(var.SourceOutput)\EntityFramework.SqlServer.dll" Vital="yes" />
<File Id="fil753895A598A12643844071A70FA84CE0" Source="$(var.SourceOutput)\EntityFramework.SqlServer.xml" Vital="yes" />
<File Id="filFC1348D75FED056A10197E522A36B6BA" Source="$(var.SourceOutput)\EntityFramework.xml" Vital="yes" />
<File Id="fil7252DEC8E62AECCABE47731A9AD8AF8F" Source="$(var.SourceOutput)\Excel.dll" Vital="yes" />
<File Id="fil2CE2A8A8259B04B3F97DD1DAFE40EDB7" Source="$(var.SourceOutput)\Helpers.dll" Vital="yes" />
<File Id="filC4FB21276BDBCDD1F4E7BF8A7F45C4A5" Source="$(var.SourceOutput)\ICSharpCode.SharpZipLib.dll" Vital="yes" />
<File Id="fil42C2BC798D2D94A68DDD00C91ABA994E" Source="$(var.SourceOutput)\installSVC.bat" Vital="yes" />
<File Id="filB02D1566FC3DC0D161ABD38AD5FC64DC" Source="$(var.SourceOutput)\InstallUtil.InstallLog" Vital="yes" />
<File Id="fil954AFA2395EEF3231797A75EDB77B0BE" Source="$(var.SourceOutput)\Ksys.BusinessLayer.dll" Vital="yes" />
<File Id="fil7ACD4014B5B636037386C4BDF79C1B78" Source="$(var.SourceOutput)\Ksys.Config.dll" Vital="yes" />
<File Id="fil9D674EB595DEF40D9EB7E7F9385692F8" Source="$(var.SourceOutput)\Ksys.DataAccessLayer.dll" Vital="yes" />
<File Id="fil5C85C3A51F97BECB30D1FD009D0A8F40" Source="$(var.SourceOutput)\Ksys.EF.dll" Vital="yes" />
<File Id="filA856B94EF75EB5736F2FF15FFE9282AE" Source="$(var.SourceOutput)\ksys.logger.dll" Vital="yes" />
<File Id="fil663E50F269D1C3C837A6CCF85F2A9300" Source="$(var.SourceOutput)\Ksys.Model.dll" Vital="yes" />
<File Id="filA0113B26097E9D1E15349612C1220CD4" Source="$(var.SourceOutput)\Ksys.Serializer.dll" Vital="yes" />
<File Id="fil5D63BB77482AF07C528276A85E2DA9EA" Source="$(var.SourceOutput)\LinqKit.dll" Vital="yes" />
<File Id="filE10B7796C9698A8AFAC095C006D48B28" Source="$(var.SourceOutput)\LinqKit.xml" Vital="yes" />
<File Id="fil533B9EB0CA736575A79518F23236D1E0" Source="$(var.SourceOutput)\MedexCloudWindowsService.exe" Vital="yes" />
<File Id="filFFC294FA751B1E0AFB84F1F322CD0074" Source="$(var.SourceOutput)\MedexCloudWindowsService.exe.config" Vital="yes" />
<File Id="fil69C4144F6FBAFBE9D9BEE80F9EE9F166" Source="$(var.SourceOutput)\MedexCloudWindowsService.InstallLog" Vital="yes" />
<File Id="fil4CA61FA9154292B5DEACC620C7D7CFBE" Source="$(var.SourceOutput)\MedexCloudWindowsService.InstallState" Vital="yes" />
<File Id="fil7F15BA8094994ADAD04DA907E934B5BD" Source="$(var.SourceOutput)\Newtonsoft.Json.dll" Vital="yes" />
<File Id="fil9BA73B8312B77DA2A8D16A6C05D0598B" Source="$(var.SourceOutput)\Newtonsoft.Json.xml" Vital="yes" />
<File Id="fil49D7CB3EEC543B549EE3BE62A5F30A21" Source="$(var.SourceOutput)\NLog.config" Vital="yes" />
<File Id="filD99192F3EF926B0696A896924D4A93A9" Source="$(var.SourceOutput)\NLog.dll" Vital="yes" />
<File Id="fil88CDAADE20F6C0BABA487DCEA46ED96F" Source="$(var.SourceOutput)\NLog.xml" Vital="yes" />
<File Id="fil5AEDF8895277D5A2AA598DDAFF1864E9" Source="$(var.SourceOutput)\PF.SecurityEngine.dll" Vital="yes" />
<File Id="fil1F3080066204F089C69EB71515856B08" Source="$(var.SourceOutput)\Telerik.Windows.Controls.dll" Vital="yes" />
<File Id="filD55FBBEEEACF8F9178263C092CE65233" Source="$(var.SourceOutput)\Telerik.Windows.Controls.Input.dll" Vital="yes" />
<File Id="filDC7E32BCE263A15047412BEF5CA27BB9" Source="$(var.SourceOutput)\Telerik.Windows.Controls.Navigation.dll" Vital="yes" />
<File Id="fil51DF87675977D541123ACB4D746195AE" Source="$(var.SourceOutput)\Telerik.Windows.Controls.ScheduleView.dll" Vital="yes" />
<File Id="fil426643C3E4EA3F59203804FB1B3737A6" Source="$(var.SourceOutput)\Telerik.Windows.Data.dll" Vital="yes" />
<File Id="fil74FBFF28BAE103F0D04C443B98393E70" Source="$(var.SourceOutput)\UninstallSVC.bat" Vital="yes" />
<File Id="filDE20D180F79A557C4356E0E6A2F651EA" Source="$(var.SourceOutput)\Ar-EG\Helpers.resources.dll" Vital="yes" />
<File Id="fil23324D44B270D2DDB61E42F72C82FA42" Source="$(var.SourceOutput)\Culture\Resources.Ar-EG.Designer.cs" Vital="yes" />
<File Id="fil309B641D96FFD04503F6706E7832137E" Source="$(var.SourceOutput)\Culture\Resources.Ar-EG.resx" Vital="yes" />
<File Id="fil5131FA2051CE202BE8A87A73423D3188" Source="$(var.SourceOutput)\Culture\Resources.Designer.cs" Vital="yes" />
<File Id="fil4B63438F9C7A1A62CE7519085FD7EF7F" Source="$(var.SourceOutput)\Culture\Resources.EN-US.Designer.cs" Vital="yes" />
<File Id="fil88BF0A38DDF70B974AE6154BCD6B56DA" Source="$(var.SourceOutput)\Culture\Resources.EN-US.resx" Vital="yes" />
<File Id="filC98495569CBB3CCB9CCC9B0F550AB54C" Source="$(var.SourceOutput)\Culture\Resources.resx" Vital="yes" />
<File Id="filCC289B0C10B0E547830E23254F453E0E" Source="$(var.SourceOutput)\EN-US\Helpers.resources.dll" Vital="yes" />
<util:User Id="user" CreateUser="yes" Name="serviceaccount" Password="p2Ekutrekac34ph2" LogonAsService="yes" UpdateIfExists="yes" RemoveOnUninstall="yes" PasswordNeverExpires="yes" FailIfExists="no" Domain="[ComputerName]" CanNotChangePassword="yes" Disabled="no" PasswordExpired="no" />
<ServiceInstall Id="QBServiceInstaller" Type="ownProcess" Vital="yes" Name="MedexCloudWindowsService.exe" DisplayName="medexCloud Backend service" Description="medexCloud Backend service" Start="auto" Account=".\serviceaccount" Password="p2Ekutrekac34ph2" ErrorControl="ignore" Interactive="no" />
<ServiceControl Id="MedecxServiceStartService" Start="install" Stop="both" Remove="uninstall" Name="MedexCloudWindowsService.exe" Wait="yes" />
</Component>
</ComponentGroup>
</Fragment>

The "insufficient privilege" error is just a guess, and isn't often the cause of the issue. So, I'll list the usual suspects:
The service code is broken in the startup area, having responded to the start message or OnStart event, it is then crashing or not responding to the start in a timely manner. This can be tested by having the service create a trace log of what it's doing, which is invaluable anyway to help debug services.
It's got a missing dependency that is either a) Not included in the install or prerequisites or b) Is being installed to the GAC or WinSxS and is therefore not available when the service is started.
Your WiX is incorrect somewhere. This actually seems the most likely cause based on what I can see of your source. ServiceInstall requires that the service binary be the keypath of the containing component. As far as I can tell, your service exe is not the keypath of the component, so it's not clear to me that your service would be installed correctly. In any case, best practice is to have one file per component.

Related

WIX install windows service with x64

I had to change my project to x64 and now following this tutorial I try to change my WIX installation to x64 also. But the WIX installation tries to install a windows service. This service throws the following exception in install.log with msiexec /i Setup.msi /L*V install.log:
System.Reflection.TargetInvocationException: A call target caused an exception. ---> System.BadImageFormatException: The file or Assembly "Service, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" or a dependency on it was not found. An attempt was made to load a file with the wrong format.
at SaveServiceConfigurationAction.CustomActions.SaveServiceConfiguration(Session session)
--- End of internal exception batch monitoring ---
bei System.RuntimeMethodHandle.InvokeMethod(Object target, Object arguments, Signature sig, Boolean constructor)
bei System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object parameters, Object arguments)
bei System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object parameters, CultureInfo culture)
at Microsoft.Deployment.WindowsInstaller.CustomActionProxy.InvokeCustomAction(Int32 sessionHandle, String entryPoint, IntPtr remotingDelegatePtr)
CustomAction SaveServiceConfigurationAction returned actual error code 1603 (note this may not be 100% accurate if translation happened inside sandbox)
When I try to install this service with installutil.exe I get a similar exception
System.BadImageFormatException: The file or assembly "Service.exe" or a dependency on it was not found. An attempt was made to load a file with the wrong format.
But if I use Framework64\v4.0.30319\installutil.exe the service could be installed with no problem.
So now my question: How do I configure my WIX project to use Framework64 to install the service?
My WIX-Code:
<Component Id="CMP_Service" Feature="Core">
<File Source="$(var.Service.TargetPath)" KeyPath="yes">
<fire:FirewallException Id="ServiceException" Name="Service Exception" Protocol="tcp" Port="[PORTProperty]" Scope="any" />
</File>
<ServiceInstall Id="ServiceInstallELS"
Name="Service"
Description="..."
Start="auto"
Account="[SERVICEACCOUNT]"
ErrorControl="normal"
Type="ownProcess"
Vital="no" />
<ServiceControl Id="ServiceControllELS"
Name="Service"
Start="install"
Stop="both"
Remove="uninstall"
Wait="no" />
</Component>
Please check this.
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<?define DemoMarketingContacts.UI_TargetDir=$(var.DemoMarketingContacts.UI.TargetDir)?>
<?define DemoMarketingContacts.UploaderUI_TargetDir=$(var.DemoMarketingContacts.UploaderUI.TargetDir)?>
<?define DemoMarketingContacts.ValidatorUI_TargetDir=$(var.DemoMarketingContacts.ValidatorUI.TargetDir)?>
<?define DemoMarketingContacts.Domain_TargetDir=$(var.DemoMarketingContacts.Domain.TargetDir)?>
<?define QueryStringUtilies_TargetDir=$(var.QueryStringUtilies.TargetDir)?>
<?define Demo.InternetCheckerService_TargetDir=$(var.Demo.InternetCheckerService.TargetDir)?>
<?define Demo.InternetChecker.Server_TargetDir=$(var.Demo.InternetChecker.Server.TargetDir)?>
<Product Id="50D6E335-B3EF-44EE-B3AE-899B260F8FBF" Name="Demo Marketing Contacts" Language="1033" Version="4.0.0.0"
Manufacturer="Demo Technologies (pvt)Ltd." UpgradeCode="495757a4-415c-4dbe-81fb-a6fa78c40a5b">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
<Icon Id="EmailMarketing.ico" SourceFile="$(var.ProjectDir)Email Marketing.ico" />
<Icon Id="UploadEmail.ico" SourceFile="$(var.ProjectDir)UploadEmail.ico" />
<Icon Id="ValidEmail.ico" SourceFile="$(var.ProjectDir)ValidEmail.ico" />
<Property Id="AppIcon" Value="Email Marketing" />
<Property Id="ARPPRODUCTICON" Value="EmailMarketing.ico" />
<!--<UIRef Id="WixUI_Minimal" />-->
<UIRef Id="DemoSetUpUI" />
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<MediaTemplate EmbedCab="yes" />
<Feature Id="ProductFeature" Title="DemoMarketing Contacts" Level="1" TypicalDefault="install">
<ComponentGroupRef Id="ProductComponents" />
<ComponentRef Id="ApplicationShortcut" />
<ComponentRef Id="ApplicationShortcutDesktop" />
<ComponentRef Id="AuditLogFolderComponent" />
<ComponentRef Id="LogFolderComponent" />
</Feature>
<Feature Id="ValidatorFeature" Title="DemoMarketing Contacts Validator" Level="1" TypicalDefault="install">
<ComponentGroupRef Id="ValidatorUIComponents" />
<ComponentRef Id="ApplicationShortcut" />
<ComponentRef Id="ApplicationShortcutDesktop" />
</Feature>
<Feature Id="InternetCheckerServiceFeature" Title="Demo Internet Checker" Level="2" Description="This is the Demo Internet Checker Service component" TypicalDefault="advertise">
<ComponentGroupRef Id="ServiceComponetGroup" />
</Feature>
</Product>
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLFOLDER" Name="Demo Marketing Contacts">
<Directory Id="AuditLogFolder" Name="AuditLog" />
<Directory Id="LogFolder" Name="Log" />
</Directory>
</Directory>
<Directory Id="ProgramMenuFolder">
<Directory Id="ApplicationProgramsFolder" Name="DemoMarketing Contacts" />
</Directory>
<Directory Id="DesktopFolder" Name="Desktop" />
</Directory>
</Fragment>
<Fragment>
<DirectoryRef Id="ApplicationProgramsFolder">
<Component Id="ApplicationShortcut" Guid="A65731C2-FDFB-4C41-BD8B-8AD5E2E441B2">
<Shortcut Id="UploaderStartMenuShortcut" Name="DemoMarketing Contacts Uploader" Description="DemoMarketing Contacts Uploader" Target="[#DemoMarketingContacts.UploaderUI.exe]" WorkingDirectory="INSTALLFOLDER" />
<Shortcut Id="ValidatorStartMenuShortcut" Name="DemoMarketing Contacts Validator" Description="DemoMarketing Contacts Validator" Target="[#DemoMarketingContacts.ValidatorUI.exe]" WorkingDirectory="INSTALLFOLDER" />
<RemoveFolder Id="RemoveApplicationProgramsFolder" Directory="ApplicationProgramsFolder" On="uninstall" />
<RegistryValue Root="HKCU" Key="Software\DemoMarketing Contacts" Name="installed" Type="integer" Value="1" KeyPath="yes" />
</Component>
</DirectoryRef>
<DirectoryRef Id="DesktopFolder">
<Component Id="ApplicationShortcutDesktop" Guid="6F764DEA-E1DE-418E-9B5C-4E09E6C5FB3E">
<Shortcut Id="UploaderDesktopShortcut" Name="DemoMarketing Contacts Uploader" Description="DemoMarketing Contacts Uploader" Target="[#DemoMarketingContacts.UploaderUI.exe]" WorkingDirectory="INSTALLFOLDER" />
<Shortcut Id="ValidatorDesktopShortcut" Name="DemoMarketing Contacts Validator" Description="DemoMarketing Contacts Validator" Target="[#DemoMarketingContacts.ValidatorUI.exe]" WorkingDirectory="INSTALLFOLDER" />
<RemoveFolder Id="RemoveDesktopFolder" Directory="ApplicationProgramsFolder" On="uninstall" />
<RegistryValue Root="HKCU" Key="Software\DemoMarketing Contacts" Name="installed" Type="integer" Value="1" KeyPath="yes" />
</Component>
</DirectoryRef>
<DirectoryRef Id="AuditLogFolder">
<Component Id="AuditLogFolderComponent" Guid="49FE9EB9-90A5-46D6-93FD-45FA153F53D5" KeyPath="yes">
<CreateFolder />
</Component>
</DirectoryRef>
<DirectoryRef Id="LogFolder">
<Component Id="LogFolderComponent" Guid="B7CFA16B-B755-42F5-B9FE-AC161F758D53" KeyPath="yes">
<CreateFolder />
</Component>
</DirectoryRef>
</Fragment>
<Fragment>
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
<Component Id="DemoMarketingContacts.UploaderUI.exe" Guid="25B57A38-AD92-430E-96C0-887F7826E69E">
<File Id="DemoMarketingContacts.UploaderUI.exe" Name="DemoMarketingContacts.UploaderUI.exe" Source="$(var.DemoMarketingContacts.UploaderUI_TargetDir)DemoMarketingContacts.UploaderUI.exe" />
</Component>
<Component Id="DemoMarketingContacts.UploaderUI.exe.config" Guid="0DD136DB-D607-42F1-9FB6-24200E43AA80">
<File Id="DemoMarketingContacts.UploaderUI.exe.config" Name="DemoMarketingContacts.UploaderUI.exe.config" Source="$(var.DemoMarketingContacts.UploaderUI_TargetDir)DemoMarketingContacts.UploaderUI.exe.config" />
</Component>
<Component Id="MySql.Data.dll" Guid="1cd1c916-b9cc-451d-be2f-c17bec362710">
<File Id="MySql.Data.dll" Name="MySql.Data.dll" Source="$(var.DemoMarketingContacts.UI_TargetDir)MySql.Data.dll" />
</Component>
<Component Id="DbManagerLibrary.dll" Guid="8307fa02-f630-4f0b-9ca1-77784fcc716b">
<File Id="DbManagerLibrary.dll" Name="DbManagerLibrary.dll" Source="$(var.DemoMarketingContacts.UI_TargetDir)DbManagerLibrary.dll" />
</Component>
<Component Id="Md5CryptoEngine.dll" Guid="0baf14db-3d30-4f20-913d-9bba02357d63">
<File Id="Md5CryptoEngine.dll" Name="Md5CryptoEngine.dll" Source="$(var.DemoMarketingContacts.UI_TargetDir)Md5CryptoEngine.dll" />
</Component>
<Component Id="QueryStringUtilies.dll" Guid="fdf2e586-a590-4ca8-bd4b-ef0fcafcd8e5">
<File Id="QueryStringUtilies.dll" Name="QueryStringUtilies.dll" Source="$(var.QueryStringUtilies_TargetDir)QueryStringUtilies.dll" />
</Component>
<Component Id="DemoMarketingContacts.Domain.dll" Guid="719641ed-d882-412f-a826-ebded804de08">
<File Id="DemoMarketingContacts.Domain.dll" Name="DemoMarketingContacts.Domain.dll" Source="$(var.DemoMarketingContacts.Domain_TargetDir)DemoMarketingContacts.Domain.dll" />
</Component>
<Component Id="Conf.sys" Guid="8f8f0b68-8a2f-4e6e-81b8-296b6d1e3038">
<File Id="Conf.sys" Name="Conf.sys" Source="$(var.DemoMarketingContacts.UI_TargetDir)Conf.sys" />
</Component>
<Component Id="LicenseKey.sys" Guid="b5478971-d1d6-4d6c-b254-ded5d8658ef7">
<File Id="LicenseKey.sys" Name="LicenseKey.sys" Source="$(var.DemoMarketingContacts.UI_TargetDir)LicenseKey.sys" />
</Component>
<Component Id="System.Windows.Interactivity.dll" Guid="1d71080d-a57b-47b9-9cbf-64f430252846">
<File Id="System.Windows.Interactivity.dll" Name="System.Windows.Interactivity.dll" Source="$(var.DemoMarketingContacts.UploaderUI_TargetDir)System.Windows.Interactivity.dll" />
</Component>
<Component Id="Caliburn.Micro.Platform.Core.dll" Guid="54fd8728-8a96-4d6e-bc14-2df25a47fbe5">
<File Id="Caliburn.Micro.Platform.Core.dll" Name="Caliburn.Micro.Platform.Core.dll" Source="$(var.DemoMarketingContacts.UploaderUI_TargetDir)Caliburn.Micro.Platform.Core.dll" />
</Component>
<Component Id="Cobisi.EmailVerify.Net45.dll" Guid="feb50857-53b2-4c14-904e-2f86f25fa4d8">
<File Id="Cobisi.EmailVerify.Net45.dll" Name="Cobisi.EmailVerify.Net45.dll" Source="$(var.DemoMarketingContacts.UploaderUI_TargetDir)Cobisi.EmailVerify.Net45.dll" />
</Component>
<Component Id="Caliburn.Micro.Platform.dll" Guid="c85997a8-0571-4a34-83cc-a12022f17ff7">
<File Id="Caliburn.Micro.Platform.dll" Name="Caliburn.Micro.Platform.dll" Source="$(var.DemoMarketingContacts.UploaderUI_TargetDir)Caliburn.Micro.Platform.dll" />
</Component>
<Component Id="Caliburn.Micro.dll" Guid="50795ece-887e-43bf-811f-29806c37ea5b">
<File Id="Caliburn.Micro.dll" Name="Caliburn.Micro.dll" Source="$(var.DemoMarketingContacts.UploaderUI_TargetDir)Caliburn.Micro.dll" />
</Component>
<Component Id="Demo.InternetCheckerService.exe.config" Guid="c60abb1b-7f57-4056-86a6-23aa7cf936db">
<File Id="Demo.InternetCheckerService.exe.config" Name="Demo.InternetCheckerService.exe.config" Source="$(var.Demo.InternetCheckerService_TargetDir)Demo.InternetCheckerService.exe.config" />
</Component>
<Component Id="Email_Marketing.ico" Guid="bbb37327-15e9-44ab-9816-c0bfe09a7895">
<File Id="Email_Marketing.ico" Name="Email Marketing.ico" Source="$(var.DemoMarketingContacts.UI_TargetDir)Email Marketing.ico" />
</Component>
<Component Id="Read_me.txt" Guid="31685dd1-c56f-4c70-89a9-f2327d143f17">
<File Id="Read_me.txt" Name="Read me.txt" Source="$(var.DemoMarketingContacts.UI_TargetDir)Read me.txt" />
</Component>
</ComponentGroup>
<ComponentGroup Id="ValidatorUIComponents" Directory="INSTALLFOLDER">
<Component Id="DemoMarketingContacts.ValidatorUI.exe" Guid="8672B6FC-6419-495D-A9C3-F3977F8B7B8F">
<File Id="DemoMarketingContacts.ValidatorUI.exe" Name="DemoMarketingContacts.ValidatorUI.exe" Source="$(var.DemoMarketingContacts.ValidatorUI_TargetDir)DemoMarketingContacts.ValidatorUI.exe" />
</Component>
<Component Id="DemoMarketingContacts.ValidatorUI.exe.config" Guid="28572FF1-B8D8-42DF-86C8-041FFBA9EA31">
<File Id="DemoMarketingContacts.ValidatorUI.exe.config" Name="DemoMarketingContacts.ValidatorUI.exe.config" Source="$(var.DemoMarketingContacts.ValidatorUI_TargetDir)DemoMarketingContacts.ValidatorUI.exe.config" />
</Component>
</ComponentGroup>
<ComponentGroup Id="ServiceComponetGroup" Directory="INSTALLFOLDER">
<Component Id="ServiceComponent" Guid="28ABD97D-3091-485D-AF21-0BD96151D52B" DiskId="1" SharedDllRefCount="no" KeyPath="no" NeverOverwrite="no" Permanent="no" Transitive="no" Win64="no" Location="either">
<File Id="Demo.InternetChecker.Server.dll" Name="Demo.InternetChecker.Server.dll" Source="$(var.Demo.InternetChecker.Server_TargetDir)Demo.InternetChecker.Server.dll" KeyPath="no" />
<File Id="Demo.InternetCheckerService.exe" Name="Demo.InternetCheckerService.exe" Source="$(var.Demo.InternetCheckerService_TargetDir)Demo.InternetCheckerService.exe" ReadOnly="no" Compressed="yes" KeyPath="yes" Vital="yes" Hidden="no" System="no" Checksum="no" />
<ServiceInstall Id="DemoInternetCheckerServiceInstall" DisplayName="Demo Internet Checker Service Instance" Description="This Service is broadcast internet availability to the intranet." Name="DemoInternetCheckerExeName" ErrorControl="normal" Start="auto" Type="ownProcess" Vital="yes" />
<ServiceControl Id="DemoInternetCheckerServiceControl" Name="DemoInternetCheckerExeName" Start="install" Stop="uninstall" Remove="uninstall" />
</Component>
</ComponentGroup>
</Fragment>
</Wix>

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: Verify that you have sufficient privileges to start system services

I'm using Wix installer. When I run installer I get this error:
I'm logged as administrator. I also tried create anotherone user.
So I tried:
1| I add my user "Administrator" to place "Log on as a service"
2| I checked my Net.Tcp Port Sharing Service if is running
3| I get my SID
4| I added to SMSvcHost.exe.config section with my SID.
Check "My administrator sid"
<system.serviceModel.activation>
<net.tcp listenBacklog="10" maxPendingConnections="100" maxPendingAccepts="2" receiveTimeout="00:00:10" teredoEnabled="false">
<allowAccounts>
// My administrator sid
<add securityIdentifier="S-1-5-21-334175509-2570308825-1313804348-500"/>
// LocalSystem account
<add securityIdentifier="S-1-5-18"/>
// LocalService account
<add securityIdentifier="S-1-5-19"/>
// Administrators account
<add securityIdentifier="S-1-5-20"/>
// Network Service account
<add securityIdentifier="S-1-5-32-544" />
// IIS_IUSRS account (Vista only)
<add securityIdentifier="S-1-5-32-568"/>
</allowAccounts>
</net.tcp>
<net.pipe maxPendingConnections="100" maxPendingAccepts="2" receiveTimeout="00:00:10">
<allowAccounts>
// LocalSystem account
<add securityIdentifier="S-1-5-18"/>
// LocalService account
<add securityIdentifier="S-1-5-19"/>
// Administrators account
<add securityIdentifier="S-1-5-20"/>
// Network Service account
<add securityIdentifier="S-1-5-32-544" />
// IIS_IUSRS account (Vista only)
<add securityIdentifier="S-1-5-32-568"/>
</allowAccounts>
</net.pipe>
<diagnostics performanceCountersEnabled="true" />
</system.serviceModel.activation>
5| I edit all SMSvcHost.exe.config for sure:
C:\Windows\Microsoft.NET\Framework\v3.0\Windows Communication Foundation\
C:\Windows\Microsoft.NET\Framework\v4.0.30319
C:\Windows\Microsoft.NET\Framework64\v3.0\Windows Communication Foundation
C:\Windows\Microsoft.NET\Framework64\v4.0.30319
6| Restart = Net.Tcp Port Sharing Service
7| When I got that warning message during instalation, I didn't cancel, I tried also run service from path where files are installed and via cmd prompt I run manualy and it's run.
8| But my instalator can't finish instalation. Everytime I got that sentense: "Verify that you have sufficient privileges to start system services." I can only cancel instalation and instalation roll back and delete all files.
ANY HELP PLEASE? 5 DAYS I'M GOING AROUND THIS WITHOUT RESULT. I TESTED THAT ON 2 DIFERRENT VIRTUAL MACHINES WITH WINDOWS SERVER X64 AND WINDOWS 8 X64.
My component code is here:
<?xml version="1.0" encoding="utf-8"?>
<!--
"C:\Program Files (x86)\Windows Installer XML v3.6\bin\heat.exe" dir ..\WindowsServiceHost\bin\Release -dr TARGETDIR -cg WindowsServiceHost_Project -scom -sfrag -sreg -srd -gg -var var.WindowsServiceHost.TargetDir -out WindowsServiceHost.wxs -pog Binaries -pog Content
-->
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
<!-- The initially, this has been created with Heat to get all output -->
<Fragment>
<DirectoryRef Id="APPLICATIONFOLDER">
<Component Id="cmpF563E3CE297225623330C6BDFBFCDB12" Guid="{6742348C-A620-46FA-8DA8-0EB0CCA1C123}">
<File Id="fil21CA92101BF52AFED2FDCE521FCA6123" KeyPath="yes" Source="$(var.WindowsServiceHost.TargetDir)\Antlr3.Runtime.dll" />
</Component>
<Component Id="cmp353671C776668DEF5DCC15C233E2CA49" Guid="{A8F26FCD-4BBB-4665-903A-45DDAAFE3123}">
<File Id="fil889A0DB56C827E66FA3035CED6E3E123" KeyPath="yes" Source="$(var.WindowsServiceHost.TargetDir)\Castle.ActiveRecord.dll" />
</Component>
<Component Id="cmpCD33B68B2028B11161C5509206174D37" Guid="{248DAA3F-EC3C-44E5-A57A-DD7090222123}">
<File Id="fil98E1300420674E5F83417696A895A123" KeyPath="yes" Source="$(var.WindowsServiceHost.TargetDir)\Castle.Components.Validator.dll" />
</Component>
<Component Id="cmp4AE2CD167FF4894E9076AF5FC612D123" Guid="{D7BB86D2-A384-4AAE-8D52-B0877B849123}">
<File Id="fil808D19806529ABA1617D818072819123" KeyPath="yes" Source="$(var.WindowsServiceHost.TargetDir)\Castle.Core.dll" />
</Component>
<Component Id="cmpD9F8C495CF8479B78BC318E8E9DAA123" Guid="{DA1C4B1F-FE3C-42D2-A273-39BFB2FB7123}">
<File Id="fil2EBE8BAEA1EB66844366CCC4FD863123" KeyPath="yes" Source="$(var.WindowsServiceHost.TargetDir)\Castle.Facilities.WcfIntegration.dll" />
</Component>
<Component Id="cmp3F6A205A397BEA19BBA40D18483BD123" Guid="{2FDB99B1-D558-4750-A3DB-00D8EB1C1123}">
<File Id="fil151C8FBAEDA5D4BDEB438F301EAE7123" KeyPath="yes" Source="$(var.WindowsServiceHost.TargetDir)\Castle.Windsor.dll" />
</Component>
<Component Id="cmpC070BF8C300741A523BD7ED7CBB9C123" Guid="{71DDC933-8912-4CEB-9257-FE07A0A3C123}">
<File Id="filD577F4DF6A5A8E2CC82379AC96025123" KeyPath="yes" Source="$(var.WindowsServiceHost.TargetDir)\Viewer.Viewer.DAL.dll" />
</Component>
<Component Id="cmp38F30287B63682CF5E25FFED1C597123" Guid="{896B54CA-6279-48A2-A20D-6C32D9370123}">
<File Id="fil2E5F30135D3485052620C0369A0C8123" KeyPath="yes" Source="$(var.WindowsServiceHost.TargetDir)\Viewer.Viewer.exe" />
<!-- This is the problem I was having - I was not able to reference this component and this is not supported yes as based on hours of googling -->
<!-- We're able to define almost anything on how the service is configured, under which user, etc -->
<ServiceInstall Id="ServiceInstaller" Type="ownProcess" Vital="yes" Name="ViewerService"
DisplayName="Viewer Service" Description="Viewer service handles all user requests and manages tasks."
Start="auto" Account="[SERVICEACCOUNT]" Password="[SERVICEPASSWORD]" ErrorControl="ignore" Interactive="no">
<util:ServiceConfig FirstFailureActionType="restart" SecondFailureActionType="restart" ThirdFailureActionType="restart" />
</ServiceInstall>
<ServiceControl Id="StartService" Start="install" Stop="both" Remove="uninstall" Name="ViewerService" Wait="yes" />
</Component>
<Component Id="cmpF4715A23C1FF23A034E3C5D7E9899123" Guid="{5439277D-DA70-476D-AFA3-A7E21792B123}">
<File Id="filD6D2807DE16A409F1A2667BA03ED8123" KeyPath="yes" Source="$(var.WindowsServiceHost.TargetDir)\Viewer.exe.config" />
</Component>
<Component Id="cmpED6174C35AEBF8A8918AC859C9681123" Guid="{84A5A3C2-A5DE-40AB-8ADC-31D2A5C1E123}">
<File Id="fil5DD49061C2ED546B40CEED5FC1BD2123" KeyPath="yes" Source="$(var.WindowsServiceHost.TargetDir)\Viewer.Library.dll" />
</Component>
<Component Id="cmpB2A2EA83D72F4C7290397730910A4123" Guid="{6A8F8C8A-47E7-4A70-B05C-92EA6711B123}">
<File Id="filF3891F073E13532E343276EC37F96123" KeyPath="yes" Source="$(var.WindowsServiceHost.TargetDir)\PstLibrary.dll" />
</Component>
<Component Id="cmpEBE3708427CCDA04E12DE366A56F4123" Guid="{60645E54-C07B-41B3-B219-4B7CECC5A123}">
<File Id="fil06760C8D25183C8A8CF53F339D6BC123" KeyPath="yes" Source="$(var.WindowsServiceHost.TargetDir)\Iesi.Collections.dll" />
</Component>
<Component Id="cmp2B6E39BC25CC0CDCEC3DAC9E80C14123" Guid="{6728EDE3-FCCD-4FC1-9032-2EA6F84E7123}">
<File Id="fil3CA8B6115A016E51F3BA10386CAEE123" KeyPath="yes" Source="$(var.WindowsServiceHost.TargetDir)\Ionic.Zip.Reduced.dll" />
</Component>
<Component Id="cmp95FFFFB1FF4FE88C7ABFAFDC94AFA123" Guid="{354B5354-4134-4225-9FA8-B6EBD1566123}">
<File Id="filD2AD4A87E4FFD97570BD414BF64D2123" KeyPath="yes" Source="$(var.WindowsServiceHost.TargetDir)\LogModule.dll" />
</Component>
<Component Id="cmp06CFD0EF8C78731C8FE99058BA827123" Guid="{13D3CCD4-A068-40F7-91F7-01BD9DAC7123}">
<File Id="filC52F7EC41731AA5B6D39C500DF546123" KeyPath="yes" Source="$(var.WindowsServiceHost.TargetDir)\Lucene.Net.dll" />
</Component>
<Component Id="cmp02134B521CDB778B256053B705B39123" Guid="{AB850CDB-C591-47C4-876A-00744AFAC123}">
<File Id="fil8B09A9C2BC8D71A0E5E923F6F4039123" KeyPath="yes" Source="$(var.WindowsServiceHost.TargetDir)\MailBee.NET.dll" />
</Component>
<Component Id="cmp0732D020141A27B3EF606680AF63C123" Guid="{39446EE7-47AE-4757-B5A4-DED57F7CE123}">
<File Id="fil194D74862CE83A0371D6324FE1C0D123" KeyPath="yes" Source="..\_dependencies\Interop.Redemption.dll" />
</Component>
<Component Id="cmp0732D020141A27B3EF606680AF632123" Guid="{39446EE7-47AE-4757-B5A4-DED57F7C2123}">
<File Id="fil194D74862CE83A0371D6324FE1C02123" KeyPath="yes" Source="..\_dependencies\Redemption64.dll" />
</Component>
<Component Id="cmp9D56D720C5BABC0701758947084E5123" Guid="{E5C9921B-AA90-4B88-898F-5A3C6D2F7123}">
<File Id="filFEE1876E7EF6CE4F720645154DFD8123" KeyPath="yes" Source="$(var.WindowsServiceHost.TargetDir)\NHibernate.ByteCode.Castle.dll" />
</Component>
<Component Id="cmp48A389F21271FDC5825A9C1B25E82123" Guid="{D485D984-1568-4A28-B2EC-EFE9791B7123}">
<File Id="fil6EDFA9A322A7AB6A8E262D0DB4F60123" KeyPath="yes" Source="$(var.WindowsServiceHost.TargetDir)\NHibernate.dll" />
</Component>
<Component Id="cmpFEBBE1308148FADB702D2C8F4D13E123" Guid="{725DD9FB-61EC-48F8-A988-916C30C73123}">
<File Id="fil5145831B362C7509226E3A90E8FF2123" KeyPath="yes" Source="$(var.WindowsServiceHost.TargetDir)\NHibernate.Search.dll" />
</Component>
<Component Id="cmpEED54193D815302FC314DB0A2C9F8123" Guid="{DD277B4A-63F4-4988-BA83-D9AF1FC89123}">
<File Id="filF81E55DF73063A3872976B67B6628123" KeyPath="yes" Source="$(var.WindowsServiceHost.TargetDir)\Library.dll" />
</Component>
<Component Id="cmpA42846C9FB9AE5A84F07BCD1C1077123" Guid="{7A89E8A4-D5DC-4EB2-A80B-BB3455B2F123}">
<File Id="fil10DFB7AB70BD839083EA5F5DCA22C123" KeyPath="yes" Source="$(var.WindowsServiceHost.TargetDir)\Processing.dll" />
</Component>
<Component Id="cmpE88CBB7A43EF8781FD98762843CF1123" Guid="{862E6578-5507-4128-89CA-877315A88123}">
<File Id="fil6095C78A39C6633B24FADCC044720123" KeyPath="yes" Source="$(var.WindowsServiceHost.TargetDir)\RedemptionWrapper.dll" />
</Component>
<Component Id="cmp74BE405C599A7B2BFF4B24B035404123" Guid="{65632DE4-45A3-4C81-911F-8E0EA7073123}">
<File Id="fil9FAD52E634F2925DB072CBBAE8AC5123" KeyPath="yes" Source="$(var.WindowsServiceHost.TargetDir)\Remotion.Data.Linq.dll" />
</Component>
<Directory Id="dirD9D25461613D53ECC73127337CA03123" Name="Licenses">
<Component Id="cmpC47DFFE5D48426458E24BE6D0A83C123" Guid="{4F3CFB3D-4E7A-4430-8EC6-3403EB856123}">
<File Id="filF3CFC81B4D04F6521220038AE4103123" KeyPath="yes" Source="..\Common\Licenses\Antlr3.license.txt" />
</Component>
<Component Id="cmp322E81F6D6B5D7FFE823EAEABAE77123" Guid="{E48BC22E-682C-4D87-BABF-1E71F6AE2123}">
<File Id="fil7294E69E9C2DDF5F09B62BA6E2EB1123" KeyPath="yes" Source="..\Common\Licenses\Castle.license.txt" />
</Component>
<Component Id="cmp5537750B07AA6621D099EA533E58C123" Guid="{412C1F3B-1A6C-444F-8645-4503F484F123}">
<File Id="filFFF3C0457CC60E6EC076FBB3DD232123" KeyPath="yes" Source="..\Common\Licenses\Iesi.Collections.license.txt" />
</Component>
<Component Id="cmp92EF42C91FD5F2D0797844A57BE78123" Guid="{E35E3446-8DD2-4DE0-B7FE-E27556D8D123}">
<File Id="filA9F4D112BA2C37F6067E328E8C972123" KeyPath="yes" Source="..\Common\Licenses\Ionic.Zip.license.txt" />
</Component>
<Component Id="cmpD6E1D6312AA116069E68B968F9AED123" Guid="{B670C6F0-901F-4049-A256-406B77F0E123}">
<File Id="filC50888C92A23713C5CE5FA816A8F9123" KeyPath="yes" Source="..\Common\Licenses\Lucene.Net.license.txt" />
</Component>
<Component Id="cmp1EEBF5BABE23C2C767438072E6410123" Guid="{3799AA4F-A169-41A1-A1DE-907F315E3123}">
<File Id="filE39771746641899F88B2A3B05E9AA123" KeyPath="yes" Source="..\Common\Licenses\NHibernate.license.txt" />
</Component>
<Component Id="cmpCF5ECE8D2EADADA313278BA15AF99123" Guid="{94C3D676-8B2B-4AAE-A4BC-226763BEE123}">
<File Id="filC1AA47E8984A0651CDA4689D2A768123" KeyPath="yes" Source="..\Common\Licenses\NLog.license.txt" />
</Component>
<Component Id="cmp599BAD3717C0FCEE410496C8E8066123" Guid="{CF247694-83FE-456D-8645-55EDF88AD123}">
<File Id="filF046615251B088B6CBFB5383F775F123" KeyPath="yes" Source="..\Common\Licenses\Remotion.Data.Linq.license.txt" />
</Component>
</Directory>
</DirectoryRef>
</Fragment>
<Fragment>
<ComponentGroup Id="WindowsServiceHost_Project">
<ComponentRef Id="cmpF563E3CE297225623330C6BDFBFCD123" />
<ComponentRef Id="cmp353671C776668DEF5DCC15C233E2C123" />
<ComponentRef Id="cmpCD33B68B2028B11161C5509206174123" />
<ComponentRef Id="cmp4AE2CD167FF4894E9076AF5FC612D123" />
<ComponentRef Id="cmpD9F8C495CF8479B78BC318E8E9DAA123" />
<ComponentRef Id="cmp3F6A205A397BEA19BBA40D18483BD123" />
<ComponentRef Id="cmpC070BF8C300741A523BD7ED7CBB9C123" />
<ComponentRef Id="cmp38F30287B63682CF5E25FFED1C597123" />
<ComponentRef Id="cmpF4715A23C1FF23A034E3C5D7E9899123" />
<ComponentRef Id="cmpED6174C35AEBF8A8918AC859C9681123" />
<ComponentRef Id="cmpB2A2EA83D72F4C7290397730910A4123" />
<ComponentRef Id="cmpEBE3708427CCDA04E12DE366A56F4123" />
<ComponentRef Id="cmp2B6E39BC25CC0CDCEC3DAC9E80C14123" />
<ComponentRef Id="cmp95FFFFB1FF4FE88C7ABFAFDC94AFA123" />
<ComponentRef Id="cmp06CFD0EF8C78731C8FE99058BA827123" />
<ComponentRef Id="cmp02134B521CDB778B256053B705B39123" />
<ComponentRef Id="cmp9D56D720C5BABC0701758947084E5123" />
<ComponentRef Id="cmp48A389F21271FDC5825A9C1B25E82123" />
<ComponentRef Id="cmpFEBBE1308148FADB702D2C8F4D13E123" />
<ComponentRef Id="cmpEED54193D815302FC314DB0A2C9F8123" />
<ComponentRef Id="cmp74BE405C599A7B2BFF4B24B035404123" />
<ComponentRef Id="cmpC47DFFE5D48426458E24BE6D0A83C123" />
<ComponentRef Id="cmp322E81F6D6B5D7FFE823EAEABAE77123" />
<ComponentRef Id="cmp5537750B07AA6621D099EA533E58C123" />
<ComponentRef Id="cmp92EF42C91FD5F2D0797844A57BE78123" />
<ComponentRef Id="cmpD6E1D6312AA116069E68B968F9AED123" />
<ComponentRef Id="cmp1EEBF5BABE23C2C767438072E6410123" />
<ComponentRef Id="cmpCF5ECE8D2EADADA313278BA15AF99123" />
<ComponentRef Id="cmp599BAD3717C0FCEE410496C8E8066123" />
<ComponentRef Id="cmp0732D020141A27B3EF606680AF63C123" />
<ComponentRef Id="cmpA42846C9FB9AE5A84F07BCD1C1077123" />
<ComponentRef Id="cmpE88CBB7A43EF8781FD98762843CF1123" />
<ComponentRef Id="cmp0732D020141A27B3EF606680AF632123" />
</ComponentGroup>
</Fragment>
</Wix>
just fix the same problem by seperating the service control. do this
<ServiceControl Id="scStorageServiceReporter_Start"
Name="Dhcp"
Start="install"
Wait="no" />
<ServiceControl Id="scStorageServiceReporter_Stop"
Name="Dhcp"
Stop="uninstall"
Remove="uninstall"
Wait="yes" />
instead of this
<ServiceControl
Id="scStorageReporter"
Name="StorageReporterService"
Start="install"
Stop="both"
Remove="uninstall"
Wait="yes"/>
Looking at your snippet this may be a red herring, but I've seen this exact same error if your installer is also adding items to the GAC (which yours doesn't seem to be - hence the red herring). This is due to GAC'd components not being available until after the service control attempts to start the service. In this case the "permissions" message isn't accurate either!
You can try to rebuild the wix project. I got this issue too and rebuilding the project has fixed it.
In my particular case the problem was that the configuration *.config file that is used by my windows service was invalid, because of that the service could not be started. It took me a while to figure out what the problem was.
Maybe it will help someone.
You can get this error also because the application that starts running is throwing an exception soon after start. For example I got this error because I had Console.ReadKey in my code.
The best way to check if this is the case is to check your application logs. By default Windows Event Viewer won't have any helpful information.

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.