WIX: Heat duplicate id issue with multiple features/folders

有些话、适合烂在心里 提交于 2019-12-05 14:29:09

If you were using Merge Modules this would be ok because each ID would be appended with a unique module ID. ( dir1.GUIDA, dir1.GUIDB, dir1.GUIDC ) If you are using fragments you either have to change the ID's or normalize the directory structure into a single wxs and use a DirectoryRef to pull it into your other wxs with your components.

I'm not sure Heat can handle all of this automatically. It's really just more of a starting point.

LordKifui

I also had the problem where I would generate multiple component groups based on folders that would end up in the same target installation folders.

If you have cygwin installed to make use of unix tools, what I did to eliminate those duplicate IDs is to use "sed" after each heat.exe command line to add a prefix to all the ids. I just add those sed commands to be part of the WIX pre-build step just like the heat ones.

For example:

sed -i 's/Directory\ Id=\"/Directory\ Id\"mod1/g' "generatedfile.wxs"

This command line would replace all ( Directory Id="..." ) by ( Directory Id="mod1..." )

It works great because those directory are not referenced but just included in the components which then are referenced in groups.

Hope that helps

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!