gpt4 book ai didi

wix - 使用 Wix 自定义操作时复制命令不起作用

转载 作者:行者123 更新时间:2023-12-01 19:22:43 37 4
gpt4 key购买 nike

我有以下CustomAction:

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

因此,当它检测到 64 位操作系统时,它会将文件复制到 System32 文件夹中。如果我用 .bat 文件执行它,它就可以正常工作。但我更喜欢它是一个批处理命令。

日志内容如下:

MSI (s) (74:AC) [10:08:33:473]: Executing op: ActionStart(Name=CopyToSystem32,,)
Action 10:08:33: CopyToSystem32.
MSI (s) (74:AC) [10:08:33:473]: Executing op: CustomActionSchedule(Action=CopyToSystem32,ActionType=3234,Source=C:\Program Files (x86)\SetupProject\,Target=copy /y 64bits.txt C:\Windows\System32,)
MSI (s) (74:AC) [10:08:33:474]: Executing op: ActionStart(Name=RegisterProduct,Description=Registering product,Template=[1])
Action 10:08:33: RegisterProduct. Registering product
MSI (s) (74:AC) [10:08:33:474]: Executing op: ChangeMedia(,MediaPrompt=Please insert the disk: ,MediaCabinet=1\cab1.cab,BytesPerTick=0,CopierType=1,,,SignatureRequired=0,,,IsFirstPhysicalMedia=1)
MSI (s) (74:AC) [10:08:33:474]: Executing op: DatabaseCopy(DatabasePath=C:\Windows\Installer\32ea43.msi,ProductCode={0C013216-61FB-4283-AF0A- 6CB264019F5B},,,)
MSI (s) (74:AC) [10:08:33:474]: Note: 1: 1402 2: UNKNOWN\Products\612310C0BF163824FAA0C62B4610F9B5\InstallProperties 3: 2
1: CopyToSystem32 2: 1631

知道为什么我的 ExeCommand 没有复制我的文件吗?

谢谢!

最佳答案

AFAIK copy 是命令 shell 解释器的一部分,而不是其本身的命令。例如,如果您例如,您可以检查此项在 Windows 文件夹中执行 dir copy.*/s 操作。没有独立实现copy的文件。您可以做什么:预先调用命令解释器,例如:

cmd /c copy /y 64bits.txt C:\Windows\System32

/c-参数告诉解释器在执行后关闭(您也可以使用[%COMSPEC]-环境变量而不是cmd)。您还可以使用 CAQuietExecute 自定义操作来阻止 cmd 弹出窗口,如 here 中所述。 .
也许您也可以使用 CopyFile-element为了你的任务?这样你就不必处理 shell 窗口等。

关于wix - 使用 Wix 自定义操作时复制命令不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23007196/

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