首页 > 解决方案 > Wix - 如何在 MSI Uninstall 上卸载服务

问题描述

我希望你们今天特别开心,身体健康!我只需要一些 Wix 安装程序的帮助。我有一个使用 WIX 创建的 .msi 安装程序。安装程序还会安装一些 Windows 服务。安装 .msi 后,服务已安装并正常运行。但是在卸载/删除 .msi 时,服务不会被删除。以下是我正在使用的代码,如果我的代码有任何问题,请纠正我:

<Directory Id="serviceencrypt" Name="service-encryption">
  <Component Id="MyAppEncryption">
    <File
    Id="MyAppEncryptionEXE"
    Name="MyApp.Encryption.exe"
    DiskId="1"
    Source="$(var.MyAppInstallerFiles)\application\service-encryption\MyApp.Encryption.exe"
    Vital="yes"
    KeyPath="yes" />
    <ServiceInstall Id="MyAppEncryptionInstall" Type="ownProcess" Vital="yes"
            Name="MyAppEncryption" DisplayName="MyApp Encryption"
            Description="MyApp Encryption" Start="auto"
            ErrorControl="normal"
            Arguments=" action:run" Interactive="no"  Account="NT AUTHORITY\LocalService">
    </ServiceInstall>
    <ServiceControl Id="MyAppEncryptionStartService" Stop="both" Start="install" Remove="uninstall"
        Name="MyAppEncryption" Wait="yes" />
  </Component>
</Directory>

任何帮助都感激不尽。谢谢!

标签: wix

解决方案


推荐阅读