我创建了一个设法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
有描述的问题。