KNOWN ISSUE: Generate Native Code Version does not function for assemblies installed to the GAC. Error: "Installation ended prematurely".

Article:TECH14141  |  Created: 2006-06-05  |  Updated: 2007-05-10  |  Article URL http://www.symantec.com/docs/TECH14141
NOTE: If you are experiencing this particular known issue, we recommend that you Subscribe to receive email notification each time this article is updated. Subscribers will be the first to learn about any releases, status changes, workarounds or decisions made.
Article Type
Technical Solution

Issue



The Assembly option "Generate native-code version during installation" is configured on a file or files that install to the Global Assembly Cache (GAC).  Resulting installation fails with "Fatal Error: Installation ended prematurely because of an error."

This problem does not affect files that are not installed to the GAC.

Environment



Wise for Windows Installer 6.20.0.282
Wise Package Studio 6.01.0.281
Wise Installation Studio 7.0 (when specifying this option for .NET 2.0 assemblies)
Wise Package Studio 7.x (when specifying this option for .NET 2.0 assemblies)


Cause



 


Solution



This issue is partially fixed for Wise Installation Studio/Express 7.0 and Wise Package Studio 7 SP2.

If you have .NET 2.0 assemblies that are installed to the C:\Windows\Assembly\GAC_MSIL directory, you will still receive the Fatal Error. In this case, continue to use the workaround found below for those assemblies.

Workaround:

Edit your .WSI project in Wise for Windows Installer...

1. Disable the "Generate native code version during installation" option on the assembly installed to the Global Assembly Cache.

2. Add a System Search for NGen.exe (Native Image Generator)...
   a. Add a File/Directory search in the System Search page in Installation Expert.  This will find NGen.exe on the destination machine.
   b.  Populate the System Search as follows:
      Property:  NGEN_EXE_20
      Operation:  Search for file: return full file name
      Search Directory: [WindowsFolder]Microsoft.Net\Framework
      Search Depth: 2
      File Name: NGen.exe
   c. Click the Details button and enter the Minimum and Maximum versions file will be considered a match on the destination machine.
       For example, to find the .NET Framework 2.0 version of NGen.exe:
         Min. version: 2.0.0.0
         Max. version: 2.9.9.9

3.  Modify the GenNativeImages.wse script...
       a.  Download the file "GenNativeImages.wse".  The file is attached to this article.
       b.  Open the .WSE file in WiseScript Express (or WiseScript Editor, depending on your product type).
       d.  Open the "Set Variable FILELIST..." script item.
       e4.  Set "New Value" to a semi-colon-delimited list of file names of files you will be installing into the GAC for which you wish to have Native Images generated.  Leave a trailing semi-colon.  Example:  file1.dll;file2.dll;
       f.  Compile the script.


Back in your .WSI project in Wise for Windows Installer...
4.  Create a WiseScript custom action to execute NGen.exe
      a.  Go to MSI Script and Select the Execute Immediate tab.
      b.  Scroll to the bottom of the script.
      c.  Drag a new "Run WiseScript from Installation" action and drop it below Install Finalize.
      d.  Populate the Run WiseScript from Installation dialog as shown below:
               Custom Action Name:  GenNativeScript
               WiseScript .EXE File:  c:\path\to\GenNativeImages.exe
               Click OK.

5.  Drag an If Statement action and drop it onto your new custom action.
        If Condition: NOT Installed AND NGEN_EXE_20
           (NOTE: This condition will allow the action to run only during installation, and only of NGen.exe was located by the System Search.)

6.  Drag an End Statement action and drop it directly after the new custom action.

7. Compile your project.


Attachments

GenNativeImages.wse.zip (2 kBytes)

Supplemental Materials

SourceDEFECT
ValueLB 50270
DescriptionLogged in Littlebuggy (Altiris - Lindon, Plymouth) database

Legacy ID



23299


Article URL http://www.symantec.com/docs/TECH14141


Terms of use for this information are found in Legal Notices