【发布时间】:2017-07-02 21:28:52
【问题描述】:
我有一个 Windows 应用程序类,我在其中定义了我的 Windows 服务,我需要从中生成一个 .msi(安装程序)。 到目前为止我所做的是:在 Visual Studio Enterprise 2017 中创建一个新项目 - 该项目的类型为 Wix v3 的安装项目(来自 Wix 工具集);在这个项目中,我默认有 References 和 Product.wxs。从 Add References, Projects 中,我添加了 Service 项目。
我发现的一个消息来源说,所需要的只是添加
Source="$(var.MyApplication.TargetPath)" />
如此处所示: http://wixtoolset.org/documentation/manual/v3/votive/authoring_first_votive_project.html
...但这对我不起作用,因为:
未定义的预处理器变量 $(var.MyApplication.TargetPath)
我不知道在哪里定义这个变量,这个路径的含义是什么。 摘录在这里:
<Fragment>
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
<!-- TODO: Remove the comments around this Component element and the ComponentRef below in order to add resources to this installer. -->
<Component Id="ProductComponent">
<!-- TODO: Insert files, registry keys, and other resources here. -->
<File Source = "$(var.MyApplication.TargetPath)"/>
</Component>
</ComponentGroup>
有什么想法吗?
谢谢。 这是除 File Source 行之外的所有自动生成的代码。也不知道我应该为 INSTALLFOLDER 添加什么以及语法应该是什么。 目的是从我的 Windows 服务生成 .msi
【问题讨论】:
-
考虑尝试InnoSetup。它可能比处理 Wix 项目更快、更容易,而且肯定比投资 InstallShield 便宜。
标签: c# wix windows-installer