WIX Error 2716: Failed to create random subcomponent name for CopySTST component

I use Heat at run time to create the components that will be installed. I need to copy multiple files. But every time I use <CopyFile> without the FileId attribute, it does not work at runtime with Error 2716: Couldn't create a random subcomponent name for component 'copyFile'

I cannot use FileId because it is not known at design time.

+4
source share
2 answers

You can convert the output WXS file using the XSL template. To do this, use -t: switch between command line options. In this template, you can add CopyFile elements to the correct components and avoid the problem with the identifier "Id is unknown."

0
source

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 add setup

 <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> 
-2
source

All Articles