问题
I have my service installed on the machine by an msi package(WIX). But when an major upgrade is done,service gets uninstalled but it doesnt get installed.
This is my code:
<Component Id="abc" Guid="{E64A8CDD-816F-4544-9ACD-A2E367F7758A}">
<File Id="EventTraceService.exe" Source="..\..\..\..\Products\abc.exe" Vital="yes" KeyPath ="yes"/>
<File Source="..\..\..\..\Products\abc.exe.config" Vital="yes" />
<ServiceInstall
Id="ServiceInstaller"
Type="ownProcess"
Vital="yes"
Name="abc"
DisplayName="abc"
Description="Monitoring and management of Trace"
Start="auto"
Account="LocalSystem"
Interactive="yes"
ErrorControl="normal"
/>
<ServiceControl Id="StartService" Start="install" Stop="uninstall" Remove="uninstall" Name="abc" Wait="yes" />
Thanks in advance!
回答1:
One possible explanation is that you changed the GUID of the component. As a result, (the different versions of) the same resources are being managed by different components.
From the windows installer documentation about what happens when the component rules are broken:
An author includes the same resource in two different components.
If two components have a resource under the same name and location and both components are installed into the same folder, then the removal of either component removes the common resource, which damages the remaining component.
- Uninstalling either component removes the resource and breaks the other component.
- The component reference-counting mechanism is damaged.
This seems to match your symptom.
回答2:
If the service EXE has the same version in both packages, this happens because of the file versioning rules. Here is an article with more details: http://setupanddeployment.com/windows-installer-bugs/missing-files-upgrade/
来源:https://stackoverflow.com/questions/10350077/windows-service-not-getting-installed-on-major-upgrade-wix