Include .Net Framework 3.5 SP1 to your installation package in Visual Studio

VS 2008 Prerequisites

Recently, after you create your application (web or windows app) in VS .Net 2008 / 2010 of course you create your setup project / click once deployment for better distribution of your application. But we will found a problem if we want to include .Net Framework 3.5 SP1 as our prerequisites in the same directory as the application. You will found error message like this one : “The install location for prerequisites has not been set to ‘component vendor’s web site’ and the file ‘DotNetFX35SP1\dotNetFX20\netfx20a_x86.msi’ in item ‘.NET Framework 3.5 SP1‘ can not be located on disk.”. Well, it’s because by default, .Net Framework 3.5 SP1 will be download from Microsoft Download Center website due to size restrictions.

The question is, how we include .Net Framework 3.5 SP1 in our installation package? well, Microsoft has provided way to doing this. You can find the full instruction in Visual Studio 2008 Service Pack 1 Readme.

I will try to provide tutorial based on VS 2008 SP1 Readme file. Here’s the step :

  1. Download .Net Framework 3.5 SP1 from Microsoft Download Center.
  2. Open command prompt and navigate to your downloaded .Net Framework path. For example : C:\dotNetFx35.exe
  3. At the command prompt, type dotNetFx35.exe /X: this will extracted Framework files to a folder named WCU in your current directory.
  4. Open

    C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bootstrapper\Packages

    for x86 os

    C:\Program Files (x86)\Microsoft SDKs\Windows\v6.0A\Bootstrapper\Packages

    for x64 OS.

  5. Edit the product.xml with notepad or other text editor tool.
  6. Paste this following into <PackageFiles> element :

    <PackageFile Name=”TOOLS\clwireg.exe”/>
    <PackageFile Name=”TOOLS\clwireg_x64.exe”/>
    <PackageFile Name=”TOOLS\clwireg_ia64.exe”/>

  7. Find the element for <PackageFile Name=”dotNetFX30\XPSEPSC-x86-en-US.exe” and change the PublicKey value to:

    3082010A0282010100A2DB0A8DCFC2C1499BCDAA3A34AD23596BDB6CBE2122B794C8EAAEBFC6D526C232118BBCDA5D2CFB36561E152BAE8F0DDD14A36E284C7F163F41AC8D40B146880DD98194AD9706D05744765CEAF1FC0EE27F74A333CB74E5EFE361A17E03B745FFD53E12D5B0CA5E0DD07BF2B7130DFC606A2885758CB7ADBC85E817B490BEF516B6625DED11DF3AEE215B8BAF8073C345E3958977609BE7AD77C1378D33142F13DB62C9AE1AA94F9867ADD420393071E08D6746E2C61CF40D5074412FE805246A216B49B092C4B239C742A56D5C184AAB8FD78E833E780A47D8A4B28423C3E2F27B66B14A74BD26414B9C6114604E30C882F3D00B707CEE554D77D2085576810203010001

  8. Find the element for <PackageFile Name=”dotNetFX30\XPSEPSC-amd64-en-US.exe” and change the PublicKey value to the same as in step 7 above.
  9. save the product.xml.
  10. Open your extracted dotNetFx35.exe files, and copy all of contents in  C:\wcu\dotNetFramework to folder in step 4.

Note : For VS 2010, you just go to this folder 

C:\Program Files\Microsoft SDKs\Windows\v7.0A\Bootstrapper\Packages

for x86 OS and 

C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bootstrapper\Packages

for x64 OS. Rest of it is the same.

That’s it. Now you can include .Net Framework 3.5 SP1 in your installation package.

About these ads

One thought on “Include .Net Framework 3.5 SP1 to your installation package in Visual Studio

  1. Funcionó, la clave para que el instalador arrastre los prerequisitos crystal reports, esta en copiar el instalador en la carpeta C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bootstrapper\Packages

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s