How to package a Windows Forms program into an installation package

Source: Internet
Author: User

http://blog.csdn.net/xyy410874116/article/details/6341787

To package a Windows Forms program as an installation package:
Specific operation in: http://hi.baidu.com/415210413/blog/item/15b9e0351cb69b5b241f141e.html

1 New Installation Deployment project

Open VS, click New Project, select: Install and deploy with other Project Types Installation Wizard (same as installation project), then click OK.

2 Installation Wizard

After closing, open the Installation Wizard, click Next, or click Done directly.

3 Start making

After the installation wizard is complete, you can go to the project folder:


PS: Here, a lot of friends ask me, what is the application executable file and the corresponding class library and component, here I explain, the application executable is that you build the WinForm Application project final generated exe executable file, and the corresponding class library is to execute this EXE file all the required non-operating system DLL files, here as long as the EXE file is selected to add, VS will automatically use it to add the DLL file. (Here you can select release in the Application project, then build, add the files under the Bin/release folder by structure)


Double-click the "Application Folder" right-click on the right-hand side of the box, choose Add-file, add the executable file of your application and the corresponding class library and components. Then right-click your file, create a shortcut, and then copy or cut the shortcut to the left of the user's Programs menu and user desktop. This creates a shortcut to the program on Start, all programs, and on the desktop when the Setup program is complete. You can also create a new shortcut directly in the "User's program menu" and "User desktop" corresponding directory, and then navigate to your file.

Then right-click the application folder on the left to open the Properties dialog box: Remove the "[Manufacturer]" in the path to the "DefaultLocation" in the property, otherwise the installer default installation directory would be "C:/Program files/ Your username/installation solution name ";

Then open Solution Manager, right-click your solution Name, select Properties: Open the Properties page, select Prerequisites, on the prerequisites page that opens, in specify the location of the prerequisite installation component, select the following: Download the prerequisites from the same location as my application. When selected, it is included in the generated installation package. NETFramework components. OK, so finish 99%, then click "Build---Build Solution", ha, build success!

4 Production completed

Now that you have opened the Debug folder under the Solution folder, you can see the resulting installation files.

5 about the addition of the uninstall feature

The above only introduces a simple way to build the installation, but under the VS2005 does not directly generate the function of the uninstaller, so we have to use the MSI to implement, the Operation method is as follows:

When adding your application project, add a Msiexec.exe to go in, this file in the C:/windows/system32 folder, add in, in order to make him more like an uninstall program, change his name to "Uninstall.exe", Of course, this relationship is not very big, change is OK.

Then create a shortcut, put in "Start-Program", the next thing we want to do is to find the ProductCode of the deployment project, the left mouse click on the project name, remember is left-click, and then click on the Properties tab, Note: Not right-click on the property, the difference is very large, Then you can see the ProductCode.

Then open the Properties dialog box for the shortcut you created, enter "/x {ProductCode}" in the Aguements property, and then click "Build Solution" to build the installer with the uninstall feature.

How to package a Windows Forms program into an installation package

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.