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.
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.
Edit your .WSI project in Wise for Windows Installer...
. Disable the "Generate native code version during installation" option on the assembly installed to the Global Assembly Cache.
. 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:
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: 184.108.40.206
Max. version: 220.127.116.11
. 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...
. 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
. 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.)
. Drag an End Statement action and drop it directly after the new custom action.
. Compile your project.
Wise for Windows Installer 18.104.22.1682 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)
Logged in Littlebuggy (Altiris - Lindon, Plymouth) database