Building a Windows Setup Project gives many Setup files

446 Views Asked by At

I did the following steps to create a Windows Setup project:

  1. Create a Windows Forms Application using Visual Studio
  2. Install "Microsoft Visual Studio Installer Projects plugin"
  3. Add a "Setup Project" to the solution
  4. In the "Application Folder", add project output

(Steps 5 and 6 are optional)

  1. By right clicking the Setup project and opening "Properties", select "Prerequisites"
  2. Select "Download prerequisites from the same location as my application"
  3. Build the solution.

After all these steps, I see many files (Setup.exe, Setup.msi, NETFX472 folder) in the Release folder. But I only want one simple self-contained setup file. So, users can run the setup file and install the application easily.

How can I make a simple and self-contained Setup file for my project?

I know it's possible, but I am looking for an easier and more efficient way to do it.

I know I can create another Windows Forms app called Setup which copies the project outputs to user's Program Files directory and copy the output files one-by-one. But I don't think that solution is elegant.

EDIT: After more tries, I learned that Setup.exe is for installing dependencies (only .NET Framework 4.7.2 for my case) and then running Setup.msi. So, without Setup.msi file, Setup.exe is nothing and vice-versa.
Also, I want my program should work 100% offline (including setup). So, installer should include offline .NET Framework 4.7.2 installer.
What I don't want here is Setup.exe to only install dependencies. It should also install my program. So, it should do also whatever Setup.msi file does. Second thing I don't want is dependency installer as separate file (offline .NET Framework 4.7.2 installer in this case). It should also be embedded into Setup.exe.

0

There are 0 best solutions below