2016-05-22 10 views
0

"セミコロンがありません"という結果になる次の機能があります。 。Inno-Setupセミコロンがありません

が助けてくれてありがとう、なぜ!

function PrepareToInstall(var NeedsRestart: Boolean): String; 
begin 
    if not IsServiceRunning('oscmaintenanceserver') then 
     begin 
      MsgBox('Service not running. Exit.', mbInformation, MB_OK); 
      exit; 
     end 
    end 
    if not StopService('oscmaintenanceserver') then 
     begin 
      MsgBox('Service couldnt be stopped.', mbInformation, MB_OK); 
      exit; 
     end 
    end 
    if not RemoveService('oscmaintenanceserver') then 
     begin 
      MsgBox('Couldnt remove service.', mbInformation, MB_OK); 
      exit; 
     end 
    end 
    begin 
     MsgBox('All went fine :-).', mbInformation, MB_OK); 
     exit; 
    end 
end; 
+1

の1-各「終了」のペアを、あなたは多くのことを持っている「開始」より多くのと。「末端の2 - 文で終わります。 『;』、あなたがする必要があります残りの最後にセミコロンを入れてください。 –

+0

ありがとうございます。 swer。 –

+0

ようこそ。あなたが望むなら、先に進む。 –

答えて

2

あなたは各ifブランチに余分endを持っている。また、文の終わりをマークすると、エラー」が、私は表示されませんendはそれの後にセミコロンが必要です

function PrepareToInstall(var NeedsRestart: Boolean): String; 
begin 
    if not IsServiceRunning('oscmaintenanceserver') then 
     begin 
      MsgBox('Service not running. Exit.', mbInformation, MB_OK); 
      exit; 
     end; 
    if not StopService('oscmaintenanceserver') then 
    ... 
関連する問題