PDA

View Full Version : Deploy .NET Framework 3.5



Christoph
01-23-2009, 11:07 AM
Hi,

I seem to have problems deploying the .NET framework 3.5 via the prerequisites editor in my basic msi project.

I downloaded the full redistributable from the microsoft website. This gives me a file bigger than 200MB.

On the appdeploy website(http://www.appdeploy.be), I found some instructions to make this package smaller(leave out the X64 binaries as I target only 32-bit systems).

The instructions I followed are:

<begin>
Micro$oft Admin Deployment Guide .NET 3.5
http://msdn2.microsoft.com/en-us/library/cc160717.aspx

I personally needed to slim down the 200MB package and deploy it silently as a "drop and run" package for x86 only. To do this:

1. Download full 3.5 redistributable from
http://download.microsoft.com/download/6/0/f/60fc5854-3cb8-4892-b6db-bd4f42510f28/dotnetfx35.exe

2. Using WinRAR (easiest), extract dotnetfx35.exe to C:\TEMP

3. Within the folder C:\Temp\dotnetfx35\wcu\dotNetFramework\ use WinRAR to extract dotNetFx35setup.exe in the same folder and then delete dotNetFx35setup.exe.

4. Go through all of the sub-folders in C:\Temp\dotnetfx35\wcu\dotNetFramework\ and delete all x64 or ia64 related folders and files (unless you need to support installing for them).

5. In folder C:\Temp\dotnetfx35\wcu\dotNetFramework\ select all (CTRL+A) and r-click "Add to archive".

6. In WinRAR, check option "Create SFX archive" to make a self extracting exe. Go into the "Advanced" tab and into "SFX Options". Check "Create in the current folder" and in the Run After Extraction field, enter "setup /q /norestart" without the quotes. Now go to the "Modes" tab and select "Silent Mode - Hide All" and "Overwrite All Files". >OK >OK.

7. Rename the created EXE (currently named dotNetFramework.exe) to x86_Net3_5.exe or similar. Use your prefered software distribution framework to deliver the executable to your prefered temporary software install location on the target machine, and launch.

This installs
.NET 2.0 SP1
.NET 3.0 SP1
.NET 3.5

<end>

NOTE: I also added /LANG:ENU as extra commandline parameter to avoid that it downloads extra language packs on non-english systems. See: http://blogs.msdn.com/astebner/archive/2008/07/17/8745415.aspx

At the end, this gives me an self extracting file of approximately 89MB... what is what I want.

After that, I created a prerequisite file to add this exe into my project.

When launching my setup with the .NET framework prerequisite included, it starts extracting the file and starts installing the .NET framework 2.0 as first part of the installation.

However, after the .NET 2.0 installation it starts my installer while it is still needs installing .NET 2.0 SP 1 and .NET 3.5 itself. :confused:
It continues installing the rest of the .NET Framework(what is .NET 3.0 SP 1 and .NET 3.5) at the background?

Why is the prerequisites editor not waiting until everything is installed fine before jumping into the actual installer?
Has it something to do with the fact that I made a self-extracting exe myself following the rules above or???

I still need to give it a try with the full 200MB package to see if this maybe works but actually I don't want to ship this 200MB package... :(

Any advice would be welcome...

Christoph
01-26-2009, 07:47 AM
After a little more investigation, I seem to have solved the problem and managed to install the .NET 3.5 framework(with all 64-bit binaries removed) successfully.

I've done a couple of things different compared to the explanation mentioned before:

- don't extract the dotnetfx35setup.exe in the '...\wcu\dotNetFramework\'-folder.

- in the run after extraction field, type "dotnetfx35setup.exe /q /norestart /LANG:ENU"(without the quotes).

- also check the option 'unpack to temporary-folder' in the 'Modes'-Tab.

When you make then the prerequisites file for installing .NET 3.5 via the prerequisites editor, don't add any commandline options anymore. You've already done this when creating the self-extracting archive.

This should do the job :cool:

thepeter
01-26-2009, 08:22 AM
I am pretty sure that modifying the original redistributable package breaks the licence terms for Redistributable packages from MS. I would be very careful in implementing this for packages that you release.

Christoph
01-26-2009, 08:28 AM
I am pretty sure that modifying the original redistributable package breaks the licence terms for Redistributable packages from MS. I would be very careful in implementing this for packages that you release.

Mmm... strange. Are you sure?
Because when I read this official MSDN article 'http://msdn.microsoft.com/en-us/library/cc160716.aspx', Microsoft explains how you can 'strip' the .NET 3.5 framework package.

Do you have a link where it says not to do so?

thepeter
01-26-2009, 09:33 AM
Following this (http://msdn.microsoft.com/en-us/library/xak0tsbd.aspx) link content leads you to the "redist.txt" file located in your Visual Studio installation directory. All redistributables listed are to be "distributed unmodified".

Regards, Peter.

Christoph
01-26-2009, 10:36 AM
you're right.
It is indeed not allowed to modify the dotnet redistributable when you distribute it to customers.

So... I included the whole binary... :(

However, I hope that with my explanation above I give some ideas to people who only need to distribute it internally... and to save space in this way.