Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

wix

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

like image 970
Amitabha Avatar asked Jan 24 '26 01:01

Amitabha


1 Answers

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.

like image 114
Amitabha Avatar answered Jan 26 '26 16:01

Amitabha