Inno setup 缺少Inno安装程序分号

Inno setup 缺少Inno安装程序分号,inno-setup,Inno Setup,我有一个导致“分号丢失”的函数。错误,但我不明白为什么 谢谢你的帮助 function PrepareToInstall(var NeedsRestart: Boolean): String; begin if not IsServiceRunning('oscmaintenanceserver') then begin MsgBox('Service not running. Exit.', mbInformation, MB_OK);

我有一个导致“分号丢失”的函数。错误,但我不明白为什么

谢谢你的帮助

 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;

在每个
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
   ...

1-每个“结束”与“开始”配对,你有更多的“结束”。2-语句以“;”结尾,你必须在剩余的“结束”后加上分号。谢谢,你可以让你的回答成为答案。不客气。如果你愿意,你可以继续。我想你需要将你的回答改为答案。