次の方法で共有


How to perform a customized command line install for the .NET Framework SDK 2.0

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:

  1. Install the .NET Framework 2.0 redistributable
  2. Install the .NET Framework 2.0 SDK in UI mode and check only the Tools and Debugger option
  3. After installation, go to the %temp% directory, locate the file dd_netfxsdk20msi*.txt and open it in a text editor such as Notepad
  4. 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
  5. 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

followed by

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>

Comments

  • Anonymous
    November 24, 2005
    Thanks! Been googling for days about this.

  • Anonymous
    November 28, 2005
    The comment has been removed

  • Anonymous
    November 28, 2005
    The comment has been removed

  • Anonymous
    November 28, 2005
    The comment has been removed

  • Anonymous
    November 28, 2005
    The comment has been removed

  • Anonymous
    November 28, 2005
    The comment has been removed

  • Anonymous
    November 29, 2005
    The comment has been removed

  • Anonymous
    November 29, 2005
    Hi astebner,

    thanks a lot. I removed the installation path and it works perfect.
    We use Netinstall ( automated software distribution to clients ) to do our global software rollouts. Therefore i have to automate everything i get on may desk.

    i appreciate your infos and your help.

    Bye Virgilio

  • Anonymous
    January 13, 2006
    Hi astebner

    I would like to make an unattended uninstall of the .Net Framework 2.0 redistributable and SDK. Can this be done?

    Thanks for this great how to.

  • Anonymous
    January 13, 2006
    Hi René - Yes, you can perform an unattended install of the .NET Framework 2.0 redist and SDK. Here is a set of example command lines that will work for this:

    dotnetfx.exe /q:a /c:"install.exe /qb"
    setup.exe /q:a /c:"install.exe /qb"

    You will have to wait for the redist package to finish installing and exit before launching the SDK setup. You will also need to make sure you install the correct version of the redist and SDK (the 32-bit version, the AMD64 version or the IA64 version, depending on your hardware)

  • Anonymous
    January 30, 2006
    Hi astebner

    I was thinking of an unattended uninstall.

  • Anonymous
    January 31, 2006
    Hi Rene - the command lines I provided are for an unattended install (an installation that requires no user intervention but shows a progress bar during install so the user knows that something is being installed on the system). Are you thinking of a different type of installation scenario?

  • Anonymous
    February 07, 2006
    Like Rene, I am looking for an unattended (silent) UNinstall for .NET Framework 2.0. Any ideas?

  • Anonymous
    February 07, 2006
    The comment has been removed

  • Anonymous
    February 07, 2006
    The comment has been removed

  • Anonymous
    April 11, 2006
    The comment has been removed

  • Anonymous
    August 27, 2006
    PingBack from http://blogs.msdn.com/astebner/articles/454956.aspx

  • Anonymous
    August 27, 2006
    PingBack from http://blogs.msdn.com/astebner/articles/454956.aspx

  • Anonymous
    October 21, 2006
    The comment has been removed

  • Anonymous
    December 06, 2006
    PingBack from http://blogs.msdn.com/astebner/archive/2006/01/14/how-to-perform-unattended-installs-of-the-net-framework-2-0-redist-and-sdk.aspx

  • Anonymous
    July 18, 2007
    The comment has been removed