MSI (Wix) 创建目录、更改权限和复制文件
我正在努力让这个工作。他们的想法是将一些文件复制到在那里创建的目录中的 ALLUSERSFOLDER 中,该目录也需要更改其权限。
我尝试使用
但我只设法创建了文件夹并更改了其权限,但没有复制(移动)文件,这里是 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>
I'm struggling to get this working. They idea is to copy some files to ALLUSERSFOLDER in a directory created there which also needs it's permissions changed.
I have try using <CreateFolder>, <util:PermissionEx> and <CopyFile>
but I only managed to get the folder created and its pemissions changed but not to copy (move) the files, here is the 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>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你可以试试这个代码。创建文件夹并更改文件夹的权限后,调用此自定义操作
You can try this code. Call this custom action once you have create the folder and changed permissions on the folder