【问题标题】:Stop service at uninstall on Win 7 with UAC on from WIX从 WIX 使用 UAC 在 Win 7 上卸载时停止服务
【发布时间】:2009-12-23 07:27:42
【问题描述】:

如何在 Win7 或 Vista 中使用 UAC 从 WIX 卸载时停止我的服务? 当我在 Win7 或 Vista 中使用 UAC 从控制面板卸载我的服务时,我总是收到“文件正在使用消息”。我怎样才能阻止它以使该消息不会出现? 我在 Wix 中有这段代码:

     <ServiceInstall Id='MyServiceInstall' DisplayName='OnPremises Gateway' Name='OPGatewayService'
  ErrorControl='normal' Start='auto' Type='ownProcess' Vital='yes' Account='NT AUTHORITY\NetworkService'   />
          <ServiceControl Id="StartOPGatewayServiceControl" Name="OPGatewayService" Wait="no" Start="install"  />
          <ServiceControl Id="StopOPGatewayServiceControl" Name="OPGatewayService" Stop="both" Wait="yes" Remove="uninstall"/>

谢谢你, 阿德里安娜

【问题讨论】:

    标签: wix windows-services installation wix3


    【解决方案1】:

    不幸的是,“正在使用的文件”检测很早。查看有关他们交互的 MSI SDK 文档:http://msdn.microsoft.com/en-us/library/aa372466(VS.85).aspx

    【讨论】:

      【解决方案2】:

      在对此进行更多调查后,解决方案是在卸载时使用一个程序(如 Uninstall.exe),该程序需要用户的管理员权限才能执行任何暗示系统更改的操作(如停止服务)。并从该程序运行 MsiExec.exe /X[MsiProductId]

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2018-10-28
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2017-06-10
        • 2011-06-03
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多