VS2010 (C #) Packaging WinForm Installer

Source: Internet
Author: User

1. Create a new Windows Forms application, such as a project named Monitor, with a slight function. Do not forget to create a solution when creating a new project.

2. On the monitor solution, "right-click"--"add"--"New Project", select "Other type of project"--"Install and deploy"--"Installation Project", and named "Setupmonitor",

After determining the display as shown

3. Add the necessary files: Right-click on the ' Application Folder ', add the configuration file that the application must have (if any), as well as icon (desktop Display icon, uninstall program icon ...). Also need to add a system EXE file Msiexec.exe (typically in the C:\WINNT\System32 directory) for uninstalling the program.

(1) on the left "application Folder", right click on "Add"--"project Output", select Monitor Project

(2) on the left "application Folder" right-click on "Add"-"File", select "C:" Windows "system32" Msiexec.exe "file.

(3) on the left "Application Folder" right click on "Add"--"file" and then select a few *.ico icon file

The following is displayed when finished

4. Create a shortcut

(1) "Shortcut", named StartMonitor, and in its property bar, select the icon you just imported for its "icon". and drag it to the user's program menu file.

(2) Desktop shortcut: Step with 1. Drag it under User desktop

(3) Uninstall shortcut: On Msiexec.exe, right-click on "Create Msiexec.exe shortcut" and name "Uninstall Monitor". Drag it to the user's Program menu file, which can also be placed on the desktop.

View Setupmonitor deployment Project Properties,

The property value has "{4ea38e9b-c4bf-4897-b095-e30160a27245}" similar to the typeface, select it "Copy".

Click your uninstall shortcut name again, "Uninstall Monitor", and then to the lower right corner of the property bar, there is a property bar called arguments, in the property bar first fill in "X" and then add a space, and then "paste", the ProductCode property value copy to this.

5. Packaging the. NET Framework

Select the properties of the Setupmonitor project, select Prerequisites in the dialog box, and in the dialog box that pops up, select Download prerequisites from the same location as my application to determine.

6. Generate

Right-click on the Setupmonitor project to select Build, the package succeeds and a Setupmonitor folder is generated in your solution folder, and the installation file is in this directory.

------------------------------Gorgeous split-line------------------------------------------------------------------------------------- -----

with WinRAR will be vs build the installer into a . EXE package (easy to install)--the premise is that it must be installed WinRAR compression Software

To step sixth, use thevsto beWinFormThe program is ready to be packaged, but at this point the installer'sDebugfolder Generation2folders,1a. EXEfiles and1a. msifiles, and. EXEinstallation, it is also dependent on the. msifile, and the other two folders are the corresponding. NET Frameworkcomponents,

This time to customers to install a copy of the past content more, but also easy to install errors, if you put these installation content together to form an. exe file, it is more convenient,

At this point, you can use the winrar self-extracting format to compress files to implement the process:

1> the files and folders to be hit are all selected, right → "Add to Compressed File", in the "General" tab of the open compression panel, tick "create self-extracting format compressed file", you will find the default compressed file name programming. EXE It is best to choose "save" so that the packaged program will quickly unzip and run.

2> Set the Run file: then switch to the "Advanced" tab, click on "Self-extracting options", "General" set the program to run after extracting files (this is very important)

3> Set the icon for the installer file:

Switch to "text and icons", click "Browse" button after "load self-extracting file icon from file", select the icon of the installer file,

Don't worry. Click "OK", there is the last setting ~ ~ ~

4> Switch to "mode", tick "unpack to temporary folder" and "Hide All", all the way click "OK", working Gaocheng!!

8, completed!

At this point we will see the following debugs :

"Test installer. exe" is the most generated packaging files, directly Click to run on the line!!


Below this no map, look below Baidu Library.
Reference:

Http://wenku.baidu.com/link?url= 1kw3w3xuzcaj7uao6bmwp9pejgs8agn7ypvxubwq9wuphbl-0aqyntvxdckfi0b5edxribetwxbsvjfa8b3tzlcuajkhuqno4tpjqw74aay

Http://www.cnblogs.com/dolphi/p/3476567.html

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.