How to package installation (framework + application) into one executable file?
I would like to create a file 'setup.exe' which contains one application that I developed in C # and a .Net framework 4.0 setup.
The idea is this: when I run setup.exe, it checks for .net framework 4.0 on the computer and if not install it!
Using InstallShield 2009.
Does anyone know how to do this?
Let me know if you don't understand anything.
Thank.
source to share
As for the installation, you can use the built-in mechanism that comes with Visual Studio, they allow, for example, to make setup.exe automatically check if the correct version of the frame is installed and install it, if not - see MSDN for a good start .
As far as the fact that your application / EXE consists of 1 file, including all managed dependencies, you have several options:
OR
- use some tool like SmartAssembly (commercial)
it can be embedded and merged by the way (no need to change source code).
OR
- code that itself in less than 10 lines (free, but minimal source code)
mark all required dependencies as "embedded resource" - this way they are included in the EXE file ... you need to set up aAssemblyResolve
handler that reads from resources at runtime and returns the required DLLs to the .NET runtime.
source to share
There are many frameworks for creating customizations.
My favorite is WIX, you can download it here: http://wix.sourceforge.net/
There is also a framework for building WIX interfaces using C # called sharpsetup, you can download it here: http://sharpsetup.eu/ but I'm not sure this will suit your needs, as the target machine may not have .NET to start with (although it would be possible to write the setup in .NET 2.0, I'm not sure).
Learning WIX can take a while, but once you get past that, it shouldn't be too hard to do what you want.
source to share