Wix light.exe : error LGHT0001: The system cannot open the device or file specified.

2

Today we build our product with MSBuild /m to build with multiprocess.

Before we do a change to heat some files in pre-build event, build with MSBuild multiprocess can be success.

Now build is failed with following exception:

124>light.exe : error LGHT0001: The system cannot open the device or file specified. (Exception from HRESULT: 0x8007006E) [...MSI.wixproj]

     Exception Type: System.IO.FileLoadException

     Stack Trace:
        at Microsoft.Tools.WindowsInstallerXml.MergeMod.IMsmMerge2.OpenModule(String fileName, Int16 language)
        at Microsoft.Tools.WindowsInstallerXml.Binder.MergeModules(String tempDatabaseFile, Output output, FileRowCollection fileRows, StringCollection suppressedTableNames)
        at Microsoft.Tools.WindowsInstallerXml.Binder.BindDatabase(Output output, String databaseFile)
        at Microsoft.Tools.WindowsInstallerXml.Binder.Bind(Output output, String file)
        at Microsoft.Tools.WindowsInstallerXml.Tools.Light.Run(String[] args)

(Link target) -> light.exe : error LGHT0001: The system cannot open the device or file specified. (Exception from HRESULT: 0x8007006E) [...Msi.wixproj]

using Wix 3.8

wix
asked on Stack Overflow May 30, 2014 by Amitabha

1 Answer

2

After investigation with team, we find out root cause. ProductMSI.sln has more than 50 MSI wix projects and all shared MSM projects to build.

Each MSI project has a post build event action that it will reopen MSI related MSM to do some change to MSI by WindowsInstaller API as DataBase. And it opens MSM as read&edit mode by API.

So if one shared MSM is opened by one MSI post event and will be opened by another wix project to compile. Open request will be denied. The above error will be thrown.

Solution: 1.Change post event action to open MSM as read-only, instead of read&edit mode.

We test it pass.

answered on Stack Overflow May 30, 2014 by Amitabha

User contributions licensed under CC BY-SA 3.0