Use the Advanced Installer software to package the winform program into an exe installation file

  When using VS to write c# code, it is generally possible to double-click the exe file in the debug file to execute it, but sometimes you need to send this exe file to others for use. The exe file can be executed on your own computer, but on other people’s computer Sometimes an error will be reported after opening, indicating that the .neta operating environment is missing, and the .net environment needs to be downloaded separately.
  So I thought about whether I can send an installation package directly when I want to send a program to others. No matter what the system is, the installation package will automatically download the required .net environment during installation, and VS does not provide the function of directly generating the exe installation file by default. I searched the Internet for a long time, and finally found a convenient and easy-to-use software Advanced Installer, which can directly package the exe file generated by vs and the required environment into an exw installation package. Software download link https://download.csdn.net/download/qq_20222919/87780646
  The following demonstrates how to use the Advanced Installer software to send and package the exe file generated by C#. First download the Advanced Installer software, and then unzip it.
insert image description here
  This software can be used directly after decompression without installation. After the software is ready, start preparing the C# files to be packaged.
insert image description here
  Here is an example of a simple test sub-window pop-up to demonstrate.
insert image description here

  In VS point generate – generate solution.
insert image description here
  At this time, three files will be generated in the debug folder. Next, use the Advanced Installer software to package the exe executable file. Open the Advanced Installer software.

insert image description here
  After opening, select New, select .NET application in the template on the right, and then click Create Project in the lower right corner.
insert image description here
  Fill in the application name and organization name in the pop-up interface.
insert image description here
  The name of this application is the name of the directory where the exe executable file is located after the final installation is completed, and the name of this organization is the name of the folder on the upper level. Fill it in here according to your own situation.
insert image description here
  Select the next page after filling out.
insert image description here
  Select the type of installation package, here select the exe installation file. Then click Next.
insert image description here
  Select the path where the installation package is generated, and click Next. Here you need to add the path of the exe file that needs to be packaged.
insert image description here
  The path here is to select the debug directory where C# generated the exe file just now.
insert image description here
  After selecting the directory, click Next.
insert image description here
  Go ahead and click on the next page.
insert image description here
  Go ahead and click on the next page.
insert image description here
  Here, select the minimum version and installation system of .net installation. If you want to be compatible with more systems, choose a lower version of .net.
insert image description here
  The supported operating system can also be selected according to the actual situation, and
insert image description here
  then click the next page after setting.
  branch
  Set the highest version of .net supported here, and generally use the default value. Click on the next page.

insert image description here
  Click directly
insert image description here
  on the next page to select the installation interface, and choose according to the situation. After selecting, click Next.
insert image description here
  Select the installation language and click Next.
insert image description here
  Add the license agreement, you can ignore it here, just click the next page.
insert image description here
  Click here to finish. At this point, the exe installation package file will be automatically generated.
insert image description here
  The prompt box at the bottom shows that the construction is complete, which means that the installation package file has been generated. Go directly to the installation package generation directory to find the generated installation file.
insert image description here

  At this point, the code written in C# has been packaged into an installation file. At this time, you can close the Advanced Installer software.

  Next, verify whether the installation file can be installed normally, and click the my_test.exe file directly to install it.
insert image description here

  This installation interface is the interface selected when packaging just now.

insert image description here
  This installation path is also the path set in the packaging interface just now, just click Next.
insert image description here
  Click Install
insert image description here
  After the installation is complete, you can open the installation directory to view the installed files.
insert image description here
  Double-click the exe file to open and run it.
insert image description here
  This has the same effect as running in vs, indicating that the program has been installed successfully. If you want to uninstall the program, just go to the control panel to uninstall it.
insert image description here

Guess you like

Origin blog.csdn.net/qq_20222919/article/details/130666701