![]() ![]() Win2K & WinXP supports aditional description text for services HService := CreateService(hSCM,ServiceName,DisplayName,SERVICE_ALL_ACCESS,ServiceType,StartType,0,FileName,``,0,'','','') HService := OpenService(hSCM,ServiceName,SERVICE_QUERY_CONFIG) įunction InstallService(FileName, ServiceName, DisplayName, Description: string ServiceType,StartType :cardinal): boolean MsgBox('only nt based systems support services', mbError, MB_OK)įunction IsServiceInstalled(ServiceName: string): boolean MsgBox('the servicemanager is not available', mbError, MB_OK) Result := OpenSCManager('','',SC_MANAGER_ALL_ACCESS) #įunction OpenSCManager(lpMachineName, lpDatabaseName: string dwDesiredAccess :cardinal): stdcall' įunction OpenService(hSCManager :HANDLE lpServiceName: string dwDesiredAccess :cardinal): stdcall' įunction CloseServiceHandle(hSCObject :HANDLE): stdcall' įunction CreateService(hSCManager :HANDLE lpServiceName, lpDisplayName: string dwDesiredAccess,dwServiceType,dwStartType,dwErrorControl: cardinal lpBinaryPathName,lpLoadOrderGroup: String lpdwTagId: cardinal lpDependencies,lpServiceStartName,lpPassword:string): stdcall' įunction DeleteService(hService :HANDLE): stdcall' įunction StartNTService(hService :HANDLE dwNumServiceArgs: cardinal lpServiceArgVectors: cardinal): stdcall' įunction ControlService(hService :HANDLE dwControl :cardinal var ServiceStatus :SERVICE_STATUS): stdcall' įunction QueryServiceStatus(hService :HANDLE var ServiceStatus :SERVICE_STATUS): stdcall' įunction QueryServiceStatusEx(hService :HANDLE ServiceStatus :SERVICE_STATUS): stdcall' function SetupService(service, port, comment: string): boolean function StopService(ServiceName: string): boolean function StartService(ServiceName: string): boolean function RemoveService(ServiceName: string): boolean function InstallService(FileName, ServiceName, DisplayName, Description: string ServiceType,StartType :cardinal): boolean function IsServiceRunning(ServiceName: string): boolean function IsServiceInstalled(ServiceName: string): boolean Code pasted from the following address, for examples and more visit it: Regarding operating windows services, I have collected a very useful script here. ![]() The basic scripts for the above 1, 2, and 3 functions have been implemented for us. Opening the program to create a new script will create a basic framework, and then we can modify the script to add functions. The use of the program will not be introduced much. Check whether the program (or service) is running during installation/uninstallation, if it is running, close the program first.You cannot run two installers at the same time during installation.Create various shortcuts, desktop, quick launch bar, etc.Let's take a look at the common functional requirements in our packaging process: Inno Setup supports pascal scripts, so we can implement functions by directly writing scripts. Later, I found a simple and convenient packaging tool, namely our protagonist Inno Setup today Its function is very powerful, but it needs to be paid for, and some fine-grained operations are more complicated. I used InstallShield Limited Edition for Visual Studio 2015 in the project before. When developing a desktop program, it is often necessary to use a packaging tool to package the program into an exe executable file.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |