1

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.

5
  • Installing a badly outdated .NET Framework version is not a good idea. Commented Dec 21, 2022 at 21:37
  • Search for wix toolset. Msi is the setup itself, to have all things like c++ runtime bundled next to the Msi use exe bootstrapper from wix toolset Commented Dec 22, 2022 at 4:29
  • Thank you @KargWare but I don't want to use unofficial tools. Is there any other way to use exe bootstrapper? Commented Dec 23, 2022 at 20:22
  • How can I make Setup.exe do all the work? 😅 Commented Dec 23, 2022 at 20:26
  • Wix toolset is not unofficial. V3 is standard and v4 short before first release. Wix is using to Windows Installer XML schema Commented Dec 24, 2022 at 7:10

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.