Page MenuHome GnuPG

MSI: Link the MSI package with wine
Open, WishlistPublic

Description

Just so that there is a task for this.

The MSI build process currently builds multiple wixlibs which are basically binary packages contining the files of some components and then as a final step links them together into an MSI package. Linking means calling the tool "light.exe" to combine the various wixlibs into a consistent MSI Database.

While everything up to that final link is done using WINE on linux, the last step always ended up with output like:

51184.480:012c:fixme:file:NtLockFile I/O completion on lock not implemented yet
51185.584:012c:fixme:msi:MsiGetLastErrorRecord 
51185.594:012c:err:msidb:msi_commit_streams failed to write stream L"\430b\4131\4735\443e\4336\41ac\47a8\43e7\482f" (hr = 0x80030102)
51185.594:012c:err:msi:MsiDatabaseCommit Failed to commit streams!
51185.594:012c:fixme:msi:MsiGetLastErrorRecord 
51185.594:012c:fixme:msi:MsiGetLastErrorRecord 
light.exe : error LGHT0216 : An unexpected Win32 exception with error code 0x65B occurred: Function failed

Searching on the Web has shown that other projects run into this too but I could not find a fix, usually it was suggest to the person encountering the problem to use Windows instead. So we use SSH to then log into a Windows Host and run the final link step there. This complicates and slows down the build and makes it harder to reproduce so it would be better if it could be avoided. When I originally started working with wine and wixtools for GnuPG, I could link the GnuPG Wixlib into a GnuPG MSI standalone installer. So it must have something to do with the size, or whatever. The same call with the same binaries works on Windows. I think I have tried nearly everything, no parrelization, no compression, etc. pp. Not even ChatGPT could help.

I think the related source for this in reactos is: https://doxygen.reactos.org/d1/dd4/streams_8c_source.html#l00607

For now I have given up on this again with wine-9.14 and wixtools 3.14 and will just commit the target I have used to test this which can be optionally executed to try it again in the future.

Event Timeline

aheinecke triaged this task as Wishlist priority.Aug 13 2024, 9:56 AM
aheinecke created this task.

light.exe : error LGHT0216 : An unexpected Win32 exception with error code 0x65B occurred: Function failed

I got hit by the same issue while trying to package an irrelevant package on Linux, and found the following workaround that seems to be working:

https://github.com/dactivllc/docker-wix/blob/master/README.md#light-fails-when-running-validation

id. est. Adding the -sval command option to bypass the database validation step will allow the command to succeed. Whether doing so is reasonable is another issue, though.

Possibly related upstream bug:

WineHQ Bugzilla – Bug 11673 – WiX Toolset v3.x: Failure to validate created MSI package due to MsiDatabaseMerge stub
https://bugs.winehq.org/show_bug.cgi?id=11673

Unfortunately, the attempt on my end still fails. The MSI package was successfully built; however, testing installing it on a Windows host resulted in garbled UI text and a bunch of errors.

We probably should avoid this approach until the package validation issue is fixed upstream.