开发者

WIX Error 2716: Couldn't create a random subcomponent name for component 'CopySTST'

开发者 https://www.devze.com 2023-03-30 16:24 出处:网络
I Am using Heat at run time to generate the components that will installed. There are few files that I need to copy. But every time I use <CopyFile> without the F开发者_Python百科ileId attribute

I Am using Heat at run time to generate the components that will installed. There are few files that I need to copy. But every time I use <CopyFile> without the F开发者_Python百科ileId attribute, it fails at run time with Error 2716: Couldn't create a random subcomponent name for component 'copyFile'

I can't use FileId because it is not known at the design time.


You can transform the output WXS file with XSL template. There's -t: switch among heat command line options to do this. In that template, you can add a CopyFile elements to the proper components and avoid "Id is unknown" problem you face with.


Use paraffin or custom action

  • Paraffin

%1\Paraffin.exe -dir "..\..\AppFolder" -dirref INSTALLLOC -custom COMPONENTNAME ..\..\ApplicationFragment.wxs -guids -ext .csproj -ext .cs -direXclude obj -direXclude "bin\Config" -direXclude Properties -multiple

  • Custom Action

In customaction add

<CustomAction Id="A_SetQtCmdLineCopyFiles" Property="QtExecCmdLine"
                Value="&quot;[SystemFolder]cmd.exe&quot; /c copy &quot;[INSTALLLOC]AppFolder\FileName&quot; &quot;[TARGETDIR]&quot;" />
<CustomAction Id="QtCmdCopyFiles" BinaryKey="WixCA" DllEntry="CAQuietExec" Execute="immediate" Return="ignore" />

Then in Product.wxs add

<Custom Action="GA_SetQtCmdLineCopyFiles" After="InstallFinalize">NOT INSTALLED AND NOT REMOVE</Custom>
<Custom Action="QtCmdCopyFiles" After="GA_SetQtCmdLineCopyFiles">NOT INSTALLED AND NOT REMOVE</Custom>
0

精彩评论

暂无评论...
验证码 换一张
取 消