简体   繁体   English

Wix Toolset将安装路径写入文件

[英]Wix Toolset write installation path to file

I created a .msi installer that copies some files in a chosen directory. 我创建了一个.msi安装程序,该安装程序将一些文件复制到所选目录中。 I have one .properties file with hard coded path strings that are used in the application. 我有一个.properties文件,其中包含在应用程序中使用的硬编码的路径字符串。 How can I write the installation path in the .properties file that is provided by the installation so that the application can get the written installation path from the .properties file at runtime. 如何在安装提供的.properties文件中写入安装路径,以便应用程序可以在运行时从.properties文件获取书面的安装路径。

It is important that the installation path is written to a file that will be installed by the installer. 重要的是将安装路径写入将由安装程序安装的文件。 A registry setting with the installation directory will not be suitable. 具有安装目录的注册表设置将不合适。

You can create a custom action that runs (after the files were moved to their final location) that edits\\rewrites the properties file to include the new paths. 您可以创建一个自定义操作,该操作运行(在文件移至其最终位置之后),该操作将编辑\\重写属性文件以包括新路径。

Creating a custom action: http://wixtoolset.org/documentation/manual/v3/wixdev/extensions/authoring_custom_actions.html 创建自定义操作: http : //wixtoolset.org/documentation/manual/v3/wixdev/extensions/authoring_custom_actions.html

(You can pass the filename as parameter to the custom action: https://stackoverflow.com/a/10953940/1632576 ) (您可以将文件名作为参数传递给自定义操作: https : //stackoverflow.com/a/10953940/1632576

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM