Bug 772 - WiX's light tool fails to use merge modules
Summary: WiX's light tool fails to use merge modules
Status: RESOLVED ANSWERED
Alias: None
Product: Installers
Classification: Mono
Component: Windows Installer ()
Version: unspecified
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Jo Shields
URL:
Depends on:
Blocks:
 
Reported: 2011-09-13 06:05 UTC by Sam Morris
Modified: 2018-01-02 13:49 UTC (History)
3 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
test case (25.97 KB, application/zip)
2011-09-13 06:05 UTC, Sam Morris
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED ANSWERED

Description Sam Morris 2011-09-13 06:05:49 UTC
Created attachment 338 [details]
test case

When run under Mono on Windows (I used the 2.10.5 installed), the attached test case fails with the following error:

Microsoft (R) Windows Installer Xml Linker version 
Copyright (C) Microsoft Corporation. All rights reserved.

light.exe : error LGHT0001 : Object reference not set to an instance of an object

Exception Type: System.NullReferenceException

Stack Trace:
  at Microsoft.Tools.WindowsInstallerXml.MergeMod.NativeMethods.GetMsmMerge () [0x00000] in <filename unknown>:0 
  at Microsoft.Tools.WindowsInstallerXml.Binder.ProcessMergeModules (Microsoft.Tools.WindowsInstallerXml.Output output, Microsoft.Tools.WindowsInstallerXml.FileRowCollection fileRows) [0x00000] in <filename unknown>:0 
  at Microsoft.Tools.WindowsInstallerXml.Binder.BindDatabase (Microsoft.Tools.WindowsInstallerXml.Output output, System.String databaseFile) [0x00000] in <filename unknown>:0 
  at Microsoft.Tools.WindowsInstallerXml.Binder.Bind (Microsoft.Tools.WindowsInstallerXml.Output output, System.String file) [0x00000] in <filename unknown>:0 
  at Microsoft.Tools.WindowsInstallerXml.Tools.Light.Run (System.String[] args) [0x00000] in <filename unknown>:0 
Binder temporary directory located at 'C:/Users/sam/AppData/Local/Temp\5dce79d9\644e2864'.
Validator temporary directory located at 'C:/Users/sam/AppData/Local/Temp\238359b1\177a591e'.

Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object
  at Microsoft.Tools.WindowsInstallerXml.MergeMod.NativeMethods.GetMsmMerge () [0x00000] in <filename unknown>:0 
  at Microsoft.Tools.WindowsInstallerXml.Binder.ProcessMergeModules (Microsoft.Tools.WindowsInstallerXml.Output output, Microsoft.Tools.WindowsInstallerXml.FileRowCollection fileRows) [0x00000] in <filename unknown>:0 
  at Microsoft.Tools.WindowsInstallerXml.Binder.BindDatabase (Microsoft.Tools.WindowsInstallerXml.Output output, System.String databaseFile) [0x00000] in <filename unknown>:0 
  at Microsoft.Tools.WindowsInstallerXml.Binder.Bind (Microsoft.Tools.WindowsInstallerXml.Output output, System.String file) [0x00000] in <filename unknown>:0 
  at Microsoft.Tools.WindowsInstallerXml.Tools.Light.Run (System.String[] args) [0x00000] in <filename unknown>:0 
[ERROR] FATAL UNHANDLED EXCEPTION: System.NullReferenceException: Object reference not set to an instance of an object
  at Microsoft.Tools.WindowsInstallerXml.MergeMod.NativeMethods.GetMsmMerge () [0x00000] in <filename unknown>:0 
  at Microsoft.Tools.WindowsInstallerXml.Binder.ProcessMergeModules (Microsoft.Tools.WindowsInstallerXml.Output output, Microsoft.Tools.WindowsInstallerXml.FileRowCollection fileRows) [0x00000] in <filename unknown>:0 
  at Microsoft.Tools.WindowsInstallerXml.Binder.BindDatabase (Microsoft.Tools.WindowsInstallerXml.Output output, System.String databaseFile) [0x00000] in <filename unknown>:0 
  at Microsoft.Tools.WindowsInstallerXml.Binder.Bind (Microsoft.Tools.WindowsInstallerXml.Output output, System.String file) [0x00000] in <filename unknown>:0 
  at Microsoft.Tools.WindowsInstallerXml.Tools.Light.Run (System.String[] args) [0x00000] in <filename unknown>:0 

To try this yourself, install Wix3.msi from <http://wix.codeplex.com/releases/view/44406#DownloadId=119160> to the default location, then from a Mono command prompt run:

C:\Users\sam\Downloads\merge-module>mono "C:\Program Files (x86)\Windows Installer XML v3\bin\light.exe" pr.wixobj

With Windows' own .NET, the same command works correctly and produces the output file, pr.msi. I'm using Windows 7 x86_64.
Comment 1 Alexander Köplinger [MSFT] 2018-01-02 13:49:44 UTC
I tried this with Mono 5.4 (32bit) on Windows 10 and WiX 3.10, it loads the mergemod.dll from the COM interop (https://github.com/wixtoolset/wix3/blob/7c8457fa3802858add8981b92996e19574e762da/src/tools/wix/MergeMod/NativeMethods.cs#L491-L506) but crashes with an access violation in mergemod.dll then.

Given that COM interop is not fully supported and we're moving to GitHub issues I'll close this bug, please reopen it on https://github.com/mono/mono/issues if you still care about it :)