gpt4 book ai didi

windows-7 - 如何将文件复制到 CommonAppDataFolder?

转载 作者:行者123 更新时间:2023-12-03 22:21:21 25 4
gpt4 key购买 nike

在 WiX 我有

<Directory Id="CommonAppDataFolder">
<Directory Id="CommonAppDataManufacturerFolder" Name="$(var.MANUFACTURER)">
<Directory Id="AppDataFolder" Name="$(var.PRODUCTNAME)">
<Directory Id="DatasFolder" Name="Datas"/>
</Directory>
</Directory>
</Directory>


<ComponentGroup Id="DatasComponents" Directory="DatasFolder">
<Component Id="Database.sdf" Guid="4c33c78e-7113-4a8c-b9fd-6ba4f6490935">
<File Id="Database.sdf" Source="Database.sdf" />
<RemoveFolder Id='DatasFolder' On='uninstall' />
<RegistryValue Root='HKCU'
Key='Software\[Manufacturer]\[ProductName]'
Type='string'
Value=''
KeyPath='yes' />
</Component>
</ComponentGroup>

但是文件被复制到 C:\Users\username\AppData\Roaming\Datas\而不是 %ProgramData%\Manufacturer\ProductName\Datas\

最佳答案

问题是AppDataFolder是一个保留关键字,可将您带到漫游数据文件夹,我只是将此 ID 更改为非保留关键字,并且我的代码有效

<Directory Id="CommonAppDataFolder">
<Directory Id="CommonAppDataManufacturerFolder" Name="$(var.MANUFACTURER)">
<Directory Id="MyAppDataFolder" Name="$(var.PRODUCTNAME)">
<Directory Id="DatasFolder" Name="Datas"/>
</Directory>
</Directory>
</Directory>

关于windows-7 - 如何将文件复制到 CommonAppDataFolder?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21865005/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com