When creating an installer, you can easily add your own program to the system's right-click menu.

Source: Internet
Author: User

UseVisual Studio. NET 2003When creating an installer, you can easily add your own program to the system's right-click menu.

 

(Author: Tang Hong fa 2003-11-28)

Sometimes we need to add our programs to the system's right-click menu to help users start our programs. For example, add the self-created "My Resource Manager" to the system's right-click menu.



 

Implementation principle: when the program is installed, modify the user's Registry and add your own columns to the system menu.

 

When Visual Studio. NET 2003 is used to create an installer, it is very simple to implement this function. The procedure is as follows:

1. add an "installation project" to your project ".

How to add and install a project is not mentioned. It is well described in the help document.

2. In Solution Explorer, right-click your installation project and choose View> registry from the shortcut menu;

3. Click registry to enter the Registry Modification view.

4. In the "registry on the target computer" column on the left, right-click "hkey_classes_root", select "New Key" in the pop-up menu, and name it "*".

5. Right-click "*" and choose "New"> "item" from the pop-up menu. The name here is your choice. For example, "MyApp ".

6. Right-click "MyApp" and choose "New"> "string value" from the pop-up menu ". In this case, new items will appear in the window on the right. Delete the name automatically given by the system (right-click and select "delete" in the pop-up menu), and press Enter. Then, the name is automatically changed to "(default )". This step is important!

7. Right-click (default), find "value" in the "properties" view, and type "My Resource Manager ".

8. Right-click "MyApp" and choose "New"> "item" from the pop-up menu, and name it "command ".

9. Right-click "command" and choose "New"> "string value" from the context menu ". Change the name to "(default)" as in the previous step )". In the Property bar, set its "value" attribute to "[targetdir] [productname]". At first glance, we can see that pulling is to set its value as the location of your program on the target computer. This is also very important.

10. Finally, in order for the program to delete the information we added in the Registry during uninstallation, do not forget to set the "deleteratuninstall" attribute of "MyApp" to "true"

Okay, you're done! Generate your installation project and install it on your own. There is no problem!

We implemented this by adding our own program links to the pop-up menu when you right click the file. If you want to implement folder-specific or specific files, the methods are similar, the location of the modified registry is different. Try it on your own! Fun!

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.