Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/wix/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ajax/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用Wix自定义操作时,“复制”命令不起作用_Wix_Wix3.5_Wix3.6_Wix3.7 - Fatal编程技术网

使用Wix自定义操作时,“复制”命令不起作用

使用Wix自定义操作时,“复制”命令不起作用,wix,wix3.5,wix3.6,wix3.7,Wix,Wix3.5,Wix3.6,Wix3.7,我有以下自定义操作: <CustomAction Id="CopyToSystem32" ExeCommand="copy /y 64bits.txt C:\Windows\System32" Directory="INSTALLFOLDER" Impersonate="no" Execute="deferred" Return="asyncWait" /> <InstallExecuteSequence> <Custom Action="CopyToSyst

我有以下
自定义操作

<CustomAction Id="CopyToSystem32" ExeCommand="copy /y 64bits.txt C:\Windows\System32" Directory="INSTALLFOLDER" Impersonate="no" Execute="deferred" Return="asyncWait" />

<InstallExecuteSequence>
  <Custom Action="CopyToSystem32" After="InstallFiles" >VersionNT64</Custom>
</InstallExecuteSequence>
你知道为什么我的
execomand
没有复制我的文件吗


谢谢

AFAIK
copy
是命令shell解释器的一部分,而不是命令本身。例如,如果您在
Windows
-文件夹中执行
dir copy.*/s
,则可以检查此项。没有独立实现
copy
的文件。 您可以做的事情:在调用命令解释器之前做准备,例如:

cmd /c copy /y 64bits.txt C:\Windows\System32
/c
-参数告诉解释器在执行后关闭(您也可以使用
[%COMSPEC]
-环境变量而不是
cmd
)。您还可以使用
CAQuietExecute
自定义操作来阻止cmd弹出,如前所述。

也许你也可以用它来完成你的任务?这样,您就不必处理外壳窗口等问题。

哇,太棒了!就那样!我也会看看你提到的CAQuiteExecute。再次感谢!A+++我忘记了使用
xcopy.exe
robocy.exe而不是
cmd/c copy
的其他可能性。这两者都可以在
System32
-文件夹中找到。但是,如果可能,最简单、最优雅的方法是使用Windows Installer/WiX提供的机制,即如果可能,使用
CopyFile
-元素。
cmd /c copy /y 64bits.txt C:\Windows\System32