WinForm Application packaging and deployment-simple version (graphics) (GO)

Source: Internet
Author: User

Developed a WinForm system so that it can run smoothly on operating systems that do not have the. NET Framework installed? This involves packaging and deploying the content, through packaging and deployment to form the installation program, the implementation of the WinForm application software is installed on the customer's operating system properly. On the other hand, we need to consider packaging and deployment to form an uninstall program, the application software uninstall, to facilitate customer use.

(i) Create a deployment project

  1. In the VS environment, click file → new → project, open the New Project dialog box, select Setup and Deployment project from the project type list, and select the desired deployment project type in the Templates list on the right side of the dialog box.


  2. Description of the template that can be used for the Winform application

    Project type

    Say   Clear

    Setup Project

    To create setup for Winform applications

    Web Setup Project

    Visual Studio.NET also supports deployment on Web servers. Installing files on a WEB server by using this method automatically handles issues related to registration and configuration

    Merge Module project

    Packages and components that can be shared by multiple applications. For example, if your application has five utility files, you can package them into a merge module project, and then merge them into any application

    Setup Wizard

    It is a wizard that guides the user through the steps of creating the installer quickly. You can customize the Setup Wizard to add more files or practice more controls during installation

    Cab Project

    Generate a Cab file for download to the Web browser

  3. After selecting "Setup Project", click OK to enter the configuration interface of the installation system files.

    left mouse button click on the "Application Folder", in the right side of the Open Interface right-click, in the Popup shortcut menu, select "Add", "File", in the Open File selection interface, add a folder specific files, such files mainly include two kinds:. EXE file or a. dll file. In general, when a C # WinForm application is developed under the Visual Studio2005 platform, both files are automatically generated under the Debug subfolder in the Bin folder in the directory where your WinForm application resides. EXE is an executable file, and the. dll file is the source of a user-defined edit class library file, or a third-party dynamic link library file, if there are two cases in your project, then please make sure to put these files together as a package file in. In fact, a relatively simple way is to put your WinForm application in the directory of the Bin folder inside the Debug subfolder below all the files are taken. If you have pictures or other multimedia files in your project, please also select them and put them in the file.

    Right-click "Application Folder", select the Properties window, in the pop-up Properties window, "[Manufacturer]" in the "DefaultLocation" property path, otherwise the installer default installation directory will be "C:\programm file \ your user name \ installation solution is called.

  4. In the right column, right-click, add "folder" and name the folder img, 8-7. The IMG folder stores all picture files for the system, and for the start and unload files, add the quick images separately to make the pre-preparation, the type must be. ICO file (icon file).

    Click on the new IMG folder on the left, and in the right-hand column, right button, add "file" and select two from your disk. ICO file (icon file).


  5. This step is critical for uninstalling the software system, if not added will fail to form the uninstall files you have installed. Right-click again in the right column to add "file", please find a file called Msiexec.exe under the C:\Windows\System32 folder, and add it to the application folder. The file will be responsible for uninstalling the software you installed.

  6. This step adds the system. NET Framework components to the application file, and if you do not do this, the system will not run even if you have installed your application software for an operating system that does not have the. NET Framework components installed. Open Solution Manager, right-click your project name, select Properties: In the Properties page that opens, choose prerequisites. Select both the. Net FrameWork3.5 component Package and the Windows Installer3.1 component package.


  7. At this point, we have completed the addition of all the files in the application folder. Then start configuring the user's program menu in the left navigation bar. The menu will appear in the "Programs" section of the operating system "start". Therefore, it is recommended to appear as a folder, which contains the execution program and uninstall the program two executable files shortcut files. left mouse button click on the "User's Program Menu", in the right navigation column in the blank space right click, add folder, we give this folder named "Diablo three". Right-click in the Diablo III folder and select Create new shortcut. In the Create New shortcut window that opens, select the executable file (. exe file) in the application folder. These two files are (project executables) and Msiexec.exe (Unload software project executables).

    Modify the shortcut to the appropriate name.


  8. We then complete the icon configuration work for the shortcut. Right-click the shortcut file, select "Properties Window" from the pop-up menu, configure the Icon property in the Properties window, and select Browse.


  9. Now complete the configuration work for the uninstall file registry. Click the Setup project and you will see that the ProductCode property appears in the Properties window, which is the registration number for the project operating system registry file and copies the number. Right click on "Uninstall" Diablo three "shortcut file, pop-up menu select the Properties window, copy the registration number just copied to the Arguments attribute, and make the following changes: The case will be:/x {8D 68B7AD-9626-41A7-9A9E-524928B50DA1}. The way to configure desktop shortcuts and icons is similar to the above steps, so there's no more talking about it.


  10. Finally, select the menu "Build" and run "build solution" to see the output installation package file under the target output path.


  11. Run the Setup.exe file and you can install your software to any computer. The desktop shortcut and the program section in the Start column run the file. Of course, you do "Uninstall", you can also complete the uninstallation of the software work.

WinForm Application packaging and deployment-simple version (graphics) (GO)

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.