The shortcut created by the winform package points to the wrong location (pointing to the installation package file)

Source: Internet
Author: User

In a developed winform project, use the package tool that comes with vs2008 to package it (set the shortcut menu). After installation, you will find that there is a problem with the target of the shortcut. (WinformProgramFor more information about the packaging process, see related resources on the network). Here I mainly want to describe the shortcut points to the problem after the package is installed.

1. Generate a file after Packaging

We all know that two files will be generated after packaging with the vs tool. One is the EXE file and the other is the MSI file.

It must be noted that the Windows Installer developed the program installation file in the MSI file allows you to install, modify, and uninstall the program you have installed, in other words, the MSI file generated by vs is the window installer package, which encapsulates all content related to the installation file in a package. The EXE file generated by the vs tool is mainly used to check the installation environment. When the installation environment check is successful, the MSI file will be automatically installed. Of course, there may be EXE files that can also be directly installed, but it is much more difficult to develop the EXE than the MSI, because you need to write and install, modify, and uninstall a lot of relevant content, however, MSI integrates these functions and is easy to develop Windows program installation packages.

2. Description of shortcuts

First, check the environment through the EXE generated by Vs and call the MSI file. After installation, right-click the shortcut image to find a strange problem:

You can find that the "Start address" and "target" of the shortcut are incorrect. In addition, there are also the following problems about the shortcut:

1. You can open the software by clicking the shortcut for the first time. However, a progress bar appears when a file is updated or deleted in the folder where the software is installed. (It can also be opened when the progress bar reaches 100% ).

2. After you delete the MSI file of the installation package and click "shortcut" again, the software cannot be opened. (Prompt: unable to access the installation package file MSI ).

Based on the above phenomenon, we can basically determine two points: (1) there is a problem with the shortcut pointing to the target settings. (2) The shortcut points to the MSI file.

As for the first point mentioned, I tested and found that when the program was started, I renamed or deleted a file in the installation path, the progress bar is displayed only when the shortcut is restarted from the MSI file to the installation path.

3. Problem Solving

Finally, I tried it several times and thought that there was a problem with the configuration during the package process, and no reason was found. There was no way to only need network resources, some friends on the network said that the shortcut created by vs is not standard, but is a problem with the installation package created by vs. However, you can modify the MSI file of the installation package created by.

The specific correction steps are as follows:

(1) download tool orca tool (MSI file editing tool) orcamis

(2) After installing orca, use Orca to open the MSI installation package, find the shourtcut table in the table list on the left, and find the desktop shortcut record in the record on the right, modify the target attribute of the record

[Targetdir#application name: .exe

(3) Save the modified MSI file and reinstall the generated shortcut to find the image and change the icon.

 

 

Copyright description

This document is a learning note. You are welcome to repost it and note itArticleSource. Its copyright belongs to the author and the blog Park.

Author: Charles Chen

Article Source: http://charles2008.cnblogs.com/or http://www.cnblogs.com/

 

 

 

Copyright description

This article is a study note. You are welcome to repost and indicate the source of the Article. Its copyright is shared by the author and the blog Park.

Author: Charles Chen

Article Source: http://charles2008.cnblogs.com/or http://www.cnblogs.com/

 

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.