indygreg / PyOxidizer

A modern Python application packaging and distribution tool
Mozilla Public License 2.0
5.51k stars 239 forks source link

tugger-wix: Sanitise characters in Directory/ComponentGroup Id's. #708

Open andrewleech opened 1 year ago

andrewleech commented 1 year ago

I'm using PyOxidizer msi functionality for the first time with an application using wxPython. This package has a bunch of files with @ in the filenames which threw errors from wix:

D:\src\wsl-usbip-gui\build\x86_64-pc-windows-msvc\debug\msi_installer\wxs\install-files.wxs(6517) : error CNDL0014 : The DirectoryRef/@Id attribute's value, 'wsl_usb_gui.dir.lib.wx.locale.ca@valencia.LC_MESSAGES', is not a legal identifier.  Identifiers may contain ASCII characters A-Z, a-z, digits, underscores (_), or periods (.).  Every identifier must begin with either a letter or an underscore.

D:\src\wsl-usbip-gui\build\x86_64-pc-windows-msvc\debug\msi_installer\wxs\install-files.wxs(6524) : warning CNDL1126 : The ComponentGroup/@Id attribute contains invalid characters for an identifier. Being able to use invalid identifier characters for a ComponentGroup identifier has been deprecated.

I saw there was already some character cleanup in the Id generation for these elements, but it didn't quite cover everything.

This PR enforces only the characters allowed according to the reported error above.