在這里,我嘗試了一些東西,但它根本不起作用。有人能指導我如何從安裝程序運行多個腳本嗎
<SetProperty Id="PS1"
Before="PS1"
Sequence="execute"
Value =""C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe"-NoLogo -NonInteractive -ExecutionPolicy Bypass -InputFormat None -NoProfile -File "-Command "cd '[INSTALLLOCATION]'; & '[#ps1]' ; exit $$($Error.Count)"" />
<CustomAction Id="PS1"
BinaryKey="WixCA"
DllEntry="WixQuietExec"
Execute="deferred"
Return="check"
Impersonate="no" />
<InstallExecuteSequence>
<Custom Action="PS1" After='InstallFiles'>
<![CDATA[NOT Installed]]>
</Custom>
</InstallExecuteSequence>
到目標文件夾的文件被復制,但它是這樣說的,為什么我不知道,在一個日志文件中,它是這樣顯示的
WixQuietExec: Processing -File '-Command cd' failed because the file does not have a '.ps1' extension. Specify a valid Windows PowerShell script file name, and then try again.
WixQuietExec: Windows PowerShell
WixQuietExec: Copyright (C) Microsoft Corporation. All rights reserved.
WixQuietExec:
WixQuietExec: Try the new cross-platform PowerShell https://aka.ms/pscore6
WixQuietExec:
WixQuietExec: Error 0xfffd0000: Command line returned an error.
WixQuietExec: Error 0xfffd0000: QuietExec Failed
WixQuietExec: Error 0xfffd0000: Failed in ExecCommon method
CustomAction PS1 returned actual error code 1603 (note this may not be 100% accurate if translation happened inside sandbox)
這種情況并不總是發生,但錯誤信息非常清楚。這里是word-wrapped,因此更容易閱讀:
這是一條PowerShell錯誤消息。