Visual Studio的安装项目 [英] Setup Project for Visual Studio

查看:120
本文介绍了Visual Studio的安装项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我右键单击安装项目,然后转到用户界面".

If I right click the setup project and go to "User Interface".

我们将看到开始".如果我右键单击并选择添加对话框"

We will see "Start". if I right click and choose "Add Dialog"

在添加"对话框中,选择客户信息"

At Add Dialog, Choose "Customer Information"

如果我转到客户信息"的属性,则有一个名为序列号模板"的标签.

If I go to the properties of "Customer Information", there is a tab called "Serial Number Template".

用于检查在安装程序时是否键入了正确的数字.

It is to check whether the correct number is typed in when the program is installed.

我不确定它是如何工作的.

I m not sure how does it work.

有人吗?

推荐答案

我真的不知道您的问题是什么. 是的,序列号模板"使您可以向安装程序中添加一个表单,以验证用户是否输入了有效的序列号以及是否有权进行安装.

I don't really know what your question is. Yes, the "Serial Number Template" allows you to add a form to your setup program that verifies whether the user has entered a valid serial number and if the installation is authorized to proceed.

它提供了本质上是掩蔽的编辑控件,使您可以定义应用程序接受的序列号格式.您可以指定一个模板,该模板定义将序列号视为有效所必需的字符模式.该模板用于在对话框上排列这些文本框以及进行验证. (请参阅MSDN上的文档.)

It provides what is essentially a masked edit control that allows you to define the format of serial numbers that your application accepts. You specify a template that defines the pattern of characters required for the serial number to be considered valid. The template is used to arrange these text boxes on the dialog as well as for validation. (See the documentation on MSDN.)

以下字符被接受为模板的一部分,而您输入的任何其他字符均被视为文字:

The following characters are accepted as part of the template, and any other characters that you enter are treated as literals:

# 需要一个不会包含在验证算法中的数字.

#   Requires a digit that will not be included in the validation algorithm.

 需要一个数字将是 包含在验证算法中.

%   Requires a digit that will be included in the validation algorithm.

? 需要字母数字字符 不会包含在 验证算法.

?   Requires an alphanumeric character that will not be included in the validation algorithm.

^  需要大写或小写 特点.数字不是 在这里有效.

^   Requires an uppercase or lowercase character. Numeric digits are not valid here.

<  左边的任何字符 此字符在以下位置将不可见 对话框.

<   Any characters to the left of this character will not be visible in the dialog box.

>  右边的任何字符 此字符在以下位置将不可见 对话框.作为必填项 如果<使用了字符.

>   Any characters to the right of this character will not be visible in the dialog box. Required as a terminator if the < character is used.

如上所示,在模板中用%指定数字表示应对照Windows Installer验证算法进行检查.这实际上将所有校验位相加,然后将它们除以7.如果余数为零,则该数字有效;否则为零.否则,事实并非如此.这不是一种特别强大的安全措施,因为该算法是众所周知的,但是它提供了一种简便的方法来减少用户键入序列号时出现抄写错误的机会.

As shown above, specifying digits with a % in the template indicates that they should be checked against the Windows Installer validation algorithm. This essentially adds up all of the checked digits and divides them by seven. If the remainder is zero, the number is valid; otherwise, it is not. This is not a particularly strong security measure, as the algorithm is quite well-known, but it provides an easy way to reduce the chances of a transcription error when the user types in a serial number.

例如,如果您使用模板<###-%%%%%%% - FOO - %%%>,则会显示以下对话框:
(从Griffiths的 Mastering Visual Studio .NET 中被无耻地偷走了,等)

For example, if you used the template <###-%%%%%%% - FOO - %%%>, you would get this dialog:
(shamelessly stolen from Mastering Visual Studio .NET by Griffiths, et. al.)

这篇关于Visual Studio的安装项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆