C # Add registry information during Winform packaging and deployment to enable startup

Source: Internet
Author: User

You can use the package module provided by VS to conveniently package and deploy the project. You can also perform registry operations during installation and deployment to enable software startup. The specific implementation is as follows:

You do not need to create, install, and deploy this part. After adding and installing a deployment project, right-click to install the project-> View-> registry to run the software on startup, you can add a key value to the Software Directory in HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionRun. Here we add the preceding items in sequence, and then add the key value in Run. The key name can be set by ourselves. The value must be the physical path of the software. The physical path is determined by the customer's deployment. How can we obtain it? Here we can use [TARGETDIR] to obtain the path selected by the customer, and add the software startup file name. For example, if the name of the software startup file is client.exe, the Value of the Value is: [targetdir1_client.exe. The installation project is generated. Find the setup.exe file in the bindirectory and run it. After installation, we can find the corresponding key value in the registry. Restarting the computer system will automatically run the software we set.
 

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.