Jump to content

Recommended Posts

Posted

Is there any other way to register & start the service besides having to use the cmd.exe with the "SC create/start ServiceName" commands..??

are there any functions to check to see if the service is stopped or running and then do a if/then conditional statement based on the services state..??

Posted

Is there any other way to register & start the service besides having to use the cmd.exe with the "SC create/start ServiceName" commands..??

are there any functions to check to see if the service is stopped or running and then do a if/then conditional statement based on the services state..??

Yes there are. Check this out -> http://www.autoitscript.com/forum/index.ph...mp;#entry587207

My contributions:Local account UDF Registry UDFs DriverSigning UDF Windows Services UDF [url="http://www.autoitscript.com/forum/index.php?showtopic=81880"][/url]

Posted

@arcker ... good work, thanks for all the work you have done ... this will allow me to start a plink.exe at startup, meaning i will be able to run VNC over ssh at startup ...

good work ... keep it up

did you intergrate the registry stuff (you mentioned in a previous post) into the _Service_Create() func ??? or is it something we need to do by hand ???

keep up the good work, and i look forward to any advancements you may have in the future ...

ask a silly question and remain a fool for 5 minutes...don't ask, and remain a fool for life__JD - YTS | VNC2Me - Secure remote Desktop Support Solutions

Posted

i was trying to test creating a service and i though it worked untill i tested my script for a time longer than 30 secs

im not using the srvany.exe file im using the Service.au3 and 2 functions from ServiceControl.au3

when i tried to start the service from Services.msc i got this error

"Error 1053 : the service did not respond to the start or control request in a timely fashion"

i searched the forum found topics but no solutions

this is my script i hope someone can help without the use of srvany.exe

(the script will start the service and close it self to leave the script work as a service)

#include <Service.au3>


$sServiceName = "blah"

If Not _ServiceExists("", $sServiceName) Then
    _Service_Create("", $sServiceName, "blah", '"' & @ScriptFullPath & '"')
    _StartService("", $sServiceName)
    Exit
EndIf

Do
    Sleep(1000)
    Beep(1000,100)
Until 1 = 5

Func _StartService($sComputerName, $sServiceName)
   Local $hAdvapi32
   Local $hKernel32
   Local $arRet
   Local $hSC
   Local $hService
   Local $lError = -1

   $hAdvapi32 = DllOpen("advapi32.dll")
   If $hAdvapi32 = -1 Then Return 0
   $hKernel32 = DllOpen("kernel32.dll")
   If $hKernel32 = -1 Then Return 0
   $arRet = DllCall($hAdvapi32, "long", "OpenSCManager", _
                    "str", $sComputerName, _
                    "str", "ServicesActive", _ 
                    "long", $SC_MANAGER_CONNECT)
   If $arRet[0] = 0 Then
      $arRet = DllCall($hKernel32, "long", "GetLastError")
      $lError = $arRet[0]
   Else
      $hSC = $arRet[0]
      $arRet = DllCall($hAdvapi32, "long", "OpenService", _
                       "long", $hSC, _
                       "str", $sServiceName, _
                       "long", $SERVICE_START)
      If $arRet[0] = 0 Then
         $arRet = DllCall($hKernel32, "long", "GetLastError")
         $lError = $arRet[0]
      Else
         $hService = $arRet[0]
         $arRet = DllCall($hAdvapi32, "int", "StartService", _
                          "long", $hService, _
                          "long", 0, _
                          "str", "")
         If $arRet[0] = 0 Then
            $arRet = DllCall($hKernel32, "long", "GetLastError")
            $lError = $arRet[0]
         EndIf
         DllCall($hAdvapi32, "int", "CloseServiceHandle", "long", $hService)         
      EndIf
      DllCall($hAdvapi32, "int", "CloseServiceHandle", "long", $hSC)
   EndIf
   DllClose($hAdvapi32)
   DllClose($hKernel32)
   If $lError <> -1 Then 
      SetError($lError)
      Return 0
   EndIf
   Return 1
EndFunc

Func _ServiceExists($sComputerName, $sServiceName)
   Local $hAdvapi32
   Local $arRet
   Local $hSC
   Local $bExist = 0

   $hAdvapi32 = DllOpen("advapi32.dll")
   If $hAdvapi32 = -1 Then Return 0
   $arRet = DllCall($hAdvapi32, "long", "OpenSCManager", _
                    "str", $sComputerName, _
                    "str", "ServicesActive", _
                    "long", $SC_MANAGER_CONNECT)
   If $arRet[0] <> 0 Then
      $hSC = $arRet[0]
      $arRet = DllCall($hAdvapi32, "long", "OpenService", _
                       "long", $hSC, _
                       "str", $sServiceName, _
                       "long", $SERVICE_INTERROGATE)
      If $arRet[0] <> 0 Then
         $bExist = 1
         DllCall($hAdvapi32, "int", "CloseServiceHandle", "long", $arRet[0])
      EndIf
      DllCall($hAdvapi32, "int", "CloseServiceHandle", "long", $hSC)
   EndIf
   DllClose($hAdvapi32)
   Return $bExist
EndFunc

as isaid in this topic http://www.autoitscript.com/forum/index.php?showtopic=85428

any help would be appreciated

Posted

Hey arcker, is your UDF able to check to the current state of a service so I can do an if/then function based on the current state of that service..??

Something like:

$sServiceName = "AAAA"
$DisplayName = "AAAA"


    If Not _ServiceExists("", $sServiceName) Then 
        _CreateService("", $sServiceName, $DisplayName, '"' & @ScriptFullPath & '"')
        _Service_Start($sServiceName)
        Exit
    Else
        $ServiceStatus = _QueryService($sServiceName)
        If $ServiceStatus = "Running" Then
            _Service_Init($sServiceName)
        Else
            If $ServiceStatus = "Stopped" Then
            _Service_Start($sServiceName)
            Exit
        EndIf
    EndIf



func Main()
    While 1

    sleep(5000)
    WEnd
EndFunc
Posted

@Cypher175

all i provide is the functions.

For custom functions ( like "if not exists then install & start" ) it's not in udf but it could be like a _service_autoinstall.

@yehia

the 1053 error is like you said a timeout error.

Check if your script send well to SCM that your process i started well. If the SCM doesn't receive any message, then it send this message.

@JDaus

Thx for your comment. Always appreciated :)

For the registry i'll integrate it but you can do it without too much work, using autoit functions. That's the easy part.

At install use regwrite, at suppress use regdelete. I know that seems stupid but the registry is just an "array". Not all

utilities use it. Services.msc don't use it, but sc.exe does ....

-- Arck System _ Soon -- Ideas make everything

"La critique est facile, l'art est difficile"

Projects :

[list] [*]Au3Service : Run your exe as service V3 / Updated 29/07/2013 Get it Here [/list]
Posted

@yehia

the 1053 error is like you said a timeout error.

Check if your script send well to SCM that your process i started well. If the SCM doesn't receive any message, then it send this message.

can u please test the code i posted and btw i use vista on laptop and the service start function works and the service gets marked as started but it just dont do anything tested it with beep and filewrite

can u support help for vista? (btw none of the other ways for starting the service worked for me too on vista)

  • 2 weeks later...
Posted

I've been using a compiled Autoit .exe with the SRVANY resource kit utility, and it works fine.

When I use this module, it installs OK, and starts up, but doesn't interact with the desktop (I'm using WINLIST()) even if the service is tickets to "interact".

Is there a way to emulate what SRVANY does and allow it to interact with the desktop?

Thanks,

Icarus

Posted

maybe you could RTFM....

another as always ask how to create an interactive service.

I must say (once again) that's it's not its purpose. Use with caution. Diesel.

-- Arck System _ Soon -- Ideas make everything

"La critique est facile, l'art est difficile"

Projects :

[list] [*]Au3Service : Run your exe as service V3 / Updated 29/07/2013 Get it Here [/list]
  • 4 weeks later...
Posted

arcker, thank you for great script.

I have trouble: need execute code on exit, but OnAutoItExit () - don't working by stop service.

Try insert code into Func _Service_Ctrl($ctrlCode):

Case $SERVICE_CONTROL_STOP
----->MyFunc() - generate error on stop service, but simple command as "ConsoleWrite" working without generate error.
    ;MsgBox(0,"","Service stop")
            _Service_ReportStatus($SERVICE_STOP_PENDING, $NO_ERROR, 0);
            _Service_SetStopEvent();
            _Service_Cleanup()
            Exit

Anybody can help me?

Hi! Its an interesting project. I'd like to add something usefull to it.

I was disapointed when my service didn't stop correctly. Spent some tome to fix it :) Thanx arcker!

I used service.au3 and service_example.au3 from the fist post.

1. service.au3. Func _Service_Ctrl($ctrlCode) have to be like this:

...

Case $SERVICE_CONTROL_STOP

Running = 0 ; that might be a flag for main() while loop.

_Service_ReportStatus($SERVICE_STOP_PENDING, $NO_ERROR, 3000); that will give us some time (3 sek) to stop service correctly.

_Service_SetStopEvent(); that code I've understood only today in the morning - one more way to make while loop in main()

Return; no Exit - only return to SCM.

...

2. Func _Service_Halting() - in an examle do nothing u can remove it at all.

3. Func _Service_ServiceMain($iArg, $sArgs) - lines till the EndFunc

...

; report the status to the service control manager.

If Not (_Service_ReportStatus($SERVICE_START_PENDING, $NO_ERROR, 3000)) Then

;goto cleanup;

_Service_Cleanup()

Return

EndIf

_Service_Start($iArg, $sArgs);

main_init(); That is my prog init() func (MSDN said that ServiceMain must set all Global vars)

main(); that is my while-loop main()

;Return;

EndFunc ;==>Service_Main

4.Service_Example.au3 - my variant

Func main()

logPrint("main start"); some loger func (writes to file)

While $Running

logPrint("main loop. evnt=" & _WinAPI_WaitForSingleObject($service_stop_event, 0)) ; it's a way to use stop event insted of $Running flag

Sleep(1000)

WEnd

logPrint("main outer. evnt=" & _WinAPI_WaitForSingleObject($service_stop_event, 0))

;~ _Service_ReportStatus($SERVICE_STOP_PENDING, $NO_ERROR, 5000)

_Service_ReportStatus($SERVICE_STOPPED, $NO_ERROR, 5000)

_Service_Cleanup()

Exit

EndFunc

Posted

Sounds good !

can you post the modified scripts ? i don't really understand your modification since you didn't use "" to insert your code.

If it works i will update the post.

thx for sharing :)

-- Arck System _ Soon -- Ideas make everything

"La critique est facile, l'art est difficile"

Projects :

[list] [*]Au3Service : Run your exe as service V3 / Updated 29/07/2013 Get it Here [/list]
Posted

sorry, i dont know how to post a file :)(( thats my temp working variant with some comments. I'd like to delete it after your modifications in your service.au3

service_example.au3

#NoTrayIcon
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_UseUpx=n
#AutoIt3Wrapper_Change2CUI=y
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
Global $MainLog = @ScriptDir & "\test_service.log"
Global $sServiceName = "Autoit_Service"
Global $Running, $ExitOk

#include "service.au3"

;~  logPrint("script started")

If $cmdline[0] > 0 Then
    Switch $cmdline[1]
        Case "install", "-i", "/i"
            InstallService()
        Case "remove", "-u", "/u", "uninstall"
            RemoveService()
        Case Else
            ConsoleWrite(" - - - Help - - - " & @crlf)
            ConsoleWrite("params : " & @crlf)
            ConsoleWrite("  -i : install service" & @crlf)
            ConsoleWrite("  -u : remove service" & @crlf)
            ConsoleWrite(" - - - - - - - - " & @crlf)
            Exit
            ;start service.
    EndSwitch
EndIf
_Service_init($sServiceName)
Exit

Func main_init()
    $MainLog = @ScriptDir & "\test_service.log"
    $sServiceName = "Autoit_Service"
    $Running = 1
    logPrint("main_init. Stop event=" & $service_stop_event)
EndFunc

Func main()
    logPrint("main start")
    While $Running
        logPrint("main loop. evnt=" & _WinAPI_WaitForSingleObject($service_stop_event, 0))
        Sleep(1000)
    WEnd
    logPrint("main outer. evnt=" & _WinAPI_WaitForSingleObject($service_stop_event, 0))
    ;Sleep(2000)    ; its rather difficult for understanding, but that 2 sec pause can destroy service stoping process 50/50... i'm thinking about timer func, that
    ; sends _Service_ReportStatus($SERVICE_STOP_PENDING every timeout/10 ms like MSDN said.
    logPrint("main stoped. Cleanup.")
    _Service_ReportStatus($SERVICE_STOPPED, $NO_ERROR, 5000)
    _Service_Cleanup()
    Exit
EndFunc

Func logPrint($text,$nolog=0)
    If $nolog Then
        MsgBox(0,"MyService",$text,1)
    Else
        If Not FileExists($MainLog) Then FileWriteLine($MainLog, "Log created: " & @YEAR & "/" & @MON & "/" & @MDAY & " " & @HOUR & ":" & @MIN & ":" & @SEC)
        FileWriteLine($MainLog, @YEAR & @MON & @MDAY & " " & @HOUR & @MIN & @SEC & " [" & @AutoItPID & "] >> " & $text)
    EndIf
Return 0
;~  ConsoleWrite($text & @CRLF)
EndFunc   ;==>logPrint

Func InstallService()
    logPrint("InstallService(): Installing service, please wait" )
    _Service_Create("", $sServiceName, "Autoit Service Test", '"' & @ScriptFullPath & '"')
    If @error Then
        logPrint("InstallService(): Problem installing service, Error number is " & @error & @CRLF & " message  : " & _WinAPI_GetLastErrorMessage())
    Else
        logPrint("InstallService(): Installation of service successful")
    EndIf
    Exit
EndFunc   ;==>InstallService
Func RemoveService()
    _StopService("", $sServiceName)
    _DeleteService("", $sServiceName)
    if not @error then logPrint("RemoveService(): service removed successfully" & @crlf)
    Exit
EndFunc   ;==>RemoveService


#cs
...from MSDN:
The ServiceMain function should perform the following tasks:

Initialize all global variables. 
Call the RegisterServiceCtrlHandler function immediately to register a Handler function to handle control requests for the service. The return value of RegisterServiceCtrlHandler is a service status handle that will be used in calls to notify the SCM of the service status. 
Perform initialization. If the execution time of the initialization code is expected to be very short (less than one second), initialization can be performed directly in ServiceMain. 
If the initialization time is expected to be longer than one second, call the SetServiceStatus function, specifying the SERVICE_START_PENDING service state and a wait hint in the SERVICE_STATUS structure.

If your service's initialization code performs tasks that are expected to take longer than the initial wait hint value, your code must call the SetServiceStatus function periodically (possibly with a revised wait hint) to indicate that progress is being made. Be sure to call SetServiceStatus only if the initialization is making progress. Otherwise, the Service Control Manager can wait for your service to enter the SERVICE_RUNNING state assuming that your service is making progress and block other services from starting. Do not call SetServiceStatus from a separate thread unless you are sure the thread performing the initialization is truly making progress.

When initialization is complete, call SetServiceStatus to set the service state to SERVICE_RUNNING. 
Perform the service tasks, or, if there are no pending tasks, return control to the caller. Any change in the service state warrants a call to SetServiceStatus to report new status information. 
If an error occurs while the service is initializing or running, the service should call SetServiceStatus to set the service state to SERVICE_STOP_PENDING if cleanup will be lengthy. After cleanup is complete, call SetServiceStatus to set the service state to SERVICE_STOPPED from the last thread to terminate. Be sure to set the dwServiceSpecificExitCode and dwWin32ExitCode members of the SERVICE_STATUS structure to identify the error. 
#ce
Posted

now service stops correctly! there is no need in Exit func.

Service_Example.au3

#NoTrayIcon
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_UseUpx=n
#AutoIt3Wrapper_Change2CUI=y
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
;~ Opt("MustDeclareVars", 1) ; just for self control :) dont to forget declare vars

Global $MainLog = @ScriptDir & "\test_service.log"
Global $sServiceName = "Autoit_Service"
Global $Running, $counter
Global $hGUI

#include "service.au3"
#Include <Timers.au3>   ; i used it for timers func

    logPrint("script started")

If $cmdline[0] > 0 Then
    Switch $cmdline[1]
        Case "install", "-i", "/i"
            InstallService()
        Case "remove", "-u", "/u", "uninstall"
            RemoveService()
        Case Else
            ConsoleWrite(" - - - Help - - - " & @crlf)
            ConsoleWrite("params : " & @crlf)
            ConsoleWrite("  -i : install service" & @crlf)
            ConsoleWrite("  -u : remove service" & @crlf)
            ConsoleWrite(" - - - - - - - - " & @crlf)
            Exit
            ;start service.
    EndSwitch
EndIf
_Service_init($sServiceName)




; emulating your program init() function
Func main_init() 
    $hGUI = GUICreate("Timers Using CallBack Function(s)")
;~  GUISetState($hGUI,@SW_HIDE) ; unneeded - timers run exelent without guisetstate.
    $MainLog = @ScriptDir & "\test_service.log"
    $sServiceName = "Autoit_Service"
    $Running = 1
    
    logPrint("main_init. Stop event=" & $service_stop_event)
EndFunc



; stop timer function. its said SCM that service is in the process of $SERVICE_STOP_PENDING
Func myStopTimer($hWnd, $Msg, $iIDTimer, $dwTime)
    logPrint("timer = " & $counter)
    _Service_ReportStatus($SERVICE_STOP_PENDING, $NO_ERROR, $counter)
    $counter += -100
EndFunc



; emulate your program main function with while loop (may be gui loop & so on)
Func main()
    logPrint("main start")
    While $Running ; there are several ways to find that service have to be stoped - $Running flag in loop is the first method
        _Service_ReportStatus($SERVICE_RUNNING, $NO_ERROR, 5000)
        logPrint("main loop. evnt=" & _WinAPI_WaitForSingleObject($service_stop_event, 0)) ; stop event is the second method
        Sleep(1000)
    WEnd
    ; stoping program correctly.
    logPrint("main outer. evnt=" & _WinAPI_WaitForSingleObject($service_stop_event, 0))
    $counter = 20000
    Local $t1 = _Timer_SetTimer($hGUI,500,"myStopTimer") ; sends _Service_ReportStatus($SERVICE_STOP_PENDING every timeout/10 ms like MSDN said.
    Sleep(5000) ; emulating hard working during stop
    logPrint("main stoped. Cleanup1.")
    _Timer_KillTimer($hGUI,$t1) ; no more stop pending
    logPrint("main stoped. Cleanup2.")
    Sleep(100)
    Local $x = GUIGetMsg( 1 )   ; emulating gui close and so on 
    logPrint("main stoped. Cleanup3.")
    GUIDelete( $hGUI ) ; emulating gui close and so on 
    logPrint("main stoped. Cleanup4.")
    Sleep(100)
    _Service_ReportStatus($SERVICE_STOPPED, $NO_ERROR, 0) ; That all! Our AutoIt Service stops just there! 0 timeout meens "Now"
    logPrint("main stoped. Cleanup5.") ; never executing
;~  _Service_Cleanup()
;~  ProcessClose(@AutoItPID)
;~  Exit
EndFunc

; some loging func
Func logPrint($text,$nolog=0)
    If $nolog Then
        MsgBox(0,"MyService",$text,1)
    Else
        If Not FileExists($MainLog) Then FileWriteLine($MainLog, "Log created: " & @YEAR & "/" & @MON & "/" & @MDAY & " " & @HOUR & ":" & @MIN & ":" & @SEC)
        FileWriteLine($MainLog, @YEAR & @MON & @MDAY & " " & @HOUR & @MIN & @SEC & " [" & @AutoItPID & "] >> " & $text)
    EndIf
Return 0
;~  ConsoleWrite($text & @CRLF)
EndFunc   ;==>logPrint

Func InstallService()
    logPrint("InstallService(): Installing service, please wait" )
    _Service_Create("", $sServiceName, "Autoit Service Test", '"' & @ScriptFullPath & '"')
    If @error Then
        logPrint("InstallService(): Problem installing service, Error number is " & @error & @CRLF & " message  : " & _WinAPI_GetLastErrorMessage())
    Else
        logPrint("InstallService(): Installation of service successful")
    EndIf
    Exit
EndFunc   ;==>InstallService
Func RemoveService()
    _StopService("", $sServiceName)
    _DeleteService("", $sServiceName)
    if not @error then logPrint("RemoveService(): service removed successfully" & @crlf)
    Exit
EndFunc   ;==>RemoveService


#cs
...from MSDN:
The ServiceMain function should perform the following tasks:

Initialize all global variables. 
Call the RegisterServiceCtrlHandler function immediately to register a Handler function to handle control requests for the service. The return value of RegisterServiceCtrlHandler is a service status handle that will be used in calls to notify the SCM of the service status. 
Perform initialization. If the execution time of the initialization code is expected to be very short (less than one second), initialization can be performed directly in ServiceMain. 
If the initialization time is expected to be longer than one second, call the SetServiceStatus function, specifying the SERVICE_START_PENDING service state and a wait hint in the SERVICE_STATUS structure.

If your service's initialization code performs tasks that are expected to take longer than the initial wait hint value, your code must call the SetServiceStatus function periodically (possibly with a revised wait hint) to indicate that progress is being made. Be sure to call SetServiceStatus only if the initialization is making progress. Otherwise, the Service Control Manager can wait for your service to enter the SERVICE_RUNNING state assuming that your service is making progress and block other services from starting. Do not call SetServiceStatus from a separate thread unless you are sure the thread performing the initialization is truly making progress.

When initialization is complete, call SetServiceStatus to set the service state to SERVICE_RUNNING. 
Perform the service tasks, or, if there are no pending tasks, return control to the caller. Any change in the service state warrants a call to SetServiceStatus to report new status information. 
If an error occurs while the service is initializing or running, the service should call SetServiceStatus to set the service state to SERVICE_STOP_PENDING if cleanup will be lengthy. After cleanup is complete, call SetServiceStatus to set the service state to SERVICE_STOPPED from the last thread to terminate. Be sure to set the dwServiceSpecificExitCode and dwWin32ExitCode members of the SERVICE_STATUS structure to identify the error. 
#ceoÝ÷ ÚÇ«¾'jíÚºÚ"µÍÚ[ÛYK[ÛÙBÚ[ÛYIÕÚ[K]LÉÝÂÛØ[ ÌÍÔÕSTÔQÒ×ÔTURTQHÈÙXÙHÛÛÛX[YÙXØÙÜÈÂÛØ[ÛÛÝ  ÌÍÔÐ×ÓPSQÑTÐÓÓPÕHBÛØ[ÛÛÝ    ÌÍÔÐ×ÓPSQÑTÐÔPUWÔÑTPÑHHÛØ[ÛÛÝ  ÌÍÔÐ×ÓPSQÑTÑSSQTUWÔÑTPÑHH
ÛØ[ÛÛÝ ÌÍÔÐ×ÓPSQÑTÓÐÒÈHÛØ[ÛÛÝ  ÌÍÔÐ×ÓPSQÑTÔUQTWÓÐÒ×ÔÕUTÈHLÛØ[ÛÛÝ   ÌÍÔÐ×ÓPSQÑTÓSÑQWÐÓÕÐÓÓQÈHÛØ[ÛÛÝ    ÌÍÔÐ×ÓPSQÑTÐSÐPÐÑTÔÈH]Ô   ÌÍÔÕSTÔQÒ×ÔTURTQ  ÌÍÔÐ×ÓPSQÑTÐÓÓPÕ   ÌÍÔÐ×ÓPSQÑTÐÔPUWÔÑTPÑK    ÌÍÔÐ×ÓPSQÑTÑSSQTUWÔÑTPÑK   ÌÍÔÐ×ÓPSQÑTÓÐÒË    ÌÍÔÐ×ÓPSQÑTÔUQTWÓÐÒ×ÔÕUTË  ÌÍÔÐ×ÓPSQÑTÓSÑQWÐÓÕÐÓÓQÊBÈÙXÙHXØÙÜÈÂÛØ[ÛÛÝ ÌÍÔÑTPÑWÔUQTWÐÓÓQÈHBÛØ[ÛÛÝ   ÌÍÔÑTPÑWÐÒSÑWÐÓÓQÈHÛØ[ÛÛÝ  ÌÍÔÑTPÑWÔUQTWÔÕUTÈH
ÛØ[ÛÛÝ ÌÍÔÑTPÑWÑSSQTUWÑTSSÈHÛØ[ÛÛÝ    ÌÍÔÑTPÑWÔÕTHLÛØ[ÛÛÝ ÌÍÔÑTPÑWÔÕÔHÛØ[ÛÛÝ ÌÍÔÑTPÑWÔUTÑWÐÓÓSQHH
ÛØ[ÛÛÝ ÌÍÔÑTPÑWÒSTÑÐUHHÛØ[ÛÛÝ ÌÍÔÑTPÑWÕTÑTÑQSQÐÓÓÓHLÛØ[ ÌÍÔÑTPÑWÐSÐPÐÑTÔÈH]Ô    ÌÍÔÕSTÔQÒ×ÔTURTQ  ÌÍÔÑTPÑWÔUQTWÐÓÓQË  ÌÍÔÑTPÑWÐÒSÑWÐÓÓQË    ÌÍÔÑTPÑWÔUQTWÔÕUTË   ÌÍÔÑTPÑWÑSSQTUWÑTSSË  ÌÍÔÑTPÑWÔÕT    ÌÍÔÑTPÑWÔÕÔ   ÌÍÔÑTPÑWÔUTÑWÐÓÓSQK ÌÍÔÑTPÑWÒSTÑÐUK   ÌÍÔÑTPÑWÕTÑTÑQSQÐÓÓÓ
BÈÙXÙHÛÛÛÂÛØ[ÛÛÝ    ÌÍÔÑTPÑWÐÓÓÓÔÕÔHBÛØ[ÛÛÝ    ÌÍÔÑTPÑWÐÓÓÓÔUTÑHHÛØ[ÛÛÝ    ÌÍÔÑTPÑWÐÓÓÓÐÓÓSQHHÂÛØ[ÛÛÝ    ÌÍÔÑTPÑWÐÓÓÓÒSTÑÐUHH
ÛØ[ÛÛÝ ÌÍÔÑTPÑWÐÓÓÓÔÒUÕÓH
BÛØ[ÛÛÝ    ÌÍÔÑTPÑWÐÓÓÓÔTSPÒSÑHH
ÛØ[ÛÛÝ ÌÍÔÑTPÑWÐÓÓÓÓUSQH
ÂÛØ[ÛÛÝ   ÌÍÔÑTPÑWÐÓÓÓÓUSSSÕHHÛØ[ÛÛÝ  ÌÍÔÑTPÑWÐÓÓÓÓUSSPHHBÛØ[ÛÛÝ   ÌÍÔÑTPÑWÐÓÓÓÓUSTÐPHHBÛØ[ÛÛÝ ÌÍÔÑTPÑWÐÓÓÓÑUPÑQUSHÛØ[ÛÛÝ  ÌÍÔÑTPÑWÐÓÓÓÒTÐTTÑSPÒSÑHHÂÛØ[ÛÛÝ    ÌÍÔÑTPÑWÐÓÓÓÔÕÑTUSHÛØ[ÛÛÝ  ÌÍÔÑTPÑWÐÓÓÓÔÑTÔÒSÓÒSÑHHBÈÙXÙHÂÛØ[ÛÛÝ  ÌÍÔÑTPÑWÒÑTSÑUTHBÛØ[ÛÛÝ    ÌÍÔÑTPÑWÑSWÔÖTÕSWÑUTHÛØ[ÛÛÝ  ÌÍÔÑTPÑWÐQTTH
ÛØ[ÛÛÝ ÌÍÔÑTPÑWÔPÓÑÓVTÑUTHÛØ[ÛÛÝ    ÌÍÔÑTPÑWÑUTH]Ô   ÌÍÔÑTPÑWÒÑTSÑUT   ÌÍÔÑTPÑWÑSWÔÖTÕSWÑUT    ÌÍÔÑTPÑWÔPÓÑÓVTÑUTBÛØ[ÛÛÝ    ÌÍÔÑTPÑWÕÒSÌÓÕÓÔÐÑTÔÈHLÛØ[ÛÛÝ  ÌÍÔÑTPÑWÕÒSÌÔÒTWÔÐÑTÔÈHÛØ[ÛÛÝ   ÌÍÔÑTPÑWÕÒSÌH]Ô    ÌÍÔÑTPÑWÕÒSÌÓÕÓÔÐÑTÔË ÌÍÔÑTPÑWÕÒSÌÔÒTWÔÐÑTÔÊBÛØ[ÛÛÝ   ÌÍÔÑTPÑWÒSTPÕUWÔÐÑTÔÈHLÛØ[ÛÛÝ  ÌÍÔÑTPÑWÕTWÐSH]Ô    ÌÍÔÑTPÑWÕÒSÌ  ÌÍÔÑTPÑWÐQTT    ÌÍÔÑTPÑWÑUT ÌÍÔÑTPÑWÒSTPÕUWÔÐÑTÔÊBÈÙXÙHÝÂÛØ[ÛÛÝ   ÌÍÔÑTPÑWÐÓÕÔÕTHÛØ[ÛÛÝ    ÌÍÔÑTPÑWÔÖTÕSWÔÕTHBÛØ[ÛÛÝ    ÌÍÔÑTPÑWÐUU×ÔÕTHÛØ[ÛÛÝ    ÌÍÔÑTPÑWÑSPSÔÕTHÂÛØ[ÛÛÝ   ÌÍÔÑTPÑWÑTÐPQH
ÈÙXÙHÜÛÛÛÛØ[ÛÛÝ ÌÍÔÑTPÑWÑTÔÒQÓÔHHÛØ[ÛÛÝ  ÌÍÔÑTPÑWÑTÔÓÔPSHBÛØ[ÛÛÝ   ÌÍÔÑTPÑWÑTÔÔÑUTHHÛØ[ÛÛÝ   ÌÍÔÑTPÑWÑTÔÐÔUPÐSHÂÛØ[ÛÛÝ   ÌÍÔÑTPÑWÐPÐÑTÒTÐTTÑSPÒSÑHHÛØ[ÛÛÝ  ÌÍÔÑTPÑWÐPÐÑTÓUSÒSÑHHLÛØ[ÛÛÝ    ÌÍÔÑTPÑWÐPÐÑTÔTSPÒSÑHHÛØ[ÛÛÝ    ÌÍÔÑTPÑWÐPÐÑTÔUTÑWÐÓÓSQHHÛØ[ÛÛÝ   ÌÍÔÑTPÑWÐPÐÑTÔÕÑTUSH
ÛØ[ÛÛÝ ÌÍÔÑTPÑWÐPÐÑTÔÑTÔÒSÓÒSÑHHÛØ[ÛÛÝ ÌÍÔÑTPÑWÐPÐÑTÔTÒUÕÓHLÛØ[ÛÛÝ    ÌÍÔÑTPÑWÐPÐÑTÔÒUÕÓH
ÛØ[ÛÛÝ ÌÍÔÑTPÑWÐPÐÑTÔÕÔHBÛØ[ÛÛÝ    ÌÍÔÑTPÑWÐPÕUHHBÛØ[ÛÛÝ   ÌÍÔÑTPÑWÒSPÕUHHÛØ[ÛÛÝ   ÌÍÔÑTPÑWÔUTÑWÔSSÈH
ÛØ[ÛÛÝ ÌÍÔÑTPÑWÔUTÑQH
ÂÛØ[ÛÛÝ   ÌÍÔÑTPÑWÔSSÈH
ÛØ[ÛÛÝ ÌÍÔÑTPÑWÔÕTÔSSÈHÛØ[ÛÛÝ    ÌÍÔÑTPÑWÔÕÔÔSSÈHÂÛØ[ÛÛÝ ÌÍÔÑTPÑWÔÕÔQHBÛØ[ÛÛÝ   ÌÍÔÑTPÑWÐÓÓSQWÔSSÈH
BÂÛØ[    ÌÍÝÙXÙS[YK ÌÍÝÙXÙPÝ  ÌÍÝÙXÙSXZ[ ÌÍÜÙXÙWÙXY×Û[ÙHH[ÙBÛØ[  ÌÍÝÙXÙWÔÝ]ÈHÝXÝÜX]J  ][ÝÙÛÜÔÙXÙUNÉ][ÝÈ [ÈÂBI][ÝÙÛÜÐÝ[Ý]NÙÛÜÐÛÛÛÐXØÙYÙÛÜÕÚ[Ì^]ÛÙNÉ][ÝÈ    [ÈÂBI][ÝÙÛÜÔÙXÙTÜXÚYXÑ^]ÛÙNÙÛÜÐÚXÚÔÚ[ÙÛÜÕØZ][    ][ÝÊBÛØ[    ÌÍÝÙXÙWÔÝ]×Ú[BÛØ[ÛÛÝ  ÌÍÓ×ÑTÔHÛØ[ÛÛÝ   ÌÍÓÓÓÓÔÕÐRUHLBÛØ[    ÌÍÜÙXÙWÜÝÜÙ][ÛØ[ ÌÍÓÓÑTÔÔÑTPÑWÔÕUTÈHÛØ[ÛÛÝ  ÌÍÕÐRUÓÐPÕÌHÛØ[   ÌÍØÚXÚÔÚ[ÈTÑØZY]YÝÙXÙPÝÜ]ÚÈÛÙHØ[H^XÝ]Y[ÈÔÙXÙWÚ[]
    ÌÍÜÔÙXÙS[YJBBØØ[    ÌÍÝÜ]ÚXK   ÌÍÜ]BIÌÍÝÙXÙPÝHØ[XÚÔYÚÝ   ][Ý×ÔÙXÙWÐÝ  ][ÝË  ][ÝÚ[ ][ÝË  ][ÝÝZ[    ][ÝÊBIÌÍÝÙXÙSXZ[HØ[XÚÔYÚÝ   ][Ý×ÔÙXÙWÔÙXÙSXZ[][ÝË ][ÝÚ[ ][ÝË  ][ÝÚ[ÜÝ][ÝÊBBIÌÍÝÜ]ÚXHHÝXÝÜX]J    ][ÝÜÌNÜÌI][ÝÊBIÌÍÝÙXÙS[YHHÝXÝÜX]J    ][ÝØÚÌLI][ÝÊBQÝXÝÙ]]J  ÌÍÝÙXÙS[YKK    ÌÍÜÔÙXÙS[YJBQÝXÝÙ]]J   ÌÍÝÜ]ÚXKKÝXÝÙ]  ÌÍÝÙXÙS[YJKJBQÝXÝÙ]]J   ÌÍÝÜ]ÚXKKØ[XÚÑÙ]   ÌÍÝÙXÙSXZ[KBQÝXÝÙ]]J    ÌÍÝÜ]ÚXKJBQÝXÝÙ]]J  ÌÍÝÜ]ÚXKBIÌÍØÚXÚÔÚ[HIÌÍÜ]HØ[
    ][ÝØYLÌ  ][ÝË  ][ÝÚ[ ][ÝË  ][ÝÔÝÙXÙPÝÜ]Ú][ÝË ][ÝÜ][ÝËÝXÝÙ]    ÌÍÝÜ]ÚXJJBßRY ÌÍÜ]ÌHH[ÙÐÞ
    ][ÝÉ][ÝË    ][ÝÈÜ    ][ÝÈ  [ÈÕÚ[TWÑÙ]ÝÜ
H   [ÈÔHÈ^YX^HÛÝÙH]]Ú]ÜÜÛÛÙ×ÙÜßQ^][[ÈÏOIÝ×ÔÙXÙWÚ[]ÂÈX^XHÂ[ÈÔÙXÙWÐÛX[

BSØØ[ ÌÍÜÙXÙWÙÜHÕÚ[TWÑÙ]ÝÜ
BRY
    ÌÍÝÙXÙWÔÝ]×Ú[JH[ÔÙXÙWÔÜÝ]Ê  ÌÍÔÑTPÑWÔÕÔQ    ÌÍÜÙXÙWÙÜ
NÂ[[ÈÏOIÝØÛX[ÂÈÈTÑØZY][È    ÌÍÚXÜË ÌÍÜÐÜÈHH[Y]Ý[ÈÛHYÚÝKÂ[ÈÔÙXÙWÔÙXÙSXZ[ ÌÍÚPË   ÌÍÜÐÜÊBNÛÙØÞ
    ][ÝÉ][ÝË    ][ÝÜÙXÙWÛXZ[ÝY    ][ÝÊBNÈÈ    ][ÝÚ  ][ÝÈÛÙHYÜHYÚÝÙXÙPÝ[ÌÌÎÉÌÌÎÉÌÌÎÂSØØ[ ÌÍÜ]HØ[
    ][ÝØYLÌ  ][ÝË  ][ÝÚÛ    ][ÝË  ][ÝÔYÚÝÙXÙPÝ[][ÝË  ][ÝÜ][ÝËÝXÝÙ]    ÌÍÝÙXÙS[YJK    ][ÝÜ][ÝËØ[XÚÑÙ] ÌÍÝÙXÙPÝ
JNÜYÚÝÙXÙBRY   ÌÍÜ]ÌHH[BSÙÐÞ
    ][ÝÑÜ][ÝËÕÚ[TWÑÙ]ÝÜ
JBBQ^]Q[YIÌÍÝÙXÙWÔÝ]×Ú[HH  ÌÍÜ]ÌBRYÝ
    ÌÍÝÙXÙWÔÝ]×Ú[JH[BWÔÙXÙWÐÛX[

BBT]Q[YNÙÛÝÈÛX[ÂQÝXÝÙ]]J   ÌÍÝÙXÙWÔÝ]Ë ][ÝÙÔÙXÙUI][ÝË]Ô    ÌÍÔÑTPÑWÕÒSÌÓÕÓÔÐÑTÔË   ÌÍÔÑTPÑWÒSTPÕUWÔÐÑTÔÊJBQÝXÝÙ]]J  ÌÍÝÙXÙWÔÝ]Ë ][ÝÙÔÙXÙTÜXÚYXÑ^]ÛÙI][ÝË
NÂBNÈÜHÝ]ÈÈHÙXÙHÛÛÛX[YÙRYÝ
ÔÙXÙWÔÜÝ]Ê   ÌÍÔÑTPÑWÔÕTÔSSË    ÌÍÓ×ÑTÔÌ
JH[BNÙÛÝÈÛX[ÂBWÔÙXÙWÐÛX[

BBT]Q[YBWÔÙXÙWÔÝ
    ÌÍÚPË   ÌÍÜÐÜÊNÂB[XZ[Ú[]

BBNØÛX[NÈHÈÜHÝÜYÝ]ÈÈHÙXÙHÛÛÛX[YÙB[XZ[
BWÔÙXÙWÐÛX[

BßQ^]NÔ]Â[[ÈÏOIÝÔÙXÙWÓXZ[È][ÈÈØ[YHÐÓHHH[Ü[È[H ][ÝÚ  ][ÝÈ]]Ú]ÛÙHÛÜÜÈH


È]ÛHÜÚYÛ[[ÈÜÙKËÊKKKKKKKKKKKKKKKKKKKKKKKKKKKKKVÈÙXÙWØÝKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKBÈ
Ø[YHHÐÓHÚ[]ÛÛÛÙXÙJ
HÈØ[YÜÈÙXÙBÈ
È
[Y]ÎÈ
BXÝÛÙHHHÙÛÛÛ]YÝYÈ
È
][YNÈ
B[ÛBÈ
KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKJÂ[ÈÔÙXÙWÐÝ
    ÌÍØÝÛÙJBß[ÙÜ[
    ][Ý×ÔÙXÙWÐÝ  ][ÝÈ  [È ÌÍØÝÛÙKJBTÝÚ]Ú
    ÌÍØÝÛÙJBBPØÙH   ÌÍÔÑTPÑWÐÓÓÓÔUTÑBBBQÝXÝÙ]]J   ÌÍÝÙXÙWÔÝ]Ë ][ÝÙÐÝ[Ý]I][ÝË   ÌÍÔÑTPÑWÔUTÑQ
BBPØÙH    ÌÍÔÑTPÑWÐÓÓÓÐÓÓSQBBBQÝXÝÙ]]J ÌÍÝÙXÙWÔÝ]Ë ][ÝÙÐÝ[Ý]I][ÝË   ÌÍÔÑTPÑWÔSSÊBBBNÜÝÜHÙXÙKBBNÂBBNÔÑTPÑWÔÕÔÔSSÈÚÝ[HÜYYÜBBBNÜÙ][ÈHÝÜ][HÙÝÜ][H[BBNÜÙXÙWÜÝÜ

KÈ]ÚYÈHXÙHÛÛ][ÛBBNÝÚXÚX^HÝ[[HL
LÈHHÙXÙHYÝÜÛBBNÙÜBBNÂBBNÈHÛÛÝÈÚ]]ÜX^XHÙÚ[ÈØ[^Z[È]ÝÝÉÌÌÎÂBBNÈBPØÙH    ÌÍÔÑTPÑWÐÓÓÓÔÕÔBBIÌÍÔ[[ÈHBBWÔÙXÙWÔÜÝ]Ê   ÌÍÔÑTPÑWÔÕÔÔSSË   ÌÍÓ×ÑTÔL
NÈ
LÈH[Y[Ý]È^XÝ]H[ÝÜØÙYÈÙ[ÝÙÜ[KBBNÈY]    ÌÎNÜÈÝ[ÝHØ[Ù[ÔÙXÙWÔÜÝ]Ê  ÌÍÔÑTPÑWÔÕÔÔSSËÛÛ[[ÜÛHHHØ[HH[Y[Ý[ÛÈÜ]BBNÈÛX[[ÈH[ÝYÈ^HXZ[
HBBNÈ[ÙÛÝÙHH]HÈÔÙXÙWÔÜÝ]Ê  ÌÍÔÑTPÑWÔÕÔQ    ÌÍÓ×ÑTÔYÜH^]ÈXZÙHÐÓHY[ÛÛÙBBBWÔÙXÙWÔÙ]ÝÜ][

NÂBBT]ßBBWÔÙXÙWÐÛX[

BßBBQ^]BBNÜ]ÂBBBBBNÈ]HHÙXÙHÝ]ËBBNÂBPØÙH  ÌÍÔÑTPÑWÐÓÓÓÒSTÑÐUHÈTÑØZY]][ ÌÍÔÑTPÑWÐÓÓÓÒSTÑÐUH]HÈK]HÛÛÝÈÚ]ÜÂBBNØXZÎÂBBNÈ[[YÛÛÛÛÙBBBNÂBPØÙH[ÙBBBNÂQ[ÝÚ]ÚWÔÙXÙWÔÜÝ]ÊÝXÝÙ]]J   ÌÍÝÙXÙWÔÝ]Ë ][ÝÙÐÝ[Ý]I][ÝÊK  ÌÍÓ×ÑTÔ
NÂ[[ÈÏOIÝÜÙXÙWØÝÎÈ][ÈÙY[ÈÈÛÜÚ[È][H[[ÝY]]ÙYÕÚ[TWÕØZ]ÜÚ[ÛSØXÝ
    ÌÍÜÙXÙWÜÝÜÙ][
HÈØ]ÚÝÜ][Ú]ÈØZ]ËÊKKKKKKKKKKKKKKKKKKKKKKKKKKKKVÈÙXÙWÚ[[ÈKKKKKKKKKKKKKKKKKKKKKKKKKKKKKBÈ
ÙXÙHÝ]ÂÈ
È
]ÎÈ
B[[ÂBLÈ
BZ[[ÂBLBÈ
KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKJÂ[ÈÔÙXÙWÒ[[Ê
BT]
ÕÚ[TWÕØZ]ÜÚ[ÛSØXÝ
    ÌÍÜÙXÙWÜÝÜÙ][  ÌÍÓÓÓÓÔÕÐRU
HOH ÌÍÕÐRUÓÐPÕÌ
NÂ[[ÈÏOIÝÜÙXÙWÚ[[ÂËÊKKKKKKKKKKKKKKKKKKKKKKKKKVÈÔÙXÙWÔÜÝ]ÈKKKKKKKKKKKKKKKKKKKKKKKKKKBÈ
Ù]ÈHÝ[Ý]È[ÜÈ]ÈHÙXÙHÛÛÛX[YÙÈ
È
[Y]ÎÈ
BXÝ[Ý]BKHHÝ]HÙHÙXÙBÈ
BY^]ÛÙBBKHÜÛÙHÈÜÈ
B]ØZ][BKHÛÜÝØÙHÝ[X]HÈ^ÚXÚÜÚ[È
È
][YNÈ
B]YBBBKHÝXØÙÜÂÈ
BY[ÙBBBKHZ[BÈ
KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKJÂ[ÈÔÙXÙWÔÜÝ]Ê  ÌÍØÝ[Ý]K   ÌÍÙ^]ÛÙK   ÌÍÝØZ][
BßSØØ[   ÌÍØÚXÚÔÚ[HNÂSØØ[  ÌÍÜÈHYNÂRYÝ
    ÌÍÜÙXÙWÙXY×Û[ÙJH[ÝÚ[XYÙÚ[ÈÙHÛÌÎNÝÜÈHÐÓBBRY
    ÌÍØÝ[Ý]HOH ÌÍÔÑTPÑWÔÕTÔSSÊH[BBQÝXÝÙ]]J ÌÍÝÙXÙWÔÝ]Ë ][ÝÙÐÛÛÛÐXØÙY  ][ÝË
NÂBQ[ÙBBBQÝXÝÙ]]J  ÌÍÝÙXÙWÔÝ]Ë ][ÝÙÐÛÛÛÐXØÙY  ][ÝË  ÌÍÔÑTPÑWÐPÐÑTÔÕÔ
BBQ[YBBBQÝXÝÙ]]J ÌÍÝÙXÙWÔÝ]Ë ][ÝÙÐÝ[Ý]I][ÝË   ÌÍØÝ[Ý]JBBQÝXÝÙ]]J  ÌÍÝÙXÙWÔÝ]Ë ][ÝÙÕÚ[Ì^]ÛÙI][ÝË  ÌÍÙ^]ÛÙJBBQÝXÝÙ]]J  ÌÍÝÙXÙWÔÝ]Ë ][ÝÙÕØZ][   ][ÝË  ÌÍÝØZ][
BBRY    ÌÍØÝ[Ý]HOH ÌÍÔÑTPÑWÔSSÈÜ   ÌÍØÝ[Ý]HOH ÌÍÔÑTPÑWÔÕÔQ[BBIÌÍØÚXÚÔÚ[HBBQÝXÝÙ]]J  ÌÍÝÙXÙWÔÝ]Ë ][ÝÙÐÚXÚÔÚ[  ][ÝË
BBQ[ÙBBBQÝXÝÙ]]J    ÌÍÝÙXÙWÔÝ]Ë ][ÝÙÐÚXÚÔÚ[  ][ÝË  ÌÍØÚXÚÔÚ[
ÈJNÂBQ[YBNÈÜHÝ]ÈÙHÙXÙHÈHÙXÙHÛÛÛX[YÙBRYÝ
    ÌÍÜÈHÔÙXÙWÔÙ]ÙXÙTÝ]Ê   ÌÍÝÙXÙWÔÝ]×Ú[KÝXÝÙ] ÌÍÝÙXÙWÔÝ]ÊJJH[BB[ÛÛÙ×ÙÜ  ÌÍÓÓÑTÔÔÑTPÑWÔÕUTËÕÚ[TWÑÙ]ÝÜ
JNÂBQ[YQ[YT]
    ÌÍÜÊNÂ[[ÈÏOIÝ×ÔÙXÙWÔÜÝ]ÂÈÈ[XÙHÛÝÜÈÚ]XÝ]][ÏÂ[ÈÛÛÙ×ÙÜ   ÌÍÚ[ÛÙK    ÌÍÜÑØÜ[ÛBPÛÛÛÛUÜ]J  ][ÝÊÈ    ][ÝÈ  [È ÌÍÚ[ÛÙH    [ÈP    [È ÌÍÜÑØÜ[Û [ÈÔB[ÙÜ[
    ][ÝÊÈ    ][ÝÈ  [È ÌÍÚ[ÛÙH    [ÈP    [È ÌÍÜÑØÜ[ÛB[[ÈÏOIÝÛÛÛÙ×ÙÜ[ÈÔÙXÙWÔÙ]ÙXÙTÝ]Ê ÌÍÚÙXÙTÝ]Ë   ÌÍÛÙXÙTÝ]ÊBSØØ[    ÌÍÜ]HØ[
    ][ÝØYLÌ  ][ÝË  ][ÝÚ[ ][ÝË  ][ÝÔÙ]ÙXÙTÝ]É][ÝË  ][ÝÚÛ    ][ÝË  ÌÍÚÙXÙTÝ]Ë   ][ÝÜ][ÝË    ÌÍÛÙXÙTÝ]ÊBN××Ú[ÑTPÑWÔÕUT×ÒSHÙXÙTÝ]ËN××Ú[ÑTPÑWÔÕUTÈÙXÙTÝ]ÂT]    ÌÍÜ]ÌB[[ÈÏOIÝÔÙ]ÙXÙTÝ]ÂËÊKKKKKKKKKKKKKKKKKKKKKKKKKKKKKVÈÙXÙWÜÝKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKBÈ
ÝÈ[[ÈHÙXÙBÈ
KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKJÂ[ÈÔÙXÙWÔÝ
    ÌÍØØË  ÌÍØÝBNÈÜHÝ]ÈÈHÙXÙHÛÛÛX[YÙRYÝ
ÔÙXÙWÔÜÝ]Ê   ÌÍÔÑTPÑWÔÕTÔSSË    ÌÍÓ×ÑTÔÌ
JH[]BNÈÜX]HH][ØXÝHÛÛÛ[[Ý[ÛÚYÛ[ÂNÝÈ][Ú[]XÙZ]ÈH  ][ÝÜÝÜ  ][ÝÈÛÛÛÛÙKIÌÍÜÙXÙWÜÝÜÙ][HÕÚ[TWÐÜX]Q][
YK[ÙK
NÂRYÝ
    ÌÍÜÙXÙWÜÝÜÙ][
H[BNÛÙØÞ
    ][ÝÉ][ÝË    ][ÝÔÙXÙHÝÜ][[HH   ][ÝÊBBT]ÂQ[ÙBBNÛÙØÞ
    ][ÝÉ][ÝË    ][ÝÉÌÍÜÙXÙWÜÝÜÙ][    ][ÝÈ  [È ÌÍÜÙXÙWÜÝÜÙ][
BQ[YNÜÜHÝ]ÈÈHÙXÙHÛÛÛX[YÙRYÝÔÙXÙWÔÜÝ]Ê    ÌÍÔÑTPÑWÔÕTÔSSË    ÌÍÓ×ÑTÔÌ
H[]ÂBNÈHØ[HÛÛYH[]X[^][ÛÛÙKÚ[H  ÌÍÔÑTPÑWÔÕTÔSSÈ[Y[Ý]ÐÓHÚ[[Ú[Ë]ÒËNÈ]HÛÛÝÈHX[ÜÙHÙ]YÚÝËBNÜÜHÝ]ÈÈHÙXÙHÛÛÛX[YÙRYÝÔÙXÙWÔÜÝ]Ê   ÌÍÔÑTPÑWÔSSË ÌÍÓ×ÑTÔ
H[]ÂBNÛÛÜ[
NÂ[[ÈÏOIÝÜÙXÙWÜÝÂËÊKKKKKKKKKKKKKKKKKKKKKKKKKKKKKVÈÙXÙWÜÝÜKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKBÈ
ÝÜÈHÙXÙKÈ
È
ÕNYÈÙXÙHÚ[ZÙHÛÙ[ÈÙXÛÛËÈ
Ü]ÛHXYÈ^XÝ]HHÝÜÛÙH[]È
ÝÚÙHHÐÓHÚ[[ÈHÙXÙHÈÝÜYÜÛ[ËÈ
KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKJÂ[ÈÔÙXÙWÔÙ]ÝÜ][

BIÌÍÔ[[ÈHRY
    ÌÍÜÙXÙWÜÝÜÙ][
H[BHÕÚ[TWÔÙ]][
    ÌÍÜÙXÙWÜÝÜÙ][
HQ[Y[[ÈÏOIÝÜÙXÙWÜÝÜÏOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOBÈØÜ[ÛÜX]ÈHÙXÙHÛHÛÛ]È[Y]Π ÌÍÜÐÛÛ][YHH[YHÙHÙ]ÛÛ]Y[KHØØ[ÛÛ][YHÈÙYÈ ÌÍÜÔÙXÙS[YHH[YHÙHÙXÙHÈÜX]BÈ ÌÍÜÑÜ^S[YHHÜ^H[YHÙHÙXÙBÈ  ÌÍÜÐ[T]H[H]X[YYY]ÈHÙXÙH[H[BÈH]Ø[[ÛÈ[ÛYHÝ[Y[ÈÜ[]]ËÝÙXÙBÈ ÌÍÜÔÙXÙUÙHÛÜ[Û[HY][ÈØØ[ÞÝ[BÈ[YHÙHXØÛÝ[[ÚXÚHÙXÙHÚÝ[[È ÌÍÜÔÜÝÛÜHÛÜ[Û[HY][È[BÈÜÝÛÜÈHXØÛÝ[[YHÜXÚYYYH  ÌÍÜÔÙXÙUÙÈÜXÚYH[[HÝ[ÈYHXØÛÝ[ÈÈÜÝÛÜÜYHÙXÙHÈ[È[HØØ[ÙXÙK]ÛÜÔÙXÙKÜØØ[ÞÝ[HXØÛÝ[È ÌÍÛÙXÙUHHÛÜ[Û[HY][È    ÌÍÔÑTPÑWÕÒSÌÓÕÓÔÐÑTÔÂÈ ÌÍÛÝHHÛÜ[Û[HY][È    ÌÍÔÑTPÑWÐUU×ÔÕTÈ  ÌÍÛÜHHÛÜ[Û[HY][È    ÌÍÔÑTPÑWÑTÔÓÔPSÈ  ÌÍÛÚYXØÙÜÈHÛÜ[Û[HY][È   ÌÍÔÑTPÑWÐSÐPÐÑTÔÂÈ  ÌÍÜÓØYÜÜÝHÛÜ[Û[HY][È[BÈ[YÈHØYÜ[ÈÜÝÙÚXÚÈÙXÙHÈHY[XÈ]Z[Y[ÎYZ[Ý]]HYÚÈÛHÛÛ]È][YÎÛÝXØÙÜÈHBÈÛZ[HH[ÜÈÙ]È^[YÚ[ÝÜÈÜÛÙBÈÝN[[ÚYÈØ[ÝHÜXÚYYYÚ[ÈÈ[Ý[ÛÈYÈHÜX]TÙXÙHYÙHÛTÑÜ[ÜH[ÜX][ÛÏOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOB[ÈÔÙXÙWÐÜX]J   ÌÍÜÐÛÛ][YK  ÌÍÜÔÙXÙS[YK ÌÍÜÑÜ^S[YK   ÌÍÜÐ[T]   ÌÍÜÔÙXÙUÙH   ][ÝÓØØ[ÞÝ[I][ÝË   ÌÍÜÔÜÝÛÜH   ][ÝÉ][ÝË  ÌÍÛÙXÙUHHL   ÌÍÛÝHH    ÌÍÛÜHHK   ÌÍÛÚYXØÙÜÈHY  ÌÍÜÓØYÜÜÝH  ][ÝÉ][ÝÊBØØ[  ÌÍÚYLÌØØ[ ÌÍÚÙ[ÌØØ[    ÌÍØ]ØØ[    ÌÍÚÐÂØØ[ ÌÍÛÜHLH ÌÍÚYLÌHÜ[  ][ÝØYLÌ  ][ÝÊBY    ÌÍÚYLÌHLH[] ÌÍÚÙ[ÌHÜ[ ][ÝÚÙ[Ì ][ÝÊBY    ÌÍÚÙ[ÌHLH[]    ÌÍØ]HØ[
    ÌÍÚYLÌ  ][ÝÛÛÉ][ÝË    ][ÝÓÜ[ÐÓX[YÙ][ÝË  ][ÝÜÝ][ÝË  ÌÍÜÐÛÛ][YK  ][ÝÜÝ][ÝË  ][ÝÔÙXÙÐXÝ]I][ÝË  ][ÝÛÛÉ][ÝË    ÌÍÔÐ×ÓPSQÑTÐSÐPÐÑTÔÊBY ÌÍØ]ÌHH[    ÌÍØ]HØ[
    ÌÍÚÙ[Ì ][ÝÛÛÉ][ÝË    ][ÝÑÙ]ÝÜ][ÝÊB    ÌÍÛÜH   ÌÍØ]ÌB[ÙB  ÌÍÚÐÈH ÌÍØ]ÌB  ÌÍØ]HØ[
    ÌÍÚYLÌ  ][ÝÛÛÉ][ÝË    ][ÝÓÜ[ÙXÙI][ÝË ][ÝÛÛÉ][ÝË    ÌÍÚÐË    ][ÝÜÝ][ÝË  ÌÍÜÔÙXÙS[YK ][ÝÛÛÉ][ÝË    ÌÍÔÑTPÑWÒSTÑÐUJBY   ÌÍØ]ÌHH[    ÌÍØ]HØ[
    ÌÍÚYLÌ  ][ÝÛÛÉ][ÝË    ][ÝÐÜX]TÙXÙI][ÝË   ][ÝÛÛÉ][ÝË    ÌÍÚÐË    ][ÝÜÝ][ÝË  ÌÍÜÔÙXÙS[YK ][ÝÜÝ][ÝË  ÌÍÜÑÜ^S[YK   ][ÝÛÛÉ][ÝË    ÌÍÛÚYXØÙÜË    ][ÝÛÛÉ][ÝË    ÌÍÛÙXÙUK ][ÝÛÛÉ][ÝË    ÌÍÛÝK ][ÝÛÛÉ][ÝË    ÌÍÛÜK ][ÝÜÝ][ÝË  ÌÍÜÐ[T]   ][ÝÜÝ][ÝË  ÌÍÜÓØYÜÜÝ ][ÝÜ][ÝË  ][ÝÜÝ][ÝË  ][ÝÉ][ÝË  ][ÝÜÝ][ÝË  ÌÍÜÔÙXÙUÙ  ][ÝÜÝ][ÝË  ÌÍÜÔÜÝÛÜ
BY  ÌÍØ]ÌHH[    ÌÍØ]HØ[
    ÌÍÚÙ[Ì ][ÝÛÛÉ][ÝË    ][ÝÑÙ]ÝÜ][ÝÊB    ÌÍÛÜH   ÌÍØ]ÌB[ÙBØ[
    ÌÍÚYLÌ  ][ÝÚ[ ][ÝË  ][ÝÐÛÜÙTÙXÙR[I][ÝË ][ÝÛÛÉ][ÝË    ÌÍØ]ÌJB[Y[ÙBØ[
    ÌÍÚYLÌ  ][ÝÚ[ ][ÝË  ][ÝÐÛÜÙTÙXÙR[I][ÝË ][ÝÛÛÉ][ÝË    ÌÍØ]ÌJB[YØ[
    ÌÍÚYLÌ  ][ÝÚ[ ][ÝË  ][ÝÐÛÜÙTÙXÙR[I][ÝË ][ÝÛÛÉ][ÝË    ÌÍÚÐÊB[YÛÜÙJ    ÌÍÚYLÌBÛÜÙJ  ÌÍÚÙ[ÌHY   ÌÍÛÜ    ÉÝÈLH[Ù]Ü  ÌÍÛÜB][Y]B[[ÂÏOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOBÈØÜ[Û[]ÈHÙXÙHÛHÛÛ]È[Y]Π ÌÍÜÐÛÛ][YHH[YHÙHÙ]ÛÛ]Y[KHØØ[ÛÛ][YHÈÙYÈ ÌÍÜÔÙXÙS[YHH[YHÙHÙXÙHÈ[]BÈ]Z[Y[ÎYZ[Ý]]HYÚÈÛHÛÛ]È][YÎÛÝXØÙÜÈHBÈÛZ[HH[ÜÈÙ]È^[YÚ[ÝÜÈÜÛÙBÏOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOB[ÈÑ[]TÙXÙJ ÌÍÜÐÛÛ][YK    ÌÍÜÔÙXÙS[YJBØØ[ ÌÍÚYLÌØØ[ ÌÍÚÙ[ÌØØ[    ÌÍØ]ØØ[    ÌÍÚÐÂØØ[ ÌÍÚÙXÙBØØ[   ÌÍÛÜHLH ÌÍÚYLÌHÜ[  ][ÝØYLÌ  ][ÝÊBY    ÌÍÚYLÌHLH[] ÌÍÚÙ[ÌHÜ[ ][ÝÚÙ[Ì ][ÝÊBY    ÌÍÚÙ[ÌHLH[]    ÌÍØ]HØ[
    ÌÍÚYLÌ  ][ÝÛÛÉ][ÝË    ][ÝÓÜ[ÐÓX[YÙ][ÝË  ][ÝÜÝ][ÝË  ÌÍÜÐÛÛ][YK  ][ÝÜÝ][ÝË  ][ÝÔÙXÙÐXÝ]I][ÝË  ][ÝÛÛÉ][ÝË    ÌÍÔÐ×ÓPSQÑTÐSÐPÐÑTÔÊBY ÌÍØ]ÌHH[    ÌÍØ]HØ[
    ÌÍÚÙ[Ì ][ÝÛÛÉ][ÝË    ][ÝÑÙ]ÝÜ][ÝÊB    ÌÍÛÜH   ÌÍØ]ÌB[ÙB  ÌÍÚÐÈH ÌÍØ]ÌB  ÌÍØ]HØ[
    ÌÍÚYLÌ  ][ÝÛÛÉ][ÝË    ][ÝÓÜ[ÙXÙI][ÝË ][ÝÛÛÉ][ÝË    ÌÍÚÐË    ][ÝÜÝ][ÝË  ÌÍÜÔÙXÙS[YK ][ÝÛÛÉ][ÝË    ÌÍÔÑTPÑWÐSÐPÐÑTÔÊBY  ÌÍØ]ÌHH[    ÌÍØ]HØ[
    ÌÍÚÙ[Ì ][ÝÛÛÉ][ÝË    ][ÝÑÙ]ÝÜ][ÝÊB    ÌÍÛÜH   ÌÍØ]ÌB[ÙB  ÌÍÚÙXÙHH   ÌÍØ]ÌB  ÌÍØ]HØ[
    ÌÍÚYLÌ  ][ÝÚ[ ][ÝË  ][ÝÑ[]TÙXÙI][ÝËÂ ][ÝÛÛÉ][ÝË    ÌÍÚÙXÙJBY  ÌÍØ]ÌHH[    ÌÍØ]HØ[
    ÌÍÚÙ[Ì ][ÝÛÛÉ][ÝË    ][ÝÑÙ]ÝÜ][ÝÊB    ÌÍÛÜH   ÌÍØ]ÌB[YØ[
    ÌÍÚYLÌ  ][ÝÚ[ ][ÝË  ][ÝÐÛÜÙTÙXÙR[I][ÝË ][ÝÛÛÉ][ÝË    ÌÍÚÙXÙJB[YØ[
    ÌÍÚYLÌ  ][ÝÚ[ ][ÝË  ][ÝÐÛÜÙTÙXÙR[I][ÝË ][ÝÛÛÉ][ÝË    ÌÍÚÐÊB[YÛÜÙJ    ÌÍÚYLÌBÛÜÙJ  ÌÍÚÙ[ÌHY   ÌÍÛÜ    ÉÝÈLH[Ù]Ü  ÌÍÛÜB][Y]B[[ÂÏOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOBÈØÜ[ÛÝÜÈHÙXÙHÛHÛÛ]È[Y]Π   ÌÍÜÐÛÛ][YHH[YHÙHÙ]ÛÛ]Y[KHØØ[ÛÛ][YHÈÙYÈ ÌÍÜÔÙXÙS[YHH[YHÙHÙXÙHÈÝÜÈ]Z[Y[ÎÛBÈ][YÎÛÝXØÙÜÈHBÈÛZ[HH[ÜÈÙ]È^[YÚ[ÝÜÈÜÛÙBÈÝNÈ[Ý[ÛÙÈÝÚXÚÈÈÙYHYHÙXÙHÈÝÜYÝXØÙÜÙ[BÏOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOB[ÈÔÝÜÙXÙJ ÌÍÜÐÛÛ][YK    ÌÍÜÔÙXÙS[YJBØØ[ ÌÍÚYLÌØØ[ ÌÍÚÙ[ÌØØ[    ÌÍØ]ØØ[    ÌÍÚÐÂØØ[ ÌÍÚÙXÙBØØ[   ÌÍÛÜHLB ÌÍÚYLÌHÜ[  ][ÝØYLÌ  ][ÝÊBY    ÌÍÚYLÌHLH[] ÌÍÚÙ[ÌHÜ[ ][ÝÚÙ[Ì ][ÝÊBY    ÌÍÚÙ[ÌHLH[]    ÌÍØ]HØ[
    ÌÍÚYLÌ  ][ÝÛÛÉ][ÝË    ][ÝÓÜ[ÐÓX[YÙ][ÝË  ][ÝÜÝ][ÝË  ÌÍÜÐÛÛ][YK  ][ÝÜÝ][ÝË  ][ÝÔÙXÙÐXÝ]I][ÝË  ][ÝÛÛÉ][ÝË    ÌÍÔÐ×ÓPSQÑTÐÓÓPÕ
BY  ÌÍØ]ÌHH[    ÌÍØ]HØ[
    ÌÍÚÙ[Ì ][ÝÛÛÉ][ÝË    ][ÝÑÙ]ÝÜ][ÝÊB    ÌÍÛÜH   ÌÍØ]ÌB[ÙB  ÌÍÚÐÈH ÌÍØ]ÌB  ÌÍØ]HØ[
    ÌÍÚYLÌ  ][ÝÛÛÉ][ÝË    ][ÝÓÜ[ÙXÙI][ÝË ][ÝÛÛÉ][ÝË    ÌÍÚÐË    ][ÝÜÝ][ÝË  ÌÍÜÔÙXÙS[YK ][ÝÛÛÉ][ÝË    ÌÍÔÑTPÑWÔÕÔ
BY  ÌÍØ]ÌHH[    ÌÍØ]HØ[
    ÌÍÚÙ[Ì ][ÝÛÛÉ][ÝË    ][ÝÑÙ]ÝÜ][ÝÊB    ÌÍÛÜH   ÌÍØ]ÌB[ÙB  ÌÍÚÙXÙHH   ÌÍØ]ÌB  ÌÍØ]HØ[
    ÌÍÚYLÌ  ][ÝÚ[ ][ÝË  ][ÝÐÛÛÛÙXÙI][ÝË  ][ÝÛÛÉ][ÝË    ÌÍÚÙXÙK  ][ÝÛÛÉ][ÝË    ÌÍÔÑTPÑWÐÓÓÓÔÕÔ   ][ÝÜÝ][ÝË  ][ÝÉ][ÝÊBY  ÌÍØ]ÌHH[    ÌÍØ]HØ[
    ÌÍÚÙ[Ì ][ÝÛÛÉ][ÝË    ][ÝÑÙ]ÝÜ][ÝÊB    ÌÍÛÜH   ÌÍØ]ÌB[YØ[
    ÌÍÚYLÌ  ][ÝÚ[ ][ÝË  ][ÝÐÛÜÙTÙXÙR[I][ÝË ][ÝÛÛÉ][ÝË    ÌÍÚÙXÙJH[YØ[
    ÌÍÚYLÌ  ][ÝÚ[ ][ÝË  ][ÝÐÛÜÙTÙXÙR[I][ÝË ][ÝÛÛÉ][ÝË    ÌÍÚÐÊB[YÛÜÙJ    ÌÍÚYLÌBÛÜÙJ  ÌÍÚÙ[ÌHY   ÌÍÛÜ    ÉÝÈLH[Ù]Ü  ÌÍÛÜB][Y]B[[
Posted

Good news! Probably i've found the working method of integrating service.au3 with other projects :)

Only some words at first.

I started sqlite based + tcp project at summer. The idea of "native" windows service was almost unreal at that time...

tcp + sqlite was very slow and took much resources. I thoght that was only because of autoit. But that was not :>

I realised it after ASock.au3 project by Zatorg (please, sorry if im wrong) - ASock is asynck socket - tcp on event (uses ws2_32.dll).

Asock & sqlite didnt work together. The only reason for that was..._ArrayDisplay() func with gui!!! Ok. I made special sqlite.au3 without dependences. It works, but my udf seemed too be much havy to use at another project.

Few weeks ago i returned to service.au3 and found TCP UDF, Event driven project based on ASock.au3. It seemed to work as example, but didn't work at all as service.

In my variant of service_example.au3 i posted msdn words about service_main procedure, that it must contain all global vars of project ;) and I made like it said!

And now only few words.

To make your project works as service with the brilliant work of @arcker U have to:

1. Make all variables be declared - use opt("mustdeclarevars",1)

2. Make Init func of your project

3. Make Stop func for your project. For example I had to make routines to destroy all gui, close all opened sockets and so on.

4. Make something similar with all other udf u are using in your service project... maybe its a worst thing on the Earth to fix somebody's else project bugs :lmao:

5. Thats not all

6. U have to combine all Globals in one place: for example at the the begining. U have to make it with other udfs too... silly work

7. Than sort Global Const and other Global statements. If u see something like global $x = 1 do that way: global $x leeve at top. $x =1 insert into module's (udf or project) Init func.

8. U have to do it even with standart udf... or use only necessary functions from it in your own include. Or... maybe u have another plan?

9. Try to build your project with modified udfs - does it works now? Hmm... But it have to ;)

U see, its nothing only a good programming style.

10. Than u can combine fixed correct project with service.au3

I compiled like CUI (meens not Gui) #AutoIt3Wrapper_Change2CUI=y

It not meens that Gui will not work in service - it works, but msdn said... yes-yes :think: Maybe later after everything will work fine i'll say "msdn is wrong, microsoft lies"... But maybe i'll say that microsoft - is not so bad, because autoit works in it :shhh:

I'll try to post that project as an another service_example.au3 in some weeks here. If it will works.

Some advice: use SysInternals Process Explorer (free gui based), or kill.exe from support tools to stop suspended service process. U can start-stop service even net start/net stop commands. Use file logging while debuging. No need to install-uninstall service after every recompilation: only stop, recompile, start. See, if it was suspended (while stopping) - kill process. The only reason not to stop service correctly i've found for today is unclean exit: opened sockets, maybe some dlls.

Posted

@udgeen

Very interesting.

I am mostly interested in Getting the Asock running together with SQLite (with or withour a service).

So if you got that running, let me know.

Thanks

Patrick

Yes, I've got that running almost at summer. It seems working as native windows service too.
  • 2 weeks later...
  • 2 weeks later...
Posted

Hello arcker

Firstly your Script for Service is extremely cool.

i am facing a problem, i have an Service Process, and i want to check that which user is currently Active(Loged In)

i tried to get the username via @UserName macro but it always return me SYSTEM

in my second try i tried to get the user name from Registry but still, i am unable to retrieve the user name of Active account.

please help me.

thanks in advance for your kind help.

73 108 111 118 101 65 117 116 111 105 116

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...