2017-07-10 38 views
2

我的安裝程序應該在已存在的時候跳過更新程序文件,但它說文件正在被應用程序使用,並且安裝無法繼續。不要測試由Inno Setup中的應用程序使用已存在的文件

安裝程序無法自動關閉所有應用程序。建議您在繼續之前使用需要由安裝程序更新的文件關閉所有應用程序。

單擊重試再試一次,忽略繼續,或中止取消安裝。

在安裝腳本的更新文件導入這樣

Source: "..\bin\Release\updater\*"; DestDir: "{app}\updater"; Flags: onlyifdoesntexist 

根據文檔的標誌onlyifdoesntexist應確保文件不會在未來的補丁。

我甚至試圖刪除updater目錄以外的其他東西,以確保這些文件導致問題。有任何想法嗎?

這裏是日誌文件

2017-07-10 14:12:59.229 Log opened. (Time zone: UTC+02:00) 
2017-07-10 14:12:59.229 Setup version: Inno Setup version 5.5.9 (u) 
2017-07-10 14:12:59.229 Original Setup EXE: C:\Users\pikausp\AppData\Roaming\TMEgadget4\updater.exe 
2017-07-10 14:12:59.229 Setup command line: /SL5="$F0962,149593,121344,C:\Users\pikausp\AppData\Roaming\TMEgadget4\updater.exe" /SPAWNWND=$140E9A /NOTIFYWND=$C0CAA /VERYSILENT 
2017-07-10 14:12:59.229 Windows version: 10.0.14393 (NT platform: Yes) 
2017-07-10 14:12:59.229 64-bit Windows: Yes 
2017-07-10 14:12:59.229 Processor architecture: x64 
2017-07-10 14:12:59.229 User privileges: Administrative 
2017-07-10 14:12:59.229 64-bit install mode: No 
2017-07-10 14:12:59.231 Created temporary directory: C:\Users\pikausp\AppData\Local\Temp\is-88HJM.tmp 
2017-07-10 14:12:59.307 RestartManager found an application using one of our files: TMEgadget.Updater 
2017-07-10 14:12:59.307 Can use RestartManager to avoid reboot? Yes (0) 
2017-07-10 14:12:59.311 Starting the installation process. 
2017-07-10 14:12:59.313 Shutting down applications using our files. 
2017-07-10 14:13:29.359 Some applications could not be shut down. 
2017-07-10 14:13:29.359 Message box (Abort/Retry/Ignore): 
          Setup was unable to automatically close all applications. It is recommended that you close all applications using files that need to be updated by Setup before continuing. 

          Click Retry to try again, Ignore to proceed anyway, or Abort to cancel installation. 
2017-07-10 14:13:34.796 User chose Abort. 
2017-07-10 14:13:34.796 User canceled the installation process. 
2017-07-10 14:13:34.796 Rolling back changes. 
2017-07-10 14:13:34.797 Starting the uninstallation process. 
2017-07-10 14:13:34.797 Uninstallation process succeeded. 
2017-07-10 14:13:34.797 Deinitializing Setup. 
2017-07-10 14:13:34.802 Log closed. 
+0

我不能重現這一點。向我們顯示[mcve]的日誌文件(單個文件安裝)。 –

+0

@MartinPrikryl更新了這個問題,那應該是好的fromat我相信? – pikausp

+0

我會在一瞬間添加日誌 – pikausp

回答

3

onlyifdoesntexist確實不用於檢查正在使用運行的應用程序文件的目的進行評估。

但是評估Check parameter

所以,你可以實現對存在的測試是這樣的:

[Files] 
Source: "..\bin\Release\updater\*"; DestDir: "{app}\updater"; Check: OnlyIfDoesntExist 

[Code] 

function OnlyIfDoesntExist: Boolean; 
begin 
    Result := not FileExists(ExpandConstant(CurrentFilename)); 
end; 

另一種方式是創造性地設置CloseApplicationsFilter directive不包括在updater文件夾中的文件。

相關問題