使用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