You are here

Service Segment

4 posts / 0 new
Last post
demon.devin
demon.devin's picture
Offline
Last seen: 3 years 7 months ago
Developer
Joined: 2007-08-02 09:04
Service Segment

Services.nsh: https://paste.ee/p/yMjyq

The file I have linked to above can be used to replace the official Services segment as it is in working order and does not require any extra plugins. It works with both ANSI and Unicode variants of NSIS and handles system architecture properly. It supports the use of handling services in the launcher.ini file ([Service1] and [Service2]). It has debugging support for those who want to debug this segment when making a portable of an application that ues Windows Services. The file is also commented for those who would like to know the play by play in the code.

USAGE:
To make use of this segment, add the section [Service1] (numerical ordering) to the Launcher.ini file. 
Each entry supports six keys which are as follows: 

Name	-	The local/portable service name.
Path	-	The path to the portable service executable. Supports environment variables.
Type	-	Specify whether you are dealing with a service, a kernel driver or a file system driver, etc.
		Choose from: own, share, interact, kernel, filesys, rec
Start	-	Specify when the service is supposed to start.
 		Choose from: boot, system, auto, demand, disabled, delayed-auto
Depend	-	List any dependencies here separated by / (forward slash).
IfExists-	You can either skip or replace the service if it already exists.
 		Choose from: skip, replace

EXAMPLE:

[Service1]
Name=ServiceName
Path=%PAL:DataDir%\drivers\service.sys
Type=kernel
Start=system
Depend=
IfExists=replace

For those of you who would like to see this file working in action, a working implementation can be seen with the development test release of Emsisoft Emergency Kit Portable. If you're curious about how it works, open the Services.nsh file and the EmergencyKitPortable.ini.

I would love to see some feedback on this new segment file as I'm sure there could be bugs within the code somewhere. It's always good to have an extra set of eyes other than your own.

Smile

demon.devin
demon.devin's picture
Offline
Last seen: 3 years 7 months ago
Developer
Joined: 2007-08-02 09:04
Fixed some minor errors.

Fixed some minor errors.

daemon.devin

lahma
Offline
Last seen: 11 months 1 week ago
Joined: 2023-04-23 04:04
This is super useful. Thank

This sounds super useful. Unfortunately, the pastebin link is dead. Would you repost it or provide a link to where one could download it? Thanks!

SimonGeek
Offline
Last seen: 5 months 3 weeks ago
Joined: 2022-07-24 01:22
The post is very old

The post listed above is very old, unlikely to be answered by the author. However, there is an official version of the plugin and you can find it here

Log in or register to post comments