The first step is to create a simple windows form application and name the project winformtest. The solution is winformsetup.
The second step is to add a button in the Form and add code to the button event. This is just a test.
namespace WinFormTest{ public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { MessageBox.Show("Hello Setup!"); } }} |
Step 3 is the focus. Add another project in another project type ==== installation and deployment === Visual Studio installer installation project, and then add the project name setuptest
Di
Step 4: You can see the following files after adding a project
Next, add three folders to the application folder.
The system folder of the test project is a common file of the project system, and the image file added by images is reserved as a backup.
Step 5 add project input in the test project system folder
Then add the primary output and click OK.
Step 6, right-click the project to generate a file.
Click setup.exe to install the winform application.
Click Next to complete the installation. However, we need to know the installation directory before opening the EXE file to open the project. So let's take a look at how to add shortcuts, now let's add a shortcut icon file in images.
Next, right-click winformtest (activity) in the main output to add a shortcut
Rename it winformtest, right-click the shortcut, and select the ICO file you just added in the ICO file.
You can place files on the desktop.
Then, the project is generated again to generate the installation file. Click "desktop shortcut" to open the project.
Create an installation file in