use strict;
use Win32;
use Win32::Daemon;

my $servicePath = $^X;

my $serviceParams = 'd:\app\tools\job\bin\job_scheduler_windows.pl';
my %hash          = (
    machine     => '',
    name        => 'RSJobScheduler',
    display     => 'RoyaltyShare Job Scheduler',
    path        => $servicePath,
    user        => '',
    pwd         => '',
    description => 'v1.1',
    parameters  => $serviceParams,
);

if ( Win32::Daemon::CreateService( \%hash ) ) {
    print "Service installed\n";
} else {
    print "Failed to install service: " . Win32::FormatMessage( Win32::Daemon::GetLastError() ) . "\n";
}

