【发布时间】:2010-07-07 10:45:46
【问题描述】:
我创建了一个托管CustomAction 来将 *.MSI 中未包含的 2 个文件复制到安装目录。
虽然这在 Windows XP 中有效,但在 Windows 7 中失败。虽然日志显示文件已复制到所需位置 C:\Program Files\MyApp\,但它们实际上已复制到 C:\Users\MyUser\AppData\Local\VirtualStore\Program Files (x86)\MyApp\。
我的猜测是这与修改程序文件夹的访问权限有关。
这就是我在 WiX 中调用自定义操作的方式:
<CustomAction
Id='InstallSource'
BinaryKey='SrcInstActionDll'
DllEntry='InstallSourceFiles'
Execute='deferred'
Impersonate='no'/>
<CustomAction
Id="InstallSource.SetProperty"
Return="check"
Property="InstallSource"
Value='Files=[SourceDir]$(var.SourceZipName),[SourceDir]$(var.SymbolsZipName);TargetDir=[ParentFolder]'
Execute='immediate'/>
CustomAction 本身只是调用File.Copy()。安装程序复制的其他文件在 Windows 7 中完美运行。只有那些使用 CustomAction 复制的文件存在上述问题。
【问题讨论】:
标签: .net windows wix installation wix3.5