Thoughts about setup and deployment issues, WiX, XNA, the .NET Framework and Visual Studio
All postings are provided AS IS with no warranties, and confer no rights. Additionally, views expressed herein are my own and not those of my employer, Microsoft.
I have heard from 2 customers this past week who were trying to pre-install the .NET Framework as part of the T13 phase of OS setup (in their cases, Windows XP). They were including the .NET Framework 2.0 setup command line in svcpack.inf and then copying svcpack.inf into the i386 directory of their OS install location. Their svcpack.inf looks similar to the following:
[Version]Signature="$Windows NT$" [SetupData]CatalogSubDir="i386\svcpack" [ProductCatalogsToInstall] [SetupHotfixesToRun]dotnetfx.exe /Q /C:"install.exe /Q"
[Version]Signature="$Windows NT$"
[SetupData]CatalogSubDir="i386\svcpack"
[ProductCatalogsToInstall]
[SetupHotfixesToRun]dotnetfx.exe /Q /C:"install.exe /Q"
However, both customers found that the .NET Framework 2.0 setup failed in this scenario. The error in the verbose MSI log file for .NET Framework 2.0 setup is the following:
Error 1406.Could not write value DW0200 to key \Software\Microsoft\PCHealth\ErrorReporting\DW\Installed. System error . Verify that you have sufficient access to that key, or contact your support personnel.
One of the customers worked around this first error by deleting the DW key during OS setup before installing the .NET Framework 2.0. However, when doing this, they then encountered the following error:
MSI (s) (9C!A8) [23:03:15:484]: Product: Microsoft .NET Framework 2.0 -- Error 25007.Error occurred while initializing fusion. Setup could not load fusion with LoadLibraryShim(). Error: The handle is invalid.
Unfortunately, I don't know of a way to workaround this second error.
This scenario used to work with .NET Framework 1.0 and 1.1 setup, but it has been broken by some of the changes made to setup in .NET Framework 2.0 (the registry key listed above and the custom action to install assemblies are both new in .NET Framework 2.0 setup).
I don't have much experience with customizing OS installations using the various methods that are available, so I asked these customers why people might want to use svcpack.inf to install the .NET Framework as part of OS setup as opposed to other methods that have been shown to work for the .NET Framework 2.0 (such as using the GuiRunOnce section of winnt.sif or setting a RunOnceEx registry value to launch .NET Framework 2.0 setup on first boot of the OS). Here is what they told me:
I am going to try to look into possible workarounds to get .NET Framework 2.0 setup to work when launched by svcpack.inf in the T13 phase of OS setup. However, for now, please be aware of this limitation and update your OS install scripts accordingly. In addition, if this scenario is important to you, please go to the bug form for this issue on the MSDN product feedback site and click on the link to vote on this bug so that the product team will better understand the importance of making this type of scenario work.
Also, if anyone has any tips and tricks that can be used to get this to work, please post a comment on this blog post or contact me and let me know.
i just used RegEdit to change reg keys, not the scripts, but 2 .reg files
first:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\Setup]
"SystemSetupInProgress"=dword:00000000
[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PCHealth\ErrorReporting\DW]
than, at the end of installation:
"SystemSetupInProgress"=dword:00000001
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PCHealth\ErrorReporting\DW]
all called from BATCH:
REGEDIT.EXE /S 1.REG
start /wait DotNetFx_1_1.exe /q:a /c:"install /l /q"
start /wait dotNetFx35setup.exe /qb /norestart
REGEDIT.EXE /S 2.REG
exit
NetFx 1.1, 2.sp1, 3.sp1, and 3.5 were installed with no problem, and fast enough too.
Hi Ibach - I personally prefer not to need to create and copy these 2 additional files, so that is why I listed the reg add and reg delete commands as a workaround in the post at http://blogs.msdn.com/astebner/archive/2006/05/06/591694.aspx. However, creating and merging in 2 registry files will work in this scenario as well, so it is up to you which workaround you'd prefer to use.
here's download ...
http://ibach.my2gig.com/index.files/NetFx3_5.html
I've tried to use your workaround, but probably f* up somewhere... i've got error complaining about registry being locked and reg keys not written... i'll give it a closer look.
Anyway, important thing is that it works, and that setup file is not too big.
im working at repacking it all now, i think i can slim it further to about 60 MB or lass.
If i get to do that, ill let you all know in hope someone will give it some testing.