Archive: Integrated .Net Framework, not download it


Integrated .Net Framework, not download it
Hello. I'm a new user of NSIS. I have created a simple application that uses WinPCap in C#. So, my application requires both .NET Framework and WinPCap installed. Other than that my application doesn't need any special setup, no sytem file change, no registry entry, no anything.

I've searched Google for this, but all the search results were about downloading the .NET Framework from Microsoft's web site then installing. For I'm going to distribute my application in a CD, I want the .Net Framework integrated inside the setup file in order to save user's downloading time.

I need to know how to integrate the .NET Framework into the setup file, but not copy it to the Program files folder. I tried to do it myself, but the .Net Framework setup file was also copied to the Program Files folder.

If you have some free time, would you give me a simple code that does:
1. Integrate the .NET Framework setup file into my setup file.
2. Execute the .NET Framework setup quitely before installing (I already know how to check if .NET is installed so you may skip the code to check if it is installed or not)
3. Not copy the .NET Framework setup file to the Program Files folder.

If you teach me the code above, I think I myself can then apply the code to do the same thing for WinPCap. Thank you for your help.


1. Integrate the .NET Framework setup file into my setup file.
Use NSIS' File instruction to add the executable into the installfer.
2. Execute the .NET Framework setup quitely before installing (I already know how to check if .NET is installed so you may skip the code to check if it is installed or not)
You need to know which are the params of the .net installer to do it quitely...According to this site, you need to pass something like /q:a /c:"install.exe /q"...use this with NSIS' instructions Exec, ExecWait or ExecShell.
3. Not copy the .NET Framework setup file to the Program Files folder.
Ok, you can use $PLUGISDIR to output the .net installer, at the end of the nsis installer, $PLUGINSDIR is deleted.

Do NOT include the .NET Framework as an installer file. Who wants to wait a minute and a half while your installer decompresses a pre-compressed .NET installer?

It's insanity.

What you should do is add the .NET installer to the CD in the same path as your installer. Then use $EXEPATH to find it and execute it.


Yes if you are using a CD, just put it in a sub-folder and execute it with ExecWait:

ExecWait `"$EXEDIR\DotNET\setup.exe" /q:a /c:"install.exe /q"` $R0

Notice the use of double quotes. Also note the $R0 on the end... that will receive the exit code of the setup (0 on success, if anything else you could show a message box).

Stu