Once again I am fighting with Pascal syntax.
I just don't get it where begin and end should be used.
My current approach is this, but Inno Setup tells me that a semicolon is expected in the line "if IsServiceRunning('oscmaintenanceservice') = true then"
Can anybody shed some light on this?
Thank you!
begin
if (CurStep=ssInstall) then
MsgBox('ssInstall.', mbInformation, MB_OK);
if IsServiceInstalled('oscmaintenanceservice') = true then
MsgBox('ssInstall: Service is installed.', mbInformation, MB_OK);
if IsServiceRunning('oscmaintenanceservice') = true then
MsgBox('ssInstall: Service is running.', mbInformation, MB_OK);
if not StopService('oscmaintenanceservice') = true then
MsgBox('ssInstall: Couldnt stop service.', mbInformation, MB_OK);
else
MsgBox('ssInstall: Service was stopped.', mbInformation, MB_OK);
if not RemoveService('oscmaintenanceservice') = true then
MsgBox('ssInstall: Couldnt remove service.', mbInformation, MB_OK);
else
MsgBox('ssInstall: Service was removed', mbInformation, MB_OK);
else
MsgBox('ssInstall: Service not running.', mbInformation, MB_OK);
end;
else
MsgBox('ssInstall: Service not installed.', mbInformation, MB_OK);
if (CurStep = ssPostInstall) then
DeleteFile(ExpandConstant('{localappdata}\OnScreenCommunicator\mutex.dat'));
PinAppTo(ExpandConstant('{app}\OSC.exe'), pdStartMenu);
if (IsHigherThanWindowsXP()) then
begin
PinAppTo(ExpandConstant('{app}\OSC.exe'), pdTaskbar);
end;
if not InstallService(ExpandConstant('{app}\maintenanceservice.exe'),'oscmaintenanceservice','oscmaintenanceservice','desc', SERVICE_WIN32_OWN_PROCESS,SERVICE_AUTO_START) = true then
begin
MsgBox('ssPostInstall: Couldnt install service.', mbInformation, MB_OK);
end;
if not StartService(ExpandConstant('{app}\maintenanceservice.exe')) then
begin
MsgBox('ssPostInstall: Couldnt start service.', mbInformation, MB_OK);
end