Now that the final release of the .NET Framework 2.0 redist and SDK are available for download, I wanted to share a story about a scenario that I helped a team with here at Microsoft a couple of weeks ago. They wanted to be able to do a command line install of the .NET Framework SDK 2.0 with customized installation options so that they did not have to install all of the documentation and samples. They were able to run the SDK setup in full UI mode and uncheck the boxes in the setup UI for QuickStart Samples and Product Documentation and that gave them the bits they wanted. However, they weren't able to figure out how to install the same set of bits in an unattended manner.
I couldn't find any documented way of doing this, but given my background working on the setup team for the .NET Framework and Visual Studio and some of the tricks I've learned over the years about reverse engineering setup packages I decided to see if I could figure out how to accomplish this. Here is what I did to learn how to do this kind of customized install:
- Install the .NET Framework 2.0 redistributable
- Install the .NET Framework 2.0 SDK in UI mode and check only the Tools and Debugger option
- After installation, go to the %temp% directory, locate the file dd_netfxsdk20msi*.txt and open it in a text editor such as Notepad
- Search for the string Command line: to find the command line that the .NET Framework 2.0 SDK external UI handler passes to the MSI to start installing
- Create a script that runs the following command lines to silently install the .NET Framework 2.0 redist and then the 2.0 SDK with the same command line that I found in the log file in step 4
I ended up creating a script with the following command lines to silently install the .NET Framework 2.0 redist and the customized installation of the 2.0 SDK:
To install the redist
dotnetfx.exe /q:a /c:"install.exe /q"
To install the SDK
You can use one of the following 2 options, depending on whether or not you want to be able to customize the installation location as part of the unattended setup.
1. If you want to customize the install location, you will need to extract setup.exe in a separate step. This means you need the following 2 command lines:
setup.exe /t:c:\temp /c
msiexec.exe /i c:\temp\netfxsdk.msi USING_EXUIH=1 REBOOT=ReallySuppress ADDLOCAL=URT_SDK_ENU_X86_IXP_SETUP, GUIH_ARP_VSDIR_HIDDEN_URT_SDK_ENU_X86_IXP, Servicing_Key, NGWS_SDK FRAMEWORKSDK.3643236F_FC70_11D3_A536_0090278A1BB8=C:\Program Files\Microsoft.NET\SDK\ /qn /l*v c:\temp\netfxsdk.log
2. If you do not want to customize the install location, you can use the following command line:
setup.exe /t:c:\temp /c:"msiexec.exe /i c:\temp\netfxsdk.msi USING_EXUIH=1 REBOOT=ReallySuppress ADDLOCAL= URT_SDK_ENU_X86_IXP_SETUP, GUIH_ARP_VSDIR_HIDDEN_URT_SDK_ENU_X86_IXP, Servicing_Key,NGWS_SDK /qn /l*v c:\temp\netfxsdk.log"
Please note - I added spaces after the commas in the ADDLOCAL command lines above to make them display nicely in web browsers, but you need to get rid of those spaces to get the command line to work correctly if you try it on your own machines.
<update date="11/29/2005"> One of the comments below demonstrated a problem with the syntax of the SDK install command line parameters that I had originally listed. I have provided a couple of different options to get around this issue </update>