WiX: pulling in a CustomTable from a Fragment WITHOUT a CustomAction

荒凉一梦 提交于 2019-12-24 03:02:05

问题


I have a custom table defined in a <Fragment> that I want to link into the main .wxs file. My question is similar to this question, but my fragment does not have a <CustomAction> tag to refer to, and there is no <CustomTableRef> tag to use in the main file.

Is the only way to pull in a <Fragment> that does not have a <...Ref>able tag to inject a dummy tag that can be Ref'd? -- e.g. a <Component> with a "never-install" condition, or a <CustomAction> that never gets scheduled to run (or does something totally benign like setting property Foo to "")?

I am looking for a recommended best practice. Thanks!


回答1:


In your fragment you can create a property like so:

<Property Id="IncludeMyFragment" Value="1" />

Then reference that fragment in your source like so:

<PropertyRef Id="IncludeMyFragment"/>

That should pull in the contents of the fragment.




回答2:


When using references, the entire fragment is consumed. Are you defining a custom table simply to be documentation / metadata regarding the MSI or are you actually using it in a data driven custom action? Typically I would define the custom action and custom table schema in a single fragment so that when someone references the custom action they get the supporting infrastructure. Other fragments can then contain the actual data for said custom table ( implementation specific ).



来源:https://stackoverflow.com/questions/10339055/wix-pulling-in-a-customtable-from-a-fragment-without-a-customaction

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