.NET安装项目:如何通过多个CustomActionData领域多个、领域、项目、NET

由网友(手插口袋谁都不爱)分享简介:在一个.NET安装项目,就可以在安装向导中添加一个或多个自定义屏幕,用字段(如文本框),用户可以输入其他安装参数。In a .net "Setup Project", it is possible to add one or more custom screens in the setup wizard, with...

在一个.NET安装项目,就可以在安装向导中添加一个或多个自定义屏幕,用字段(如文本框),用户可以输入其他安装参数。

In a .net "Setup Project", it is possible to add one or more custom screens in the setup wizard, with fields (e.g. text boxes) where the user can enter additional installation parameters.

自定义字段可以被传递到自定义操作类库项目,来处理用户领域。下图显示了如何将财产服务器名称被映射到EDITB1文本字段:

A custom field can then be passed to a "Custom Action" class library project, to handle the user field. The image below shows how the property "ServerName" gets mapped to the EDITB1 text field:

在自定义操作类,访问该属性如下:

Within the Custom Action class, the property is accessed as follows:

string serverName = Context.Parameters["ServerName"];

问:一个人如何可以指定多个属性(多个文本框)的自定义操作

Question: how can one specify multiple properties (for multiple text boxes) to the Custom Action?

推荐答案

根据该的文档 CustomActionData 关于传递多个值:

As per the documentation for CustomActionData regarding passing multiple values:

多个值必须用一个空格隔开。如果值中有空格,它必须用引号括起来:/名称=值

Multiple values must be separated by a single space: /name1=value1 /name2=value2. If the value has a space in it, it must be surrounded by quotation marks: /name="a value"