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.
Anyone?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
上面的答案并没有说明如何自定义序列号验证,毕竟如果只输入序列号而不验证是没有意义的。
我们必须在自定义操作的 CustomActionData 属性中添加以下文本:
然后您可以使用下面的代码来获取并验证自定义操作项目中输入的序列号:
相关链接:
http://msdn.microsoft.com/en-US/library/vstudio/8z9h65a3(v=vs.100).aspx
http://msdn.microsoft.com/en-US/library/vstudio/aa370826(v=vs. 100).aspx
如何构建自定义操作项目:
http://msdn.microsoft.com/en-US/library/vstudio/d9k65z2d(v=vs.100).aspx
Above answers did not explain how to customize the serial number verification, after all, it is meaningless if you just enter the serial number but does not validate it.
We must add the following text at CustomActionData property of Custom Action:
You can then use below code to obtain and verify the serial number of input in Custom Action Project:
Related links:
http://msdn.microsoft.com/en-US/library/vstudio/8z9h65a3(v=vs.100).aspx
http://msdn.microsoft.com/en-US/library/vstudio/aa370826(v=vs.100).aspx
How to build a Custom Action Project:
http://msdn.microsoft.com/en-US/library/vstudio/d9k65z2d(v=vs.100).aspx
我实在不知道你的问题是什么。 是的,“序列号模板”允许您向安装程序添加一个表单,用于验证用户是否输入了有效的序列号以及安装是否有权继续进行。
它提供了基本内容屏蔽编辑控件,允许您定义应用程序接受的序列号格式。您指定一个模板,该模板定义序列号被视为有效所需的字符模式。该模板用于在对话框上排列这些文本框以及进行验证。 (请参阅 MSDN 上的文档。)
以下字符被接受为模板的一部分以及您输入的任何其他字符都将被视为文字:
如上所示,在模板中指定带有
%
的数字表示应根据 Windows Installer 验证算法对它们进行检查。这实际上是将所有检查的数字相加并除以七。如果余数为零,则该数字有效;否则,就不是。这不是一个特别强大的安全措施,因为该算法非常知名,但它提供了一种简单的方法来减少用户输入序列号时出现转录错误的可能性。例如,如果您使用模板
<###-%%%%%%% - FOO - %%%>
,您将看到以下对话框:(无耻地从 Griffiths 的掌握 Visual Studio .NET 中盗用,等)
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.
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:
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.For example, if you used the template
<###-%%%%%%% - FOO - %%%>
, you would get this dialog:(shamelessly stolen from Mastering Visual Studio .NET by Griffiths, et. al.)
该特定设置的文档位于 http://msdn.microsoft.com/en- us/library/w3xwh311.aspx
有关验证序列号的(有点旧)知识库文章位于 http://support.microsoft.com/kb/253683/en-us
Documentation for that particular setting is at http://msdn.microsoft.com/en-us/library/w3xwh311.aspx
A (somewhat old) knowledge base article on validating serial numbers is at http://support.microsoft.com/kb/253683/en-us