0
私はもっと大きなInno Setupスクリプトを持っています。Innoセットアップ構文エラー
私はそれがうまくいくはずだと思いますが、何らかの理由でそれはしません。
構文エラー:コンパイラは、コンパイラが私に語っライン
function PrepareToInstall
に停止します。
誰かが私のエラーに気付くでしょうか? ありがとうございます!
[Code]
//I have removed some functions of which I think they don't contribute to the problem
function IsServiceRunning(ServiceName: string): boolean;
var
hSCM: HANDLE;
hService: HANDLE;
Status: SERVICE_STATUS;
begin
hSCM := OpenServiceManager();
Result := false;
if hSCM <> 0 then
begin
hService := OpenService(hSCM, ServiceName, SERVICE_QUERY_STATUS);
if hService <> 0 then
begin
if QueryServiceStatus(hService, Status) then
begin
Result := (Status.dwCurrentState = SERVICE_RUNNING)
end;
CloseServiceHandle(hService)
end;
CloseServiceHandle(hSCM)
end
end;
function PrepareToInstall(var NeedsRestart: Boolean): String;
begin
if IsServiceRunning("oscmaintenanceserver") then begin
if StopService("oscmaintenanceserver") then begin
RemoveService("oscmaintenanceserver");
end;
end;
end;
end;
開始と終了を使用しなければならないとき、私はちょうど理解していません。たとえば、この例の行「if(CurStep = ssInstall)then」があり、終了していません。とても奇妙。 –
* http://wiki.freepascal.org/Ifの "then"文 "*セクションの" More statements "を参照してください。 –