I did the following steps to create a Windows Setup project:
- Create a Windows Forms Application using Visual Studio
- Install "Microsoft Visual Studio Installer Projects plugin"
- Add a "Setup Project" to the solution
- In the "Application Folder", add project output
(Steps 5 and 6 are optional)
- By right clicking the Setup project and opening "Properties", select "Prerequisites"
- Select "Download prerequisites from the same location as my application"
- 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.