Adding shortcut for WiX file in a different fragment
I'm using heat.exe to generate fragments similar to this:
<Fragment>
<DirectoryRef Id="INSTALLDIR">
<Component Id="id1" Guid="*">
<File Id="fid1" KeyPath="yes" Source="SourceDir\Foo1.dll" />
</Component>
开发者_JAVA技巧<Component Id="id2" Guid="*">
<File Id="fid2" KeyPath="yes" Source="SourceDir\Foo2.dll" />
</Component>
<Component Id="id3" Guid="*">
<File Id="fid3" KeyPath="yes" Source="SourceDir\Bar.exe" />
</Component>
</DirectoryRef>
</Fragment>
<Fragment>
<ComponentGroup Id="Components">
<ComponentRef Id="id1" />
<ComponentRef Id="id2" />
<ComponentRef Id="id3" />
</ComponentGroup>
</Fragment>
These fragments are stored in the auto-generated wxs file.
I'm then adding them into my feature (in the main WiX file) like so:
<ComponentGroupRef Id="Components"/>
This works fine.
However, I'd also like to add a shortcut to Bar.exe to my start menu. I ideally want to do this in my main wix file, with the Bar.exe component still residing in the auto-generated wxs file. How would I approach this problem without modifying the auto-generated code?
Do you necessarily want it to reside in the definition? You can have it in a separate component, the way it is demonstrated in the manual: http://wix.sourceforge.net/manual-wix3/create_start_menu_shortcut.htm
Otherwise, you should probably transform the heat output with the XSL transform by adding the definition there. Heat.exe accepts the switch to apply XSL transform right after harvesting.
Hope this helps.
精彩评论