WIX Error 2716: Couldn't create a random subcomponent name for component 'CopySTST'
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=""[SystemFolder]cmd.exe" /c copy "[INSTALLLOC]AppFolder\FileName" "[TARGETDIR]"" />
<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>
精彩评论