Skip to content

Run yours VCL's applications as StandAlone and WinService

Notifications You must be signed in to change notification settings

gabrielbaltazar/GBWinService

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GBWinService

Run yours VCL's applications as a StandAlone and WinService

Add Uses

uses
  GBWinService.Setup.Interfaces;

Install Service

procedure TfrmMain.btnInstallServiceClick(Sender: TObject);
begin
  InstallService;
end;

Uninstall Service

procedure TfrmMain.btnUninstallServiceClick(Sender: TObject);
begin
  UninstallService;
end;

Sample Complete

program SampleVCLAndWinService;

uses
  Vcl.Forms,
  System.SysUtils,
  System.Classes,
  GBWinService.Setup.Interfaces,
  FMain in 'FMain.pas' {frmMain},
  Service.Sample in 'Service.Sample.pas';

{$R *.res}

begin
  WinServiceSetup
    .ServiceName('SampleVCL')
    .ServiceTitle('Sample VCL')
    .ServiceDetail('Test Service')
    .OnStart(OnStartService)
    .OnStop(OnStopService)
    .OnPause(OnPauseService)
    .OnExecute(onExecuteService)
    .OnCreate(OnCreateService)
    .OnDestroy(OnDestroyService)
    .OnContinue(OnContinueService)
    .OnBeforeUninstall(OnBeforeUninstallService)
    .OnBeforeInstall(OnBeforeInstallService)
    .OnAfterInstall(OnAfterInstallService)
    .OnAfterUninstall(OnAfterUninstallService);

  if not WinServiceSetup.RunAsService then
    WinServiceSetup.CreateForm(TfrmMain, frmMain);
end.

About

Run yours VCL's applications as StandAlone and WinService

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages