Windows service not getting installed on major upgrade-WIX

て烟熏妆下的殇ゞ 提交于 2019-12-13 21:03:37

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!