Use Microsoft Visual Studio to create an installation package

Source: Internet
Author: User
Previously, due to work needs, we need to study the installation package creation process. In addition to professional installation package creation tools, Visual Studio itself also comes with the installation package creation function, which is simple and clear to use. More importantly, if Visual Studio is installed, the tool is automatically available. The following is a tutorial from Google. record it.

The Setup Project in Visual Studio. NET can help you package your. NET application into an msi installer. The following describes how to add methods for users to enter personal information and registration codes in the installation program, and how to program the methods for obtaining the data.

[How to have users enter personal information and registration code in the MSI installer]
1) create a Project: in the "New Project" dialog box, select Setup Project in "Setup and Deployment Projects.
2) Add a file:
A) after the project is created, right-click the project root node and select "View-> File System" from the context menu"
B) In the pop-up "File System" window, right-click Application Folder and choose "Add-> Files ...", Add your exe, dll files, and other resource files.
3) add Customer Information dialog box:
A) Right-click the project root node and choose View> User Interface from the context menu"
B) In the pop-up "User Interface" window, right-click "Install-> Start" and select "Add Dialog" in the pop-up menu"
C) In the "Add Dialog" window that appears, select Customer Information.
In this step, the system prompts you to enter Name, Organization, and Serial Number when the installer is running.

[How to read the personal information and registration code entered by the user through programming]
The preceding three data items will be stored in the HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Windows \ CurrentVersion \ Installer \ UserData key value of the registry after the committed is installed, you can search for the sub-keys of your product based on ProductCode. The ProductCode can be viewed in the Project Properties of the installation project. It is a GUID. Name, Organization, and Serial Number are stored in RegOwner, RegCompany, and ProductID, respectively, and can be directly read.

In addition, you can read this information when the installation is not completed. For details, refer to the description of the System. Configuration. Install. Installer class in MSDN.

PS: According to my memory, when creating the installation package and entering the password, it seems that the # code is used as the password, that is, when the password is actually entered, the password is verified only when a code word exists at the position. In addition, it seems that the verification mechanism is to add the number at the # position to check whether it is an integer multiple of 7.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.