tom-englert / Wax

An interactive editor for WiX setup projects.
MIT License
220 stars 25 forks source link

The directory name: x64 is the same as one of the MSI Public Properties and can cause unforeseen side effects #19

Closed maikebing closed 7 years ago

maikebing commented 7 years ago

error LGHT0204: ICE99: The directory name: x64 is the same as one of the MSI Public Properties and can cause unforeseen side effects. [D:\Multi-Runner\builds\3c61e4ea\0\maikebing\DES\src\DES.Installer\DES.Installer.wixproj]

Wrong code: <Directory Id="x64" Name="x64" />

Resolvent: http://stackoverflow.com/questions/16851193/with-wix-distribute-a-program-that-uses-sqlite-must-work-on-both-32bit-and-64b

My code <Directory Id="DIR_x64" Name="x64" />

Can you fix this problem in the new version?

tom-englert commented 7 years ago

This is not an issue of Wax - it just helps you to maintain the file list in .wxs files - it does not compile your code.

Your issue is using illegal ids, and the stackoverflow article already has the answer.

maikebing commented 7 years ago

This is the wax generated by ID, because SQLite relies on X86 and x64 files. Using the wax will automatically generate the ID. Can WAX avoid generating such ID?

Leogiciel commented 7 years ago

@maikebing : You can force wax to prefix directory ids by "dir_". I'll come back to you with a working example.

@tom-englert : Maybe implementing this can be interesting, it will avoid some other conflicts like this one ?

Leogiciel commented 7 years ago

@maikebing : To achieve this, you can replace line 154 of file WaxProject.cs : return (_configuration.DirectoryMappings.TryGetValue(directory, out value) && (value != null)) ? value : GetDefaultId(directory);

by : return (_configuration.DirectoryMappings.TryGetValue(directory, out value) && (value != null)) ? value : string.Concat("dir_",GetDefaultId(directory));

maikebing commented 7 years ago

OK!

tom-englert commented 7 years ago

The solution suggested by @Leogiciel would break backward compatibility, so I have added a more specific workaround. However you can always create your own id's an just add a custom mapping in Wax.

@maikebing: I am also using SQLite in some projects, but SQLite has a post-build step to copy those files, and I had to maintain those entries manually, so I wonder how Wax can know about these directories?