http://bugs.winehq.org/show_bug.cgi?id=11742
--- Comment #5 from Anastasius Focht focht@gmx.net 2008-02-29 15:12:13 --- Created an attachment (id=11046) --> (http://bugs.winehq.org/attachment.cgi?id=11046) shell script which fixes .NET 1.1 GAC problem (caused by MsiPublishAssemblies stub)
Hello,
Fusion log shows that none of the crucial system assemblies are registered in global assembly cache (GAC): $WINEPREFIX/drive_c/windows/assembly/GAC -> empty Even if the system (strong named) assemblies are pre-JIT'd with ngen.exe (into $WINEPREFIX/drive_c/windows/assembly/NativeImages1_v1.1.4322) they must be first registered into GAC to be recognized.
The important msi installer step that usually takes care of this is MsiPublishAssemblies() - currently a stub. Depending on assembly type (.NET or C/C++ runtime), assemblies get either registered/installed into GAC or SxS. For .NET assemblies, the Fusion API is used to register them into GAC (documented here: http://support.microsoft.com/kb/317540 )
MsiPublishAssemblies() probably remains a stub for indeterminate time - it requires some work to get it right. For the meantime I present a workaround.
Another way to get shared assemblies into GAC is the "gacutil" tool (which is nothing more than a command line wrapper for Fusion API). Unfortunately this program is considered a developer tool and not shipped with .NET redistributables by default. You would have to download the .NET 1.1 SDK (106 MB) only to get the tool... Fortunately there was an oversight: .NET 1.1 SP1 redistributable accidentally shipped this tool.
Installing .NET 1.1 SP1 on top of .NET 1.1 doesn't work because parts of the installer (patcher) requires .NET functionality present (all assemblies missing from GAC). A chicken and egg problem. Therefore I wrote a little script that takes care of this (parts taken from winetricks).
Basically it downloads .NET 1.1 SP1 after .NET 1.1 install and cabextracts the contents, copying the required GAC tool into right place. It then registers all assemblies (*.dll) found in $WINEPREFIX/drive_c/windows/Microsoft.NET/Framework/v1.1.4322/GAC into system wide GAC. Some assemblies are not really to be registered into GAC - that's why I didn't use winetricks try() on some steps (errors are expected).
After script end you will see new assemblies in GAC subdirs. "gacutil -l" can be used to list all registered assemblies.
The script serves only as base to be incorporated into official winetricks (relevant parts).
.NET 1.1 SP1 installer has some issues on it's own which I didn't bother to evaluate yet due to lack of time. That's why the install step of SP1 is omitted (only used to extract the gacutil tool).
---
Any .NET 1.1 application installer that use msi.MsiPublishAssemblies() to register shared assemblies into GAC needs to be worked around this way. Fortunately that happens not too often...
---
Stay tuned...
Regards