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 (38)

  1. monica keller says:

    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

  2. Karsten Burger says:

    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

  3. astebner says:

    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.

  4. Karsten Burger says:

    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

  5. astebner says:

    Hi Karsten – the configuration wizard comes with the .NET Framework SDK, so you will need to install that to get it.  You can also use caspol.exe that comes with the .NET Framework redistributable, but it only has a command line interface.

  6. Question

    You previously posted a set of instructions that can be used to run the .NET Framework 2.0…

  7. J Ward says:

    seems to work – thanks a lot.  I was banging my head for a while before I found this on the web.  

  8. Software deployment says:

    Thanks for the instructions. This guide worked a treat. Thank you for posting the info.

  9. Mean says:

    What if you whant to installe it using an active directory policy? Then you can’t add the ADDEPLOY=1 to the commandline.

  10. astebner says:

    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.

  11. This guide is intended to serve as a collection of links to articles, tools, tips and tricks that explain…

  12. Kevin says:

    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!  

  13. SmilPent says:

    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.

  14. astebner says:

    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?

  15. SmilPent says:

    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.

  16. SmilPent says:

    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)

  17. astebner says:

    Hi SmilPent – I am not sure about VMWare, but I know this scenario works using Active Directory.  The instructions listed at http://msdn2.microsoft.com/en-us/library/kz6tzdt1.aspx should allow you to use machine assignment for .NET Framework 2.0 deployment with elevated privileges.

    When you say that other objects install into the GAC – do you mean other objects that are a part of .NET Framework 2.0 setup, or other objects that are a part of other setup packages?  Can you let me know the exact command line that is used in this deployment scenario?

  18. SmilPent says:

    Thanks for your answer.

    We are a large organization, about to implement SMS, but this component is meant to be distributed with our current, script-based distribution system called Snow. We use AD for security groups and similar, but our deployment policy doesn’t allow me to deploy directly through AD/GPO.

    We advertise packages on users start menu, or force them through dependencies. The start menu link calls a script containing a msiexec command, depended on another script which sets elevated privileges. The command in this case is:

    Setup=MSIExec.exe /I "%CopyPath%Files%MSIFilename%" /QB-! /L "%WindowsDir%ZAKLOGS%MSILogFileName%" ALLUSERS=1

    MSIFilename being netfx.msi

  19. SmilPent says:

    Oh, and I meant other objects that are a part of the setup.

  20. astebner says:

    Hi SmilPent – I’m not positive here, but I think that advertising on the user’s Start menu is equivalent to per-user deployment as opposed to per-machine, and that isn’t supported for the .NET Framework.  I don’t think that setting ALLUSERS=1 is enought override the per-user nature of that deployment.  I’d still like to try to look and see if I can figure anything out.  Can you change that command line to use /l*v instead of /l and then send me the verbose log file at Aaron.Stebner (at) microsoft (dot) com so I can take a look?

  21. Sudhakar says:

    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

  22. Reggie Van Wyk says:

    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?

  23. astebner says:

    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.

  24. vanwykr says:

    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)?

  25. astebner says:

    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.

  26. vanwykr says:

    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.

  27. astebner says:

    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.

  28. DarinClausing says:

    Ok follow his directions on extracting the MSI and then use Orca to edit the MSI. Add a new row in the "Property" and for the property string make it "ADDEPLOY" and make the Value "1" then save the MSI and you do not have to pass the command line to the MSI to install it.

  29. astebner says:

    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.

  30. trackjack says:

    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.

  31. astebner says:

    Hi Trackjack – There are a couple of possible issues that you’ve run into in your scenario.

    1.  The condition in that custom action only lists USING_EXUIH, but you’re passing in USING_EXUIH_SILENT.  In general, any MSI action that checks the value of USING_EXUIH should also check the value of USING_EXUIH_SILENT, but that doesn’t appear to be the case for this custom action.  I’ll double-check on that and log a bug for the team to fix this in the next version.

    2.  The FRAMEWORKSDK condition that you mention above contains _RO – this is a special custom action that we use to detect whether or not the .NET Framework SDK was previously installed by some other product.  Typically that happens if you have a version of Visual Studio 2005 installed on the same system.

    Summarizing 1 and 2 from above, I would suggest trying to change your command line to use USING_EXUIH instead of USING_EXUIH_SILENT, and I would also suggest verifying that you don’t already have the .NET Framework 2.0 SDK installed on this system via Visual Studio 2005.

  32. Details about the .NET Framework 2.0 setup packaging Available command line switches for .NET Framework

  33. I received a question from a customer about how to perform a sequential unattended install of the .NET

  34. K3PIO says:

    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

  35. astebner says:

    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.

  36. This guide is intended to serve as a collection of links to articles, tools, tips and tricks that explain