通过用户输入进行WIX设置

我已经和WIX纠缠了一段时间了。我希望将程序安装在用户定义的位置,安装服务并在安装后启动程序。

首先,我的msi软件包不要求安装路径。

<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
  <Directory Id="ProgramFilesFolder">
    <Directory Id="INSTALLFOLDER" Name="Test" />
  </Directory>
</Directory>

有人可以告诉我如何使用更改安装路径来提示屏幕吗?

第二次取消我的服务时,出现一个错误,提示我错过了一些权限:

<File Id="FILE_Service" Source="$(var.Service.TargetPath)" />
    <ServiceInstall Id="INSTALL_Service"
                    Name="Servcie"
                    Description=""
                    Start="auto"
                    ErrorControl="normal"
                    Type="ownProcess"/>

    <ServiceControl Id="CONTROL_Service"
                          Name="Servcie"
                          Start="install"
                          Stop="both"
                          Remove="uninstall"
                          Wait="yes" />

有人可以告诉我如何以管理员权限启动我的服务吗?

安装的软件包中仅包含一个EXE文件,没有被引用。有人可以告诉我如何告诉WIX搜索参考并进行安装吗?

woliufeiyu 回答:通过用户输入进行WIX设置

WiX教程 :此处有点。您应该尝试WiX教程: https://www.firegiant.com/wix/tutorial/

链接 :这是我的WiX quick start tip answer-各种资源和提示,用于处理WiX和一般的部署。

请注意,如果您对MSI和设置没有什么经验,there are alternative deployment and package creation tools可能会帮助您更快,更可靠地进行设置。


具体答案 :以下是一些针对您具体问题的尝试答案:

  • Configurable installation directory(在页面下方)。本质上,您为功能元素设置了 ConfigurableDirectory 属性,以允许用户选择自定义安装目录(进入对话框,您可以通过选择{{3}来更改安装路径}):

    <Feature Id="FeatureDirectory" Title="FeatureDirectory" ConfigurableDirectory="MYCUSTOMDIR">
         <!-- your stuff here -->
    </Feature>
    
  • 主要升级安装目录 :您需要读回自定义目录以进行主要升级。方法如下:"Custom" installation。否则它将在主要升级期间恢复为默认设置。这是因为主要升级是卸载旧版本并(重新)安装新版本。

  • 文件 :要安装所有必需文件,您需要通过依赖性扫描来确定需要部署哪些文件才能使应用程序正常工作,然后添加将它们手动添加到您的软件包中(或使用heat.exe自动生成要包含的文件列表)。请参阅上面的快速入门链接以获取帮助,或参阅以下hello wix样式文章: The WiX toolset's "Remember Property" pattern

  • 服务权限 :如果您在UAC提升提示后安装安装程序,则应以管理员权限安装服务。它最有可能没有启动,因为缺少文件,因此损坏了依赖性。服务使用什么凭证来运行?本地系统?


模拟 :这是根据您需要的东西的快速模拟。您需要添加所有文件和依赖项,以及插入Service构造:

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
  <Product Id="*" Name="WiXSample" Language="1033" Version="1.0.0.0"
           Manufacturer="Someone" UpgradeCode="cb24bedf-e361-4f25-9a06-ac84ce5d6f5c">
    <Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />

    <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
    <MediaTemplate EmbedCab="yes" />

    <!--Default GUI - add reference to WixUIExtension.dll -->
    <UIRef Id="WixUI_Mondo" />

    <Feature Id="Core" Title="Core" Level="1" ConfigurableDirectory="INSTALLFOLDER" />

    <Directory Id="TARGETDIR" Name="SourceDir">
      <Directory Id="ProgramFilesFolder">
        <Directory Id="INSTALLFOLDER" Name="WiXSample">
          <Component Feature="Core">
            <File Source="D:\MyBinary.exe" />
          </Component>
        </Directory>
      </Directory>
    </Directory>
  </Product>

</Wix>
本文链接:https://www.f2er.com/3158696.html

大家都在问