我嘗試,所以我用這個代碼段與NSIS安裝MS SQL 2008 R2:NSIS不以正確的方式解決魔術變量?
SetOutPath "$TEMP\Unit\DimIns\binary\SQLSVR"
File /r "..\..\shared-binaries\download.unit.hu\MsSQLServer2008R2\SQLSVR-x86\"
SetOutPath "$TEMP\Unit\DimIns\"ExecDos::exec "$OUTDIR\binary\SQLSVR\setup.exe /QUIET /IACCEPTSQLSERVERLICENSETERMS /ConfigurationFile=$OUTDIR\binary\SQLSVR\dimsqlsetup.ini /ACTION=Install" "" "$OUTDIR\MsSQLServer2008R2.log"
但它會失敗。它輸出此錯誤消息:
The following error occurred:
The action type 'ExecuteWorkflowAction' is not valid for the WorkflowIdentity element. The only valid action type is ExecuteWorkflowAction.
Error result: -2068709375
Result facility code: 1202
Result error code: 1
Please review the summary.txt log for further details
The following error occurred:
The action type 'ExecuteWorkflowAction' is not valid for the WorkflowIdentity element. The only valid action type is ExecuteWorkflowAction.
Error result: -2068709375
Result facility code: 1202
Result error code: 1
Please review the summary.txt log for further details
Microsoft (R) SQL Server 2008 R2 Setup 10.50.4000.00
Copyright (c) Microsoft Corporation. All rights reserved.
但是,如果我明確給予路徑
ExecDos::exec "C:\Users\UNIT-TEST\AppData\Local\Temp\Unit\DimIns\binary\SQLSVR\setup.exe /QUIET /IACCEPTSQLSERVERLICENSETERMS /ConfigurationFile=C:\Users\UNIT-TEST\AppData\Local\Temp\Unit\DimIns\binary\SQLSVR\dimsqlsetup.ini /ACTION=Install" "" "C:\Users\UNIT-TEST\AppData\Local\Temp\Unit\DimIns\MsSQLServer2008R2.log"
或運行它從CMD
C:\Users\UNIT-TEST\AppData\Local\Temp\Unit\DimIns\binary\SQLSVR\setup.exe /QUIET /IACCEPTSQLSERVERLICENSETERMS /ConfigurationFile=C:\Users\UNIT-TEST\AppData\Local\Temp\Unit\DimIns\binary\SQLSVR\dimsqlsetup.ini /ACTION=Install
然後安裝程序正確安裝MS SQL。所以我無法想象$TEMP
或$OUTDIR
由NSIS以不良方式解決。是否可能或問題在哪裏?
如果我將$TEMP
或$OUTDIR
的內容寫到控制檯日誌中,它看起來像是存儲了正確的路徑。
我正確使用ExecDos :: exec。無論如何,我已經嘗試了你的建議,但我仍然有同樣的錯誤。 – NoNameProvided