【问题标题】:Wix File property with user selected directory具有用户选择目录的 Wix 文件属性
【发布时间】:2017-04-27 23:47:16
【问题描述】:

我正在尝试使用 wix 安装 Windows 服务,但我似乎无法将服务文件指向用户选择的安装目录。

<Component Id="MyServiceInstaller_ServiceControl" Guid="B72CAA3F-F2DB-48D2-90DD-061209AB2CE5" Directory="INSTALLDIR">
        <CreateFolder />
        <File Id='MyServiceEXE' Name='MyService.exe' DiskId='1' Source='[INSTALLDIR]MyService.exe'  KeyPath='yes'/>
        <ServiceInstall Id="MyServiceInstaller_ServiceInstall"
            Type="ownProcess"
            Vital="yes"
            Name="My Service"                    
            DisplayName="My Service"
            Description="This will make windows services great again!"
            Start="auto"
            Account="NT AUTHORITY\LocalService"
            ErrorControl="ignore"
            Interactive="no" />
        <ServiceControl Id="MyServiceInstaller_ServiceInstall" 
            Name="My Service"
            Stop="both"
            Remove="uninstall"
            Wait="yes" />               
    </Component>

问题似乎是当我使用任何 [PROPERTY] 目录时出现以下错误。

错误 LGHT0103 : 系统找不到文件 '[INSTALLDIR]MyService.exe'。

如何告诉 Wix 使用用户选择的安装文件夹作为服务的路径?

【问题讨论】:

    标签: wix installation wix3


    【解决方案1】:

    File/@Source 指向构建环境中的文件。 Component/@Directory 告诉 Windows Installer 文件应该安装在哪里。它控制用于安装和控制服务的文件。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-03-05
      • 2011-02-26
      • 2021-04-22
      • 2023-02-02
      • 1970-01-01
      相关资源
      最近更新 更多