我很难让这个工作。他们的想法是将一些文件复制到在那里创建的目录中的ALLUSERSFOLDER,这也需要更改权限。
我尝试使用<CreateFolder>, <util:PermissionEx> and <CopyFile>
,但我只设法创建了文件夹并更改了其版权,但没有复制(移动)文件,这里是XML:
<Directory Id="ProgramFilesFolder">
<Directory Id="APPLICATIONROOTDIRECTORY" Name="MyApp">
<Directory Id="PFSTORAGE" Name="storage"/>
</Directory>
</Directory>
<Directory Id="CommonAppDataFolder">
<Directory Id="ALLUSERSFOLDER" Name="MyApp">
<Directory Id="AUSTORAGE" Name="storage"/>
</Directory>
<Component Id="AllUsersFiles" Guid="{F8765AB2-D78B-4A38-9FF4-DEEC1ACE6509}">
<CreateFolder>
<util:PermissionEx User="Everyone" GenericAll="yes"/>
</CreateFolder>
<CopyFile Id="copy" DestinationProperty="AUSTORAGE" SourceProperty="PFSTORAGE" SourceName="*.*" Delete="yes" />
<RegistryKey Root="HKCU" Key="Software\MyApp\install">
<RegistryValue Value="installing" Type="string" KeyPath="yes" />
</RegistryKey>
</Component>
</Directory>
答案 0 :(得分:-1)
您可以尝试使用此代码。在创建文件夹并更改文件夹的权限后调用此自定义操作
<CustomAction Id="C_SetQtCmdLineMoveFiles" Property="QtExecCmdLine"
Value=""[SystemFolder]cmd.exe" /c move/Y "[ALLUSERSFOLDER]storage\*.log" "[ALLUSERSFOLDER]NewFolder"" />
<CustomAction Id="QtCmdMoveFiles" BinaryKey="WixCA" DllEntry="CAQuietExec" Execute="immediate" Return="ignore" />