Aaron Stebner's WebLog

Thoughts about setup and deployment issues, WiX, XNA, the .NET Framework and Visual Studio

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

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

  • Comments 21

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>

 

  • Thanks! Been googling for days about this.
  • the command line to install the sdk should begin with install.exe instead of setup.exe.

    right?

  • Hi Virgilio - the command line listed above for the SDK is correct as is. There is a file named install.exe inside of the self-extracting setup package, but the self-extracting package itself is named setup.exe for the SDK.
  • Hi astebner,

    if i use the setup.exe in the command line for the sdk installation, i get always a popup with the following error:
    "command line option syntax error. Type command /?"

    I made a .cmd file to execute the installation line. I checked everything in the command line ( removed spaces after comma )

    what do i wrong?

    thanks
  • Hi stebner,

    this is the command line in my .cmd file:

    c:\temp\setup.exe /t:c:\temp /c:"msiexec.exe /ic:\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"
  • Hi astebner, ( comment before was wrong )

    this is the command line in my .cmd file:

    c:\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"
  • Hi Virgilio - It appears that the command line being passed via /c is exceeding the MAX_PATH (260 character) threshold and that is why it is giving this error. I apparently ran a shorter version of that command line when I was testing it prior to writing this blog post, and I apologize for the inconvenience.

    Here are a couple of options that you can use to workaround this:

    1. Extract setup.exe in a separate step. This means you would have 2 command lines:

    setup.exe /t:c:\temp /c

    and

    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. Remove the part of the command line that sets the install path, so the command would look like:

    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"

    I will update the main blog post to reflect this information as well.
  • 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
  • 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.
  • 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)
  • Hi astebner

    I was thinking of an unattended uninstall.
  • 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?

  • Like Rene, I am looking for an unattended (silent) UNinstall for .NET Framework 2.0. Any ideas?
  • Hi Kennon and Rene - I am sorry, I totally misread Rene's last question and missed that it said UNinstall.  Here is the command line to perform an unattended uninstall of the .NET Framework 2.0:

    dotnetfx.exe /q:a /c:"install.exe /u /qb"
  • Question
    You have written blog posts in the past describing the command line parameters that can be...
Page 1 of 2 (21 items) 12
Leave a Comment
  • Please add 7 and 2 and type the answer here:
  • Post