How to write the selected installation path to the Registry in Visual Studio installation project

Source: Internet
Author: User

Right-click your project name and choose View> Registry (View> registry)
Under the primary key you need to write the registry, for example, the example of registering the Firefox plug-in is:

(1) Right-click HKEY_CURRENT_USER-> New-> key: Software

(2) Right-click Software-> New-> key: mozillaplugins

(3) Right-click mozillaplugins-> New-> key: @ ABC/DEF

(4) Right-click @ ABC/def-> New-> string value: path, and set the value to [targetdir] <your program name>. dll

[Targetdir] is the installation path. After installation, the installation path strength information is written to the Registry!

The operation result is as follows:

The following content is a summary of a Web page, see the reply on the second floor, very useful, turn over: http://bbs.csdn.net/topics/280062282

I.
1. add a new project to the solution of an existing project: Right-click solution and choose add> new project. In the Add project selection window, "project type" select "other project type" -- "installation and deployment", "template" select "Installation Project", and specify the name and location of the new project;
2. right-click the newly added installation project, select "View" -- "File System", and right-click "application folder" on the file system of the target computer ", select "add file" or "add project output" to add the file to this location;
3. initial installation location: on the "File System" interface, left-click "application folder" and find "defaultlocation" in the "properties" column. The default property value is: [programfilesfolder] [manufacturer] \ [productname]. This is the default installation location. If not, change it to this.
4. in addition, in solution manager, click the installation project you added, and in the "properties" Edit bar, enter your company name or text you want in [manufacturer], and enter your name for the project to be installed in [productname.
5. First generate your project in solution manager and then generate your installation project
6. in solution manager, right-click your installation project and select "Install" to install it on your development machine, there are two folders under bin in the path of your installation project: Debug and release,
7. in solution manager, right-click your installation project and select "properties". If "configuration" is "debug" in your project properties ", the installation file you generated is in debug. If "configuration" is "release" selected, the generated installation file is in release. of course, you can also modify the file name of your location and set other settings for your installation file.

II.
In solution manager, right-click the added "installation project" and select "View" -- "Registry ";
Under "registry on the target computer", the Registry has five primary key columns by default;
By default, [software] \ [manufacturer] branches are available under [HKEY_CURRENT_USER] and [hkey_current_machine]. If the [manufacturer] value is set in the properties of your installation project, after installation, [manufacturer] is replaced by a value. For example, the value of [manufacturer] is set to "Power Word ", after installation, a [Power Word] branch is created under [software;
By default, the AlwaysCreate attribute of [Manufacturer] is false. That is, if you do not have a project in [Manufacturer], [Manufacturer] is not created. If you need to create this key in any case, you can set its AlwaysCreate to true;
Follow the above method to create branch items and projects step by step in the primary key of the registry key you want to create, right-click the new registry project, select properties, and set the value of the registration item;
Whether you are creating a primary key branch or project, you can use the [] method to dynamically specify the Registry content to be added using system variables. For example:
[Manufacturer] stores the company value of the installation project,
[ProductName] stores the product name in the property of the installation project,
[TARGETDIR] stores the installation path selected by the user during installation,
[COMPANYNAME] stores the company name entered by the user during installation (if the user information installation interface is not set, the company name in the operating system is used ),
[USERNAME] stores the user name entered during installation (if the user information installation interface is not set, the user name in the operating system is used,
So on

If you want to have a registration code during installation, you can either create a DLL or EXE project by yourself, add it to the custom operation, and enter the registration code on the installation page, either use the UI provided by VS to install the project (add the "user information" installation interface in the view-user interface and set showserialnumber to true). However, the registration code is verified by mode 7, as long as it is a verification bit value and can be divisible by 7, it is the same as entering "1111111" when installing the Board office 97.

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.