VS2012 Program Packaging Deployment Graphics and text _c# tutorial

Source: Internet
Author: User

After the program has been written and tested, the next thing we need to do is to package the deployment program, but the VS2012 is that there is no packaging tool. I don't know why Microsoft didn't integrate packaged tools into the development environment, but I knew there was always a solution.
After browsing the data found that VS2012 although no integrated packaging tools, but it provides us with the download port, we need to manually install a plugin InstallShield. There are a lot of third-party packaging tools on the Web, but why do you want to use Microsoft? Because the most primitive is also the most advanced, same.

One. NET program deployment mechanism

A little summary of the previous blog. NET program, the following is a few of the mechanisms for program deployment. There are three folders under the. NET package that are bin files, obj files, and my project files, which hold parts of the program separately.
The bin directory is used to store the compiled results of the program, it has debug and release two versions, the corresponding folders are Bin/debug and Bin/release, this folder is the default output path, the compiled program files will be stored in the directory. Of course, we can also manually modify the program's output path, modify the method: The Project Properties-> configuration Properties-> output path to modify.

The obj directory is used to hold the compilation results for each module to place intermediate files when the program is generated. The program does not directly generate the available files, but instead generates intermediate files from the source program, and then compiles the intermediate files to generate the executable files. In. NET, compilation is done in a module and is merged into one after the compilation is complete. DLL or. exe saved to the bin directory. Because the default is incremental compilation at each compile time, only the changed module is recompiled, and obj saves the compilation results for each module to speed up the compilation. Whether to use incremental compilation can be set by using the project Properties-> Configuration Properties-> Advanced-> Incremental compilation.
The My project directory defines the properties of your assembly, which is called the Project Properties folder. The AssemblyInfo class file in the directory that holds information about the assembly, such as the name, version, and so on, which typically corresponds to the data in the project Properties panel and does not need to be written manually.
After compiling the program, the source file of the program is not important, it is important that the components of the program, such as DLL, EXE, config, and so on, have the program component program to run normally. So we just need to package the components of the program when we publish the installer.

Second, InstallShield program packaging diagram

The VS2012 package tool is considered an assembly that is created in the same way as an assembly into a program solution when used. What we need to do is add the project. But for our first-time friends, we need to download and install the package tool in the first step. The specific installation method is no longer detailed and there is a lot of information on the web.
1, set up the installation assembly

After the InstallShield installation is complete, perform the following steps to right-click the solution--> add--> New Project--> Other project types--> installation and deployment, as shown below:


2, the release of the program

Be sure to select the publication before proceeding down, and set the Publish folder default path to the folder where the system is installed in the properties of the startup project.

3, set up the program installation information

Application information The main Setup program in the installation of some information about the program, such as: Program developers, program development Company, program installation icon and program introduction.

4, add Program Files

When you add a program file in step fourth in the following illustration, there are multiple options boxes, such as the main output, the source file, and so on, and the resulting mechanism and. NET program is the same as the compilation mechanism. The fifth part of the following illustration shows the UI. Master output, the package contains references to other layers that interact with the UI layer when the installation file is generated, but does not generate components that are not connected to the UI layer (the startup layer) and can only be added manually.

5, add the program's resource file

The program source file is the resource file that the program runs, also contains the source file of the program. This step can be omitted if you do not need to package the source files.


6, set up installation registration file

If a Third-party control is used in a developed program, it is often necessary to register it with the target system at installation time, and the same install also provides this functionality to the user. Install can set up the DLL file or OCX file registration, first to add the registered file, and then set the file installation properties to specify whether or not, set the following figure.


7, the design program opens the way

Application shortcuts program to open the way, install to provide users with two display forms, respectively, the win menu and desktop. The following illustration shows some of the attention items that are set up, and you can set the program's display icon at this stage.

8, set up the program to install the registry key

General applications do not need to consider the registry key for the program at installation time, this step can be set without setting.

9, set up the installation of the program installation view

According to their own needs of the design can be.



10, packaged environment

After you set up the above steps, our package basic setup is complete, but in some cases we often have to pack the. NET environment or other programs to run the Windows environment, install also for us to design a good environment packaging.

Be sure to note the name of the file when you choose the environment you want to package, usually by placing the environment installation package directly in the installation EXE. When we want to select a file named client, if I want to integrate the. NET Framework 4.0 Complete installation package into the EXE, I want to select the Microsoft. NET Framework 4.0 clinet then wait for vs to download the environment's installation package to the Assembly folder. Also be sure to note that the name behind the (Web Download) Bracket Content Description file is only a link, the installation requires a network download to complete the installation.

11, the release of the program

The above installation steps are completed to generate the solution. However, the generated files will be placed in the DVD-5 folder, you want to use the installation files must copy the entire folder or the installation will be wrong, so the content is cumbersome, and to the customer's installation experience is also very poor, there should be other solutions, yes, As shown in the following illustration, we will use the Singleimage installation package to integrate all the files into one Setup.exe, and only one Setup.exe will be required to install it again.


If our installation file does not have a packaged program to run the environment the above steps can be satisfied with only a Setup.exe can be required, but if you need to package the installation environment into the Setup.exe must also go through the steps of the following diagram.


All right, after the setup is complete, the next step is to build the solution or to generate only a single assembly, when the installation file is only one setup.exe, as shown below.

After the above steps have been completed, the program Packaging Basic setup is complete, and the next step is to build the solution. After the solution is built, a folder named Setup is generated under the Setup assembly, and the installation files are saved in the following directory. Install after generating the installation files, there will be Setup.exe and. msi two installation files, EXE files are installed boot files, the core file is MSI file, which contains the components of the program. Find the Setup.exe file and MSI file inside to install.

Finally, we should also emphasize that the install packaging tools do not inherit the Chinese environment, in its underlying language library does not have Chinese language, so the solution, assembly name, etc. related to the main output of the file should not be named in Chinese name, otherwise the following error will occur: " -7184:the FileName column of the file table includes characters that are not available on code page 1252, which is not found in code snippet 1252 and is related to file name Language library.

Same, Microsoft's install program packaging Tools Although more cumbersome to use, but the original is the most advanced, other packaging tools and it is not much worse than it.

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.