简体   繁体   English

如何在Windows Installer中更改自定义文件夹的路径?

[英]How to change the path of custom folder in windows installer?

In my project's installer file I have added a custom folder in the file system. 在项目的安装程序文件中,我在文件系统中添加了一个自定义文件夹。 I want this folder to be created at the time of installation with the data added to it. 我希望在安装时创建此文件夹,并添加数据。 My problem is the path of this folder would be decided at the time of installation, so, I want to consume its "Property" property to change this path. 我的问题是此文件夹的路径将在安装时确定,因此,我想使用其“属性”属性来更改此路径。 But I am not sure how to use this property in the code. 但是我不确定如何在代码中使用此属性。 Here is the msdn link for the property. 是该属性的msdn链接。 Can you please suggest how to consume this in the code and change the path. 您能否在代码中建议如何使用它并更改路径。 Also looking forward for some small code example or references. 也期待一些小的代码示例或参考。

To do it, you need to use Public Properties. 为此,您需要使用公共属性。 Just in table Directory set name of directory with uppercase letters, for example CUSTOMDIR, and during installation transfer this property with command line: 在表Directory中,使用大写字母(例如CUSTOMDIR)设置目录名称,并在安装过程中通过命令行传输此属性:

msiexec /i installer.msi CUSTOMDIR="C:\temp"

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

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