Error : Creating new installer using WiX toolset, for windows service. Not able to install the service. Getting an error
Error screenshot
Environment
- Microsoft visual studio 2017
- Windows 7
- WiX toolset v3 : Setup project for MSI
Problem/Goal
I want to create a MSI which installs a Windows service.
On Install :
Windows service gets installed and visible in services.msc
On UnInstall:
Stop and Remove the service.
My windows service has lot of dependencies which are to be used when running the service.
I have added all the files as component and added ServiceDependency for each of the component ID also, but still not able to resolve the error. The error in the event viewer is also the same as the above screenshot.
Any pointers are most welcome.
My Code
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<MediaTemplate EmbedCab="yes" />
<Feature Id="ProductFeature" Title="LayoutSwitcher" Level="1">
<ComponentGroupRef Id="ProductComponents" />
</Feature>
</Product>
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLFOLDER" Name="LayoutSwitcher" />
</Directory>
</Directory>
</Fragment>
<Fragment>
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
<Component Id="PlcmLayoutSwitcherWinSvc.exe" Guid="PUT_GUID_HERE" KeyPath="yes">
<File Id="LayoutSwitcherWinSvc.exe"
Name="LayoutSwitcherWinSvc.exe" Source="$(var.LayoutSwitcherWinSvc_TargetDir)LayoutSwitcherWinSvc.exe" />
<CreateFolder />
<ServiceInstall Id="LayoutSwitcher" Type="ownProcess" Vital="yes"
Name="LayoutSwitcher" DisplayName="LayoutSwitcher"
Description="LayoutSwitcher" Start="auto" Account="NT AUTHORITY\LocalSystem"
ErrorControl="ignore" Interactive="no">
<ServiceControl Id="StartService" Start="install" Stop="both"
Remove="uninstall" Name="LayoutSwitcher" Wait="yes" />
</Component>
<Component Id="logoicon.ico" Guid="PUT_GUID_HERE">
<File Id="logoicon.ico" Name="logoicon.ico" Source="$(var.LayoutSwitcherWinSvc_ProjectDir)logoicon.ico" />
</Component>
<Component Id="LayoutSwitcherWinSvc.exe.config" Guid="PUT_GUID_HERE">
<File Id="LayoutSwitcherWinSvc.exe.config" Name="LayoutSwitcherWinSvc.exe.config" Source="$(var.LayoutSwitcherWinSvc_TargetDir)LayoutSwitcherWinSvc.exe.config" />
</Component>
<Component Id="Transactions.dll" Guid="PUT_GUID_HERE">
<File Id="Transactions.dll" Name="Transactions.dll" Source="$(var.LayoutSwitcherWinSvc_TargetDir)Transactions.dll" />
</Component>
<Component Id="Transactions.Cfg.dll" Guid="PUT_GUID_HERE">
<File Id=" Transactions.Cfg.dll" Name="Transactions.Cfg.dll" Source="$(var.LayoutSwitcherWinSvc_TargetDir) Transactions.Cfg.dll" />
</Component>
EDIT :1
Updated the source code after removing the service dependency, but still getting the same error.
EDIT :2
Removed the whitespaces, but still getting the same error.
EDIT :3
Verbose logs attached. Please download from the below link.
http://www.yourfilelink.com/get.php?fid=1432133