![](/img/trans.png)
[英]Inno Setup skips postinstall when 3rd party software installation was cancelled
[英]Detecting that installation was aborted/cancelled in Inno Setup
我有一個 Inno Setup 安裝程序,在DeinitilizeSetup()
過程中有一些代碼。 重要的是,此過程包括調用創建/啟動托管本地主機 REST API 的服務(它剛剛安裝),然后調用該 API 以“完成”安裝(這是一個誤導性的名稱,但這並不重要) .
交易如下:如果安裝因任何原因中止(當前測試用例是應用程序是否打開,因此安裝程序無法覆蓋 exe/etc),它會中止,因為它以/verysilent
模式運行。 但我想知道它正在中止(與快樂路徑結束相比)並使用查詢字符串參數調用 RESTAPI 作為 true 與 false。
我都設置了這樣的條件:
if (InstallerCanceled = true) then begin
Log('Calling Service''s FinishInstall endpoint with errorOccurred=true')
WinHttpReq.Open('GET', 'http://localhost:5000/api/update/FinishInstall?errorOccurred=true', False)
end
else begin
Log('Calling Service''s FinishInstall endpoint with errorOccurred=false');
WinHttpReq.Open('GET', 'http://localhost:5000/api/update/FinishInstall?errorOccurred=false', False);
end
WinHttpReq.Send('');
但我不知道如何定義條件本身……我怎么知道安裝是否被取消?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.