Partager via


How to deploy the .NET Framework 2.0 by using the MSI directly

If you try to extract the contents of the .NET Framework 2.0 setup package and install it using the MSI directly, you will see a blocking dialog that looks like the following:

.NET Framework 2.0 block dialog

This type of blocking dialog does not appear when trying to install the .NET Framework 1.0 or 1.1 using the MSI directly.

If you look at the .NET Framework 2.0 netfx.msi in Orca, you can see that there is a custom action that starts with the name CA_BlockDirectInstall_GUIH_SKU_URT. Then, if you look at the InstallExecuteSequence table of the MSI, you will see that this custom action has the following condition: ( NOT (ADDEPLOY = 1 OR USING_EXUIH = 1 OR USING_EXUIH_SILENT = 1 OR ADVERTISED = 1 OR ProductState >= 1) ) AND ( NOT (ADDEPLOY = 1 OR USING_EXUIH = 1 OR USING_EXUIH_SILENT = 1 OR ADVERTISED = 1 OR ProductState >= 1) ). As you can see from these conditions, this custom action will fire and show this block dialog unless one of those properties is passed on the command line or the product is already installed.

As I previously described in this blog post, we created a new external UI handler for the .NET Framework 2.0. Along with this external UI handler, we added this custom action to block the user from installing via the MSI directly as a means of more strongly encouraging people to install using the external UI handler (side note - this is the technique described in this post on the Windows Installer team blog for using external UI handlers).

The external UI handler for the .NET Framework 2.0 includes a command line parameter (described in this previous post) to invoke administrator mode - you can enter this mode by running install.exe /a. This administrator mode is essentially a UI wrapper around the standard msiexec.exe /a command line parameter for creating an administrative install point (AIP) for an MSI. It requires you to accept a EULA, then allows you to specify a location to stage the files for the administrative install point. The interesting thing is that if you run install.exe /a and then look at the verbose MSI log file (named %temp%\dd_netfx20_a_msi*.txt), you will see that the property ADDEPLOY=1 is set while creating the AIP. However, this property is not used at all during creation of the AIP, and it is not saved as a part of the staged MSI. Therefore, even if you try to install the .NET Framework 2.0 using the AIP created using install.exe /a, you will still run into the block dialog shown above.

To make a long story short, you can use the following command lines to create an administrative install point and install the .NET Framework 2.0 using the MSI directly:

  1. To extract the contents of the setup package - dotnetfx.exe /t:c:\temp /c (or you can substitute any path of your choosing for c:\temp)
  2. To create an administrative install point - c:\temp\install.exe /a
  3. To install using the MSI directly - msiexec.exe /i netfx.msi ADDEPLOY=1

If you are interested, you can combine the steps above if you do not care about being able to extract the contents of dotnetfx.exe or create an administrative install point:

  • To combine steps 1 and 2 above to create an administrative install point without extracting dotnetfx.exe first - dotnetfx.exe /c:"install.exe /a"
  • To combine steps 1, 2 and 3 above to directly install the MSI - dotnetfx.exe /q /c:"msiexec.exe /i netfx.msi ADDEPLOY=1 /qn"

One other item I should point out here - you will also notice when you install the MSI directly with basic UI (using the /qb switch instead of the /qn switch above), the progress dialog has a title bar and a cancel button but is otherwise blank like the following:

.NET Framework 2.0 blank progress dialog

The .NET Framework 2.0 MSI has been configured to be language-neutral (described in more detail here if you're interested), and there is a bug in Windows Installer that when a language-neutral MSI with no action text or error text is installed in basic UI mode, it will not display any of the standard messages in the progress dialog. Unfortunately, this bug is present in all current versions of Windows Installer up to and including version 3.1. I tried an installation scenario using basic UI mode on a recent Windows Vista build and verified that this bug has been fixed in Windows Installer 4.0 (which is included in Vista).

One final thing - all of the details in this blog post apply to all .NET Framework 2.0 and VS 2005 products that use the new external UI handler we have created. This includes the .NET Framework 2.0 SDK, the J# redistributable package, the VS Tools for Office Runtime, Document Explorer, etc. Essentially, any setup package included as part of Visual Studio that is packaged as a self-extracting executable and contains install.exe, install.ini and install.res.####.dll will behave the same way.

I realize this topic is a bit involved and confusing and represents a change from previous versions of the .NET Framework, so please let me know if you have any questions or run into any problems getting things to work for you.

Comments

  • Anonymous
    February 01, 2006
    Thanks for posting this it really helps
    Now i just need to figure out how to make Install Shield 8 do what aspnet_regiis.exe does after installing 2.0

  • Anonymous
    February 07, 2006
    Hello

    Thanks for posting this, it really helps.
    Unfortunately I have a problem. I installed via msi installation. Eeach .NET Framework 2.0 application which I run, produce the follow error.
    http://burger.studentspace.ch/temp/error_net.jpg

    Have you some ideas?

    Thanks

  • Anonymous
    February 07, 2006
    Hi Karsten - I am not sure what would be causing this error you're seeing.  I don't believe that your method of installing via the MSI directly would cause this.  You may want to check the user and system security settings as well as any application-specific settings and see if you have sufficient permissions to run .NET applications in your environment.

  • Anonymous
    February 07, 2006
    Thanks for you answer. I can't check the configuration. The installation doesn't create the management console. Is there an other way to check this settings?

    Karsten

  • Anonymous
    February 08, 2006
    The comment has been removed

  • Anonymous
    February 10, 2006
    Question
    You previously posted a set of instructions that can be used to run the .NET Framework 2.0...

  • Anonymous
    February 22, 2006
    The comment has been removed

  • Anonymous
    March 20, 2006
    Thanks for the instructions. This guide worked a treat. Thank you for posting the info.

  • Anonymous
    March 24, 2006
    What if you whant to installe it using an active directory policy? Then you can't add the ADDEPLOY=1 to the commandline.

  • Anonymous
    March 24, 2006
    Hi Mean - You can use the steps listed at http://blogs.msdn.com/astebner/archive/2006/02/10/529987.aspx to deploy the .NET Framework 2.0 using Group Policy.  The steps are very similar, but Group Policy sets a property named ADVERTISED that is equivalent to the ADDEPLOY switch listed in this blog post.

  • Anonymous
    April 11, 2006
    The comment has been removed

  • Anonymous
    May 09, 2006
    Thank you for positing this article. I was trying to figure out why the progress dialog has a title bar and a cancel button but is otherwise blank for one whole day. Managed to resolve that now!  

  • Anonymous
    May 12, 2006
    Hi Aaron!
    I'd like to join the thanksgiving, you've done a great job here. I do have one question, though; is it possible to deploy .NET FW 2.0 with elevated privileges only? I seem to get different errors depending on how I go about the task, but no problems with my admin account.

  • Anonymous
    May 12, 2006
    Hi SmilPent - Yes, it should be possible to deploy the .NET Framework 2.0 with elevated privileges, but you have to use machine assignment - the .NET Framework 2.0 setup does not support per-user deployment.  What kind of errors are you receiving when you try this?

  • Anonymous
    May 15, 2006
    Hi again,
    The ALLUSERS=1 has not been modified, so I believe the installation is per-machine.
    I seem to encounter the same issue as a previous commenter on another page; firstly, the MSCOREE.DLL issue, which I can now get around. Secondly, the Microsoft.VisualBasic.Vsa.dll access denied issue. I ran Filemon, and tried running gacutil on the file, with "Failure adding assembly to the cache: Access denied." etc as a result. Like I mentioned, I try to install the package with AlwaysInstallElevated, and the user with which I ran gacutil has very limited rights.

  • Anonymous
    May 15, 2006
    Other objects install/register successfully into the GAC, but not Microsoft.VisualBasic.Vsa.dll.
    I'm doing the installations on VM-Ware clients, controlled. I can supply you with logs, if that would help. :o)

  • Anonymous
    May 15, 2006
    The comment has been removed

  • Anonymous
    May 15, 2006
    The comment has been removed

  • Anonymous
    May 15, 2006
    Oh, and I meant other objects that are a part of the setup.

  • Anonymous
    May 15, 2006
    The comment has been removed

  • Anonymous
    June 13, 2006
    Hi

    Nice posting

    How can i deploy Framework 2.0 through my setup & deployment project, i dont want user to download from microsoft site while installing my application


  • Anonymous
    June 16, 2006
    This works really well but I liked the /qr switch.  I used it with 1.1 to give the user a more information than just the progress bar.  I tried this with 2.0 (dotnetfx.exe /q /c:"msiexec.exe /i netfx.msi ADDEPLOY=1 /qr") and it does not behave the same.  Am I doing something wrong?

  • Anonymous
    June 17, 2006
    Hi Sudhakar - I think the instructions at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetdep/html/ndp2_dplvs.asp should help solve the .NET Framework 2.0 deployment issue you're trying to figure out.

    Hi Reggie - No, you are not doing anything wrong.  What you're seeing is a bug in Windows Installer.  We changed the .NET Framework 2.0 MSI to be language-neutral in v2.0 (you can see that ProductLanguage = 0 in the MSI, this means language neutral).  When a language-neutral MSI is installed with /qr or /qb, the progress dialog does not display any text.  I'm sorry to say that I don't know of any workaround for this issue.

  • Anonymous
    June 17, 2006
    I must not have been clear.  When installing 1.1 with the /qr switch, no questions are asked but the main dialog appears(the one with the graphic,  the files/registry keys being installed, a progress bar and time left).  Is there a way to get 2.0's new UI handler main dialog to appear in a similar fashion(no questions/clicks, just what is being installed and how long)?

  • Anonymous
    June 18, 2006
    Hi Vanwykr - No, unfortunately, there is not a way to do this.  Because we changed the .NET Framework 2.0 to be language neutral, and because of the bug in Windows Installer that I previously mentioned, the UI that appears in unattended installation mode does not have any text on it.  I'm sorry for the inconvenience.

  • Anonymous
    June 21, 2006
    I think you may have answered my question, but bear with me I can be a little slow at times.

    The missing text when using /qn(Quiet, No UI) or /qb(Quiet, Basic UI) really does not matter to me.  I want to see a Reduced UI screen when using the /qr switch.  Maybe I am not understanding the switches or what you are trying to explain to me.

    I've placed a PDF at my homepage that I hope may show what I'm looking for.
    http://home.earthlink.net/~vanwykr/FrameworkIssue.pdf

    Thanks again.

  • Anonymous
    June 28, 2006
    Hi Vanwykr - I apologize for misunderstanding your scenario.  The PDF clears things up for me.  Unfortunately, what you are trying to do is not supported in the .NET Framework 2.0 setup.  In 1.1, we used native Windows Installer UI, so the /qr switch showed a more verbose progress page than the /qb switch.  In 2.0, we have an external UI handler, so /qr and /qb both show the same small progress dialog.

    I am looking into ways to at least make that progress dialog display text instead of being blank for .NET 2.0 setup, and I will post something on my blog in the next couple of days with some options for that.

    I apologize for the inconvenience.

  • Anonymous
    July 19, 2006
    The comment has been removed

  • Anonymous
    July 19, 2006
    Hi DarinClausing - This technique will work, but I do not recommend making modifications directly to the MSIs that we shipped for the .NET Framework.  In this case, simply adding a property to the Property table likely won't cause any issues, but other types of modifications are not guaranteed to be safe and could cause problems when users try to install future hotfixes or service packs.

  • Anonymous
    July 26, 2006
    Great post.

    My goal is to write a batch script that can silently install the .NET 2.0 SDK to a non-default directory. I have been unable to do this using the commands:

    msiexec /package C:templocnetfxsdk.msi /lvx* C:log.txt ADDEPLOY=1 USING_EXUIH_SILENT=1 REBOOT=ReallySuppress FILESINUSETEXT="" ADDLOCAL=URT_SDK_ENU_X86_IXP_SETUP,GUIH_ARP_VSDIR_HIDDEN_URT_SDK_ENU_X86_IXP,Servicing_Key,SDK_Samples,NGWS_SDK,NETFx_Docs FRAMEWORKSDK.3643236F_FC70_11D3_A536_0090278A1BB8="S:mydir"

    and

    install.exe /q /lvx* C:log.txt
    /msipassthru MSI_ARGS_FILENAME_BEGINS:args.txtMSI_ARGS
    _FILENAME_END

    where args.txt contains:
    USING_EXUIH_SILENT=1 REBOOT=ReallySuppress FILESINUSETEXT="" ADDLOCAL=URT_SDK_ENU_X86_IXP_SETUP,GUIH_ARP_VSDIR_HIDDEN_URT_SDK_ENU_X86_IXP,Servicing_Key,SDK_Samples,NGWS_SDK,NETFx_Docs FRAMEWORKSDK.3643236F_FC70_11D3_A536_0090278A1BB8="S:mydir"

    In the logs, I see my install directory get picked up, but then overridden by what looks to be the RedirectSDKDir action. After reading your blog entry, I used Orca to study the underlying msi and saw that this action fires if:

    ( NOT Installed AND NOT FRAMEWORKSDK.3643236F_FC70_11D3_A536_0090278A1BB8_RO.3643236F_FC70_11D3_A536_0090278A1BB8 AND NOT USING_EXUIH )

    Since I am running silently and doing a fresh install, the first and last conditions will naturally evaluate to true. Apparently, the middle condition is also evaluating to true (ie no alternate directory was specified). But when I searched for the action that sets the alternate directory, it appears to be:  CA_VIntegration_Exec_FrameworkSDK.3643236F_FC70_11D3_A536_0090278A1BB8, which only sets the directory if it is already set!

    Is it possible to install silently to a directory of my choice? If so, how?

    I realize my question is regarding the SDK installer and not the framework installer. But per your post http://blogs.msdn.com/astebner/archive/2005/08/15/452030.aspx, the same wrapper is used for both.

    Any insight much appreciated.

  • Anonymous
    July 28, 2006
    The comment has been removed

  • 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
    I received a question from a customer about how to perform a sequential unattended install of the .NET

  • Anonymous
    January 30, 2007
    I am trying to know if there is a way to install .NET 2.0 framework using MSI packaging.  This MSI package will reside on the web server.  The link to the package will be given to the user such that when they click on the link installation of .NET framework begins and installs on the client desktop.  The client desktops are Windows XP based machines.  The web server is IIS 5.0. I followed the instruction in the link below first.  But that does not help since we will be providing a link to the user and no way for use to provide the ADDEPLOY flag. http://blogs.msdn.com/astebner/archive/2005/11/17/494312.aspx I followed the link below next and since I am publishing the netfx.msi to the web server I am not in control of the group policy.  I got the error message “To install this product please run install.exe” http://blogs.msdn.com/astebner/archive/2006/02/10/529987.aspx So I did the following 1> dotnetfx.exe /t:x:dotnetfx /c 2> changed the netfx.msi using ORCA and adding ADDEPLOY=1 property 3> resign netfx.msi It worked but gave me a whole bunch of messages that had to do with .txt files and had to click on multiple ignore buttons to finally get .NET 2.0 framework installed on client desktop from the web server using netfx.msi. So the question being -->   1>Is there a way to publish the netfx.msi to the web server without having to go thru all the stuff above and also not get the error message? or 2> Is there a way to avoid all the ignore messages I was getting when I used the changed netfx.msi file. Thanks

  • Anonymous
    January 31, 2007
    Hi K3PIO - It is possible to install the .NET Framework 2.0 by using msiexec.exe and running the MSI directly (as opposed to using the install.exe wrapper), but the MSI itself installs some files that are stored as flat files next to the MSI in addition to files stored as an embedded cab within the MSI.  Therefore, it isn't possible to install by using only the MSI and not any of the other files next to the MSI when you unpack dotnetfx.exe. Does your installation process require that you directly link to the MSI in this manner?  Or could you link to dotnetfx.exe or to a batch script that copies all of the setup files to the user's %temp% folder and executes setup from there or something like that? Note - it would be possible to ignore all of the file-not-found error messages, but all of the files you see those errors for are required to support repair/uninstall from Add/Remove Programs, so I definitely don't advise ignoring those errors.

  • Anonymous
    July 18, 2007
    The comment has been removed

  • Anonymous
    January 21, 2009
    PingBack from http://www.hilpers.it/1575077-win-2003-server-installazione-programmi