當我編譯下面的Inno Setup腳本時,它給我一個錯誤(如下)。我借用了here的代碼,所以我不確定它爲什麼不能正常工作。 136如何獲取Inno Setup以檢查文件是否不存在
Line 136:
Column 10:
Invalid prototype for 'FileDoesNotExist'
線是function FileDoesNotExist(file: string): Boolean;
[Run]
Filename: "{sys}\regsvr32.exe"; Parameters: "msstdfmt.dll"; WorkingDir: {app}\Pronto\Programs\; BeforeInstall: FileDoesNotExist(ExpandConstant('{sys}\msstdfmt.dll')); StatusMsg: "Registering Controls..."
[Code]
function FileDoesNotExist(file: string): Boolean;
begin
if (FileExists(file)) then
begin
Result := False;
end
else
begin
Result := True;
end;
end;
其實你通常不應該在乎它是否存在。只需使用默認設置(即不是「ignoreversion」),這樣就可以安裝該文件,如果它將升級它,並將其保持獨立。 – Miral