<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://nsis.sourceforge.io/mediawiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Speed78</id>
	<title>NSIS Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://nsis.sourceforge.io/mediawiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Speed78"/>
	<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/Special:Contributions/Speed78"/>
	<updated>2026-05-17T15:20:45Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.17</generator>
	<entry>
		<id>https://nsis.sourceforge.io/mediawiki/index.php?title=NSIS_Simple_Firewall_Plugin&amp;diff=25681</id>
		<title>NSIS Simple Firewall Plugin</title>
		<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/mediawiki/index.php?title=NSIS_Simple_Firewall_Plugin&amp;diff=25681"/>
		<updated>2021-05-04T21:30:23Z</updated>

		<summary type="html">&lt;p&gt;Speed78: /* Changelog */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This plugin can be used to configure the Windows firewall. This plugin contains functions to enable, check, add or remove programs or ports to the firewall exception list. It also contains functions for checking the firewall status, enable or disable the firewall and so on.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This plugin is using the MPL License or alternatively the LGPL License.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
The ZIP file containing a precompiled plugin DLL (to be saved in NSIS&#039; plugin directory) and the sources. &lt;br /&gt;
If you update from a previous version it is strongly &#039;&#039;&#039;recommend&#039;&#039;&#039; to take look at the changelog.&lt;br /&gt;
*Unicode Version: &amp;lt;attach&amp;gt;NSIS_Simple_Firewall_Plugin_Unicode_1.21.zip&amp;lt;/attach&amp;gt; (Recommend for &amp;gt;= NSIS 3.x)&lt;br /&gt;
*ANSI Version: &amp;lt;attach&amp;gt;NSIS_Simple_Firewall_Plugin_ANSI_1.21.zip&amp;lt;/attach&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Donation ==&lt;br /&gt;
If you believe that I am doing a good job and you want to support me please [http://www.speed-soft.de/donation/index.php?language=en donate] any amount via PayPal.&lt;br /&gt;
&lt;br /&gt;
== Short Reference ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
SimpleFC::EnableDisableFirewall [status]&lt;br /&gt;
SimpleFC::IsFirewallEnabled  &lt;br /&gt;
 &lt;br /&gt;
SimpleFC::AllowDisallowExceptionsNotAllowed [status]&lt;br /&gt;
SimpleFC::AreExceptionsNotAllowed  &lt;br /&gt;
 &lt;br /&gt;
SimpleFC::EnableDisableNotifications [status]&lt;br /&gt;
SimpleFC::AreNotificationsEnabled  &lt;br /&gt;
 &lt;br /&gt;
SimpleFC::StartStopFirewallService [status]&lt;br /&gt;
SimpleFC::IsFirewallServiceRunning  &lt;br /&gt;
 &lt;br /&gt;
SimpleFC::AddPort [port] [name] [protocol] [scope] [ip_version] [remote_addresses] [status]&lt;br /&gt;
SimpleFC::IsPortAdded [port] [protocol]&lt;br /&gt;
SimpleFC::RemovePort [port] [protocol]&lt;br /&gt;
 &lt;br /&gt;
SimpleFC::IsPortEnabled [port] [protocol]&lt;br /&gt;
SimpleFC::EnableDisablePort [port] [protocol]&lt;br /&gt;
 &lt;br /&gt;
SimpleFC::AddApplication [name] [path] [scope] [ip_version] [remote_addresses] [status]&lt;br /&gt;
SimpleFC::IsApplicationAdded [path]&lt;br /&gt;
SimpleFC::RemoveApplication [path]&lt;br /&gt;
 &lt;br /&gt;
SimpleFC::IsApplicationEnabled [path]&lt;br /&gt;
SimpleFC::EnableDisableApplication [path]&lt;br /&gt;
&lt;br /&gt;
SimpleFC::RestoreDefaults&lt;br /&gt;
&lt;br /&gt;
SimpleFC::AllowDisallowIcmpOutboundDestinationUnreachable [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpRedirect [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpInboundEchoRequest [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpOutboundTimeExceeded [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpOutboundParameterProblem [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpOutboundSourceQuench [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpInboundRouterRequest [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpInboundTimestampRequest [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpInboundMaskRequest [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpOutboundPacketTooBig [status]&lt;br /&gt;
SimpleFC::IsIcmpTypeAllowed [ip_version] [local_address] [icmp_type]&lt;br /&gt;
&lt;br /&gt;
SimpleFC::AdvAddRule [name] [description] [protocol] [direction] &lt;br /&gt;
  [status] [profile] [action] [application] [service_name] [icmp_types_and_codes] &lt;br /&gt;
  [group] [local_ports] [remote_ports] [local_address] [remote_address]&lt;br /&gt;
SimpleFC::AdvRemoveRule [name]&lt;br /&gt;
SimpleFC::AdvExistsRule [name]&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
*port - TCP/UDP port which should be opened/closed&lt;br /&gt;
*name - The name of the application/port/rule&lt;br /&gt;
*description - Description of the rule&lt;br /&gt;
*protocol - One of the following protocol&lt;br /&gt;
**1 - ICMPv4&lt;br /&gt;
**6 - TCP&lt;br /&gt;
**17 - UDP&lt;br /&gt;
**58 - ICMPv6&lt;br /&gt;
**256 - Any protocol&lt;br /&gt;
*scope - One of the following scope&lt;br /&gt;
**0 - All networks&lt;br /&gt;
**1 - Only local subnets&lt;br /&gt;
**2 - Custom scope&lt;br /&gt;
**3 - Max scope&lt;br /&gt;
**NOTE: If you use custom you must define remote_addresses&lt;br /&gt;
*ip_version&lt;br /&gt;
**0 - IPv4&lt;br /&gt;
**1 - IPv6&lt;br /&gt;
**2 - Any version&lt;br /&gt;
*icmp_type&lt;br /&gt;
**3 - Outbound Destination Unreachable (ICMPv4)&lt;br /&gt;
**4 - Outbound Source Quench (ICMPv4)&lt;br /&gt;
**5 - Redirect (ICMPv4)&lt;br /&gt;
**8 - Inbound Echo Request (ICMPv4)&lt;br /&gt;
**9 - Inbound Router Request (ICMPv4)&lt;br /&gt;
**11 - Outbound Time Exceeded (ICMPv4)&lt;br /&gt;
**12 - Outbound Parameter Problem (ICMPv4)&lt;br /&gt;
**13 - Inbound Timespamp Request (ICMPv4)&lt;br /&gt;
**17 - Inbound Mask Request (ICMPv4)&lt;br /&gt;
**1 - Outbound Destination Unreachable (ICMPv6)&lt;br /&gt;
**2 - Outbound Packet Too Big (ICMPv6)&lt;br /&gt;
**3 - Outbound Time Exceeded (ICMPv6)&lt;br /&gt;
**4 - Outbound Parameter Problem (ICMPv6)&lt;br /&gt;
**128 - Inbound Echo Request (ICMPv6)&lt;br /&gt;
**137 - Redirect (ICMPv6)&lt;br /&gt;
*direction&lt;br /&gt;
**1 - In&lt;br /&gt;
**2 - Out&lt;br /&gt;
*profile&lt;br /&gt;
**1 - Domain &lt;br /&gt;
**2 - Private&lt;br /&gt;
**4 - Public&lt;br /&gt;
**2147483647 - All profiles&lt;br /&gt;
*action&lt;br /&gt;
**0 - Block&lt;br /&gt;
**1 - Allow&lt;br /&gt;
*application - Path of the application (can be empty)&lt;br /&gt;
servicename - Specifies the service name property of the application (can be empty). &lt;br /&gt;
**&#039;&#039;&#039;Note&#039;&#039;&#039;: A serviceName value of &amp;quot;*&amp;quot; indicates that a service, not an application, must be sending or receiving traffic.&lt;br /&gt;
*icmp_types_and_codes - Specified icmp types and codes (can be empty)&lt;br /&gt;
*group - Put the rule in this specified group (can be empty) &lt;br /&gt;
**&#039;&#039;&#039;Note&#039;&#039;&#039;: On Vista the group must the a resource string in a exe/dll e.g. &amp;quot;@C:\Program Files\My Application\myapp.exe,-10000&amp;quot;. On all other supported operating systems it can be a string value.&lt;br /&gt;
*local_ports - Local ports (The protocol property must be set before - Otherwise can be empty)&lt;br /&gt;
**&#039;&#039;&#039;Note&#039;&#039;&#039;: The following port keywords are valid addionally: &amp;quot;RPC&amp;quot;, &amp;quot;RPC-EPMap&amp;quot;, &amp;quot;Teredo&amp;quot;, &amp;quot;IPTLSIn&amp;quot;, &amp;quot;IPHTTPSIn&amp;quot; and &amp;quot;Ply2Disc&amp;quot;&lt;br /&gt;
*remote_ports - Remote ports (The protocol property must be set before - Otherwise can be empty)&lt;br /&gt;
**&#039;&#039;&#039;Note&#039;&#039;&#039;: The following port keywords are valid addionally: &amp;quot;RPC&amp;quot;, &amp;quot;RPC-EPMap&amp;quot;, &amp;quot;Teredo&amp;quot;, &amp;quot;IPTLSIn&amp;quot;, &amp;quot;IPHTTPSIn&amp;quot; and &amp;quot;Ply2Disc&amp;quot;&lt;br /&gt;
*local_address - Local addresses from which the port can listen for traffic (can be empty)&lt;br /&gt;
*remote_address - Remote addresses from which the port can listen for traffic (can be empty)&lt;br /&gt;
*status - Status of the port, application, rule, firewall or service for example enabled/disabled, start/stop or allow/disallow&lt;br /&gt;
**0 - Disabled, stop or disallow&lt;br /&gt;
**1 - Enabled, start, or allow&lt;br /&gt;
&lt;br /&gt;
== The Sample Script ==&lt;br /&gt;
In this script you can find the two most used functions. If you are searching for some special firewall exceptions please look at &amp;quot;The Sample Script (All Functions)&amp;quot;. &lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
; Add an application to the firewall exception list - All Networks - All IP Version - Enabled&lt;br /&gt;
  SimpleFC::AddApplication &amp;quot;My Application&amp;quot; &amp;quot;PathToApplication&amp;quot; 0 2 &amp;quot;&amp;quot; 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Remove an application from the firewall exception list&lt;br /&gt;
  SimpleFC::RemoveApplication &amp;quot;PathToApplication&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== The Sample Script (All Functions) ==&lt;br /&gt;
In this script you can find the examples of all functions provided by this plugin.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Add the port 37/TCP to the firewall exception list - All Networks - All IP Version - Enabled&lt;br /&gt;
  SimpleFC::AddPort 37 &amp;quot;My Application&amp;quot; 6 0 2 &amp;quot;&amp;quot; 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if the port 37/TCP is added to the firewall exception list&lt;br /&gt;
  SimpleFC::IsPortAdded 37 6&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Added/0=Not added&lt;br /&gt;
&lt;br /&gt;
; Remove the port 37/TCP from the firewall exception list&lt;br /&gt;
  SimpleFC::RemovePort 37 6&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if the port 37/TCP is enabled/disabled&lt;br /&gt;
  SimpleFC::IsPortEnabled 37 6&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Enabled/0=Not enabled&lt;br /&gt;
&lt;br /&gt;
; Disable the port 37/TCP&lt;br /&gt;
  SimpleFC::EnableDisablePort 37 6 0&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable the port 37/TCP&lt;br /&gt;
  SimpleFC::EnableDisablePort 37 6 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if an application is enabled/disabled&lt;br /&gt;
  SimpleFC::IsApplicationEnabled &amp;quot;PathToApplication&amp;quot; &lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Enabled/0=Not enabled&lt;br /&gt;
&lt;br /&gt;
; Disable the application&lt;br /&gt;
  SimpleFC::EnableDisableApplication &amp;quot;PathToApplication&amp;quot; 0&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable the application&lt;br /&gt;
  SimpleFC::EnableDisableApplication &amp;quot;PathToApplication&amp;quot; 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Add an application to the firewall exception list - All Networks - All IP Version - Enabled&lt;br /&gt;
  SimpleFC::AddApplication &amp;quot;My Application&amp;quot; &amp;quot;PathToApplication&amp;quot; 0 2 &amp;quot;&amp;quot; 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if the application is added to the firewall exception list&lt;br /&gt;
  SimpleFC::IsApplicationAdded &amp;quot;PathToApplication&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Added/0=Not added&lt;br /&gt;
&lt;br /&gt;
; Remove an application from the firewall exception list&lt;br /&gt;
  SimpleFC::RemoveApplication &amp;quot;PathToApplication&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Disable the windows firewall&lt;br /&gt;
  SimpleFC::EnableDisableFirewall 0&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable the windows firewall&lt;br /&gt;
  SimpleFC::EnableDisableFirewall 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if the firewall is enabled&lt;br /&gt;
  SimpleFC::IsFirewallEnabled &lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Enabled/0=Disabled&lt;br /&gt;
&lt;br /&gt;
; Enable exceptions are not allowed on the windows firewall&lt;br /&gt;
  SimpleFC::AllowDisallowExceptionsNotAllowed 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Disable exceptions are not allowed on the windows firewall&lt;br /&gt;
  SimpleFC::AllowDisallowExceptionsNotAllowed 0&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if exceptions are not allowed&lt;br /&gt;
  SimpleFC::AreExceptionsNotAllowed&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Exceptions are not allowed is &lt;br /&gt;
         ; activated/0=Exception are not allowed is deactivated&lt;br /&gt;
&lt;br /&gt;
; Enable notifications on the windows firewall&lt;br /&gt;
  SimpleFC::EnableDisableNotifications 1&lt;br /&gt;
&lt;br /&gt;
; Disable notifications on the windows firewall&lt;br /&gt;
  SimpleFC::EnableDisableNotifications 0&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if notifications are enabled/disabled&lt;br /&gt;
  SimpleFC::AreNotificationsEnabled &lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Enabled/0=Disabled&lt;br /&gt;
&lt;br /&gt;
; Starts the windows firewall service&lt;br /&gt;
  SimpleFC::StartStopFirewallService 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Stops the windows firewall service&lt;br /&gt;
  SimpleFC::StartStopFirewallService 0&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if windows firewall service is running&lt;br /&gt;
  SimpleFC::IsFirewallServiceRunning&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=IsRunning/0=Not Running&lt;br /&gt;
&lt;br /&gt;
; Sets the windows firewall to default settings&lt;br /&gt;
  SimpleFC::RestoreDefaults&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP outbound destination unreachable state&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpOutboundDestinationUnreachable 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP redirect state&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpRedirect 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP inbound echo request &lt;br /&gt;
  SimpleFC::AllowDisallowIcmpInboundEchoRequest 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP outbound time exceeded&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpOutboundTimeExceeded 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP outbound parameter problem&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpOutboundParameterProblem 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP outbound source quench&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpOutboundSourceQuench 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP inbound router request&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpInboundRouterRequest 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP inbound timestamp request&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpInboundTimestampRequest 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP inbound mask request&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpInboundMaskRequest 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP outbound packet too big&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpOutboundPacketTooBig 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if ICMPv4 echo request is allowed&lt;br /&gt;
  SimpleFC::IsIcmpTypeAllowed &amp;quot;0&amp;quot; &amp;quot;&amp;quot; &amp;quot;8&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Restricted/0=Not restricted&lt;br /&gt;
  Pop $2 ; return 1=Allowed/0=Not allowed &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Some example rules for the windows firewall with advanced security.&lt;br /&gt;
; Please note this functions are very powerful, so for a detailed &lt;br /&gt;
; description please read the windows firewall with advanced &lt;br /&gt;
; security api reference:&lt;br /&gt;
; http://msdn2.microsoft.com/en-us/library/aa365309.aspx&lt;br /&gt;
&lt;br /&gt;
; Adds an ICMPv4 rule to allow incoming echo reply messages (IcmpCodeAndType = 0:0)&lt;br /&gt;
  SimpleFC::AdvAddRule &amp;quot;Echo-Reply (ICMPv4 incoming)&amp;quot; \&lt;br /&gt;
    &amp;quot;Allows incoming Echo Replies messages.&amp;quot; &amp;quot;1&amp;quot; &amp;quot;1&amp;quot; &amp;quot;1&amp;quot; &amp;quot;7&amp;quot; &amp;quot;1&amp;quot; &amp;quot;&amp;quot; \ &lt;br /&gt;
    &amp;quot;&amp;quot; &amp;quot;0:0&amp;quot; &amp;quot;@PathToApplication,-10000&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Adds an ICMPv4 rule to allow incoming echo request messages (IcmpCodeAndType = 8:0)&lt;br /&gt;
  SimpleFC::AdvAddRule &amp;quot;Echo-Request (ICMPv4 incoming)&amp;quot; \&lt;br /&gt;
    &amp;quot;Allows incoming ICMP Echo messages.&amp;quot; &amp;quot;1&amp;quot; &amp;quot;1&amp;quot; &amp;quot;1&amp;quot; &amp;quot;7&amp;quot; &amp;quot;1&amp;quot; &amp;quot;&amp;quot; \&lt;br /&gt;
    &amp;quot;&amp;quot; &amp;quot;8:0&amp;quot; &amp;quot;@PathToApplication,-10000&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Add an application rule to allow incoming TCP access on this application&lt;br /&gt;
  SimpleFC::AdvAddRule &amp;quot;Incoming requests (TCP incoming)&amp;quot; \ &lt;br /&gt;
    &amp;quot;Allows incoming requests.&amp;quot; &amp;quot;6&amp;quot; &amp;quot;1&amp;quot; &amp;quot;1&amp;quot; &amp;quot;7&amp;quot; &amp;quot;1&amp;quot; &amp;quot;PathToApplication&amp;quot; \ &lt;br /&gt;
    &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;@PathToApplication,-10000&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Add an application rule to allow incoming UDP access on this application&lt;br /&gt;
  SimpleFC::AdvAddRule &amp;quot;Incoming requests (UDP incoming)&amp;quot; \&lt;br /&gt;
    &amp;quot;Allows incoming requests.&amp;quot; &amp;quot;17&amp;quot; &amp;quot;1&amp;quot; &amp;quot;1&amp;quot; &amp;quot;7&amp;quot; &amp;quot;1&amp;quot; &amp;quot;PathToApplication&amp;quot; \ &lt;br /&gt;
    &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;@PathToApplication,-10000&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Removes a firewall rule&lt;br /&gt;
  SimpleFC::AdvRemoveRule &amp;quot;Incoming requests (UDP incoming)&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if the firewall exists&lt;br /&gt;
  SimpleFC::AdvExistsRule &amp;quot;Incoming requests (UDP incoming)&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Exists/0=DoesnÂ´t exists&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Changelog ==&lt;br /&gt;
*Version 1.21 (Unicode) (2021-05-04)&lt;br /&gt;
**Unicode Version added with the same functions like the ANSI version.&lt;br /&gt;
*Version 1.21 (ANSI) (2021-05-04)&lt;br /&gt;
**SimpleFC::StartStopFirewallService return now correct false if the service cannot be stopped / started. Hint: In Windows 10 the firewall service is part of the Windows Defender and cannot be stopped / started.&lt;br /&gt;
*Version 1.20 (ANSI) (2014-06-12)&lt;br /&gt;
**Added &amp;quot;ServiceName&amp;quot; parameter to function &amp;quot;AdvAddRule&amp;quot;&lt;br /&gt;
**Documentation updated&lt;br /&gt;
*Version 1.19 (ANSI) (2012-07-16)&lt;br /&gt;
**Documentation updated&lt;br /&gt;
*Version 1.18 (ANSI) (2010-02-23)&lt;br /&gt;
**Documentation updated&lt;br /&gt;
*Version 1.17 (ANSI) (2009-09-05)&lt;br /&gt;
**Added changes from the service manager&lt;br /&gt;
**The following functions are now case insensitive:&lt;br /&gt;
***SimpleFC::IsApplicationAdded&lt;br /&gt;
***SimpleFC::IsApplicationEnabled&lt;br /&gt;
***SimpleFC::EnableDisableApplication&lt;br /&gt;
***SimpleFC::AdvExistsRule&lt;br /&gt;
*Version 1.16 (ANSI) (2009-04-13)&lt;br /&gt;
**Added changes from the service manager&lt;br /&gt;
*Version 1.15 (ANSI) (2008-08-18)&lt;br /&gt;
**Added changes from the service manager and checked removed compiler optimization to avoid a false-positive virusscan.&lt;br /&gt;
*Version 1.14 (ANSI) (2008-02-05)&lt;br /&gt;
** Added changes from the service manager&lt;br /&gt;
*Version 1.13 (ANSI) (2008-01-29)&lt;br /&gt;
** Added changes from the service manager&lt;br /&gt;
*Version 1.12 (ANSI) (2007-11-13)&lt;br /&gt;
** Fixed wrong documentation about SimpleFC::AdvExistsRule&lt;br /&gt;
*Version 1.11 (ANSI) (2007-08-07)&lt;br /&gt;
** Fixed potential endless loop bug in SimpleFC::StartStopFirewallService&lt;br /&gt;
*Version 1.10 (ANSI) (2007-08-02)&lt;br /&gt;
** Added default firewall functions:&lt;br /&gt;
*** SimpleFC::RestoreDefaults&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpOutboundDestinationUnreachable&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpRedirect&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpInboundEchoRequest&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpOutboundTimeExceeded&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpOutboundParameterProblem&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpOutboundSourceQuench&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpInboundRouterRequest&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpInboundTimestampRequest&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpInboundMaskRequest&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpOutboundPacketTooBig&lt;br /&gt;
*** SimpleFC::IsIcmpTypeAllowed&lt;br /&gt;
** Added functions for Windows Firewall with Advanced Security&lt;br /&gt;
*** SimpleFC::AdvAddRule&lt;br /&gt;
*** SimpleFC::AdvRemoveRule&lt;br /&gt;
*** SimpleFC::AdvExistsRule&lt;br /&gt;
*Version 1.01 (ANSI) (2007-07-05)&lt;br /&gt;
**Changed missing documentation about the function SimpleFC::IsFirewallEnabled&lt;br /&gt;
*Version 1.0 (ANSI) (2007-05-02)&lt;br /&gt;
**First offical version&lt;br /&gt;
&lt;br /&gt;
== Important Notes ==&lt;br /&gt;
&lt;br /&gt;
*This plugin is running on Windows XP SP2, Windows 2003, Windows Vista, Windows 7, Windows 8, Windows Server 2012, Windows Server 8.1, Windows Server 2012 R2&lt;br /&gt;
*Before you execute some plugin commands it is recommend to check for windows firewall service is running (SimpleFC::IsFirewallServiceRunning).&lt;br /&gt;
*All functions with the prefix &amp;quot;Adv&amp;quot; are only for Windows Firewall with Advanced Security (Windows Vista and above). It is recommend to use these functions on the operating systems which supports the Windows Firewall with Advanced Security. Nethertheless, the default functions without the prefix &amp;quot;Adv&amp;quot; can be used.&lt;br /&gt;
* If you have any suggestions, comments or questions please mail me: mailto:rainer@speed-soft.de&lt;br /&gt;
&lt;br /&gt;
[[Category:Plugins]]&lt;/div&gt;</summary>
		<author><name>Speed78</name></author>
	</entry>
	<entry>
		<id>https://nsis.sourceforge.io/mediawiki/index.php?title=NSIS_Simple_Firewall_Plugin&amp;diff=25680</id>
		<title>NSIS Simple Firewall Plugin</title>
		<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/mediawiki/index.php?title=NSIS_Simple_Firewall_Plugin&amp;diff=25680"/>
		<updated>2021-05-04T21:26:47Z</updated>

		<summary type="html">&lt;p&gt;Speed78: /* Links */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This plugin can be used to configure the Windows firewall. This plugin contains functions to enable, check, add or remove programs or ports to the firewall exception list. It also contains functions for checking the firewall status, enable or disable the firewall and so on.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This plugin is using the MPL License or alternatively the LGPL License.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
The ZIP file containing a precompiled plugin DLL (to be saved in NSIS&#039; plugin directory) and the sources. &lt;br /&gt;
If you update from a previous version it is strongly &#039;&#039;&#039;recommend&#039;&#039;&#039; to take look at the changelog.&lt;br /&gt;
*Unicode Version: &amp;lt;attach&amp;gt;NSIS_Simple_Firewall_Plugin_Unicode_1.21.zip&amp;lt;/attach&amp;gt; (Recommend for &amp;gt;= NSIS 3.x)&lt;br /&gt;
*ANSI Version: &amp;lt;attach&amp;gt;NSIS_Simple_Firewall_Plugin_ANSI_1.21.zip&amp;lt;/attach&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Donation ==&lt;br /&gt;
If you believe that I am doing a good job and you want to support me please [http://www.speed-soft.de/donation/index.php?language=en donate] any amount via PayPal.&lt;br /&gt;
&lt;br /&gt;
== Short Reference ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
SimpleFC::EnableDisableFirewall [status]&lt;br /&gt;
SimpleFC::IsFirewallEnabled  &lt;br /&gt;
 &lt;br /&gt;
SimpleFC::AllowDisallowExceptionsNotAllowed [status]&lt;br /&gt;
SimpleFC::AreExceptionsNotAllowed  &lt;br /&gt;
 &lt;br /&gt;
SimpleFC::EnableDisableNotifications [status]&lt;br /&gt;
SimpleFC::AreNotificationsEnabled  &lt;br /&gt;
 &lt;br /&gt;
SimpleFC::StartStopFirewallService [status]&lt;br /&gt;
SimpleFC::IsFirewallServiceRunning  &lt;br /&gt;
 &lt;br /&gt;
SimpleFC::AddPort [port] [name] [protocol] [scope] [ip_version] [remote_addresses] [status]&lt;br /&gt;
SimpleFC::IsPortAdded [port] [protocol]&lt;br /&gt;
SimpleFC::RemovePort [port] [protocol]&lt;br /&gt;
 &lt;br /&gt;
SimpleFC::IsPortEnabled [port] [protocol]&lt;br /&gt;
SimpleFC::EnableDisablePort [port] [protocol]&lt;br /&gt;
 &lt;br /&gt;
SimpleFC::AddApplication [name] [path] [scope] [ip_version] [remote_addresses] [status]&lt;br /&gt;
SimpleFC::IsApplicationAdded [path]&lt;br /&gt;
SimpleFC::RemoveApplication [path]&lt;br /&gt;
 &lt;br /&gt;
SimpleFC::IsApplicationEnabled [path]&lt;br /&gt;
SimpleFC::EnableDisableApplication [path]&lt;br /&gt;
&lt;br /&gt;
SimpleFC::RestoreDefaults&lt;br /&gt;
&lt;br /&gt;
SimpleFC::AllowDisallowIcmpOutboundDestinationUnreachable [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpRedirect [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpInboundEchoRequest [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpOutboundTimeExceeded [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpOutboundParameterProblem [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpOutboundSourceQuench [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpInboundRouterRequest [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpInboundTimestampRequest [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpInboundMaskRequest [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpOutboundPacketTooBig [status]&lt;br /&gt;
SimpleFC::IsIcmpTypeAllowed [ip_version] [local_address] [icmp_type]&lt;br /&gt;
&lt;br /&gt;
SimpleFC::AdvAddRule [name] [description] [protocol] [direction] &lt;br /&gt;
  [status] [profile] [action] [application] [service_name] [icmp_types_and_codes] &lt;br /&gt;
  [group] [local_ports] [remote_ports] [local_address] [remote_address]&lt;br /&gt;
SimpleFC::AdvRemoveRule [name]&lt;br /&gt;
SimpleFC::AdvExistsRule [name]&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
*port - TCP/UDP port which should be opened/closed&lt;br /&gt;
*name - The name of the application/port/rule&lt;br /&gt;
*description - Description of the rule&lt;br /&gt;
*protocol - One of the following protocol&lt;br /&gt;
**1 - ICMPv4&lt;br /&gt;
**6 - TCP&lt;br /&gt;
**17 - UDP&lt;br /&gt;
**58 - ICMPv6&lt;br /&gt;
**256 - Any protocol&lt;br /&gt;
*scope - One of the following scope&lt;br /&gt;
**0 - All networks&lt;br /&gt;
**1 - Only local subnets&lt;br /&gt;
**2 - Custom scope&lt;br /&gt;
**3 - Max scope&lt;br /&gt;
**NOTE: If you use custom you must define remote_addresses&lt;br /&gt;
*ip_version&lt;br /&gt;
**0 - IPv4&lt;br /&gt;
**1 - IPv6&lt;br /&gt;
**2 - Any version&lt;br /&gt;
*icmp_type&lt;br /&gt;
**3 - Outbound Destination Unreachable (ICMPv4)&lt;br /&gt;
**4 - Outbound Source Quench (ICMPv4)&lt;br /&gt;
**5 - Redirect (ICMPv4)&lt;br /&gt;
**8 - Inbound Echo Request (ICMPv4)&lt;br /&gt;
**9 - Inbound Router Request (ICMPv4)&lt;br /&gt;
**11 - Outbound Time Exceeded (ICMPv4)&lt;br /&gt;
**12 - Outbound Parameter Problem (ICMPv4)&lt;br /&gt;
**13 - Inbound Timespamp Request (ICMPv4)&lt;br /&gt;
**17 - Inbound Mask Request (ICMPv4)&lt;br /&gt;
**1 - Outbound Destination Unreachable (ICMPv6)&lt;br /&gt;
**2 - Outbound Packet Too Big (ICMPv6)&lt;br /&gt;
**3 - Outbound Time Exceeded (ICMPv6)&lt;br /&gt;
**4 - Outbound Parameter Problem (ICMPv6)&lt;br /&gt;
**128 - Inbound Echo Request (ICMPv6)&lt;br /&gt;
**137 - Redirect (ICMPv6)&lt;br /&gt;
*direction&lt;br /&gt;
**1 - In&lt;br /&gt;
**2 - Out&lt;br /&gt;
*profile&lt;br /&gt;
**1 - Domain &lt;br /&gt;
**2 - Private&lt;br /&gt;
**4 - Public&lt;br /&gt;
**2147483647 - All profiles&lt;br /&gt;
*action&lt;br /&gt;
**0 - Block&lt;br /&gt;
**1 - Allow&lt;br /&gt;
*application - Path of the application (can be empty)&lt;br /&gt;
servicename - Specifies the service name property of the application (can be empty). &lt;br /&gt;
**&#039;&#039;&#039;Note&#039;&#039;&#039;: A serviceName value of &amp;quot;*&amp;quot; indicates that a service, not an application, must be sending or receiving traffic.&lt;br /&gt;
*icmp_types_and_codes - Specified icmp types and codes (can be empty)&lt;br /&gt;
*group - Put the rule in this specified group (can be empty) &lt;br /&gt;
**&#039;&#039;&#039;Note&#039;&#039;&#039;: On Vista the group must the a resource string in a exe/dll e.g. &amp;quot;@C:\Program Files\My Application\myapp.exe,-10000&amp;quot;. On all other supported operating systems it can be a string value.&lt;br /&gt;
*local_ports - Local ports (The protocol property must be set before - Otherwise can be empty)&lt;br /&gt;
**&#039;&#039;&#039;Note&#039;&#039;&#039;: The following port keywords are valid addionally: &amp;quot;RPC&amp;quot;, &amp;quot;RPC-EPMap&amp;quot;, &amp;quot;Teredo&amp;quot;, &amp;quot;IPTLSIn&amp;quot;, &amp;quot;IPHTTPSIn&amp;quot; and &amp;quot;Ply2Disc&amp;quot;&lt;br /&gt;
*remote_ports - Remote ports (The protocol property must be set before - Otherwise can be empty)&lt;br /&gt;
**&#039;&#039;&#039;Note&#039;&#039;&#039;: The following port keywords are valid addionally: &amp;quot;RPC&amp;quot;, &amp;quot;RPC-EPMap&amp;quot;, &amp;quot;Teredo&amp;quot;, &amp;quot;IPTLSIn&amp;quot;, &amp;quot;IPHTTPSIn&amp;quot; and &amp;quot;Ply2Disc&amp;quot;&lt;br /&gt;
*local_address - Local addresses from which the port can listen for traffic (can be empty)&lt;br /&gt;
*remote_address - Remote addresses from which the port can listen for traffic (can be empty)&lt;br /&gt;
*status - Status of the port, application, rule, firewall or service for example enabled/disabled, start/stop or allow/disallow&lt;br /&gt;
**0 - Disabled, stop or disallow&lt;br /&gt;
**1 - Enabled, start, or allow&lt;br /&gt;
&lt;br /&gt;
== The Sample Script ==&lt;br /&gt;
In this script you can find the two most used functions. If you are searching for some special firewall exceptions please look at &amp;quot;The Sample Script (All Functions)&amp;quot;. &lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
; Add an application to the firewall exception list - All Networks - All IP Version - Enabled&lt;br /&gt;
  SimpleFC::AddApplication &amp;quot;My Application&amp;quot; &amp;quot;PathToApplication&amp;quot; 0 2 &amp;quot;&amp;quot; 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Remove an application from the firewall exception list&lt;br /&gt;
  SimpleFC::RemoveApplication &amp;quot;PathToApplication&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== The Sample Script (All Functions) ==&lt;br /&gt;
In this script you can find the examples of all functions provided by this plugin.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Add the port 37/TCP to the firewall exception list - All Networks - All IP Version - Enabled&lt;br /&gt;
  SimpleFC::AddPort 37 &amp;quot;My Application&amp;quot; 6 0 2 &amp;quot;&amp;quot; 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if the port 37/TCP is added to the firewall exception list&lt;br /&gt;
  SimpleFC::IsPortAdded 37 6&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Added/0=Not added&lt;br /&gt;
&lt;br /&gt;
; Remove the port 37/TCP from the firewall exception list&lt;br /&gt;
  SimpleFC::RemovePort 37 6&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if the port 37/TCP is enabled/disabled&lt;br /&gt;
  SimpleFC::IsPortEnabled 37 6&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Enabled/0=Not enabled&lt;br /&gt;
&lt;br /&gt;
; Disable the port 37/TCP&lt;br /&gt;
  SimpleFC::EnableDisablePort 37 6 0&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable the port 37/TCP&lt;br /&gt;
  SimpleFC::EnableDisablePort 37 6 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if an application is enabled/disabled&lt;br /&gt;
  SimpleFC::IsApplicationEnabled &amp;quot;PathToApplication&amp;quot; &lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Enabled/0=Not enabled&lt;br /&gt;
&lt;br /&gt;
; Disable the application&lt;br /&gt;
  SimpleFC::EnableDisableApplication &amp;quot;PathToApplication&amp;quot; 0&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable the application&lt;br /&gt;
  SimpleFC::EnableDisableApplication &amp;quot;PathToApplication&amp;quot; 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Add an application to the firewall exception list - All Networks - All IP Version - Enabled&lt;br /&gt;
  SimpleFC::AddApplication &amp;quot;My Application&amp;quot; &amp;quot;PathToApplication&amp;quot; 0 2 &amp;quot;&amp;quot; 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if the application is added to the firewall exception list&lt;br /&gt;
  SimpleFC::IsApplicationAdded &amp;quot;PathToApplication&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Added/0=Not added&lt;br /&gt;
&lt;br /&gt;
; Remove an application from the firewall exception list&lt;br /&gt;
  SimpleFC::RemoveApplication &amp;quot;PathToApplication&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Disable the windows firewall&lt;br /&gt;
  SimpleFC::EnableDisableFirewall 0&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable the windows firewall&lt;br /&gt;
  SimpleFC::EnableDisableFirewall 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if the firewall is enabled&lt;br /&gt;
  SimpleFC::IsFirewallEnabled &lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Enabled/0=Disabled&lt;br /&gt;
&lt;br /&gt;
; Enable exceptions are not allowed on the windows firewall&lt;br /&gt;
  SimpleFC::AllowDisallowExceptionsNotAllowed 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Disable exceptions are not allowed on the windows firewall&lt;br /&gt;
  SimpleFC::AllowDisallowExceptionsNotAllowed 0&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if exceptions are not allowed&lt;br /&gt;
  SimpleFC::AreExceptionsNotAllowed&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Exceptions are not allowed is &lt;br /&gt;
         ; activated/0=Exception are not allowed is deactivated&lt;br /&gt;
&lt;br /&gt;
; Enable notifications on the windows firewall&lt;br /&gt;
  SimpleFC::EnableDisableNotifications 1&lt;br /&gt;
&lt;br /&gt;
; Disable notifications on the windows firewall&lt;br /&gt;
  SimpleFC::EnableDisableNotifications 0&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if notifications are enabled/disabled&lt;br /&gt;
  SimpleFC::AreNotificationsEnabled &lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Enabled/0=Disabled&lt;br /&gt;
&lt;br /&gt;
; Starts the windows firewall service&lt;br /&gt;
  SimpleFC::StartStopFirewallService 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Stops the windows firewall service&lt;br /&gt;
  SimpleFC::StartStopFirewallService 0&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if windows firewall service is running&lt;br /&gt;
  SimpleFC::IsFirewallServiceRunning&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=IsRunning/0=Not Running&lt;br /&gt;
&lt;br /&gt;
; Sets the windows firewall to default settings&lt;br /&gt;
  SimpleFC::RestoreDefaults&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP outbound destination unreachable state&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpOutboundDestinationUnreachable 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP redirect state&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpRedirect 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP inbound echo request &lt;br /&gt;
  SimpleFC::AllowDisallowIcmpInboundEchoRequest 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP outbound time exceeded&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpOutboundTimeExceeded 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP outbound parameter problem&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpOutboundParameterProblem 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP outbound source quench&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpOutboundSourceQuench 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP inbound router request&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpInboundRouterRequest 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP inbound timestamp request&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpInboundTimestampRequest 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP inbound mask request&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpInboundMaskRequest 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP outbound packet too big&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpOutboundPacketTooBig 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if ICMPv4 echo request is allowed&lt;br /&gt;
  SimpleFC::IsIcmpTypeAllowed &amp;quot;0&amp;quot; &amp;quot;&amp;quot; &amp;quot;8&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Restricted/0=Not restricted&lt;br /&gt;
  Pop $2 ; return 1=Allowed/0=Not allowed &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Some example rules for the windows firewall with advanced security.&lt;br /&gt;
; Please note this functions are very powerful, so for a detailed &lt;br /&gt;
; description please read the windows firewall with advanced &lt;br /&gt;
; security api reference:&lt;br /&gt;
; http://msdn2.microsoft.com/en-us/library/aa365309.aspx&lt;br /&gt;
&lt;br /&gt;
; Adds an ICMPv4 rule to allow incoming echo reply messages (IcmpCodeAndType = 0:0)&lt;br /&gt;
  SimpleFC::AdvAddRule &amp;quot;Echo-Reply (ICMPv4 incoming)&amp;quot; \&lt;br /&gt;
    &amp;quot;Allows incoming Echo Replies messages.&amp;quot; &amp;quot;1&amp;quot; &amp;quot;1&amp;quot; &amp;quot;1&amp;quot; &amp;quot;7&amp;quot; &amp;quot;1&amp;quot; &amp;quot;&amp;quot; \ &lt;br /&gt;
    &amp;quot;&amp;quot; &amp;quot;0:0&amp;quot; &amp;quot;@PathToApplication,-10000&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Adds an ICMPv4 rule to allow incoming echo request messages (IcmpCodeAndType = 8:0)&lt;br /&gt;
  SimpleFC::AdvAddRule &amp;quot;Echo-Request (ICMPv4 incoming)&amp;quot; \&lt;br /&gt;
    &amp;quot;Allows incoming ICMP Echo messages.&amp;quot; &amp;quot;1&amp;quot; &amp;quot;1&amp;quot; &amp;quot;1&amp;quot; &amp;quot;7&amp;quot; &amp;quot;1&amp;quot; &amp;quot;&amp;quot; \&lt;br /&gt;
    &amp;quot;&amp;quot; &amp;quot;8:0&amp;quot; &amp;quot;@PathToApplication,-10000&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Add an application rule to allow incoming TCP access on this application&lt;br /&gt;
  SimpleFC::AdvAddRule &amp;quot;Incoming requests (TCP incoming)&amp;quot; \ &lt;br /&gt;
    &amp;quot;Allows incoming requests.&amp;quot; &amp;quot;6&amp;quot; &amp;quot;1&amp;quot; &amp;quot;1&amp;quot; &amp;quot;7&amp;quot; &amp;quot;1&amp;quot; &amp;quot;PathToApplication&amp;quot; \ &lt;br /&gt;
    &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;@PathToApplication,-10000&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Add an application rule to allow incoming UDP access on this application&lt;br /&gt;
  SimpleFC::AdvAddRule &amp;quot;Incoming requests (UDP incoming)&amp;quot; \&lt;br /&gt;
    &amp;quot;Allows incoming requests.&amp;quot; &amp;quot;17&amp;quot; &amp;quot;1&amp;quot; &amp;quot;1&amp;quot; &amp;quot;7&amp;quot; &amp;quot;1&amp;quot; &amp;quot;PathToApplication&amp;quot; \ &lt;br /&gt;
    &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;@PathToApplication,-10000&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Removes a firewall rule&lt;br /&gt;
  SimpleFC::AdvRemoveRule &amp;quot;Incoming requests (UDP incoming)&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if the firewall exists&lt;br /&gt;
  SimpleFC::AdvExistsRule &amp;quot;Incoming requests (UDP incoming)&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Exists/0=DoesnÂ´t exists&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Changelog ==&lt;br /&gt;
*Version 1.20 (2014-06-12)&lt;br /&gt;
**Added &amp;quot;ServiceName&amp;quot; parameter to function &amp;quot;AdvAddRule&amp;quot;&lt;br /&gt;
**Documentation updated&lt;br /&gt;
*Version 1.19 (2012-07-16)&lt;br /&gt;
**Documentation updated&lt;br /&gt;
*Version 1.18 (2010-02-23)&lt;br /&gt;
**Documentation updated&lt;br /&gt;
*Version 1.17 (2009-09-05)&lt;br /&gt;
**Added changes from the service manager&lt;br /&gt;
**The following functions are now case insensitive:&lt;br /&gt;
***SimpleFC::IsApplicationAdded&lt;br /&gt;
***SimpleFC::IsApplicationEnabled&lt;br /&gt;
***SimpleFC::EnableDisableApplication&lt;br /&gt;
***SimpleFC::AdvExistsRule&lt;br /&gt;
*Version 1.16 (2009-04-13)&lt;br /&gt;
**Added changes from the service manager&lt;br /&gt;
*Version 1.15 (2008-08-18)&lt;br /&gt;
**Added changes from the service manager and checked removed compiler optimization to avoid a false-positive virusscan.&lt;br /&gt;
*Version 1.14 (2008-02-05)&lt;br /&gt;
** Added changes from the service manager&lt;br /&gt;
*Version 1.13 (2008-01-29)&lt;br /&gt;
** Added changes from the service manager&lt;br /&gt;
*Version 1.12 (2007-11-13)&lt;br /&gt;
** Fixed wrong documentation about SimpleFC::AdvExistsRule&lt;br /&gt;
*Version 1.11 (2007-08-07)&lt;br /&gt;
** Fixed potential endless loop bug in SimpleFC::StartStopFirewallService&lt;br /&gt;
*Version 1.10 (2007-08-02)&lt;br /&gt;
** Added default firewall functions:&lt;br /&gt;
*** SimpleFC::RestoreDefaults&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpOutboundDestinationUnreachable&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpRedirect&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpInboundEchoRequest&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpOutboundTimeExceeded&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpOutboundParameterProblem&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpOutboundSourceQuench&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpInboundRouterRequest&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpInboundTimestampRequest&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpInboundMaskRequest&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpOutboundPacketTooBig&lt;br /&gt;
*** SimpleFC::IsIcmpTypeAllowed&lt;br /&gt;
** Added functions for Windows Firewall with Advanced Security&lt;br /&gt;
*** SimpleFC::AdvAddRule&lt;br /&gt;
*** SimpleFC::AdvRemoveRule&lt;br /&gt;
*** SimpleFC::AdvExistsRule&lt;br /&gt;
*Version 1.01 (2007-07-05)&lt;br /&gt;
**Changed missing documentation about the function SimpleFC::IsFirewallEnabled&lt;br /&gt;
*Version 1.0 (2007-05-02)&lt;br /&gt;
**First offical version&lt;br /&gt;
&lt;br /&gt;
== Important Notes ==&lt;br /&gt;
&lt;br /&gt;
*This plugin is running on Windows XP SP2, Windows 2003, Windows Vista, Windows 7, Windows 8, Windows Server 2012, Windows Server 8.1, Windows Server 2012 R2&lt;br /&gt;
*Before you execute some plugin commands it is recommend to check for windows firewall service is running (SimpleFC::IsFirewallServiceRunning).&lt;br /&gt;
*All functions with the prefix &amp;quot;Adv&amp;quot; are only for Windows Firewall with Advanced Security (Windows Vista and above). It is recommend to use these functions on the operating systems which supports the Windows Firewall with Advanced Security. Nethertheless, the default functions without the prefix &amp;quot;Adv&amp;quot; can be used.&lt;br /&gt;
* If you have any suggestions, comments or questions please mail me: mailto:rainer@speed-soft.de&lt;br /&gt;
&lt;br /&gt;
[[Category:Plugins]]&lt;/div&gt;</summary>
		<author><name>Speed78</name></author>
	</entry>
	<entry>
		<id>https://nsis.sourceforge.io/mediawiki/index.php?title=NSIS_Simple_Firewall_Plugin&amp;diff=25679</id>
		<title>NSIS Simple Firewall Plugin</title>
		<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/mediawiki/index.php?title=NSIS_Simple_Firewall_Plugin&amp;diff=25679"/>
		<updated>2021-05-04T21:26:18Z</updated>

		<summary type="html">&lt;p&gt;Speed78: /* Links */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This plugin can be used to configure the Windows firewall. This plugin contains functions to enable, check, add or remove programs or ports to the firewall exception list. It also contains functions for checking the firewall status, enable or disable the firewall and so on.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This plugin is using the MPL License or alternatively the LGPL License.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
The ZIP file containing a precompiled plugin DLL (to be saved in NSIS&#039; plugin directory) and the sources. &lt;br /&gt;
If you update from a previous version it is strongly &#039;&#039;&#039;recommend&#039;&#039;&#039; to take look at the changelog.&lt;br /&gt;
*Unicode Version: &amp;lt;attach&amp;gt;NSIS_Simple_Firewall_Plugin_Unicode_1.21.zip&amp;lt;/attach&amp;gt; (Recommend for &amp;gt;= NSIS 3.x)&lt;br /&gt;
*ANSI Version: &amp;lt;attach&amp;gt;NSIS_Simple_Firewall_Plugin_ANSI_1.21.zip&amp;lt;/attach&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Short Reference ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
SimpleFC::EnableDisableFirewall [status]&lt;br /&gt;
SimpleFC::IsFirewallEnabled  &lt;br /&gt;
 &lt;br /&gt;
SimpleFC::AllowDisallowExceptionsNotAllowed [status]&lt;br /&gt;
SimpleFC::AreExceptionsNotAllowed  &lt;br /&gt;
 &lt;br /&gt;
SimpleFC::EnableDisableNotifications [status]&lt;br /&gt;
SimpleFC::AreNotificationsEnabled  &lt;br /&gt;
 &lt;br /&gt;
SimpleFC::StartStopFirewallService [status]&lt;br /&gt;
SimpleFC::IsFirewallServiceRunning  &lt;br /&gt;
 &lt;br /&gt;
SimpleFC::AddPort [port] [name] [protocol] [scope] [ip_version] [remote_addresses] [status]&lt;br /&gt;
SimpleFC::IsPortAdded [port] [protocol]&lt;br /&gt;
SimpleFC::RemovePort [port] [protocol]&lt;br /&gt;
 &lt;br /&gt;
SimpleFC::IsPortEnabled [port] [protocol]&lt;br /&gt;
SimpleFC::EnableDisablePort [port] [protocol]&lt;br /&gt;
 &lt;br /&gt;
SimpleFC::AddApplication [name] [path] [scope] [ip_version] [remote_addresses] [status]&lt;br /&gt;
SimpleFC::IsApplicationAdded [path]&lt;br /&gt;
SimpleFC::RemoveApplication [path]&lt;br /&gt;
 &lt;br /&gt;
SimpleFC::IsApplicationEnabled [path]&lt;br /&gt;
SimpleFC::EnableDisableApplication [path]&lt;br /&gt;
&lt;br /&gt;
SimpleFC::RestoreDefaults&lt;br /&gt;
&lt;br /&gt;
SimpleFC::AllowDisallowIcmpOutboundDestinationUnreachable [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpRedirect [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpInboundEchoRequest [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpOutboundTimeExceeded [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpOutboundParameterProblem [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpOutboundSourceQuench [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpInboundRouterRequest [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpInboundTimestampRequest [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpInboundMaskRequest [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpOutboundPacketTooBig [status]&lt;br /&gt;
SimpleFC::IsIcmpTypeAllowed [ip_version] [local_address] [icmp_type]&lt;br /&gt;
&lt;br /&gt;
SimpleFC::AdvAddRule [name] [description] [protocol] [direction] &lt;br /&gt;
  [status] [profile] [action] [application] [service_name] [icmp_types_and_codes] &lt;br /&gt;
  [group] [local_ports] [remote_ports] [local_address] [remote_address]&lt;br /&gt;
SimpleFC::AdvRemoveRule [name]&lt;br /&gt;
SimpleFC::AdvExistsRule [name]&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
*port - TCP/UDP port which should be opened/closed&lt;br /&gt;
*name - The name of the application/port/rule&lt;br /&gt;
*description - Description of the rule&lt;br /&gt;
*protocol - One of the following protocol&lt;br /&gt;
**1 - ICMPv4&lt;br /&gt;
**6 - TCP&lt;br /&gt;
**17 - UDP&lt;br /&gt;
**58 - ICMPv6&lt;br /&gt;
**256 - Any protocol&lt;br /&gt;
*scope - One of the following scope&lt;br /&gt;
**0 - All networks&lt;br /&gt;
**1 - Only local subnets&lt;br /&gt;
**2 - Custom scope&lt;br /&gt;
**3 - Max scope&lt;br /&gt;
**NOTE: If you use custom you must define remote_addresses&lt;br /&gt;
*ip_version&lt;br /&gt;
**0 - IPv4&lt;br /&gt;
**1 - IPv6&lt;br /&gt;
**2 - Any version&lt;br /&gt;
*icmp_type&lt;br /&gt;
**3 - Outbound Destination Unreachable (ICMPv4)&lt;br /&gt;
**4 - Outbound Source Quench (ICMPv4)&lt;br /&gt;
**5 - Redirect (ICMPv4)&lt;br /&gt;
**8 - Inbound Echo Request (ICMPv4)&lt;br /&gt;
**9 - Inbound Router Request (ICMPv4)&lt;br /&gt;
**11 - Outbound Time Exceeded (ICMPv4)&lt;br /&gt;
**12 - Outbound Parameter Problem (ICMPv4)&lt;br /&gt;
**13 - Inbound Timespamp Request (ICMPv4)&lt;br /&gt;
**17 - Inbound Mask Request (ICMPv4)&lt;br /&gt;
**1 - Outbound Destination Unreachable (ICMPv6)&lt;br /&gt;
**2 - Outbound Packet Too Big (ICMPv6)&lt;br /&gt;
**3 - Outbound Time Exceeded (ICMPv6)&lt;br /&gt;
**4 - Outbound Parameter Problem (ICMPv6)&lt;br /&gt;
**128 - Inbound Echo Request (ICMPv6)&lt;br /&gt;
**137 - Redirect (ICMPv6)&lt;br /&gt;
*direction&lt;br /&gt;
**1 - In&lt;br /&gt;
**2 - Out&lt;br /&gt;
*profile&lt;br /&gt;
**1 - Domain &lt;br /&gt;
**2 - Private&lt;br /&gt;
**4 - Public&lt;br /&gt;
**2147483647 - All profiles&lt;br /&gt;
*action&lt;br /&gt;
**0 - Block&lt;br /&gt;
**1 - Allow&lt;br /&gt;
*application - Path of the application (can be empty)&lt;br /&gt;
servicename - Specifies the service name property of the application (can be empty). &lt;br /&gt;
**&#039;&#039;&#039;Note&#039;&#039;&#039;: A serviceName value of &amp;quot;*&amp;quot; indicates that a service, not an application, must be sending or receiving traffic.&lt;br /&gt;
*icmp_types_and_codes - Specified icmp types and codes (can be empty)&lt;br /&gt;
*group - Put the rule in this specified group (can be empty) &lt;br /&gt;
**&#039;&#039;&#039;Note&#039;&#039;&#039;: On Vista the group must the a resource string in a exe/dll e.g. &amp;quot;@C:\Program Files\My Application\myapp.exe,-10000&amp;quot;. On all other supported operating systems it can be a string value.&lt;br /&gt;
*local_ports - Local ports (The protocol property must be set before - Otherwise can be empty)&lt;br /&gt;
**&#039;&#039;&#039;Note&#039;&#039;&#039;: The following port keywords are valid addionally: &amp;quot;RPC&amp;quot;, &amp;quot;RPC-EPMap&amp;quot;, &amp;quot;Teredo&amp;quot;, &amp;quot;IPTLSIn&amp;quot;, &amp;quot;IPHTTPSIn&amp;quot; and &amp;quot;Ply2Disc&amp;quot;&lt;br /&gt;
*remote_ports - Remote ports (The protocol property must be set before - Otherwise can be empty)&lt;br /&gt;
**&#039;&#039;&#039;Note&#039;&#039;&#039;: The following port keywords are valid addionally: &amp;quot;RPC&amp;quot;, &amp;quot;RPC-EPMap&amp;quot;, &amp;quot;Teredo&amp;quot;, &amp;quot;IPTLSIn&amp;quot;, &amp;quot;IPHTTPSIn&amp;quot; and &amp;quot;Ply2Disc&amp;quot;&lt;br /&gt;
*local_address - Local addresses from which the port can listen for traffic (can be empty)&lt;br /&gt;
*remote_address - Remote addresses from which the port can listen for traffic (can be empty)&lt;br /&gt;
*status - Status of the port, application, rule, firewall or service for example enabled/disabled, start/stop or allow/disallow&lt;br /&gt;
**0 - Disabled, stop or disallow&lt;br /&gt;
**1 - Enabled, start, or allow&lt;br /&gt;
&lt;br /&gt;
== The Sample Script ==&lt;br /&gt;
In this script you can find the two most used functions. If you are searching for some special firewall exceptions please look at &amp;quot;The Sample Script (All Functions)&amp;quot;. &lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
; Add an application to the firewall exception list - All Networks - All IP Version - Enabled&lt;br /&gt;
  SimpleFC::AddApplication &amp;quot;My Application&amp;quot; &amp;quot;PathToApplication&amp;quot; 0 2 &amp;quot;&amp;quot; 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Remove an application from the firewall exception list&lt;br /&gt;
  SimpleFC::RemoveApplication &amp;quot;PathToApplication&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== The Sample Script (All Functions) ==&lt;br /&gt;
In this script you can find the examples of all functions provided by this plugin.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Add the port 37/TCP to the firewall exception list - All Networks - All IP Version - Enabled&lt;br /&gt;
  SimpleFC::AddPort 37 &amp;quot;My Application&amp;quot; 6 0 2 &amp;quot;&amp;quot; 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if the port 37/TCP is added to the firewall exception list&lt;br /&gt;
  SimpleFC::IsPortAdded 37 6&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Added/0=Not added&lt;br /&gt;
&lt;br /&gt;
; Remove the port 37/TCP from the firewall exception list&lt;br /&gt;
  SimpleFC::RemovePort 37 6&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if the port 37/TCP is enabled/disabled&lt;br /&gt;
  SimpleFC::IsPortEnabled 37 6&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Enabled/0=Not enabled&lt;br /&gt;
&lt;br /&gt;
; Disable the port 37/TCP&lt;br /&gt;
  SimpleFC::EnableDisablePort 37 6 0&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable the port 37/TCP&lt;br /&gt;
  SimpleFC::EnableDisablePort 37 6 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if an application is enabled/disabled&lt;br /&gt;
  SimpleFC::IsApplicationEnabled &amp;quot;PathToApplication&amp;quot; &lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Enabled/0=Not enabled&lt;br /&gt;
&lt;br /&gt;
; Disable the application&lt;br /&gt;
  SimpleFC::EnableDisableApplication &amp;quot;PathToApplication&amp;quot; 0&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable the application&lt;br /&gt;
  SimpleFC::EnableDisableApplication &amp;quot;PathToApplication&amp;quot; 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Add an application to the firewall exception list - All Networks - All IP Version - Enabled&lt;br /&gt;
  SimpleFC::AddApplication &amp;quot;My Application&amp;quot; &amp;quot;PathToApplication&amp;quot; 0 2 &amp;quot;&amp;quot; 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if the application is added to the firewall exception list&lt;br /&gt;
  SimpleFC::IsApplicationAdded &amp;quot;PathToApplication&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Added/0=Not added&lt;br /&gt;
&lt;br /&gt;
; Remove an application from the firewall exception list&lt;br /&gt;
  SimpleFC::RemoveApplication &amp;quot;PathToApplication&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Disable the windows firewall&lt;br /&gt;
  SimpleFC::EnableDisableFirewall 0&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable the windows firewall&lt;br /&gt;
  SimpleFC::EnableDisableFirewall 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if the firewall is enabled&lt;br /&gt;
  SimpleFC::IsFirewallEnabled &lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Enabled/0=Disabled&lt;br /&gt;
&lt;br /&gt;
; Enable exceptions are not allowed on the windows firewall&lt;br /&gt;
  SimpleFC::AllowDisallowExceptionsNotAllowed 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Disable exceptions are not allowed on the windows firewall&lt;br /&gt;
  SimpleFC::AllowDisallowExceptionsNotAllowed 0&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if exceptions are not allowed&lt;br /&gt;
  SimpleFC::AreExceptionsNotAllowed&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Exceptions are not allowed is &lt;br /&gt;
         ; activated/0=Exception are not allowed is deactivated&lt;br /&gt;
&lt;br /&gt;
; Enable notifications on the windows firewall&lt;br /&gt;
  SimpleFC::EnableDisableNotifications 1&lt;br /&gt;
&lt;br /&gt;
; Disable notifications on the windows firewall&lt;br /&gt;
  SimpleFC::EnableDisableNotifications 0&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if notifications are enabled/disabled&lt;br /&gt;
  SimpleFC::AreNotificationsEnabled &lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Enabled/0=Disabled&lt;br /&gt;
&lt;br /&gt;
; Starts the windows firewall service&lt;br /&gt;
  SimpleFC::StartStopFirewallService 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Stops the windows firewall service&lt;br /&gt;
  SimpleFC::StartStopFirewallService 0&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if windows firewall service is running&lt;br /&gt;
  SimpleFC::IsFirewallServiceRunning&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=IsRunning/0=Not Running&lt;br /&gt;
&lt;br /&gt;
; Sets the windows firewall to default settings&lt;br /&gt;
  SimpleFC::RestoreDefaults&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP outbound destination unreachable state&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpOutboundDestinationUnreachable 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP redirect state&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpRedirect 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP inbound echo request &lt;br /&gt;
  SimpleFC::AllowDisallowIcmpInboundEchoRequest 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP outbound time exceeded&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpOutboundTimeExceeded 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP outbound parameter problem&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpOutboundParameterProblem 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP outbound source quench&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpOutboundSourceQuench 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP inbound router request&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpInboundRouterRequest 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP inbound timestamp request&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpInboundTimestampRequest 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP inbound mask request&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpInboundMaskRequest 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP outbound packet too big&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpOutboundPacketTooBig 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if ICMPv4 echo request is allowed&lt;br /&gt;
  SimpleFC::IsIcmpTypeAllowed &amp;quot;0&amp;quot; &amp;quot;&amp;quot; &amp;quot;8&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Restricted/0=Not restricted&lt;br /&gt;
  Pop $2 ; return 1=Allowed/0=Not allowed &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Some example rules for the windows firewall with advanced security.&lt;br /&gt;
; Please note this functions are very powerful, so for a detailed &lt;br /&gt;
; description please read the windows firewall with advanced &lt;br /&gt;
; security api reference:&lt;br /&gt;
; http://msdn2.microsoft.com/en-us/library/aa365309.aspx&lt;br /&gt;
&lt;br /&gt;
; Adds an ICMPv4 rule to allow incoming echo reply messages (IcmpCodeAndType = 0:0)&lt;br /&gt;
  SimpleFC::AdvAddRule &amp;quot;Echo-Reply (ICMPv4 incoming)&amp;quot; \&lt;br /&gt;
    &amp;quot;Allows incoming Echo Replies messages.&amp;quot; &amp;quot;1&amp;quot; &amp;quot;1&amp;quot; &amp;quot;1&amp;quot; &amp;quot;7&amp;quot; &amp;quot;1&amp;quot; &amp;quot;&amp;quot; \ &lt;br /&gt;
    &amp;quot;&amp;quot; &amp;quot;0:0&amp;quot; &amp;quot;@PathToApplication,-10000&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Adds an ICMPv4 rule to allow incoming echo request messages (IcmpCodeAndType = 8:0)&lt;br /&gt;
  SimpleFC::AdvAddRule &amp;quot;Echo-Request (ICMPv4 incoming)&amp;quot; \&lt;br /&gt;
    &amp;quot;Allows incoming ICMP Echo messages.&amp;quot; &amp;quot;1&amp;quot; &amp;quot;1&amp;quot; &amp;quot;1&amp;quot; &amp;quot;7&amp;quot; &amp;quot;1&amp;quot; &amp;quot;&amp;quot; \&lt;br /&gt;
    &amp;quot;&amp;quot; &amp;quot;8:0&amp;quot; &amp;quot;@PathToApplication,-10000&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Add an application rule to allow incoming TCP access on this application&lt;br /&gt;
  SimpleFC::AdvAddRule &amp;quot;Incoming requests (TCP incoming)&amp;quot; \ &lt;br /&gt;
    &amp;quot;Allows incoming requests.&amp;quot; &amp;quot;6&amp;quot; &amp;quot;1&amp;quot; &amp;quot;1&amp;quot; &amp;quot;7&amp;quot; &amp;quot;1&amp;quot; &amp;quot;PathToApplication&amp;quot; \ &lt;br /&gt;
    &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;@PathToApplication,-10000&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Add an application rule to allow incoming UDP access on this application&lt;br /&gt;
  SimpleFC::AdvAddRule &amp;quot;Incoming requests (UDP incoming)&amp;quot; \&lt;br /&gt;
    &amp;quot;Allows incoming requests.&amp;quot; &amp;quot;17&amp;quot; &amp;quot;1&amp;quot; &amp;quot;1&amp;quot; &amp;quot;7&amp;quot; &amp;quot;1&amp;quot; &amp;quot;PathToApplication&amp;quot; \ &lt;br /&gt;
    &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;@PathToApplication,-10000&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Removes a firewall rule&lt;br /&gt;
  SimpleFC::AdvRemoveRule &amp;quot;Incoming requests (UDP incoming)&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if the firewall exists&lt;br /&gt;
  SimpleFC::AdvExistsRule &amp;quot;Incoming requests (UDP incoming)&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Exists/0=DoesnÂ´t exists&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Changelog ==&lt;br /&gt;
*Version 1.20 (2014-06-12)&lt;br /&gt;
**Added &amp;quot;ServiceName&amp;quot; parameter to function &amp;quot;AdvAddRule&amp;quot;&lt;br /&gt;
**Documentation updated&lt;br /&gt;
*Version 1.19 (2012-07-16)&lt;br /&gt;
**Documentation updated&lt;br /&gt;
*Version 1.18 (2010-02-23)&lt;br /&gt;
**Documentation updated&lt;br /&gt;
*Version 1.17 (2009-09-05)&lt;br /&gt;
**Added changes from the service manager&lt;br /&gt;
**The following functions are now case insensitive:&lt;br /&gt;
***SimpleFC::IsApplicationAdded&lt;br /&gt;
***SimpleFC::IsApplicationEnabled&lt;br /&gt;
***SimpleFC::EnableDisableApplication&lt;br /&gt;
***SimpleFC::AdvExistsRule&lt;br /&gt;
*Version 1.16 (2009-04-13)&lt;br /&gt;
**Added changes from the service manager&lt;br /&gt;
*Version 1.15 (2008-08-18)&lt;br /&gt;
**Added changes from the service manager and checked removed compiler optimization to avoid a false-positive virusscan.&lt;br /&gt;
*Version 1.14 (2008-02-05)&lt;br /&gt;
** Added changes from the service manager&lt;br /&gt;
*Version 1.13 (2008-01-29)&lt;br /&gt;
** Added changes from the service manager&lt;br /&gt;
*Version 1.12 (2007-11-13)&lt;br /&gt;
** Fixed wrong documentation about SimpleFC::AdvExistsRule&lt;br /&gt;
*Version 1.11 (2007-08-07)&lt;br /&gt;
** Fixed potential endless loop bug in SimpleFC::StartStopFirewallService&lt;br /&gt;
*Version 1.10 (2007-08-02)&lt;br /&gt;
** Added default firewall functions:&lt;br /&gt;
*** SimpleFC::RestoreDefaults&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpOutboundDestinationUnreachable&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpRedirect&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpInboundEchoRequest&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpOutboundTimeExceeded&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpOutboundParameterProblem&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpOutboundSourceQuench&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpInboundRouterRequest&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpInboundTimestampRequest&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpInboundMaskRequest&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpOutboundPacketTooBig&lt;br /&gt;
*** SimpleFC::IsIcmpTypeAllowed&lt;br /&gt;
** Added functions for Windows Firewall with Advanced Security&lt;br /&gt;
*** SimpleFC::AdvAddRule&lt;br /&gt;
*** SimpleFC::AdvRemoveRule&lt;br /&gt;
*** SimpleFC::AdvExistsRule&lt;br /&gt;
*Version 1.01 (2007-07-05)&lt;br /&gt;
**Changed missing documentation about the function SimpleFC::IsFirewallEnabled&lt;br /&gt;
*Version 1.0 (2007-05-02)&lt;br /&gt;
**First offical version&lt;br /&gt;
&lt;br /&gt;
== Important Notes ==&lt;br /&gt;
&lt;br /&gt;
*This plugin is running on Windows XP SP2, Windows 2003, Windows Vista, Windows 7, Windows 8, Windows Server 2012, Windows Server 8.1, Windows Server 2012 R2&lt;br /&gt;
*Before you execute some plugin commands it is recommend to check for windows firewall service is running (SimpleFC::IsFirewallServiceRunning).&lt;br /&gt;
*All functions with the prefix &amp;quot;Adv&amp;quot; are only for Windows Firewall with Advanced Security (Windows Vista and above). It is recommend to use these functions on the operating systems which supports the Windows Firewall with Advanced Security. Nethertheless, the default functions without the prefix &amp;quot;Adv&amp;quot; can be used.&lt;br /&gt;
* If you have any suggestions, comments or questions please mail me: mailto:rainer@speed-soft.de&lt;br /&gt;
&lt;br /&gt;
[[Category:Plugins]]&lt;/div&gt;</summary>
		<author><name>Speed78</name></author>
	</entry>
	<entry>
		<id>https://nsis.sourceforge.io/mediawiki/index.php?title=File:NSIS_Simple_Firewall_Plugin_Unicode_1.21.zip&amp;diff=25678</id>
		<title>File:NSIS Simple Firewall Plugin Unicode 1.21.zip</title>
		<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/mediawiki/index.php?title=File:NSIS_Simple_Firewall_Plugin_Unicode_1.21.zip&amp;diff=25678"/>
		<updated>2021-05-04T21:24:57Z</updated>

		<summary type="html">&lt;p&gt;Speed78: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Speed78</name></author>
	</entry>
	<entry>
		<id>https://nsis.sourceforge.io/mediawiki/index.php?title=File:NSIS_Simple_Firewall_Plugin_ANSI_1.21.zip&amp;diff=25677</id>
		<title>File:NSIS Simple Firewall Plugin ANSI 1.21.zip</title>
		<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/mediawiki/index.php?title=File:NSIS_Simple_Firewall_Plugin_ANSI_1.21.zip&amp;diff=25677"/>
		<updated>2021-05-04T21:23:22Z</updated>

		<summary type="html">&lt;p&gt;Speed78: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Speed78</name></author>
	</entry>
	<entry>
		<id>https://nsis.sourceforge.io/mediawiki/index.php?title=NSIS_Simple_Service_Plugin&amp;diff=25676</id>
		<title>NSIS Simple Service Plugin</title>
		<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/mediawiki/index.php?title=NSIS_Simple_Service_Plugin&amp;diff=25676"/>
		<updated>2021-05-02T18:35:53Z</updated>

		<summary type="html">&lt;p&gt;Speed78: /* Links */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This plugin contains basic service functions like start, stop the service or checking the service status. It also contains advanced service functions for example setting the service description, changed the logon account, granting or removing the service logon privilege.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This plugin is using the MPL License or alternatively the LGPL License.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
The ZIP file containing a precompiled plugin DLL (to be saved in NSIS&#039; plugin directory) and the sources. &lt;br /&gt;
If you update from a previous version it is strongly &#039;&#039;&#039;recommend&#039;&#039;&#039; to take look at the changelog.&lt;br /&gt;
*Unicode Version: &amp;lt;attach&amp;gt;NSIS_Simple_Service_Plugin_Unicode_1.30.zip&amp;lt;/attach&amp;gt; (Recommend for &amp;gt;= NSIS 3.x)&lt;br /&gt;
*ANSI Version: &amp;lt;attach&amp;gt;NSIS_Simple_Service_Plugin_ANSI_1.30.zip&amp;lt;/attach&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Donation ==&lt;br /&gt;
If you believe that I am doing a good job and you want to support me please [http://www.speed-soft.de/donation/index.php?language=en donate] any amount via PayPal.&lt;br /&gt;
&lt;br /&gt;
== Short Reference ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
SimpleSC::InstallService [name_of_service] [display_name] [service_type] [start_type] &lt;br /&gt;
  [binary_path] [dependencies] [account] [password]&lt;br /&gt;
SimpleSC::RemoveService [name_of_service]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::StartService [name_of_service] [arguments] [timeout]&lt;br /&gt;
SimpleSC::StopService [name_of_service] [wait_for_file_release] [timeout]&lt;br /&gt;
SimpleSC::PauseService [name_of_service] [timeout]&lt;br /&gt;
SimpleSC::ContinueService [name_of_service] [timeout]&lt;br /&gt;
SimpleSC::RestartService [name_of_service] [arguments] [timeout]&lt;br /&gt;
SimpleSC::ExistsService [name_of_service]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::GetServiceDisplayName [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceName [display_name]&lt;br /&gt;
SimpleSC::GetServiceStatus [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceDescription [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceStartType [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceBinaryPath [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceLogon [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceFailure [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceFailureFlag [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceDelayedAutoStartInfo [name_of_service]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::SetServiceDescription [name_of_service] [service_description]&lt;br /&gt;
SimpleSC::SetServiceStartType [name_of_service] [start_type]&lt;br /&gt;
SimpleSC::SetServiceBinaryPath [name_of_service] [binary_path]&lt;br /&gt;
SimpleSC::SetServiceLogon [name_of_service] [account] [password]&lt;br /&gt;
SimpleSC::SetServiceFailure [name_of_service] [reset_period] [reboot_message] [command] &lt;br /&gt;
  [action_type_1] [action_delay_1] [action_type_2] [action_delay_2] [action_type_3] &lt;br /&gt;
  [action_delay_3]&lt;br /&gt;
SimpleSC::SetServiceFailureFlag [name_of_service] [failure_actions_on_non_crash_failures]&lt;br /&gt;
SimpleSC::SetServiceDelayedAutoStartInfo [name_of_service] [delayed_autostart]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::GrantServiceLogonPrivilege [account]&lt;br /&gt;
SimpleSC::RemoveServiceLogonPrivilege [account]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::ServiceIsPaused [name_of_service]&lt;br /&gt;
SimpleSC::ServiceIsRunning [name_of_service]&lt;br /&gt;
SimpleSC::ServiceIsStopped [name_of_service]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::GetErrorMessage [error_code]&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
*name_of_service - The name of the service used for Start/Stop commands and all further commands &lt;br /&gt;
*display_name - The name as shown in the service control manager applet in system control &lt;br /&gt;
*service_type - One of the following codes &lt;br /&gt;
**1 - SERVICE_KERNEL_DRIVER - Driver service.&lt;br /&gt;
**2 - SERVICE_FILE_SYSTEM_DRIVER - File system driver service.&lt;br /&gt;
**16 - SERVICE_WIN32_OWN_PROCESS - Service that runs in its own process. (Should be used in most cases)&lt;br /&gt;
**32 - SERVICE_WIN32_SHARE_PROCESS - Service that shares a process with one or more other services. &lt;br /&gt;
**256 - SERVICE_INTERACTIVE_PROCESS - The service can interact with the desktop. &lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: If you specify either SERVICE_WIN32_OWN_PROCESS or SERVICE_WIN32_SHARE_PROCESS,          and the service is running in the context of the LocalSystem account,          you can also specify this value. Example: SERVICE_WIN32_OWN_PROCESS or SERVICE_INTERACTIVE_PROCESS - (16 or 256) = 272&lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: Services cannot directly interact with a user as of Windows Vista.             Therefore, this technique should not be used in new code. See for more information: http://msdn2.microsoft.com/en-us/library/ms683502(VS.85).aspx          &lt;br /&gt;
&lt;br /&gt;
*start_type - one of the following codes &lt;br /&gt;
**0 - SERVICE_BOOT_START - Driver boot stage start &lt;br /&gt;
**1 - SERVICE_SYSTEM_START - Driver scm stage start &lt;br /&gt;
**2 - SERVICE_AUTO_START - Service auto start (Should be used in most cases)&lt;br /&gt;
**3 - SERVICE_DEMAND_START - Driver/service manual start &lt;br /&gt;
**4 - SERVICE_DISABLED - Driver/service disabled&lt;br /&gt;
*service_status - one of the following codes&lt;br /&gt;
**1 - SERVICE_STOPPED&lt;br /&gt;
**2 - SERVICE_START_PENDING&lt;br /&gt;
**3 - SERVICE_STOP_PENDING&lt;br /&gt;
**4 - SERVICE_RUNNING&lt;br /&gt;
**5 - SERVICE_CONTINUE_PENDING&lt;br /&gt;
**6 - SERVICE_PAUSE_PENDING&lt;br /&gt;
**7 - SERVICE_PAUSED&lt;br /&gt;
*binary_path - The path to the binary including all necessary parameters &lt;br /&gt;
*dependencies - Needed services, controls which services have to be started before this one; use the forward slash &amp;quot;/&amp;quot; to add more more than one service&lt;br /&gt;
*account - The username/account which should be used &lt;br /&gt;
*password - Password of the aforementioned account to be able to logon as a service &lt;br /&gt;
**&#039;&#039;&#039;Note&#039;&#039;&#039;: If you do not specify account/password, the local system account will be used to run the service&lt;br /&gt;
*arguments - Arguments passed to the service main function. &lt;br /&gt;
**&#039;&#039;&#039;Note&#039;&#039;&#039;: Driver services do not receive these arguments.&lt;br /&gt;
*reset_period - The time after which to reset the failure count to zero if there are no failures, in seconds. Specify 0 (INFINITE) to indicate that this value should never be reset&lt;br /&gt;
*reboot_message - The message to be broadcast to server users before rebooting&lt;br /&gt;
*command - The command line of the process to execute in response to the SC_ACTION_RUN_COMMAND service controller action. This process runs under the same account as the service&lt;br /&gt;
*timeout - Timeout in seconds of the function&lt;br /&gt;
*action_type_x - one of the following codes for the action to be performed&lt;br /&gt;
**0 - SC_ACTION_NONE - No action&lt;br /&gt;
**1 - SC_ACTION_RESTART - Restart the service&lt;br /&gt;
**2 - SC_ACTION_REBOOT - Reboot the computer (Note: The service user must have the SE_SHUTDOWN_NAME privilege)&lt;br /&gt;
**3 - SC_ACTION_RUN_COMMAND - Run a command&lt;br /&gt;
*action_delay_x - The time to wait before performing the specified action, in milliseconds&lt;br /&gt;
*failure_actions_on_non_crash_failures - This setting determines when failure actions are to be executed&lt;br /&gt;
**0 - The failure actions executed only if the service terminates without reporting a status of SERVICE_STOPPED&lt;br /&gt;
**1 - The failure actions executed if the status of a service is SERVICE_STOPPED but the exit code of the service is not 0&lt;br /&gt;
*delayed_autostart - The delayed auto-start setting of an auto-start service&lt;br /&gt;
**0 - The service will be started during system boot.&lt;br /&gt;
**1 - The service will be started after other auto-start services are started plus a short delay&lt;br /&gt;
*error_code - Error code of a function&lt;br /&gt;
*service_description - The description as shown in the service control manager applet in system control&lt;br /&gt;
*wait_for_file_release - Wait for file release after the service is stopped. This is useful if the binary file will be overwritten after stopping the service.&lt;br /&gt;
**0 - NO_WAIT - No wait for file release&lt;br /&gt;
**1 - WAIT - Wait for file release &lt;br /&gt;
**&#039;&#039;&#039;Note&#039;&#039;&#039;: If SERVICE_WIN32_OWN_PROCESS is used this option should be set to WAIT.	If SERVICE_WIN32_SHARE_PROCESS is used this option should only be set to WAIT if the last service in the process is stopped.&lt;br /&gt;
&lt;br /&gt;
== The Sample Script ==&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
; Install a service - ServiceType own process - StartType automatic - NoDependencies - Logon as System Account&lt;br /&gt;
  SimpleSC::InstallService &amp;quot;MyService&amp;quot; &amp;quot;My Service Display Name&amp;quot; &amp;quot;16&amp;quot; &amp;quot;2&amp;quot; &amp;quot;C:\MyPath\MyService.exe&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Install a service - ServiceType interact with desktop - StartType automatic - Dependencies on &amp;quot;Windows Time Service&amp;quot; (w32time) and &amp;quot;WWW Publishing Service&amp;quot; (w3svc) - Logon as System Account&lt;br /&gt;
  SimpleSC::InstallService &amp;quot;MyService&amp;quot; &amp;quot;My Service Display Name&amp;quot; &amp;quot;272&amp;quot; &amp;quot;2&amp;quot; &amp;quot;C:\MyPath\MyService.exe&amp;quot; &amp;quot;w32time/w3svc&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Remove a service&lt;br /&gt;
  SimpleSC::RemoveService &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Start a service. Be sure to pass the service name, not the display name.&lt;br /&gt;
  SimpleSC::StartService &amp;quot;MyService&amp;quot; &amp;quot;&amp;quot; 30&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Start a service with two arguments &amp;quot;/param1=true&amp;quot; &amp;quot;/param2=1&amp;quot;&lt;br /&gt;
  SimpleSC::StartService &amp;quot;MyService&amp;quot; &amp;quot;/param1=true /param2=1&amp;quot; 30&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
 &lt;br /&gt;
; Start a service with two arguments &amp;quot;-p param1&amp;quot; &amp;quot;-param2&amp;quot;&lt;br /&gt;
  SimpleSC::StartService &amp;quot;MyService&amp;quot; &#039;&amp;quot;-p param1&amp;quot; -param2&#039; 30&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Stop a service and waits for file release. Be sure to pass the service name, not the display name.&lt;br /&gt;
  SimpleSC::StopService &amp;quot;MyService&amp;quot; 1 30&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Stops two services and waits for file release after the last service is stopped&lt;br /&gt;
  SimpleSC::StopService &amp;quot;MyService1&amp;quot; 0 30&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  SimpleSC::StopService &amp;quot;MyService2&amp;quot; 1 30&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Pause a service&lt;br /&gt;
  SimpleSC::PauseService &amp;quot;MyService&amp;quot; 30&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Continue a service&lt;br /&gt;
  SimpleSC::ContinueService &amp;quot;MyService&amp;quot; 30&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Restart a service&lt;br /&gt;
  SimpleSC::RestartService &amp;quot;MyService&amp;quot; &amp;quot;&amp;quot; 30&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Restart a service with two arguments &amp;quot;/param1=true&amp;quot; &amp;quot;/param2=1&amp;quot;&lt;br /&gt;
  SimpleSC::RestartService &amp;quot;MyService&amp;quot; &amp;quot;/param1=true /param2=1&amp;quot; 30&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Start a service with two arguments &amp;quot;-p param1&amp;quot; &amp;quot;-param2&amp;quot;&lt;br /&gt;
  SimpleSC::RestartService &amp;quot;MyService&amp;quot; &#039;&amp;quot;-p param1&amp;quot; -param2&#039; 30&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Check if the service exists&lt;br /&gt;
  SimpleSC::ExistsService &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode if the service doesn´t exists (&amp;lt;&amp;gt;0)/service exists (0)&lt;br /&gt;
&lt;br /&gt;
; Get the displayname of a service&lt;br /&gt;
  SimpleSC::GetServiceDisplayName &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the displayname of the service&lt;br /&gt;
&lt;br /&gt;
; Get the servicename of a service by the displayname&lt;br /&gt;
  SimpleSC::GetServiceName &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the servicename of the service&lt;br /&gt;
&lt;br /&gt;
; Get the current status of a service&lt;br /&gt;
  SimpleSC::GetServiceStatus &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; return the status of the service (See &amp;quot;service_status&amp;quot; in the parameters)&lt;br /&gt;
&lt;br /&gt;
; Get the description of a service&lt;br /&gt;
  SimpleSC::GetServiceDescription &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the description of the service&lt;br /&gt;
 &lt;br /&gt;
; Get the start type of the service&lt;br /&gt;
  SimpleSC::GetServiceStartType &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the start type of the service (see &amp;quot;start_type&amp;quot; in the parameters)&lt;br /&gt;
&lt;br /&gt;
; Get the binary path of a service&lt;br /&gt;
  SimpleSC::GetServiceBinaryPath &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the binary path of the service&lt;br /&gt;
&lt;br /&gt;
; Get the logon user of the service&lt;br /&gt;
  SimpleSC::GetServiceLogon &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the logon username of the service  &lt;br /&gt;
&lt;br /&gt;
; Get the failure configuration of a service&lt;br /&gt;
  SimpleSC::GetServiceFailure &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the reset period &lt;br /&gt;
  Pop $2 ; returns the reboot message&lt;br /&gt;
  Pop $3 ; returns the command&lt;br /&gt;
  Pop $4 ; returns the first action (See &amp;quot;action_type_x&amp;quot; in the parameters)&lt;br /&gt;
  Pop $5 ; returns the first action delay &lt;br /&gt;
  Pop $6 ; returns the second action (See &amp;quot;action_type_x&amp;quot; in the parameters)&lt;br /&gt;
  Pop $7 ; returns the second action delay &lt;br /&gt;
  Pop $8 ; returns the third action (See &amp;quot;action_type_x&amp;quot; in the parameters)&lt;br /&gt;
  Pop $9 ; returns the third action delay &lt;br /&gt;
&lt;br /&gt;
; Get the failure flag configuration of a service&lt;br /&gt;
  SimpleSC::GetServiceFailureFlag &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the service flag&lt;br /&gt;
&lt;br /&gt;
; Get the delayed auto-start configuration of a service&lt;br /&gt;
  SimpleSC::GetServiceDelayedAutoStartInfo &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the delayed auto-start configuration&lt;br /&gt;
&lt;br /&gt;
; Set the description of a service&lt;br /&gt;
  SimpleSC::SetServiceDescription &amp;quot;MyService&amp;quot; &amp;quot;Sample Description&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Set the starttype to automatic of a service&lt;br /&gt;
  SimpleSC::SetServiceStartType &amp;quot;MyService&amp;quot; &amp;quot;2&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Sets the service binary path&lt;br /&gt;
  SimpleSC::SetServiceBinaryPath &amp;quot;MyService&amp;quot; &amp;quot;C:\MySoftware\MyService.exe&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Sets the service logon to a user and grant the user the &amp;quot;SeServiceLogonPrivilege&amp;quot;&lt;br /&gt;
  SimpleSC::SetServiceLogon &amp;quot;MyService&amp;quot; &amp;quot;MyServiceUser&amp;quot; &amp;quot;MyServiceUserPassword&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  IntCmp $0 0 +1 Done Done ; If successful grant the service logon privilege to &amp;quot;MyServiceUser&amp;quot;&lt;br /&gt;
    ; Note: Every serviceuser must have the ServiceLogonPrivilege to start the service&lt;br /&gt;
    SimpleSC::GrantServiceLogonPrivilege &amp;quot;MyServiceUser&amp;quot;&lt;br /&gt;
    Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Done:&lt;br /&gt;
&lt;br /&gt;
; Sets the service failure configuration - First action: Restart the service after one minute - Second action: Reboot the computer after five minutes&lt;br /&gt;
  SimpleSC::SetServiceFailure &amp;quot;MyService&amp;quot; &amp;quot;0&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;1&amp;quot; &amp;quot;60000&amp;quot; &amp;quot;2&amp;quot; &amp;quot;300000&amp;quot; &amp;quot;0&amp;quot; &amp;quot;0&amp;quot; &lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Sets the failure flag configuration of a service&lt;br /&gt;
  SimpleSC::SetServiceFailureFlag &amp;quot;MyService&amp;quot; &amp;quot;1&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Sets the delayed auto-start configuration of a service&lt;br /&gt;
  SimpleSC::SetServiceDelayedAutoStartInfo &amp;quot;MyService&amp;quot; &amp;quot;1&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Remove the &amp;quot;SeServiceLogonPrivilege&amp;quot; from a user&lt;br /&gt;
  SimpleSC::RemoveServiceLogonPrivilege &amp;quot;MyServiceUser&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Check if the service is paused&lt;br /&gt;
  SimpleSC::ServiceIsPaused &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns 1 (service is paused) - returns 0 (service is not paused)&lt;br /&gt;
&lt;br /&gt;
; Check if the service is running&lt;br /&gt;
  SimpleSC::ServiceIsRunning &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns 1 (service is running) - returns 0 (service is not running)&lt;br /&gt;
&lt;br /&gt;
; Check if the service is stopped&lt;br /&gt;
  SimpleSC::ServiceIsStopped &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns 1 (service is stopped) - returns 0 (service is not stopped)&lt;br /&gt;
&lt;br /&gt;
; Show the error message if a function fails &lt;br /&gt;
  SimpleSC::StopService &amp;quot;MyService&amp;quot; 1 30&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  IntCmp $0 0 Done +1 +1 &lt;br /&gt;
    Push $0&lt;br /&gt;
    SimpleSC::GetErrorMessage&lt;br /&gt;
    Pop $0&lt;br /&gt;
    MessageBox MB_OK|MB_ICONSTOP &amp;quot;Stopping fails - Reason: $0&amp;quot;&lt;br /&gt;
  Done:&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Changelog ==&lt;br /&gt;
*Version 1.30 (Unicode) (2021-05-02)&lt;br /&gt;
**Unicode Version added with the same functions like the ANSI version.&lt;br /&gt;
*Version 1.30 (ANSI) (2011-08-15)&lt;br /&gt;
**SimpleSC::RemoveService doesn&#039;t stop the service now.&lt;br /&gt;
**SimpleSC::StartService, SimpleSC::StopService, SimpleSC::PauseService, SimpleSC::ContinueService and SimpleSC::RestartService got a new &amp;quot;Timeout&amp;quot; parameter. It is recommend to use a timeout of 30.&lt;br /&gt;
*Version 1.29 (ANSI) (2011-04-16)&lt;br /&gt;
**SimpleSC::GetServiceFailureFlag added&lt;br /&gt;
**SimpleSC::SetServiceFailureFlag added&lt;br /&gt;
**SimpleSC::GetServiceDelayedAutoStartInfo added&lt;br /&gt;
**SimpleSC::SetServiceDelayedAutoStartInfo added&lt;br /&gt;
*Version 1.28 (ANSI) (2010-09-14)&lt;br /&gt;
**SimpleSC::GetServiceFailure function added&lt;br /&gt;
**SimpleSC::SetServiceFailure function added&lt;br /&gt;
**SimpleSC::StopService WaitForFileRelease feature added (For details take a look at the documentation)&lt;br /&gt;
*Version 1.27 (ANSI) (2010-03-23)&lt;br /&gt;
**Documentation updated&lt;br /&gt;
*Version 1.26 (ANSI) (2009-05-21)&lt;br /&gt;
**Fixed wait for status bug on starting, stopping, pausing or continuing a service &lt;br /&gt;
* Version 1.25 (ANSI) (2009-04-23)&lt;br /&gt;
**SimpleSC::SetServiceLogon supports now non-domain username without the &amp;quot;.\&amp;quot;-prefix&lt;br /&gt;
**SimpleSC::SetServiceBinaryPath function added&lt;br /&gt;
*Version 1.24 (ANSI) (2009-04-13)&lt;br /&gt;
**Fixed wait for status bug if the service status changed. Now, if a service stops, starts aso. the plugin will work like the recommendations in the MSDN.&lt;br /&gt;
*Version 1.23 (ANSI) (2008-08-23)&lt;br /&gt;
**Removed compiler optimization to avoid a false-positive virusscan.&lt;br /&gt;
*Version 1.22 (ANSI) (2008-08-17)&lt;br /&gt;
**SimpleSC::GrantServiceLogonPrivilege and SimpleSC::RemoveServiceLogonPrivilege works now correct with domain names like MyDomain\MyUser.&lt;br /&gt;
**Added function SimpleSC::GetServiceLogon to get the logon username of a service.&lt;br /&gt;
*Version 1.21 (2008-02-10)&lt;br /&gt;
**SimpleSC::ExistsService results now 0 if the service exists and &amp;lt;&amp;gt; 0 if the service doensnÂ´t exists.&lt;br /&gt;
*Version 1.20 (ANSI) (2008-02-05)&lt;br /&gt;
**Every function now returns &amp;lt;&amp;gt; 0 if there is an error. Use SimpleSC::GetErrorMessage to get the message of a function result.&lt;br /&gt;
**Added function SimpleSC::GetErrorMessage to get the message of a function result.&lt;br /&gt;
**SimpleSC::ExistsService results now 0 if the service exists and &amp;lt;&amp;gt; 0 if the service doensnÂ´t exists.&lt;br /&gt;
**SimpleSC::RestartService supports now arguments.&lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: The signature has been changed. If you update from a previous version you must check your parameters.&lt;br /&gt;
*Version 1.10 (ANSI) (2008-01-29)&lt;br /&gt;
**SimpleSC::InstallService supports now more than one dependencies (delimitter is the forward slash).&lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: The signature has been changed. If you update from a previous version you must check your parameters.&lt;br /&gt;
**SimpleSC::InstallService supports now more service types e.g. to create an interactive service.&lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: The signature has been changed. If you update from a previous version you must check your parameters.&lt;br /&gt;
**SimpleSC::StartService supports now arguments. &lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: The signature has been changed. If you update from a previous version you must check your parameters.&lt;br /&gt;
*Version 1.05 (ANSI) (2008-01-12)&lt;br /&gt;
**The functions SimpleSC::StopService and SimpleSC::RestartService are now improved. Now all dependent services are stopping recursively too.&lt;br /&gt;
*Version 1.04 (ANSI) (2007-08-07)&lt;br /&gt;
**Fixed bug for possible endless loops. This concerns to the functions StartService, StopService, ContinueService and PauseService. &lt;br /&gt;
*Version 1.03 (ANSI) (2007-08-02)&lt;br /&gt;
**Added function SimpleSC::GetServiceBinaryPath to get the binary path of a specified service.&lt;br /&gt;
*Version 1.02 (ANSI) (2007-05-29)&lt;br /&gt;
**Changed wrong documentation informations about the functions SimpleSC::InstallService and SimpleSC::RemoveService.&lt;br /&gt;
*Version 1.01 (ANSI) (2007-05-07)&lt;br /&gt;
**Changed wrong status-results in Readme.txt. This concerns to the functions ServiceIsPaused, ServiceIsRunning and ServiceIsStopped.&lt;br /&gt;
**Changed the access privileges of the plugin. The plugin now uses the lowest privlege of each function to execute.&lt;br /&gt;
*Version 1.0 (ANSI) (2007-05-02)&lt;br /&gt;
**First offical version&lt;br /&gt;
&lt;br /&gt;
== Important Notes ==&lt;br /&gt;
* Error codes are any non-zero value. For instance, if you attempt to start, stop, or query a service that does not exist, you may get the error code 1060.&lt;br /&gt;
*The function &amp;quot;SetServiceLogon&amp;quot; only works if the servicetype is &amp;quot;SERVICE_WIN32_OWN_PROCESS&amp;quot;.&lt;br /&gt;
* The functions &amp;quot;GetServiceDescription&amp;quot; or &amp;quot;SetServiceDescription&amp;quot; are only available on systems higher than Windows NT.&lt;br /&gt;
* The function &amp;quot;GetServiceFailureFlag&amp;quot;, &amp;quot;SetServiceFailureFlag&amp;quot;, &amp;quot;GetServiceDelayedAutoStartInfo&amp;quot; and &amp;quot;SetServiceDelayedAutoStartInfo&amp;quot; are only available on systems higher than Windows 2003.&lt;br /&gt;
* If you change the logon of an service to a new user you have to grant him the Service Logon Privilege. Otherwise the service cannot be started by the user you have assigned.&lt;br /&gt;
* The functions StartService, StopService, PauseService and ContinueService uses a timeout of 30 seconds. This means the function must be executed within 30 seconds, otherwise the functions will return an error.&lt;br /&gt;
* If you have any suggestions, comments or questions please mail me: mailto:rainer@speed-soft.de&lt;br /&gt;
&lt;br /&gt;
[[Category:Plugins]]&lt;/div&gt;</summary>
		<author><name>Speed78</name></author>
	</entry>
	<entry>
		<id>https://nsis.sourceforge.io/mediawiki/index.php?title=NSIS_Simple_Service_Plugin&amp;diff=25675</id>
		<title>NSIS Simple Service Plugin</title>
		<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/mediawiki/index.php?title=NSIS_Simple_Service_Plugin&amp;diff=25675"/>
		<updated>2021-05-02T18:12:30Z</updated>

		<summary type="html">&lt;p&gt;Speed78: /* Links */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This plugin contains basic service functions like start, stop the service or checking the service status. It also contains advanced service functions for example setting the service description, changed the logon account, granting or removing the service logon privilege.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This plugin is using the MPL License or alternatively the LGPL License.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
The ZIP file containing a precompiled plugin DLL (to be saved in NSIS&#039; plugin directory) and the sources. &lt;br /&gt;
If you update from a previous version it is strongly &#039;&#039;&#039;recommend&#039;&#039;&#039; to take look at the changelog.&lt;br /&gt;
*Unicode Version (Recommend for &amp;gt;= NSIS 3.x): &amp;lt;attach&amp;gt;NSIS_Simple_Service_Plugin_Unicode_1.30.zip&amp;lt;/attach&amp;gt; &lt;br /&gt;
*ANSI Version: &amp;lt;attach&amp;gt;NSIS_Simple_Service_Plugin_ANSI_1.30.zip&amp;lt;/attach&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Donation ==&lt;br /&gt;
If you believe that I am doing a good job and you want to support me please [http://www.speed-soft.de/donation/index.php?language=en donate] any amount via PayPal.&lt;br /&gt;
&lt;br /&gt;
== Short Reference ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
SimpleSC::InstallService [name_of_service] [display_name] [service_type] [start_type] &lt;br /&gt;
  [binary_path] [dependencies] [account] [password]&lt;br /&gt;
SimpleSC::RemoveService [name_of_service]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::StartService [name_of_service] [arguments] [timeout]&lt;br /&gt;
SimpleSC::StopService [name_of_service] [wait_for_file_release] [timeout]&lt;br /&gt;
SimpleSC::PauseService [name_of_service] [timeout]&lt;br /&gt;
SimpleSC::ContinueService [name_of_service] [timeout]&lt;br /&gt;
SimpleSC::RestartService [name_of_service] [arguments] [timeout]&lt;br /&gt;
SimpleSC::ExistsService [name_of_service]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::GetServiceDisplayName [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceName [display_name]&lt;br /&gt;
SimpleSC::GetServiceStatus [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceDescription [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceStartType [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceBinaryPath [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceLogon [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceFailure [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceFailureFlag [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceDelayedAutoStartInfo [name_of_service]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::SetServiceDescription [name_of_service] [service_description]&lt;br /&gt;
SimpleSC::SetServiceStartType [name_of_service] [start_type]&lt;br /&gt;
SimpleSC::SetServiceBinaryPath [name_of_service] [binary_path]&lt;br /&gt;
SimpleSC::SetServiceLogon [name_of_service] [account] [password]&lt;br /&gt;
SimpleSC::SetServiceFailure [name_of_service] [reset_period] [reboot_message] [command] &lt;br /&gt;
  [action_type_1] [action_delay_1] [action_type_2] [action_delay_2] [action_type_3] &lt;br /&gt;
  [action_delay_3]&lt;br /&gt;
SimpleSC::SetServiceFailureFlag [name_of_service] [failure_actions_on_non_crash_failures]&lt;br /&gt;
SimpleSC::SetServiceDelayedAutoStartInfo [name_of_service] [delayed_autostart]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::GrantServiceLogonPrivilege [account]&lt;br /&gt;
SimpleSC::RemoveServiceLogonPrivilege [account]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::ServiceIsPaused [name_of_service]&lt;br /&gt;
SimpleSC::ServiceIsRunning [name_of_service]&lt;br /&gt;
SimpleSC::ServiceIsStopped [name_of_service]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::GetErrorMessage [error_code]&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
*name_of_service - The name of the service used for Start/Stop commands and all further commands &lt;br /&gt;
*display_name - The name as shown in the service control manager applet in system control &lt;br /&gt;
*service_type - One of the following codes &lt;br /&gt;
**1 - SERVICE_KERNEL_DRIVER - Driver service.&lt;br /&gt;
**2 - SERVICE_FILE_SYSTEM_DRIVER - File system driver service.&lt;br /&gt;
**16 - SERVICE_WIN32_OWN_PROCESS - Service that runs in its own process. (Should be used in most cases)&lt;br /&gt;
**32 - SERVICE_WIN32_SHARE_PROCESS - Service that shares a process with one or more other services. &lt;br /&gt;
**256 - SERVICE_INTERACTIVE_PROCESS - The service can interact with the desktop. &lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: If you specify either SERVICE_WIN32_OWN_PROCESS or SERVICE_WIN32_SHARE_PROCESS,          and the service is running in the context of the LocalSystem account,          you can also specify this value. Example: SERVICE_WIN32_OWN_PROCESS or SERVICE_INTERACTIVE_PROCESS - (16 or 256) = 272&lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: Services cannot directly interact with a user as of Windows Vista.             Therefore, this technique should not be used in new code. See for more information: http://msdn2.microsoft.com/en-us/library/ms683502(VS.85).aspx          &lt;br /&gt;
&lt;br /&gt;
*start_type - one of the following codes &lt;br /&gt;
**0 - SERVICE_BOOT_START - Driver boot stage start &lt;br /&gt;
**1 - SERVICE_SYSTEM_START - Driver scm stage start &lt;br /&gt;
**2 - SERVICE_AUTO_START - Service auto start (Should be used in most cases)&lt;br /&gt;
**3 - SERVICE_DEMAND_START - Driver/service manual start &lt;br /&gt;
**4 - SERVICE_DISABLED - Driver/service disabled&lt;br /&gt;
*service_status - one of the following codes&lt;br /&gt;
**1 - SERVICE_STOPPED&lt;br /&gt;
**2 - SERVICE_START_PENDING&lt;br /&gt;
**3 - SERVICE_STOP_PENDING&lt;br /&gt;
**4 - SERVICE_RUNNING&lt;br /&gt;
**5 - SERVICE_CONTINUE_PENDING&lt;br /&gt;
**6 - SERVICE_PAUSE_PENDING&lt;br /&gt;
**7 - SERVICE_PAUSED&lt;br /&gt;
*binary_path - The path to the binary including all necessary parameters &lt;br /&gt;
*dependencies - Needed services, controls which services have to be started before this one; use the forward slash &amp;quot;/&amp;quot; to add more more than one service&lt;br /&gt;
*account - The username/account which should be used &lt;br /&gt;
*password - Password of the aforementioned account to be able to logon as a service &lt;br /&gt;
**&#039;&#039;&#039;Note&#039;&#039;&#039;: If you do not specify account/password, the local system account will be used to run the service&lt;br /&gt;
*arguments - Arguments passed to the service main function. &lt;br /&gt;
**&#039;&#039;&#039;Note&#039;&#039;&#039;: Driver services do not receive these arguments.&lt;br /&gt;
*reset_period - The time after which to reset the failure count to zero if there are no failures, in seconds. Specify 0 (INFINITE) to indicate that this value should never be reset&lt;br /&gt;
*reboot_message - The message to be broadcast to server users before rebooting&lt;br /&gt;
*command - The command line of the process to execute in response to the SC_ACTION_RUN_COMMAND service controller action. This process runs under the same account as the service&lt;br /&gt;
*timeout - Timeout in seconds of the function&lt;br /&gt;
*action_type_x - one of the following codes for the action to be performed&lt;br /&gt;
**0 - SC_ACTION_NONE - No action&lt;br /&gt;
**1 - SC_ACTION_RESTART - Restart the service&lt;br /&gt;
**2 - SC_ACTION_REBOOT - Reboot the computer (Note: The service user must have the SE_SHUTDOWN_NAME privilege)&lt;br /&gt;
**3 - SC_ACTION_RUN_COMMAND - Run a command&lt;br /&gt;
*action_delay_x - The time to wait before performing the specified action, in milliseconds&lt;br /&gt;
*failure_actions_on_non_crash_failures - This setting determines when failure actions are to be executed&lt;br /&gt;
**0 - The failure actions executed only if the service terminates without reporting a status of SERVICE_STOPPED&lt;br /&gt;
**1 - The failure actions executed if the status of a service is SERVICE_STOPPED but the exit code of the service is not 0&lt;br /&gt;
*delayed_autostart - The delayed auto-start setting of an auto-start service&lt;br /&gt;
**0 - The service will be started during system boot.&lt;br /&gt;
**1 - The service will be started after other auto-start services are started plus a short delay&lt;br /&gt;
*error_code - Error code of a function&lt;br /&gt;
*service_description - The description as shown in the service control manager applet in system control&lt;br /&gt;
*wait_for_file_release - Wait for file release after the service is stopped. This is useful if the binary file will be overwritten after stopping the service.&lt;br /&gt;
**0 - NO_WAIT - No wait for file release&lt;br /&gt;
**1 - WAIT - Wait for file release &lt;br /&gt;
**&#039;&#039;&#039;Note&#039;&#039;&#039;: If SERVICE_WIN32_OWN_PROCESS is used this option should be set to WAIT.	If SERVICE_WIN32_SHARE_PROCESS is used this option should only be set to WAIT if the last service in the process is stopped.&lt;br /&gt;
&lt;br /&gt;
== The Sample Script ==&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
; Install a service - ServiceType own process - StartType automatic - NoDependencies - Logon as System Account&lt;br /&gt;
  SimpleSC::InstallService &amp;quot;MyService&amp;quot; &amp;quot;My Service Display Name&amp;quot; &amp;quot;16&amp;quot; &amp;quot;2&amp;quot; &amp;quot;C:\MyPath\MyService.exe&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Install a service - ServiceType interact with desktop - StartType automatic - Dependencies on &amp;quot;Windows Time Service&amp;quot; (w32time) and &amp;quot;WWW Publishing Service&amp;quot; (w3svc) - Logon as System Account&lt;br /&gt;
  SimpleSC::InstallService &amp;quot;MyService&amp;quot; &amp;quot;My Service Display Name&amp;quot; &amp;quot;272&amp;quot; &amp;quot;2&amp;quot; &amp;quot;C:\MyPath\MyService.exe&amp;quot; &amp;quot;w32time/w3svc&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Remove a service&lt;br /&gt;
  SimpleSC::RemoveService &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Start a service. Be sure to pass the service name, not the display name.&lt;br /&gt;
  SimpleSC::StartService &amp;quot;MyService&amp;quot; &amp;quot;&amp;quot; 30&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Start a service with two arguments &amp;quot;/param1=true&amp;quot; &amp;quot;/param2=1&amp;quot;&lt;br /&gt;
  SimpleSC::StartService &amp;quot;MyService&amp;quot; &amp;quot;/param1=true /param2=1&amp;quot; 30&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
 &lt;br /&gt;
; Start a service with two arguments &amp;quot;-p param1&amp;quot; &amp;quot;-param2&amp;quot;&lt;br /&gt;
  SimpleSC::StartService &amp;quot;MyService&amp;quot; &#039;&amp;quot;-p param1&amp;quot; -param2&#039; 30&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Stop a service and waits for file release. Be sure to pass the service name, not the display name.&lt;br /&gt;
  SimpleSC::StopService &amp;quot;MyService&amp;quot; 1 30&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Stops two services and waits for file release after the last service is stopped&lt;br /&gt;
  SimpleSC::StopService &amp;quot;MyService1&amp;quot; 0 30&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  SimpleSC::StopService &amp;quot;MyService2&amp;quot; 1 30&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Pause a service&lt;br /&gt;
  SimpleSC::PauseService &amp;quot;MyService&amp;quot; 30&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Continue a service&lt;br /&gt;
  SimpleSC::ContinueService &amp;quot;MyService&amp;quot; 30&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Restart a service&lt;br /&gt;
  SimpleSC::RestartService &amp;quot;MyService&amp;quot; &amp;quot;&amp;quot; 30&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Restart a service with two arguments &amp;quot;/param1=true&amp;quot; &amp;quot;/param2=1&amp;quot;&lt;br /&gt;
  SimpleSC::RestartService &amp;quot;MyService&amp;quot; &amp;quot;/param1=true /param2=1&amp;quot; 30&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Start a service with two arguments &amp;quot;-p param1&amp;quot; &amp;quot;-param2&amp;quot;&lt;br /&gt;
  SimpleSC::RestartService &amp;quot;MyService&amp;quot; &#039;&amp;quot;-p param1&amp;quot; -param2&#039; 30&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Check if the service exists&lt;br /&gt;
  SimpleSC::ExistsService &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode if the service doesn´t exists (&amp;lt;&amp;gt;0)/service exists (0)&lt;br /&gt;
&lt;br /&gt;
; Get the displayname of a service&lt;br /&gt;
  SimpleSC::GetServiceDisplayName &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the displayname of the service&lt;br /&gt;
&lt;br /&gt;
; Get the servicename of a service by the displayname&lt;br /&gt;
  SimpleSC::GetServiceName &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the servicename of the service&lt;br /&gt;
&lt;br /&gt;
; Get the current status of a service&lt;br /&gt;
  SimpleSC::GetServiceStatus &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; return the status of the service (See &amp;quot;service_status&amp;quot; in the parameters)&lt;br /&gt;
&lt;br /&gt;
; Get the description of a service&lt;br /&gt;
  SimpleSC::GetServiceDescription &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the description of the service&lt;br /&gt;
 &lt;br /&gt;
; Get the start type of the service&lt;br /&gt;
  SimpleSC::GetServiceStartType &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the start type of the service (see &amp;quot;start_type&amp;quot; in the parameters)&lt;br /&gt;
&lt;br /&gt;
; Get the binary path of a service&lt;br /&gt;
  SimpleSC::GetServiceBinaryPath &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the binary path of the service&lt;br /&gt;
&lt;br /&gt;
; Get the logon user of the service&lt;br /&gt;
  SimpleSC::GetServiceLogon &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the logon username of the service  &lt;br /&gt;
&lt;br /&gt;
; Get the failure configuration of a service&lt;br /&gt;
  SimpleSC::GetServiceFailure &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the reset period &lt;br /&gt;
  Pop $2 ; returns the reboot message&lt;br /&gt;
  Pop $3 ; returns the command&lt;br /&gt;
  Pop $4 ; returns the first action (See &amp;quot;action_type_x&amp;quot; in the parameters)&lt;br /&gt;
  Pop $5 ; returns the first action delay &lt;br /&gt;
  Pop $6 ; returns the second action (See &amp;quot;action_type_x&amp;quot; in the parameters)&lt;br /&gt;
  Pop $7 ; returns the second action delay &lt;br /&gt;
  Pop $8 ; returns the third action (See &amp;quot;action_type_x&amp;quot; in the parameters)&lt;br /&gt;
  Pop $9 ; returns the third action delay &lt;br /&gt;
&lt;br /&gt;
; Get the failure flag configuration of a service&lt;br /&gt;
  SimpleSC::GetServiceFailureFlag &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the service flag&lt;br /&gt;
&lt;br /&gt;
; Get the delayed auto-start configuration of a service&lt;br /&gt;
  SimpleSC::GetServiceDelayedAutoStartInfo &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the delayed auto-start configuration&lt;br /&gt;
&lt;br /&gt;
; Set the description of a service&lt;br /&gt;
  SimpleSC::SetServiceDescription &amp;quot;MyService&amp;quot; &amp;quot;Sample Description&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Set the starttype to automatic of a service&lt;br /&gt;
  SimpleSC::SetServiceStartType &amp;quot;MyService&amp;quot; &amp;quot;2&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Sets the service binary path&lt;br /&gt;
  SimpleSC::SetServiceBinaryPath &amp;quot;MyService&amp;quot; &amp;quot;C:\MySoftware\MyService.exe&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Sets the service logon to a user and grant the user the &amp;quot;SeServiceLogonPrivilege&amp;quot;&lt;br /&gt;
  SimpleSC::SetServiceLogon &amp;quot;MyService&amp;quot; &amp;quot;MyServiceUser&amp;quot; &amp;quot;MyServiceUserPassword&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  IntCmp $0 0 +1 Done Done ; If successful grant the service logon privilege to &amp;quot;MyServiceUser&amp;quot;&lt;br /&gt;
    ; Note: Every serviceuser must have the ServiceLogonPrivilege to start the service&lt;br /&gt;
    SimpleSC::GrantServiceLogonPrivilege &amp;quot;MyServiceUser&amp;quot;&lt;br /&gt;
    Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Done:&lt;br /&gt;
&lt;br /&gt;
; Sets the service failure configuration - First action: Restart the service after one minute - Second action: Reboot the computer after five minutes&lt;br /&gt;
  SimpleSC::SetServiceFailure &amp;quot;MyService&amp;quot; &amp;quot;0&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;1&amp;quot; &amp;quot;60000&amp;quot; &amp;quot;2&amp;quot; &amp;quot;300000&amp;quot; &amp;quot;0&amp;quot; &amp;quot;0&amp;quot; &lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Sets the failure flag configuration of a service&lt;br /&gt;
  SimpleSC::SetServiceFailureFlag &amp;quot;MyService&amp;quot; &amp;quot;1&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Sets the delayed auto-start configuration of a service&lt;br /&gt;
  SimpleSC::SetServiceDelayedAutoStartInfo &amp;quot;MyService&amp;quot; &amp;quot;1&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Remove the &amp;quot;SeServiceLogonPrivilege&amp;quot; from a user&lt;br /&gt;
  SimpleSC::RemoveServiceLogonPrivilege &amp;quot;MyServiceUser&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Check if the service is paused&lt;br /&gt;
  SimpleSC::ServiceIsPaused &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns 1 (service is paused) - returns 0 (service is not paused)&lt;br /&gt;
&lt;br /&gt;
; Check if the service is running&lt;br /&gt;
  SimpleSC::ServiceIsRunning &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns 1 (service is running) - returns 0 (service is not running)&lt;br /&gt;
&lt;br /&gt;
; Check if the service is stopped&lt;br /&gt;
  SimpleSC::ServiceIsStopped &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns 1 (service is stopped) - returns 0 (service is not stopped)&lt;br /&gt;
&lt;br /&gt;
; Show the error message if a function fails &lt;br /&gt;
  SimpleSC::StopService &amp;quot;MyService&amp;quot; 1 30&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  IntCmp $0 0 Done +1 +1 &lt;br /&gt;
    Push $0&lt;br /&gt;
    SimpleSC::GetErrorMessage&lt;br /&gt;
    Pop $0&lt;br /&gt;
    MessageBox MB_OK|MB_ICONSTOP &amp;quot;Stopping fails - Reason: $0&amp;quot;&lt;br /&gt;
  Done:&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Changelog ==&lt;br /&gt;
*Version 1.30 (Unicode) (2021-05-02)&lt;br /&gt;
**Unicode Version added with the same functions like the ANSI version.&lt;br /&gt;
*Version 1.30 (ANSI) (2011-08-15)&lt;br /&gt;
**SimpleSC::RemoveService doesn&#039;t stop the service now.&lt;br /&gt;
**SimpleSC::StartService, SimpleSC::StopService, SimpleSC::PauseService, SimpleSC::ContinueService and SimpleSC::RestartService got a new &amp;quot;Timeout&amp;quot; parameter. It is recommend to use a timeout of 30.&lt;br /&gt;
*Version 1.29 (ANSI) (2011-04-16)&lt;br /&gt;
**SimpleSC::GetServiceFailureFlag added&lt;br /&gt;
**SimpleSC::SetServiceFailureFlag added&lt;br /&gt;
**SimpleSC::GetServiceDelayedAutoStartInfo added&lt;br /&gt;
**SimpleSC::SetServiceDelayedAutoStartInfo added&lt;br /&gt;
*Version 1.28 (ANSI) (2010-09-14)&lt;br /&gt;
**SimpleSC::GetServiceFailure function added&lt;br /&gt;
**SimpleSC::SetServiceFailure function added&lt;br /&gt;
**SimpleSC::StopService WaitForFileRelease feature added (For details take a look at the documentation)&lt;br /&gt;
*Version 1.27 (ANSI) (2010-03-23)&lt;br /&gt;
**Documentation updated&lt;br /&gt;
*Version 1.26 (ANSI) (2009-05-21)&lt;br /&gt;
**Fixed wait for status bug on starting, stopping, pausing or continuing a service &lt;br /&gt;
* Version 1.25 (ANSI) (2009-04-23)&lt;br /&gt;
**SimpleSC::SetServiceLogon supports now non-domain username without the &amp;quot;.\&amp;quot;-prefix&lt;br /&gt;
**SimpleSC::SetServiceBinaryPath function added&lt;br /&gt;
*Version 1.24 (ANSI) (2009-04-13)&lt;br /&gt;
**Fixed wait for status bug if the service status changed. Now, if a service stops, starts aso. the plugin will work like the recommendations in the MSDN.&lt;br /&gt;
*Version 1.23 (ANSI) (2008-08-23)&lt;br /&gt;
**Removed compiler optimization to avoid a false-positive virusscan.&lt;br /&gt;
*Version 1.22 (ANSI) (2008-08-17)&lt;br /&gt;
**SimpleSC::GrantServiceLogonPrivilege and SimpleSC::RemoveServiceLogonPrivilege works now correct with domain names like MyDomain\MyUser.&lt;br /&gt;
**Added function SimpleSC::GetServiceLogon to get the logon username of a service.&lt;br /&gt;
*Version 1.21 (2008-02-10)&lt;br /&gt;
**SimpleSC::ExistsService results now 0 if the service exists and &amp;lt;&amp;gt; 0 if the service doensnÂ´t exists.&lt;br /&gt;
*Version 1.20 (ANSI) (2008-02-05)&lt;br /&gt;
**Every function now returns &amp;lt;&amp;gt; 0 if there is an error. Use SimpleSC::GetErrorMessage to get the message of a function result.&lt;br /&gt;
**Added function SimpleSC::GetErrorMessage to get the message of a function result.&lt;br /&gt;
**SimpleSC::ExistsService results now 0 if the service exists and &amp;lt;&amp;gt; 0 if the service doensnÂ´t exists.&lt;br /&gt;
**SimpleSC::RestartService supports now arguments.&lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: The signature has been changed. If you update from a previous version you must check your parameters.&lt;br /&gt;
*Version 1.10 (ANSI) (2008-01-29)&lt;br /&gt;
**SimpleSC::InstallService supports now more than one dependencies (delimitter is the forward slash).&lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: The signature has been changed. If you update from a previous version you must check your parameters.&lt;br /&gt;
**SimpleSC::InstallService supports now more service types e.g. to create an interactive service.&lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: The signature has been changed. If you update from a previous version you must check your parameters.&lt;br /&gt;
**SimpleSC::StartService supports now arguments. &lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: The signature has been changed. If you update from a previous version you must check your parameters.&lt;br /&gt;
*Version 1.05 (ANSI) (2008-01-12)&lt;br /&gt;
**The functions SimpleSC::StopService and SimpleSC::RestartService are now improved. Now all dependent services are stopping recursively too.&lt;br /&gt;
*Version 1.04 (ANSI) (2007-08-07)&lt;br /&gt;
**Fixed bug for possible endless loops. This concerns to the functions StartService, StopService, ContinueService and PauseService. &lt;br /&gt;
*Version 1.03 (ANSI) (2007-08-02)&lt;br /&gt;
**Added function SimpleSC::GetServiceBinaryPath to get the binary path of a specified service.&lt;br /&gt;
*Version 1.02 (ANSI) (2007-05-29)&lt;br /&gt;
**Changed wrong documentation informations about the functions SimpleSC::InstallService and SimpleSC::RemoveService.&lt;br /&gt;
*Version 1.01 (ANSI) (2007-05-07)&lt;br /&gt;
**Changed wrong status-results in Readme.txt. This concerns to the functions ServiceIsPaused, ServiceIsRunning and ServiceIsStopped.&lt;br /&gt;
**Changed the access privileges of the plugin. The plugin now uses the lowest privlege of each function to execute.&lt;br /&gt;
*Version 1.0 (ANSI) (2007-05-02)&lt;br /&gt;
**First offical version&lt;br /&gt;
&lt;br /&gt;
== Important Notes ==&lt;br /&gt;
* Error codes are any non-zero value. For instance, if you attempt to start, stop, or query a service that does not exist, you may get the error code 1060.&lt;br /&gt;
*The function &amp;quot;SetServiceLogon&amp;quot; only works if the servicetype is &amp;quot;SERVICE_WIN32_OWN_PROCESS&amp;quot;.&lt;br /&gt;
* The functions &amp;quot;GetServiceDescription&amp;quot; or &amp;quot;SetServiceDescription&amp;quot; are only available on systems higher than Windows NT.&lt;br /&gt;
* The function &amp;quot;GetServiceFailureFlag&amp;quot;, &amp;quot;SetServiceFailureFlag&amp;quot;, &amp;quot;GetServiceDelayedAutoStartInfo&amp;quot; and &amp;quot;SetServiceDelayedAutoStartInfo&amp;quot; are only available on systems higher than Windows 2003.&lt;br /&gt;
* If you change the logon of an service to a new user you have to grant him the Service Logon Privilege. Otherwise the service cannot be started by the user you have assigned.&lt;br /&gt;
* The functions StartService, StopService, PauseService and ContinueService uses a timeout of 30 seconds. This means the function must be executed within 30 seconds, otherwise the functions will return an error.&lt;br /&gt;
* If you have any suggestions, comments or questions please mail me: mailto:rainer@speed-soft.de&lt;br /&gt;
&lt;br /&gt;
[[Category:Plugins]]&lt;/div&gt;</summary>
		<author><name>Speed78</name></author>
	</entry>
	<entry>
		<id>https://nsis.sourceforge.io/mediawiki/index.php?title=NSIS_Simple_Service_Plugin&amp;diff=25674</id>
		<title>NSIS Simple Service Plugin</title>
		<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/mediawiki/index.php?title=NSIS_Simple_Service_Plugin&amp;diff=25674"/>
		<updated>2021-05-02T18:12:01Z</updated>

		<summary type="html">&lt;p&gt;Speed78: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This plugin contains basic service functions like start, stop the service or checking the service status. It also contains advanced service functions for example setting the service description, changed the logon account, granting or removing the service logon privilege.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This plugin is using the MPL License or alternatively the LGPL License.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
The ZIP file containing a precompiled plugin DLL (to be saved in NSIS&#039; plugin directory) and the sources. &lt;br /&gt;
If you update from a previous version it is strongly &#039;&#039;&#039;recommend&#039;&#039;&#039; to take look at the changelog.&lt;br /&gt;
*Unicode Version (Recommend for &amp;gt;= NSIS 3.x): &amp;lt;attach&amp;gt;NSIS_Simple_Service_Plugin_Unicode_1.30.zip&amp;lt;/attach&amp;gt; &lt;br /&gt;
*ANSI Version (Recommend for &amp;lt; NSIS 3.x): &amp;lt;attach&amp;gt;NSIS_Simple_Service_Plugin_ANSI_1.30.zip&amp;lt;/attach&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Donation ==&lt;br /&gt;
If you believe that I am doing a good job and you want to support me please [http://www.speed-soft.de/donation/index.php?language=en donate] any amount via PayPal.&lt;br /&gt;
&lt;br /&gt;
== Short Reference ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
SimpleSC::InstallService [name_of_service] [display_name] [service_type] [start_type] &lt;br /&gt;
  [binary_path] [dependencies] [account] [password]&lt;br /&gt;
SimpleSC::RemoveService [name_of_service]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::StartService [name_of_service] [arguments] [timeout]&lt;br /&gt;
SimpleSC::StopService [name_of_service] [wait_for_file_release] [timeout]&lt;br /&gt;
SimpleSC::PauseService [name_of_service] [timeout]&lt;br /&gt;
SimpleSC::ContinueService [name_of_service] [timeout]&lt;br /&gt;
SimpleSC::RestartService [name_of_service] [arguments] [timeout]&lt;br /&gt;
SimpleSC::ExistsService [name_of_service]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::GetServiceDisplayName [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceName [display_name]&lt;br /&gt;
SimpleSC::GetServiceStatus [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceDescription [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceStartType [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceBinaryPath [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceLogon [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceFailure [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceFailureFlag [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceDelayedAutoStartInfo [name_of_service]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::SetServiceDescription [name_of_service] [service_description]&lt;br /&gt;
SimpleSC::SetServiceStartType [name_of_service] [start_type]&lt;br /&gt;
SimpleSC::SetServiceBinaryPath [name_of_service] [binary_path]&lt;br /&gt;
SimpleSC::SetServiceLogon [name_of_service] [account] [password]&lt;br /&gt;
SimpleSC::SetServiceFailure [name_of_service] [reset_period] [reboot_message] [command] &lt;br /&gt;
  [action_type_1] [action_delay_1] [action_type_2] [action_delay_2] [action_type_3] &lt;br /&gt;
  [action_delay_3]&lt;br /&gt;
SimpleSC::SetServiceFailureFlag [name_of_service] [failure_actions_on_non_crash_failures]&lt;br /&gt;
SimpleSC::SetServiceDelayedAutoStartInfo [name_of_service] [delayed_autostart]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::GrantServiceLogonPrivilege [account]&lt;br /&gt;
SimpleSC::RemoveServiceLogonPrivilege [account]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::ServiceIsPaused [name_of_service]&lt;br /&gt;
SimpleSC::ServiceIsRunning [name_of_service]&lt;br /&gt;
SimpleSC::ServiceIsStopped [name_of_service]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::GetErrorMessage [error_code]&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
*name_of_service - The name of the service used for Start/Stop commands and all further commands &lt;br /&gt;
*display_name - The name as shown in the service control manager applet in system control &lt;br /&gt;
*service_type - One of the following codes &lt;br /&gt;
**1 - SERVICE_KERNEL_DRIVER - Driver service.&lt;br /&gt;
**2 - SERVICE_FILE_SYSTEM_DRIVER - File system driver service.&lt;br /&gt;
**16 - SERVICE_WIN32_OWN_PROCESS - Service that runs in its own process. (Should be used in most cases)&lt;br /&gt;
**32 - SERVICE_WIN32_SHARE_PROCESS - Service that shares a process with one or more other services. &lt;br /&gt;
**256 - SERVICE_INTERACTIVE_PROCESS - The service can interact with the desktop. &lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: If you specify either SERVICE_WIN32_OWN_PROCESS or SERVICE_WIN32_SHARE_PROCESS,          and the service is running in the context of the LocalSystem account,          you can also specify this value. Example: SERVICE_WIN32_OWN_PROCESS or SERVICE_INTERACTIVE_PROCESS - (16 or 256) = 272&lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: Services cannot directly interact with a user as of Windows Vista.             Therefore, this technique should not be used in new code. See for more information: http://msdn2.microsoft.com/en-us/library/ms683502(VS.85).aspx          &lt;br /&gt;
&lt;br /&gt;
*start_type - one of the following codes &lt;br /&gt;
**0 - SERVICE_BOOT_START - Driver boot stage start &lt;br /&gt;
**1 - SERVICE_SYSTEM_START - Driver scm stage start &lt;br /&gt;
**2 - SERVICE_AUTO_START - Service auto start (Should be used in most cases)&lt;br /&gt;
**3 - SERVICE_DEMAND_START - Driver/service manual start &lt;br /&gt;
**4 - SERVICE_DISABLED - Driver/service disabled&lt;br /&gt;
*service_status - one of the following codes&lt;br /&gt;
**1 - SERVICE_STOPPED&lt;br /&gt;
**2 - SERVICE_START_PENDING&lt;br /&gt;
**3 - SERVICE_STOP_PENDING&lt;br /&gt;
**4 - SERVICE_RUNNING&lt;br /&gt;
**5 - SERVICE_CONTINUE_PENDING&lt;br /&gt;
**6 - SERVICE_PAUSE_PENDING&lt;br /&gt;
**7 - SERVICE_PAUSED&lt;br /&gt;
*binary_path - The path to the binary including all necessary parameters &lt;br /&gt;
*dependencies - Needed services, controls which services have to be started before this one; use the forward slash &amp;quot;/&amp;quot; to add more more than one service&lt;br /&gt;
*account - The username/account which should be used &lt;br /&gt;
*password - Password of the aforementioned account to be able to logon as a service &lt;br /&gt;
**&#039;&#039;&#039;Note&#039;&#039;&#039;: If you do not specify account/password, the local system account will be used to run the service&lt;br /&gt;
*arguments - Arguments passed to the service main function. &lt;br /&gt;
**&#039;&#039;&#039;Note&#039;&#039;&#039;: Driver services do not receive these arguments.&lt;br /&gt;
*reset_period - The time after which to reset the failure count to zero if there are no failures, in seconds. Specify 0 (INFINITE) to indicate that this value should never be reset&lt;br /&gt;
*reboot_message - The message to be broadcast to server users before rebooting&lt;br /&gt;
*command - The command line of the process to execute in response to the SC_ACTION_RUN_COMMAND service controller action. This process runs under the same account as the service&lt;br /&gt;
*timeout - Timeout in seconds of the function&lt;br /&gt;
*action_type_x - one of the following codes for the action to be performed&lt;br /&gt;
**0 - SC_ACTION_NONE - No action&lt;br /&gt;
**1 - SC_ACTION_RESTART - Restart the service&lt;br /&gt;
**2 - SC_ACTION_REBOOT - Reboot the computer (Note: The service user must have the SE_SHUTDOWN_NAME privilege)&lt;br /&gt;
**3 - SC_ACTION_RUN_COMMAND - Run a command&lt;br /&gt;
*action_delay_x - The time to wait before performing the specified action, in milliseconds&lt;br /&gt;
*failure_actions_on_non_crash_failures - This setting determines when failure actions are to be executed&lt;br /&gt;
**0 - The failure actions executed only if the service terminates without reporting a status of SERVICE_STOPPED&lt;br /&gt;
**1 - The failure actions executed if the status of a service is SERVICE_STOPPED but the exit code of the service is not 0&lt;br /&gt;
*delayed_autostart - The delayed auto-start setting of an auto-start service&lt;br /&gt;
**0 - The service will be started during system boot.&lt;br /&gt;
**1 - The service will be started after other auto-start services are started plus a short delay&lt;br /&gt;
*error_code - Error code of a function&lt;br /&gt;
*service_description - The description as shown in the service control manager applet in system control&lt;br /&gt;
*wait_for_file_release - Wait for file release after the service is stopped. This is useful if the binary file will be overwritten after stopping the service.&lt;br /&gt;
**0 - NO_WAIT - No wait for file release&lt;br /&gt;
**1 - WAIT - Wait for file release &lt;br /&gt;
**&#039;&#039;&#039;Note&#039;&#039;&#039;: If SERVICE_WIN32_OWN_PROCESS is used this option should be set to WAIT.	If SERVICE_WIN32_SHARE_PROCESS is used this option should only be set to WAIT if the last service in the process is stopped.&lt;br /&gt;
&lt;br /&gt;
== The Sample Script ==&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
; Install a service - ServiceType own process - StartType automatic - NoDependencies - Logon as System Account&lt;br /&gt;
  SimpleSC::InstallService &amp;quot;MyService&amp;quot; &amp;quot;My Service Display Name&amp;quot; &amp;quot;16&amp;quot; &amp;quot;2&amp;quot; &amp;quot;C:\MyPath\MyService.exe&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Install a service - ServiceType interact with desktop - StartType automatic - Dependencies on &amp;quot;Windows Time Service&amp;quot; (w32time) and &amp;quot;WWW Publishing Service&amp;quot; (w3svc) - Logon as System Account&lt;br /&gt;
  SimpleSC::InstallService &amp;quot;MyService&amp;quot; &amp;quot;My Service Display Name&amp;quot; &amp;quot;272&amp;quot; &amp;quot;2&amp;quot; &amp;quot;C:\MyPath\MyService.exe&amp;quot; &amp;quot;w32time/w3svc&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Remove a service&lt;br /&gt;
  SimpleSC::RemoveService &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Start a service. Be sure to pass the service name, not the display name.&lt;br /&gt;
  SimpleSC::StartService &amp;quot;MyService&amp;quot; &amp;quot;&amp;quot; 30&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Start a service with two arguments &amp;quot;/param1=true&amp;quot; &amp;quot;/param2=1&amp;quot;&lt;br /&gt;
  SimpleSC::StartService &amp;quot;MyService&amp;quot; &amp;quot;/param1=true /param2=1&amp;quot; 30&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
 &lt;br /&gt;
; Start a service with two arguments &amp;quot;-p param1&amp;quot; &amp;quot;-param2&amp;quot;&lt;br /&gt;
  SimpleSC::StartService &amp;quot;MyService&amp;quot; &#039;&amp;quot;-p param1&amp;quot; -param2&#039; 30&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Stop a service and waits for file release. Be sure to pass the service name, not the display name.&lt;br /&gt;
  SimpleSC::StopService &amp;quot;MyService&amp;quot; 1 30&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Stops two services and waits for file release after the last service is stopped&lt;br /&gt;
  SimpleSC::StopService &amp;quot;MyService1&amp;quot; 0 30&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  SimpleSC::StopService &amp;quot;MyService2&amp;quot; 1 30&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Pause a service&lt;br /&gt;
  SimpleSC::PauseService &amp;quot;MyService&amp;quot; 30&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Continue a service&lt;br /&gt;
  SimpleSC::ContinueService &amp;quot;MyService&amp;quot; 30&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Restart a service&lt;br /&gt;
  SimpleSC::RestartService &amp;quot;MyService&amp;quot; &amp;quot;&amp;quot; 30&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Restart a service with two arguments &amp;quot;/param1=true&amp;quot; &amp;quot;/param2=1&amp;quot;&lt;br /&gt;
  SimpleSC::RestartService &amp;quot;MyService&amp;quot; &amp;quot;/param1=true /param2=1&amp;quot; 30&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Start a service with two arguments &amp;quot;-p param1&amp;quot; &amp;quot;-param2&amp;quot;&lt;br /&gt;
  SimpleSC::RestartService &amp;quot;MyService&amp;quot; &#039;&amp;quot;-p param1&amp;quot; -param2&#039; 30&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Check if the service exists&lt;br /&gt;
  SimpleSC::ExistsService &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode if the service doesn´t exists (&amp;lt;&amp;gt;0)/service exists (0)&lt;br /&gt;
&lt;br /&gt;
; Get the displayname of a service&lt;br /&gt;
  SimpleSC::GetServiceDisplayName &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the displayname of the service&lt;br /&gt;
&lt;br /&gt;
; Get the servicename of a service by the displayname&lt;br /&gt;
  SimpleSC::GetServiceName &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the servicename of the service&lt;br /&gt;
&lt;br /&gt;
; Get the current status of a service&lt;br /&gt;
  SimpleSC::GetServiceStatus &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; return the status of the service (See &amp;quot;service_status&amp;quot; in the parameters)&lt;br /&gt;
&lt;br /&gt;
; Get the description of a service&lt;br /&gt;
  SimpleSC::GetServiceDescription &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the description of the service&lt;br /&gt;
 &lt;br /&gt;
; Get the start type of the service&lt;br /&gt;
  SimpleSC::GetServiceStartType &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the start type of the service (see &amp;quot;start_type&amp;quot; in the parameters)&lt;br /&gt;
&lt;br /&gt;
; Get the binary path of a service&lt;br /&gt;
  SimpleSC::GetServiceBinaryPath &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the binary path of the service&lt;br /&gt;
&lt;br /&gt;
; Get the logon user of the service&lt;br /&gt;
  SimpleSC::GetServiceLogon &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the logon username of the service  &lt;br /&gt;
&lt;br /&gt;
; Get the failure configuration of a service&lt;br /&gt;
  SimpleSC::GetServiceFailure &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the reset period &lt;br /&gt;
  Pop $2 ; returns the reboot message&lt;br /&gt;
  Pop $3 ; returns the command&lt;br /&gt;
  Pop $4 ; returns the first action (See &amp;quot;action_type_x&amp;quot; in the parameters)&lt;br /&gt;
  Pop $5 ; returns the first action delay &lt;br /&gt;
  Pop $6 ; returns the second action (See &amp;quot;action_type_x&amp;quot; in the parameters)&lt;br /&gt;
  Pop $7 ; returns the second action delay &lt;br /&gt;
  Pop $8 ; returns the third action (See &amp;quot;action_type_x&amp;quot; in the parameters)&lt;br /&gt;
  Pop $9 ; returns the third action delay &lt;br /&gt;
&lt;br /&gt;
; Get the failure flag configuration of a service&lt;br /&gt;
  SimpleSC::GetServiceFailureFlag &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the service flag&lt;br /&gt;
&lt;br /&gt;
; Get the delayed auto-start configuration of a service&lt;br /&gt;
  SimpleSC::GetServiceDelayedAutoStartInfo &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the delayed auto-start configuration&lt;br /&gt;
&lt;br /&gt;
; Set the description of a service&lt;br /&gt;
  SimpleSC::SetServiceDescription &amp;quot;MyService&amp;quot; &amp;quot;Sample Description&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Set the starttype to automatic of a service&lt;br /&gt;
  SimpleSC::SetServiceStartType &amp;quot;MyService&amp;quot; &amp;quot;2&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Sets the service binary path&lt;br /&gt;
  SimpleSC::SetServiceBinaryPath &amp;quot;MyService&amp;quot; &amp;quot;C:\MySoftware\MyService.exe&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Sets the service logon to a user and grant the user the &amp;quot;SeServiceLogonPrivilege&amp;quot;&lt;br /&gt;
  SimpleSC::SetServiceLogon &amp;quot;MyService&amp;quot; &amp;quot;MyServiceUser&amp;quot; &amp;quot;MyServiceUserPassword&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  IntCmp $0 0 +1 Done Done ; If successful grant the service logon privilege to &amp;quot;MyServiceUser&amp;quot;&lt;br /&gt;
    ; Note: Every serviceuser must have the ServiceLogonPrivilege to start the service&lt;br /&gt;
    SimpleSC::GrantServiceLogonPrivilege &amp;quot;MyServiceUser&amp;quot;&lt;br /&gt;
    Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Done:&lt;br /&gt;
&lt;br /&gt;
; Sets the service failure configuration - First action: Restart the service after one minute - Second action: Reboot the computer after five minutes&lt;br /&gt;
  SimpleSC::SetServiceFailure &amp;quot;MyService&amp;quot; &amp;quot;0&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;1&amp;quot; &amp;quot;60000&amp;quot; &amp;quot;2&amp;quot; &amp;quot;300000&amp;quot; &amp;quot;0&amp;quot; &amp;quot;0&amp;quot; &lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Sets the failure flag configuration of a service&lt;br /&gt;
  SimpleSC::SetServiceFailureFlag &amp;quot;MyService&amp;quot; &amp;quot;1&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Sets the delayed auto-start configuration of a service&lt;br /&gt;
  SimpleSC::SetServiceDelayedAutoStartInfo &amp;quot;MyService&amp;quot; &amp;quot;1&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Remove the &amp;quot;SeServiceLogonPrivilege&amp;quot; from a user&lt;br /&gt;
  SimpleSC::RemoveServiceLogonPrivilege &amp;quot;MyServiceUser&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Check if the service is paused&lt;br /&gt;
  SimpleSC::ServiceIsPaused &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns 1 (service is paused) - returns 0 (service is not paused)&lt;br /&gt;
&lt;br /&gt;
; Check if the service is running&lt;br /&gt;
  SimpleSC::ServiceIsRunning &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns 1 (service is running) - returns 0 (service is not running)&lt;br /&gt;
&lt;br /&gt;
; Check if the service is stopped&lt;br /&gt;
  SimpleSC::ServiceIsStopped &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns 1 (service is stopped) - returns 0 (service is not stopped)&lt;br /&gt;
&lt;br /&gt;
; Show the error message if a function fails &lt;br /&gt;
  SimpleSC::StopService &amp;quot;MyService&amp;quot; 1 30&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  IntCmp $0 0 Done +1 +1 &lt;br /&gt;
    Push $0&lt;br /&gt;
    SimpleSC::GetErrorMessage&lt;br /&gt;
    Pop $0&lt;br /&gt;
    MessageBox MB_OK|MB_ICONSTOP &amp;quot;Stopping fails - Reason: $0&amp;quot;&lt;br /&gt;
  Done:&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Changelog ==&lt;br /&gt;
*Version 1.30 (Unicode) (2021-05-02)&lt;br /&gt;
**Unicode Version added with the same functions like the ANSI version.&lt;br /&gt;
*Version 1.30 (ANSI) (2011-08-15)&lt;br /&gt;
**SimpleSC::RemoveService doesn&#039;t stop the service now.&lt;br /&gt;
**SimpleSC::StartService, SimpleSC::StopService, SimpleSC::PauseService, SimpleSC::ContinueService and SimpleSC::RestartService got a new &amp;quot;Timeout&amp;quot; parameter. It is recommend to use a timeout of 30.&lt;br /&gt;
*Version 1.29 (ANSI) (2011-04-16)&lt;br /&gt;
**SimpleSC::GetServiceFailureFlag added&lt;br /&gt;
**SimpleSC::SetServiceFailureFlag added&lt;br /&gt;
**SimpleSC::GetServiceDelayedAutoStartInfo added&lt;br /&gt;
**SimpleSC::SetServiceDelayedAutoStartInfo added&lt;br /&gt;
*Version 1.28 (ANSI) (2010-09-14)&lt;br /&gt;
**SimpleSC::GetServiceFailure function added&lt;br /&gt;
**SimpleSC::SetServiceFailure function added&lt;br /&gt;
**SimpleSC::StopService WaitForFileRelease feature added (For details take a look at the documentation)&lt;br /&gt;
*Version 1.27 (ANSI) (2010-03-23)&lt;br /&gt;
**Documentation updated&lt;br /&gt;
*Version 1.26 (ANSI) (2009-05-21)&lt;br /&gt;
**Fixed wait for status bug on starting, stopping, pausing or continuing a service &lt;br /&gt;
* Version 1.25 (ANSI) (2009-04-23)&lt;br /&gt;
**SimpleSC::SetServiceLogon supports now non-domain username without the &amp;quot;.\&amp;quot;-prefix&lt;br /&gt;
**SimpleSC::SetServiceBinaryPath function added&lt;br /&gt;
*Version 1.24 (ANSI) (2009-04-13)&lt;br /&gt;
**Fixed wait for status bug if the service status changed. Now, if a service stops, starts aso. the plugin will work like the recommendations in the MSDN.&lt;br /&gt;
*Version 1.23 (ANSI) (2008-08-23)&lt;br /&gt;
**Removed compiler optimization to avoid a false-positive virusscan.&lt;br /&gt;
*Version 1.22 (ANSI) (2008-08-17)&lt;br /&gt;
**SimpleSC::GrantServiceLogonPrivilege and SimpleSC::RemoveServiceLogonPrivilege works now correct with domain names like MyDomain\MyUser.&lt;br /&gt;
**Added function SimpleSC::GetServiceLogon to get the logon username of a service.&lt;br /&gt;
*Version 1.21 (2008-02-10)&lt;br /&gt;
**SimpleSC::ExistsService results now 0 if the service exists and &amp;lt;&amp;gt; 0 if the service doensnÂ´t exists.&lt;br /&gt;
*Version 1.20 (ANSI) (2008-02-05)&lt;br /&gt;
**Every function now returns &amp;lt;&amp;gt; 0 if there is an error. Use SimpleSC::GetErrorMessage to get the message of a function result.&lt;br /&gt;
**Added function SimpleSC::GetErrorMessage to get the message of a function result.&lt;br /&gt;
**SimpleSC::ExistsService results now 0 if the service exists and &amp;lt;&amp;gt; 0 if the service doensnÂ´t exists.&lt;br /&gt;
**SimpleSC::RestartService supports now arguments.&lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: The signature has been changed. If you update from a previous version you must check your parameters.&lt;br /&gt;
*Version 1.10 (ANSI) (2008-01-29)&lt;br /&gt;
**SimpleSC::InstallService supports now more than one dependencies (delimitter is the forward slash).&lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: The signature has been changed. If you update from a previous version you must check your parameters.&lt;br /&gt;
**SimpleSC::InstallService supports now more service types e.g. to create an interactive service.&lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: The signature has been changed. If you update from a previous version you must check your parameters.&lt;br /&gt;
**SimpleSC::StartService supports now arguments. &lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: The signature has been changed. If you update from a previous version you must check your parameters.&lt;br /&gt;
*Version 1.05 (ANSI) (2008-01-12)&lt;br /&gt;
**The functions SimpleSC::StopService and SimpleSC::RestartService are now improved. Now all dependent services are stopping recursively too.&lt;br /&gt;
*Version 1.04 (ANSI) (2007-08-07)&lt;br /&gt;
**Fixed bug for possible endless loops. This concerns to the functions StartService, StopService, ContinueService and PauseService. &lt;br /&gt;
*Version 1.03 (ANSI) (2007-08-02)&lt;br /&gt;
**Added function SimpleSC::GetServiceBinaryPath to get the binary path of a specified service.&lt;br /&gt;
*Version 1.02 (ANSI) (2007-05-29)&lt;br /&gt;
**Changed wrong documentation informations about the functions SimpleSC::InstallService and SimpleSC::RemoveService.&lt;br /&gt;
*Version 1.01 (ANSI) (2007-05-07)&lt;br /&gt;
**Changed wrong status-results in Readme.txt. This concerns to the functions ServiceIsPaused, ServiceIsRunning and ServiceIsStopped.&lt;br /&gt;
**Changed the access privileges of the plugin. The plugin now uses the lowest privlege of each function to execute.&lt;br /&gt;
*Version 1.0 (ANSI) (2007-05-02)&lt;br /&gt;
**First offical version&lt;br /&gt;
&lt;br /&gt;
== Important Notes ==&lt;br /&gt;
* Error codes are any non-zero value. For instance, if you attempt to start, stop, or query a service that does not exist, you may get the error code 1060.&lt;br /&gt;
*The function &amp;quot;SetServiceLogon&amp;quot; only works if the servicetype is &amp;quot;SERVICE_WIN32_OWN_PROCESS&amp;quot;.&lt;br /&gt;
* The functions &amp;quot;GetServiceDescription&amp;quot; or &amp;quot;SetServiceDescription&amp;quot; are only available on systems higher than Windows NT.&lt;br /&gt;
* The function &amp;quot;GetServiceFailureFlag&amp;quot;, &amp;quot;SetServiceFailureFlag&amp;quot;, &amp;quot;GetServiceDelayedAutoStartInfo&amp;quot; and &amp;quot;SetServiceDelayedAutoStartInfo&amp;quot; are only available on systems higher than Windows 2003.&lt;br /&gt;
* If you change the logon of an service to a new user you have to grant him the Service Logon Privilege. Otherwise the service cannot be started by the user you have assigned.&lt;br /&gt;
* The functions StartService, StopService, PauseService and ContinueService uses a timeout of 30 seconds. This means the function must be executed within 30 seconds, otherwise the functions will return an error.&lt;br /&gt;
* If you have any suggestions, comments or questions please mail me: mailto:rainer@speed-soft.de&lt;br /&gt;
&lt;br /&gt;
[[Category:Plugins]]&lt;/div&gt;</summary>
		<author><name>Speed78</name></author>
	</entry>
	<entry>
		<id>https://nsis.sourceforge.io/mediawiki/index.php?title=File:NSIS_Simple_Service_Plugin_ANSI_1.30.zip&amp;diff=25673</id>
		<title>File:NSIS Simple Service Plugin ANSI 1.30.zip</title>
		<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/mediawiki/index.php?title=File:NSIS_Simple_Service_Plugin_ANSI_1.30.zip&amp;diff=25673"/>
		<updated>2021-05-02T18:09:21Z</updated>

		<summary type="html">&lt;p&gt;Speed78: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Speed78</name></author>
	</entry>
	<entry>
		<id>https://nsis.sourceforge.io/mediawiki/index.php?title=NSIS_Simple_Service_Plugin&amp;diff=25672</id>
		<title>NSIS Simple Service Plugin</title>
		<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/mediawiki/index.php?title=NSIS_Simple_Service_Plugin&amp;diff=25672"/>
		<updated>2021-05-02T18:05:25Z</updated>

		<summary type="html">&lt;p&gt;Speed78: /* Changelog */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This plugin contains basic service functions like start, stop the service or checking the service status. It also contains advanced service functions for example setting the service description, changed the logon account, granting or removing the service logon privilege.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This plugin is using the MPL License or alternatively the LGPL License.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
&amp;lt;attach&amp;gt;NSIS_Simple_Service_Plugin_1.30.zip&amp;lt;/attach&amp;gt; The ZIP file containing a precompiled plugin DLL (to be saved in NSIS&#039; plugin directory) and the sources. If you update from a previous version it is strongly &#039;&#039;&#039;recommend&#039;&#039;&#039; to take look at the changelog.&lt;br /&gt;
&lt;br /&gt;
== Donation ==&lt;br /&gt;
If you believe that I am doing a good job and you want to support me please [http://www.speed-soft.de/donation/index.php?language=en donate] any amount via PayPal.&lt;br /&gt;
&lt;br /&gt;
== Short Reference ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
SimpleSC::InstallService [name_of_service] [display_name] [service_type] [start_type] &lt;br /&gt;
  [binary_path] [dependencies] [account] [password]&lt;br /&gt;
SimpleSC::RemoveService [name_of_service]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::StartService [name_of_service] [arguments] [timeout]&lt;br /&gt;
SimpleSC::StopService [name_of_service] [wait_for_file_release] [timeout]&lt;br /&gt;
SimpleSC::PauseService [name_of_service] [timeout]&lt;br /&gt;
SimpleSC::ContinueService [name_of_service] [timeout]&lt;br /&gt;
SimpleSC::RestartService [name_of_service] [arguments] [timeout]&lt;br /&gt;
SimpleSC::ExistsService [name_of_service]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::GetServiceDisplayName [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceName [display_name]&lt;br /&gt;
SimpleSC::GetServiceStatus [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceDescription [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceStartType [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceBinaryPath [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceLogon [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceFailure [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceFailureFlag [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceDelayedAutoStartInfo [name_of_service]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::SetServiceDescription [name_of_service] [service_description]&lt;br /&gt;
SimpleSC::SetServiceStartType [name_of_service] [start_type]&lt;br /&gt;
SimpleSC::SetServiceBinaryPath [name_of_service] [binary_path]&lt;br /&gt;
SimpleSC::SetServiceLogon [name_of_service] [account] [password]&lt;br /&gt;
SimpleSC::SetServiceFailure [name_of_service] [reset_period] [reboot_message] [command] &lt;br /&gt;
  [action_type_1] [action_delay_1] [action_type_2] [action_delay_2] [action_type_3] &lt;br /&gt;
  [action_delay_3]&lt;br /&gt;
SimpleSC::SetServiceFailureFlag [name_of_service] [failure_actions_on_non_crash_failures]&lt;br /&gt;
SimpleSC::SetServiceDelayedAutoStartInfo [name_of_service] [delayed_autostart]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::GrantServiceLogonPrivilege [account]&lt;br /&gt;
SimpleSC::RemoveServiceLogonPrivilege [account]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::ServiceIsPaused [name_of_service]&lt;br /&gt;
SimpleSC::ServiceIsRunning [name_of_service]&lt;br /&gt;
SimpleSC::ServiceIsStopped [name_of_service]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::GetErrorMessage [error_code]&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
*name_of_service - The name of the service used for Start/Stop commands and all further commands &lt;br /&gt;
*display_name - The name as shown in the service control manager applet in system control &lt;br /&gt;
*service_type - One of the following codes &lt;br /&gt;
**1 - SERVICE_KERNEL_DRIVER - Driver service.&lt;br /&gt;
**2 - SERVICE_FILE_SYSTEM_DRIVER - File system driver service.&lt;br /&gt;
**16 - SERVICE_WIN32_OWN_PROCESS - Service that runs in its own process. (Should be used in most cases)&lt;br /&gt;
**32 - SERVICE_WIN32_SHARE_PROCESS - Service that shares a process with one or more other services. &lt;br /&gt;
**256 - SERVICE_INTERACTIVE_PROCESS - The service can interact with the desktop. &lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: If you specify either SERVICE_WIN32_OWN_PROCESS or SERVICE_WIN32_SHARE_PROCESS,          and the service is running in the context of the LocalSystem account,          you can also specify this value. Example: SERVICE_WIN32_OWN_PROCESS or SERVICE_INTERACTIVE_PROCESS - (16 or 256) = 272&lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: Services cannot directly interact with a user as of Windows Vista.             Therefore, this technique should not be used in new code. See for more information: http://msdn2.microsoft.com/en-us/library/ms683502(VS.85).aspx          &lt;br /&gt;
&lt;br /&gt;
*start_type - one of the following codes &lt;br /&gt;
**0 - SERVICE_BOOT_START - Driver boot stage start &lt;br /&gt;
**1 - SERVICE_SYSTEM_START - Driver scm stage start &lt;br /&gt;
**2 - SERVICE_AUTO_START - Service auto start (Should be used in most cases)&lt;br /&gt;
**3 - SERVICE_DEMAND_START - Driver/service manual start &lt;br /&gt;
**4 - SERVICE_DISABLED - Driver/service disabled&lt;br /&gt;
*service_status - one of the following codes&lt;br /&gt;
**1 - SERVICE_STOPPED&lt;br /&gt;
**2 - SERVICE_START_PENDING&lt;br /&gt;
**3 - SERVICE_STOP_PENDING&lt;br /&gt;
**4 - SERVICE_RUNNING&lt;br /&gt;
**5 - SERVICE_CONTINUE_PENDING&lt;br /&gt;
**6 - SERVICE_PAUSE_PENDING&lt;br /&gt;
**7 - SERVICE_PAUSED&lt;br /&gt;
*binary_path - The path to the binary including all necessary parameters &lt;br /&gt;
*dependencies - Needed services, controls which services have to be started before this one; use the forward slash &amp;quot;/&amp;quot; to add more more than one service&lt;br /&gt;
*account - The username/account which should be used &lt;br /&gt;
*password - Password of the aforementioned account to be able to logon as a service &lt;br /&gt;
**&#039;&#039;&#039;Note&#039;&#039;&#039;: If you do not specify account/password, the local system account will be used to run the service&lt;br /&gt;
*arguments - Arguments passed to the service main function. &lt;br /&gt;
**&#039;&#039;&#039;Note&#039;&#039;&#039;: Driver services do not receive these arguments.&lt;br /&gt;
*reset_period - The time after which to reset the failure count to zero if there are no failures, in seconds. Specify 0 (INFINITE) to indicate that this value should never be reset&lt;br /&gt;
*reboot_message - The message to be broadcast to server users before rebooting&lt;br /&gt;
*command - The command line of the process to execute in response to the SC_ACTION_RUN_COMMAND service controller action. This process runs under the same account as the service&lt;br /&gt;
*timeout - Timeout in seconds of the function&lt;br /&gt;
*action_type_x - one of the following codes for the action to be performed&lt;br /&gt;
**0 - SC_ACTION_NONE - No action&lt;br /&gt;
**1 - SC_ACTION_RESTART - Restart the service&lt;br /&gt;
**2 - SC_ACTION_REBOOT - Reboot the computer (Note: The service user must have the SE_SHUTDOWN_NAME privilege)&lt;br /&gt;
**3 - SC_ACTION_RUN_COMMAND - Run a command&lt;br /&gt;
*action_delay_x - The time to wait before performing the specified action, in milliseconds&lt;br /&gt;
*failure_actions_on_non_crash_failures - This setting determines when failure actions are to be executed&lt;br /&gt;
**0 - The failure actions executed only if the service terminates without reporting a status of SERVICE_STOPPED&lt;br /&gt;
**1 - The failure actions executed if the status of a service is SERVICE_STOPPED but the exit code of the service is not 0&lt;br /&gt;
*delayed_autostart - The delayed auto-start setting of an auto-start service&lt;br /&gt;
**0 - The service will be started during system boot.&lt;br /&gt;
**1 - The service will be started after other auto-start services are started plus a short delay&lt;br /&gt;
*error_code - Error code of a function&lt;br /&gt;
*service_description - The description as shown in the service control manager applet in system control&lt;br /&gt;
*wait_for_file_release - Wait for file release after the service is stopped. This is useful if the binary file will be overwritten after stopping the service.&lt;br /&gt;
**0 - NO_WAIT - No wait for file release&lt;br /&gt;
**1 - WAIT - Wait for file release &lt;br /&gt;
**&#039;&#039;&#039;Note&#039;&#039;&#039;: If SERVICE_WIN32_OWN_PROCESS is used this option should be set to WAIT.	If SERVICE_WIN32_SHARE_PROCESS is used this option should only be set to WAIT if the last service in the process is stopped.&lt;br /&gt;
&lt;br /&gt;
== The Sample Script ==&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
; Install a service - ServiceType own process - StartType automatic - NoDependencies - Logon as System Account&lt;br /&gt;
  SimpleSC::InstallService &amp;quot;MyService&amp;quot; &amp;quot;My Service Display Name&amp;quot; &amp;quot;16&amp;quot; &amp;quot;2&amp;quot; &amp;quot;C:\MyPath\MyService.exe&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Install a service - ServiceType interact with desktop - StartType automatic - Dependencies on &amp;quot;Windows Time Service&amp;quot; (w32time) and &amp;quot;WWW Publishing Service&amp;quot; (w3svc) - Logon as System Account&lt;br /&gt;
  SimpleSC::InstallService &amp;quot;MyService&amp;quot; &amp;quot;My Service Display Name&amp;quot; &amp;quot;272&amp;quot; &amp;quot;2&amp;quot; &amp;quot;C:\MyPath\MyService.exe&amp;quot; &amp;quot;w32time/w3svc&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Remove a service&lt;br /&gt;
  SimpleSC::RemoveService &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Start a service. Be sure to pass the service name, not the display name.&lt;br /&gt;
  SimpleSC::StartService &amp;quot;MyService&amp;quot; &amp;quot;&amp;quot; 30&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Start a service with two arguments &amp;quot;/param1=true&amp;quot; &amp;quot;/param2=1&amp;quot;&lt;br /&gt;
  SimpleSC::StartService &amp;quot;MyService&amp;quot; &amp;quot;/param1=true /param2=1&amp;quot; 30&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
 &lt;br /&gt;
; Start a service with two arguments &amp;quot;-p param1&amp;quot; &amp;quot;-param2&amp;quot;&lt;br /&gt;
  SimpleSC::StartService &amp;quot;MyService&amp;quot; &#039;&amp;quot;-p param1&amp;quot; -param2&#039; 30&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Stop a service and waits for file release. Be sure to pass the service name, not the display name.&lt;br /&gt;
  SimpleSC::StopService &amp;quot;MyService&amp;quot; 1 30&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Stops two services and waits for file release after the last service is stopped&lt;br /&gt;
  SimpleSC::StopService &amp;quot;MyService1&amp;quot; 0 30&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  SimpleSC::StopService &amp;quot;MyService2&amp;quot; 1 30&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Pause a service&lt;br /&gt;
  SimpleSC::PauseService &amp;quot;MyService&amp;quot; 30&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Continue a service&lt;br /&gt;
  SimpleSC::ContinueService &amp;quot;MyService&amp;quot; 30&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Restart a service&lt;br /&gt;
  SimpleSC::RestartService &amp;quot;MyService&amp;quot; &amp;quot;&amp;quot; 30&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Restart a service with two arguments &amp;quot;/param1=true&amp;quot; &amp;quot;/param2=1&amp;quot;&lt;br /&gt;
  SimpleSC::RestartService &amp;quot;MyService&amp;quot; &amp;quot;/param1=true /param2=1&amp;quot; 30&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Start a service with two arguments &amp;quot;-p param1&amp;quot; &amp;quot;-param2&amp;quot;&lt;br /&gt;
  SimpleSC::RestartService &amp;quot;MyService&amp;quot; &#039;&amp;quot;-p param1&amp;quot; -param2&#039; 30&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Check if the service exists&lt;br /&gt;
  SimpleSC::ExistsService &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode if the service doesn´t exists (&amp;lt;&amp;gt;0)/service exists (0)&lt;br /&gt;
&lt;br /&gt;
; Get the displayname of a service&lt;br /&gt;
  SimpleSC::GetServiceDisplayName &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the displayname of the service&lt;br /&gt;
&lt;br /&gt;
; Get the servicename of a service by the displayname&lt;br /&gt;
  SimpleSC::GetServiceName &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the servicename of the service&lt;br /&gt;
&lt;br /&gt;
; Get the current status of a service&lt;br /&gt;
  SimpleSC::GetServiceStatus &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; return the status of the service (See &amp;quot;service_status&amp;quot; in the parameters)&lt;br /&gt;
&lt;br /&gt;
; Get the description of a service&lt;br /&gt;
  SimpleSC::GetServiceDescription &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the description of the service&lt;br /&gt;
 &lt;br /&gt;
; Get the start type of the service&lt;br /&gt;
  SimpleSC::GetServiceStartType &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the start type of the service (see &amp;quot;start_type&amp;quot; in the parameters)&lt;br /&gt;
&lt;br /&gt;
; Get the binary path of a service&lt;br /&gt;
  SimpleSC::GetServiceBinaryPath &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the binary path of the service&lt;br /&gt;
&lt;br /&gt;
; Get the logon user of the service&lt;br /&gt;
  SimpleSC::GetServiceLogon &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the logon username of the service  &lt;br /&gt;
&lt;br /&gt;
; Get the failure configuration of a service&lt;br /&gt;
  SimpleSC::GetServiceFailure &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the reset period &lt;br /&gt;
  Pop $2 ; returns the reboot message&lt;br /&gt;
  Pop $3 ; returns the command&lt;br /&gt;
  Pop $4 ; returns the first action (See &amp;quot;action_type_x&amp;quot; in the parameters)&lt;br /&gt;
  Pop $5 ; returns the first action delay &lt;br /&gt;
  Pop $6 ; returns the second action (See &amp;quot;action_type_x&amp;quot; in the parameters)&lt;br /&gt;
  Pop $7 ; returns the second action delay &lt;br /&gt;
  Pop $8 ; returns the third action (See &amp;quot;action_type_x&amp;quot; in the parameters)&lt;br /&gt;
  Pop $9 ; returns the third action delay &lt;br /&gt;
&lt;br /&gt;
; Get the failure flag configuration of a service&lt;br /&gt;
  SimpleSC::GetServiceFailureFlag &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the service flag&lt;br /&gt;
&lt;br /&gt;
; Get the delayed auto-start configuration of a service&lt;br /&gt;
  SimpleSC::GetServiceDelayedAutoStartInfo &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the delayed auto-start configuration&lt;br /&gt;
&lt;br /&gt;
; Set the description of a service&lt;br /&gt;
  SimpleSC::SetServiceDescription &amp;quot;MyService&amp;quot; &amp;quot;Sample Description&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Set the starttype to automatic of a service&lt;br /&gt;
  SimpleSC::SetServiceStartType &amp;quot;MyService&amp;quot; &amp;quot;2&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Sets the service binary path&lt;br /&gt;
  SimpleSC::SetServiceBinaryPath &amp;quot;MyService&amp;quot; &amp;quot;C:\MySoftware\MyService.exe&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Sets the service logon to a user and grant the user the &amp;quot;SeServiceLogonPrivilege&amp;quot;&lt;br /&gt;
  SimpleSC::SetServiceLogon &amp;quot;MyService&amp;quot; &amp;quot;MyServiceUser&amp;quot; &amp;quot;MyServiceUserPassword&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  IntCmp $0 0 +1 Done Done ; If successful grant the service logon privilege to &amp;quot;MyServiceUser&amp;quot;&lt;br /&gt;
    ; Note: Every serviceuser must have the ServiceLogonPrivilege to start the service&lt;br /&gt;
    SimpleSC::GrantServiceLogonPrivilege &amp;quot;MyServiceUser&amp;quot;&lt;br /&gt;
    Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Done:&lt;br /&gt;
&lt;br /&gt;
; Sets the service failure configuration - First action: Restart the service after one minute - Second action: Reboot the computer after five minutes&lt;br /&gt;
  SimpleSC::SetServiceFailure &amp;quot;MyService&amp;quot; &amp;quot;0&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;1&amp;quot; &amp;quot;60000&amp;quot; &amp;quot;2&amp;quot; &amp;quot;300000&amp;quot; &amp;quot;0&amp;quot; &amp;quot;0&amp;quot; &lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Sets the failure flag configuration of a service&lt;br /&gt;
  SimpleSC::SetServiceFailureFlag &amp;quot;MyService&amp;quot; &amp;quot;1&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Sets the delayed auto-start configuration of a service&lt;br /&gt;
  SimpleSC::SetServiceDelayedAutoStartInfo &amp;quot;MyService&amp;quot; &amp;quot;1&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Remove the &amp;quot;SeServiceLogonPrivilege&amp;quot; from a user&lt;br /&gt;
  SimpleSC::RemoveServiceLogonPrivilege &amp;quot;MyServiceUser&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Check if the service is paused&lt;br /&gt;
  SimpleSC::ServiceIsPaused &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns 1 (service is paused) - returns 0 (service is not paused)&lt;br /&gt;
&lt;br /&gt;
; Check if the service is running&lt;br /&gt;
  SimpleSC::ServiceIsRunning &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns 1 (service is running) - returns 0 (service is not running)&lt;br /&gt;
&lt;br /&gt;
; Check if the service is stopped&lt;br /&gt;
  SimpleSC::ServiceIsStopped &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns 1 (service is stopped) - returns 0 (service is not stopped)&lt;br /&gt;
&lt;br /&gt;
; Show the error message if a function fails &lt;br /&gt;
  SimpleSC::StopService &amp;quot;MyService&amp;quot; 1 30&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  IntCmp $0 0 Done +1 +1 &lt;br /&gt;
    Push $0&lt;br /&gt;
    SimpleSC::GetErrorMessage&lt;br /&gt;
    Pop $0&lt;br /&gt;
    MessageBox MB_OK|MB_ICONSTOP &amp;quot;Stopping fails - Reason: $0&amp;quot;&lt;br /&gt;
  Done:&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Changelog ==&lt;br /&gt;
*Version 1.30 (Unicode) (2021-05-02)&lt;br /&gt;
**Unicode Version added with the same functions like the ANSI version.&lt;br /&gt;
*Version 1.30 (ANSI) (2011-08-15)&lt;br /&gt;
**SimpleSC::RemoveService doesn&#039;t stop the service now.&lt;br /&gt;
**SimpleSC::StartService, SimpleSC::StopService, SimpleSC::PauseService, SimpleSC::ContinueService and SimpleSC::RestartService got a new &amp;quot;Timeout&amp;quot; parameter. It is recommend to use a timeout of 30.&lt;br /&gt;
*Version 1.29 (ANSI) (2011-04-16)&lt;br /&gt;
**SimpleSC::GetServiceFailureFlag added&lt;br /&gt;
**SimpleSC::SetServiceFailureFlag added&lt;br /&gt;
**SimpleSC::GetServiceDelayedAutoStartInfo added&lt;br /&gt;
**SimpleSC::SetServiceDelayedAutoStartInfo added&lt;br /&gt;
*Version 1.28 (ANSI) (2010-09-14)&lt;br /&gt;
**SimpleSC::GetServiceFailure function added&lt;br /&gt;
**SimpleSC::SetServiceFailure function added&lt;br /&gt;
**SimpleSC::StopService WaitForFileRelease feature added (For details take a look at the documentation)&lt;br /&gt;
*Version 1.27 (ANSI) (2010-03-23)&lt;br /&gt;
**Documentation updated&lt;br /&gt;
*Version 1.26 (ANSI) (2009-05-21)&lt;br /&gt;
**Fixed wait for status bug on starting, stopping, pausing or continuing a service &lt;br /&gt;
* Version 1.25 (ANSI) (2009-04-23)&lt;br /&gt;
**SimpleSC::SetServiceLogon supports now non-domain username without the &amp;quot;.\&amp;quot;-prefix&lt;br /&gt;
**SimpleSC::SetServiceBinaryPath function added&lt;br /&gt;
*Version 1.24 (ANSI) (2009-04-13)&lt;br /&gt;
**Fixed wait for status bug if the service status changed. Now, if a service stops, starts aso. the plugin will work like the recommendations in the MSDN.&lt;br /&gt;
*Version 1.23 (ANSI) (2008-08-23)&lt;br /&gt;
**Removed compiler optimization to avoid a false-positive virusscan.&lt;br /&gt;
*Version 1.22 (ANSI) (2008-08-17)&lt;br /&gt;
**SimpleSC::GrantServiceLogonPrivilege and SimpleSC::RemoveServiceLogonPrivilege works now correct with domain names like MyDomain\MyUser.&lt;br /&gt;
**Added function SimpleSC::GetServiceLogon to get the logon username of a service.&lt;br /&gt;
*Version 1.21 (2008-02-10)&lt;br /&gt;
**SimpleSC::ExistsService results now 0 if the service exists and &amp;lt;&amp;gt; 0 if the service doensnÂ´t exists.&lt;br /&gt;
*Version 1.20 (ANSI) (2008-02-05)&lt;br /&gt;
**Every function now returns &amp;lt;&amp;gt; 0 if there is an error. Use SimpleSC::GetErrorMessage to get the message of a function result.&lt;br /&gt;
**Added function SimpleSC::GetErrorMessage to get the message of a function result.&lt;br /&gt;
**SimpleSC::ExistsService results now 0 if the service exists and &amp;lt;&amp;gt; 0 if the service doensnÂ´t exists.&lt;br /&gt;
**SimpleSC::RestartService supports now arguments.&lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: The signature has been changed. If you update from a previous version you must check your parameters.&lt;br /&gt;
*Version 1.10 (ANSI) (2008-01-29)&lt;br /&gt;
**SimpleSC::InstallService supports now more than one dependencies (delimitter is the forward slash).&lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: The signature has been changed. If you update from a previous version you must check your parameters.&lt;br /&gt;
**SimpleSC::InstallService supports now more service types e.g. to create an interactive service.&lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: The signature has been changed. If you update from a previous version you must check your parameters.&lt;br /&gt;
**SimpleSC::StartService supports now arguments. &lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: The signature has been changed. If you update from a previous version you must check your parameters.&lt;br /&gt;
*Version 1.05 (ANSI) (2008-01-12)&lt;br /&gt;
**The functions SimpleSC::StopService and SimpleSC::RestartService are now improved. Now all dependent services are stopping recursively too.&lt;br /&gt;
*Version 1.04 (ANSI) (2007-08-07)&lt;br /&gt;
**Fixed bug for possible endless loops. This concerns to the functions StartService, StopService, ContinueService and PauseService. &lt;br /&gt;
*Version 1.03 (ANSI) (2007-08-02)&lt;br /&gt;
**Added function SimpleSC::GetServiceBinaryPath to get the binary path of a specified service.&lt;br /&gt;
*Version 1.02 (ANSI) (2007-05-29)&lt;br /&gt;
**Changed wrong documentation informations about the functions SimpleSC::InstallService and SimpleSC::RemoveService.&lt;br /&gt;
*Version 1.01 (ANSI) (2007-05-07)&lt;br /&gt;
**Changed wrong status-results in Readme.txt. This concerns to the functions ServiceIsPaused, ServiceIsRunning and ServiceIsStopped.&lt;br /&gt;
**Changed the access privileges of the plugin. The plugin now uses the lowest privlege of each function to execute.&lt;br /&gt;
*Version 1.0 (ANSI) (2007-05-02)&lt;br /&gt;
**First offical version&lt;br /&gt;
&lt;br /&gt;
== Important Notes ==&lt;br /&gt;
* Error codes are any non-zero value. For instance, if you attempt to start, stop, or query a service that does not exist, you may get the error code 1060.&lt;br /&gt;
*The function &amp;quot;SetServiceLogon&amp;quot; only works if the servicetype is &amp;quot;SERVICE_WIN32_OWN_PROCESS&amp;quot;.&lt;br /&gt;
* The functions &amp;quot;GetServiceDescription&amp;quot; or &amp;quot;SetServiceDescription&amp;quot; are only available on systems higher than Windows NT.&lt;br /&gt;
* The function &amp;quot;GetServiceFailureFlag&amp;quot;, &amp;quot;SetServiceFailureFlag&amp;quot;, &amp;quot;GetServiceDelayedAutoStartInfo&amp;quot; and &amp;quot;SetServiceDelayedAutoStartInfo&amp;quot; are only available on systems higher than Windows 2003.&lt;br /&gt;
* If you change the logon of an service to a new user you have to grant him the Service Logon Privilege. Otherwise the service cannot be started by the user you have assigned.&lt;br /&gt;
* The functions StartService, StopService, PauseService and ContinueService uses a timeout of 30 seconds. This means the function must be executed within 30 seconds, otherwise the functions will return an error.&lt;br /&gt;
* If you have any suggestions, comments or questions please mail me: mailto:rainer@speed-soft.de&lt;br /&gt;
&lt;br /&gt;
[[Category:Plugins]]&lt;/div&gt;</summary>
		<author><name>Speed78</name></author>
	</entry>
	<entry>
		<id>https://nsis.sourceforge.io/mediawiki/index.php?title=NSIS_Simple_Service_Plugin&amp;diff=25671</id>
		<title>NSIS Simple Service Plugin</title>
		<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/mediawiki/index.php?title=NSIS_Simple_Service_Plugin&amp;diff=25671"/>
		<updated>2021-05-02T18:03:02Z</updated>

		<summary type="html">&lt;p&gt;Speed78: /* Changelog */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This plugin contains basic service functions like start, stop the service or checking the service status. It also contains advanced service functions for example setting the service description, changed the logon account, granting or removing the service logon privilege.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This plugin is using the MPL License or alternatively the LGPL License.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
&amp;lt;attach&amp;gt;NSIS_Simple_Service_Plugin_1.30.zip&amp;lt;/attach&amp;gt; The ZIP file containing a precompiled plugin DLL (to be saved in NSIS&#039; plugin directory) and the sources. If you update from a previous version it is strongly &#039;&#039;&#039;recommend&#039;&#039;&#039; to take look at the changelog.&lt;br /&gt;
&lt;br /&gt;
== Donation ==&lt;br /&gt;
If you believe that I am doing a good job and you want to support me please [http://www.speed-soft.de/donation/index.php?language=en donate] any amount via PayPal.&lt;br /&gt;
&lt;br /&gt;
== Short Reference ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
SimpleSC::InstallService [name_of_service] [display_name] [service_type] [start_type] &lt;br /&gt;
  [binary_path] [dependencies] [account] [password]&lt;br /&gt;
SimpleSC::RemoveService [name_of_service]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::StartService [name_of_service] [arguments] [timeout]&lt;br /&gt;
SimpleSC::StopService [name_of_service] [wait_for_file_release] [timeout]&lt;br /&gt;
SimpleSC::PauseService [name_of_service] [timeout]&lt;br /&gt;
SimpleSC::ContinueService [name_of_service] [timeout]&lt;br /&gt;
SimpleSC::RestartService [name_of_service] [arguments] [timeout]&lt;br /&gt;
SimpleSC::ExistsService [name_of_service]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::GetServiceDisplayName [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceName [display_name]&lt;br /&gt;
SimpleSC::GetServiceStatus [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceDescription [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceStartType [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceBinaryPath [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceLogon [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceFailure [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceFailureFlag [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceDelayedAutoStartInfo [name_of_service]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::SetServiceDescription [name_of_service] [service_description]&lt;br /&gt;
SimpleSC::SetServiceStartType [name_of_service] [start_type]&lt;br /&gt;
SimpleSC::SetServiceBinaryPath [name_of_service] [binary_path]&lt;br /&gt;
SimpleSC::SetServiceLogon [name_of_service] [account] [password]&lt;br /&gt;
SimpleSC::SetServiceFailure [name_of_service] [reset_period] [reboot_message] [command] &lt;br /&gt;
  [action_type_1] [action_delay_1] [action_type_2] [action_delay_2] [action_type_3] &lt;br /&gt;
  [action_delay_3]&lt;br /&gt;
SimpleSC::SetServiceFailureFlag [name_of_service] [failure_actions_on_non_crash_failures]&lt;br /&gt;
SimpleSC::SetServiceDelayedAutoStartInfo [name_of_service] [delayed_autostart]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::GrantServiceLogonPrivilege [account]&lt;br /&gt;
SimpleSC::RemoveServiceLogonPrivilege [account]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::ServiceIsPaused [name_of_service]&lt;br /&gt;
SimpleSC::ServiceIsRunning [name_of_service]&lt;br /&gt;
SimpleSC::ServiceIsStopped [name_of_service]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::GetErrorMessage [error_code]&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
*name_of_service - The name of the service used for Start/Stop commands and all further commands &lt;br /&gt;
*display_name - The name as shown in the service control manager applet in system control &lt;br /&gt;
*service_type - One of the following codes &lt;br /&gt;
**1 - SERVICE_KERNEL_DRIVER - Driver service.&lt;br /&gt;
**2 - SERVICE_FILE_SYSTEM_DRIVER - File system driver service.&lt;br /&gt;
**16 - SERVICE_WIN32_OWN_PROCESS - Service that runs in its own process. (Should be used in most cases)&lt;br /&gt;
**32 - SERVICE_WIN32_SHARE_PROCESS - Service that shares a process with one or more other services. &lt;br /&gt;
**256 - SERVICE_INTERACTIVE_PROCESS - The service can interact with the desktop. &lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: If you specify either SERVICE_WIN32_OWN_PROCESS or SERVICE_WIN32_SHARE_PROCESS,          and the service is running in the context of the LocalSystem account,          you can also specify this value. Example: SERVICE_WIN32_OWN_PROCESS or SERVICE_INTERACTIVE_PROCESS - (16 or 256) = 272&lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: Services cannot directly interact with a user as of Windows Vista.             Therefore, this technique should not be used in new code. See for more information: http://msdn2.microsoft.com/en-us/library/ms683502(VS.85).aspx          &lt;br /&gt;
&lt;br /&gt;
*start_type - one of the following codes &lt;br /&gt;
**0 - SERVICE_BOOT_START - Driver boot stage start &lt;br /&gt;
**1 - SERVICE_SYSTEM_START - Driver scm stage start &lt;br /&gt;
**2 - SERVICE_AUTO_START - Service auto start (Should be used in most cases)&lt;br /&gt;
**3 - SERVICE_DEMAND_START - Driver/service manual start &lt;br /&gt;
**4 - SERVICE_DISABLED - Driver/service disabled&lt;br /&gt;
*service_status - one of the following codes&lt;br /&gt;
**1 - SERVICE_STOPPED&lt;br /&gt;
**2 - SERVICE_START_PENDING&lt;br /&gt;
**3 - SERVICE_STOP_PENDING&lt;br /&gt;
**4 - SERVICE_RUNNING&lt;br /&gt;
**5 - SERVICE_CONTINUE_PENDING&lt;br /&gt;
**6 - SERVICE_PAUSE_PENDING&lt;br /&gt;
**7 - SERVICE_PAUSED&lt;br /&gt;
*binary_path - The path to the binary including all necessary parameters &lt;br /&gt;
*dependencies - Needed services, controls which services have to be started before this one; use the forward slash &amp;quot;/&amp;quot; to add more more than one service&lt;br /&gt;
*account - The username/account which should be used &lt;br /&gt;
*password - Password of the aforementioned account to be able to logon as a service &lt;br /&gt;
**&#039;&#039;&#039;Note&#039;&#039;&#039;: If you do not specify account/password, the local system account will be used to run the service&lt;br /&gt;
*arguments - Arguments passed to the service main function. &lt;br /&gt;
**&#039;&#039;&#039;Note&#039;&#039;&#039;: Driver services do not receive these arguments.&lt;br /&gt;
*reset_period - The time after which to reset the failure count to zero if there are no failures, in seconds. Specify 0 (INFINITE) to indicate that this value should never be reset&lt;br /&gt;
*reboot_message - The message to be broadcast to server users before rebooting&lt;br /&gt;
*command - The command line of the process to execute in response to the SC_ACTION_RUN_COMMAND service controller action. This process runs under the same account as the service&lt;br /&gt;
*timeout - Timeout in seconds of the function&lt;br /&gt;
*action_type_x - one of the following codes for the action to be performed&lt;br /&gt;
**0 - SC_ACTION_NONE - No action&lt;br /&gt;
**1 - SC_ACTION_RESTART - Restart the service&lt;br /&gt;
**2 - SC_ACTION_REBOOT - Reboot the computer (Note: The service user must have the SE_SHUTDOWN_NAME privilege)&lt;br /&gt;
**3 - SC_ACTION_RUN_COMMAND - Run a command&lt;br /&gt;
*action_delay_x - The time to wait before performing the specified action, in milliseconds&lt;br /&gt;
*failure_actions_on_non_crash_failures - This setting determines when failure actions are to be executed&lt;br /&gt;
**0 - The failure actions executed only if the service terminates without reporting a status of SERVICE_STOPPED&lt;br /&gt;
**1 - The failure actions executed if the status of a service is SERVICE_STOPPED but the exit code of the service is not 0&lt;br /&gt;
*delayed_autostart - The delayed auto-start setting of an auto-start service&lt;br /&gt;
**0 - The service will be started during system boot.&lt;br /&gt;
**1 - The service will be started after other auto-start services are started plus a short delay&lt;br /&gt;
*error_code - Error code of a function&lt;br /&gt;
*service_description - The description as shown in the service control manager applet in system control&lt;br /&gt;
*wait_for_file_release - Wait for file release after the service is stopped. This is useful if the binary file will be overwritten after stopping the service.&lt;br /&gt;
**0 - NO_WAIT - No wait for file release&lt;br /&gt;
**1 - WAIT - Wait for file release &lt;br /&gt;
**&#039;&#039;&#039;Note&#039;&#039;&#039;: If SERVICE_WIN32_OWN_PROCESS is used this option should be set to WAIT.	If SERVICE_WIN32_SHARE_PROCESS is used this option should only be set to WAIT if the last service in the process is stopped.&lt;br /&gt;
&lt;br /&gt;
== The Sample Script ==&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
; Install a service - ServiceType own process - StartType automatic - NoDependencies - Logon as System Account&lt;br /&gt;
  SimpleSC::InstallService &amp;quot;MyService&amp;quot; &amp;quot;My Service Display Name&amp;quot; &amp;quot;16&amp;quot; &amp;quot;2&amp;quot; &amp;quot;C:\MyPath\MyService.exe&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Install a service - ServiceType interact with desktop - StartType automatic - Dependencies on &amp;quot;Windows Time Service&amp;quot; (w32time) and &amp;quot;WWW Publishing Service&amp;quot; (w3svc) - Logon as System Account&lt;br /&gt;
  SimpleSC::InstallService &amp;quot;MyService&amp;quot; &amp;quot;My Service Display Name&amp;quot; &amp;quot;272&amp;quot; &amp;quot;2&amp;quot; &amp;quot;C:\MyPath\MyService.exe&amp;quot; &amp;quot;w32time/w3svc&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Remove a service&lt;br /&gt;
  SimpleSC::RemoveService &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Start a service. Be sure to pass the service name, not the display name.&lt;br /&gt;
  SimpleSC::StartService &amp;quot;MyService&amp;quot; &amp;quot;&amp;quot; 30&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Start a service with two arguments &amp;quot;/param1=true&amp;quot; &amp;quot;/param2=1&amp;quot;&lt;br /&gt;
  SimpleSC::StartService &amp;quot;MyService&amp;quot; &amp;quot;/param1=true /param2=1&amp;quot; 30&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
 &lt;br /&gt;
; Start a service with two arguments &amp;quot;-p param1&amp;quot; &amp;quot;-param2&amp;quot;&lt;br /&gt;
  SimpleSC::StartService &amp;quot;MyService&amp;quot; &#039;&amp;quot;-p param1&amp;quot; -param2&#039; 30&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Stop a service and waits for file release. Be sure to pass the service name, not the display name.&lt;br /&gt;
  SimpleSC::StopService &amp;quot;MyService&amp;quot; 1 30&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Stops two services and waits for file release after the last service is stopped&lt;br /&gt;
  SimpleSC::StopService &amp;quot;MyService1&amp;quot; 0 30&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  SimpleSC::StopService &amp;quot;MyService2&amp;quot; 1 30&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Pause a service&lt;br /&gt;
  SimpleSC::PauseService &amp;quot;MyService&amp;quot; 30&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Continue a service&lt;br /&gt;
  SimpleSC::ContinueService &amp;quot;MyService&amp;quot; 30&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Restart a service&lt;br /&gt;
  SimpleSC::RestartService &amp;quot;MyService&amp;quot; &amp;quot;&amp;quot; 30&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Restart a service with two arguments &amp;quot;/param1=true&amp;quot; &amp;quot;/param2=1&amp;quot;&lt;br /&gt;
  SimpleSC::RestartService &amp;quot;MyService&amp;quot; &amp;quot;/param1=true /param2=1&amp;quot; 30&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Start a service with two arguments &amp;quot;-p param1&amp;quot; &amp;quot;-param2&amp;quot;&lt;br /&gt;
  SimpleSC::RestartService &amp;quot;MyService&amp;quot; &#039;&amp;quot;-p param1&amp;quot; -param2&#039; 30&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Check if the service exists&lt;br /&gt;
  SimpleSC::ExistsService &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode if the service doesn´t exists (&amp;lt;&amp;gt;0)/service exists (0)&lt;br /&gt;
&lt;br /&gt;
; Get the displayname of a service&lt;br /&gt;
  SimpleSC::GetServiceDisplayName &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the displayname of the service&lt;br /&gt;
&lt;br /&gt;
; Get the servicename of a service by the displayname&lt;br /&gt;
  SimpleSC::GetServiceName &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the servicename of the service&lt;br /&gt;
&lt;br /&gt;
; Get the current status of a service&lt;br /&gt;
  SimpleSC::GetServiceStatus &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; return the status of the service (See &amp;quot;service_status&amp;quot; in the parameters)&lt;br /&gt;
&lt;br /&gt;
; Get the description of a service&lt;br /&gt;
  SimpleSC::GetServiceDescription &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the description of the service&lt;br /&gt;
 &lt;br /&gt;
; Get the start type of the service&lt;br /&gt;
  SimpleSC::GetServiceStartType &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the start type of the service (see &amp;quot;start_type&amp;quot; in the parameters)&lt;br /&gt;
&lt;br /&gt;
; Get the binary path of a service&lt;br /&gt;
  SimpleSC::GetServiceBinaryPath &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the binary path of the service&lt;br /&gt;
&lt;br /&gt;
; Get the logon user of the service&lt;br /&gt;
  SimpleSC::GetServiceLogon &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the logon username of the service  &lt;br /&gt;
&lt;br /&gt;
; Get the failure configuration of a service&lt;br /&gt;
  SimpleSC::GetServiceFailure &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the reset period &lt;br /&gt;
  Pop $2 ; returns the reboot message&lt;br /&gt;
  Pop $3 ; returns the command&lt;br /&gt;
  Pop $4 ; returns the first action (See &amp;quot;action_type_x&amp;quot; in the parameters)&lt;br /&gt;
  Pop $5 ; returns the first action delay &lt;br /&gt;
  Pop $6 ; returns the second action (See &amp;quot;action_type_x&amp;quot; in the parameters)&lt;br /&gt;
  Pop $7 ; returns the second action delay &lt;br /&gt;
  Pop $8 ; returns the third action (See &amp;quot;action_type_x&amp;quot; in the parameters)&lt;br /&gt;
  Pop $9 ; returns the third action delay &lt;br /&gt;
&lt;br /&gt;
; Get the failure flag configuration of a service&lt;br /&gt;
  SimpleSC::GetServiceFailureFlag &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the service flag&lt;br /&gt;
&lt;br /&gt;
; Get the delayed auto-start configuration of a service&lt;br /&gt;
  SimpleSC::GetServiceDelayedAutoStartInfo &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the delayed auto-start configuration&lt;br /&gt;
&lt;br /&gt;
; Set the description of a service&lt;br /&gt;
  SimpleSC::SetServiceDescription &amp;quot;MyService&amp;quot; &amp;quot;Sample Description&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Set the starttype to automatic of a service&lt;br /&gt;
  SimpleSC::SetServiceStartType &amp;quot;MyService&amp;quot; &amp;quot;2&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Sets the service binary path&lt;br /&gt;
  SimpleSC::SetServiceBinaryPath &amp;quot;MyService&amp;quot; &amp;quot;C:\MySoftware\MyService.exe&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Sets the service logon to a user and grant the user the &amp;quot;SeServiceLogonPrivilege&amp;quot;&lt;br /&gt;
  SimpleSC::SetServiceLogon &amp;quot;MyService&amp;quot; &amp;quot;MyServiceUser&amp;quot; &amp;quot;MyServiceUserPassword&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  IntCmp $0 0 +1 Done Done ; If successful grant the service logon privilege to &amp;quot;MyServiceUser&amp;quot;&lt;br /&gt;
    ; Note: Every serviceuser must have the ServiceLogonPrivilege to start the service&lt;br /&gt;
    SimpleSC::GrantServiceLogonPrivilege &amp;quot;MyServiceUser&amp;quot;&lt;br /&gt;
    Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Done:&lt;br /&gt;
&lt;br /&gt;
; Sets the service failure configuration - First action: Restart the service after one minute - Second action: Reboot the computer after five minutes&lt;br /&gt;
  SimpleSC::SetServiceFailure &amp;quot;MyService&amp;quot; &amp;quot;0&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;1&amp;quot; &amp;quot;60000&amp;quot; &amp;quot;2&amp;quot; &amp;quot;300000&amp;quot; &amp;quot;0&amp;quot; &amp;quot;0&amp;quot; &lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Sets the failure flag configuration of a service&lt;br /&gt;
  SimpleSC::SetServiceFailureFlag &amp;quot;MyService&amp;quot; &amp;quot;1&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Sets the delayed auto-start configuration of a service&lt;br /&gt;
  SimpleSC::SetServiceDelayedAutoStartInfo &amp;quot;MyService&amp;quot; &amp;quot;1&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Remove the &amp;quot;SeServiceLogonPrivilege&amp;quot; from a user&lt;br /&gt;
  SimpleSC::RemoveServiceLogonPrivilege &amp;quot;MyServiceUser&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Check if the service is paused&lt;br /&gt;
  SimpleSC::ServiceIsPaused &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns 1 (service is paused) - returns 0 (service is not paused)&lt;br /&gt;
&lt;br /&gt;
; Check if the service is running&lt;br /&gt;
  SimpleSC::ServiceIsRunning &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns 1 (service is running) - returns 0 (service is not running)&lt;br /&gt;
&lt;br /&gt;
; Check if the service is stopped&lt;br /&gt;
  SimpleSC::ServiceIsStopped &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns 1 (service is stopped) - returns 0 (service is not stopped)&lt;br /&gt;
&lt;br /&gt;
; Show the error message if a function fails &lt;br /&gt;
  SimpleSC::StopService &amp;quot;MyService&amp;quot; 1 30&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  IntCmp $0 0 Done +1 +1 &lt;br /&gt;
    Push $0&lt;br /&gt;
    SimpleSC::GetErrorMessage&lt;br /&gt;
    Pop $0&lt;br /&gt;
    MessageBox MB_OK|MB_ICONSTOP &amp;quot;Stopping fails - Reason: $0&amp;quot;&lt;br /&gt;
  Done:&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Changelog ==&lt;br /&gt;
* Unicode: Version 1.30 (2021-05-02)&lt;br /&gt;
**Unicode Version added with the same functions like the ANSI version.&lt;br /&gt;
* Version 1.30 (2011-08-15)&lt;br /&gt;
**SimpleSC::RemoveService doesn&#039;t stop the service now.&lt;br /&gt;
**SimpleSC::StartService, SimpleSC::StopService, SimpleSC::PauseService, SimpleSC::ContinueService and SimpleSC::RestartService got a new &amp;quot;Timeout&amp;quot; parameter. It is recommend to use a timeout of 30.&lt;br /&gt;
* Version 1.29 (2011-04-16)&lt;br /&gt;
**SimpleSC::GetServiceFailureFlag added&lt;br /&gt;
**SimpleSC::SetServiceFailureFlag added&lt;br /&gt;
**SimpleSC::GetServiceDelayedAutoStartInfo added&lt;br /&gt;
**SimpleSC::SetServiceDelayedAutoStartInfo added&lt;br /&gt;
* Version 1.28 (2010-09-14)&lt;br /&gt;
**SimpleSC::GetServiceFailure function added&lt;br /&gt;
**SimpleSC::SetServiceFailure function added&lt;br /&gt;
**SimpleSC::StopService WaitForFileRelease feature added (For details take a look at the documentation)&lt;br /&gt;
* Version 1.27 (2010-03-23)&lt;br /&gt;
**Documentation updated&lt;br /&gt;
* Version 1.26 (2009-05-21)&lt;br /&gt;
**Fixed wait for status bug on starting, stopping, pausing or continuing a service &lt;br /&gt;
* Version 1.25 (2009-04-23)&lt;br /&gt;
**SimpleSC::SetServiceLogon supports now non-domain username without the &amp;quot;.\&amp;quot;-prefix&lt;br /&gt;
**SimpleSC::SetServiceBinaryPath function added&lt;br /&gt;
*Version 1.24 (2009-04-13)&lt;br /&gt;
**Fixed wait for status bug if the service status changed. Now, if a service stops, starts aso. the plugin will work like the recommendations in the MSDN.&lt;br /&gt;
*Version 1.23 (2008-08-23)&lt;br /&gt;
**Removed compiler optimization to avoid a false-positive virusscan.&lt;br /&gt;
*Version 1.22 (2008-08-17)&lt;br /&gt;
**SimpleSC::GrantServiceLogonPrivilege and SimpleSC::RemoveServiceLogonPrivilege works now correct with domain names like MyDomain\MyUser.&lt;br /&gt;
**Added function SimpleSC::GetServiceLogon to get the logon username of a service.&lt;br /&gt;
*Version 1.21 (2008-02-10)&lt;br /&gt;
**SimpleSC::ExistsService results now 0 if the service exists and &amp;lt;&amp;gt; 0 if the service doensnÂ´t exists.&lt;br /&gt;
*Version 1.20 (2008-02-05)&lt;br /&gt;
**Every function now returns &amp;lt;&amp;gt; 0 if there is an error. Use SimpleSC::GetErrorMessage to get the message of a function result.&lt;br /&gt;
**Added function SimpleSC::GetErrorMessage to get the message of a function result.&lt;br /&gt;
**SimpleSC::ExistsService results now 0 if the service exists and &amp;lt;&amp;gt; 0 if the service doensnÂ´t exists.&lt;br /&gt;
**SimpleSC::RestartService supports now arguments.&lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: The signature has been changed. If you update from a previous version you must check your parameters.&lt;br /&gt;
*Version 1.10 (2008-01-29)&lt;br /&gt;
**SimpleSC::InstallService supports now more than one dependencies (delimitter is the forward slash).&lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: The signature has been changed. If you update from a previous version you must check your parameters.&lt;br /&gt;
**SimpleSC::InstallService supports now more service types e.g. to create an interactive service.&lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: The signature has been changed. If you update from a previous version you must check your parameters.&lt;br /&gt;
**SimpleSC::StartService supports now arguments. &lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: The signature has been changed. If you update from a previous version you must check your parameters.&lt;br /&gt;
*Version 1.05 (2008-01-12)&lt;br /&gt;
**The functions SimpleSC::StopService and SimpleSC::RestartService are now improved. Now all dependent services are stopping recursively too.&lt;br /&gt;
*Version 1.04 (2007-08-07)&lt;br /&gt;
**Fixed bug for possible endless loops. This concerns to the functions StartService, StopService, ContinueService and PauseService. &lt;br /&gt;
*Version 1.03 (2007-08-02)&lt;br /&gt;
**Added function SimpleSC::GetServiceBinaryPath to get the binary path of a specified service.&lt;br /&gt;
*Version 1.02 (2007-05-29)&lt;br /&gt;
**Changed wrong documentation informations about the functions SimpleSC::InstallService and SimpleSC::RemoveService.&lt;br /&gt;
*Version 1.01 (2007-05-07)&lt;br /&gt;
**Changed wrong status-results in Readme.txt. This concerns to the functions ServiceIsPaused, ServiceIsRunning and ServiceIsStopped.&lt;br /&gt;
**Changed the access privileges of the plugin. The plugin now uses the lowest privlege of each function to execute.&lt;br /&gt;
*Version 1.0 (2007-05-02)&lt;br /&gt;
**First offical version&lt;br /&gt;
&lt;br /&gt;
== Important Notes ==&lt;br /&gt;
* Error codes are any non-zero value. For instance, if you attempt to start, stop, or query a service that does not exist, you may get the error code 1060.&lt;br /&gt;
*The function &amp;quot;SetServiceLogon&amp;quot; only works if the servicetype is &amp;quot;SERVICE_WIN32_OWN_PROCESS&amp;quot;.&lt;br /&gt;
* The functions &amp;quot;GetServiceDescription&amp;quot; or &amp;quot;SetServiceDescription&amp;quot; are only available on systems higher than Windows NT.&lt;br /&gt;
* The function &amp;quot;GetServiceFailureFlag&amp;quot;, &amp;quot;SetServiceFailureFlag&amp;quot;, &amp;quot;GetServiceDelayedAutoStartInfo&amp;quot; and &amp;quot;SetServiceDelayedAutoStartInfo&amp;quot; are only available on systems higher than Windows 2003.&lt;br /&gt;
* If you change the logon of an service to a new user you have to grant him the Service Logon Privilege. Otherwise the service cannot be started by the user you have assigned.&lt;br /&gt;
* The functions StartService, StopService, PauseService and ContinueService uses a timeout of 30 seconds. This means the function must be executed within 30 seconds, otherwise the functions will return an error.&lt;br /&gt;
* If you have any suggestions, comments or questions please mail me: mailto:rainer@speed-soft.de&lt;br /&gt;
&lt;br /&gt;
[[Category:Plugins]]&lt;/div&gt;</summary>
		<author><name>Speed78</name></author>
	</entry>
	<entry>
		<id>https://nsis.sourceforge.io/mediawiki/index.php?title=File:NSIS_Simple_Service_Plugin_Unicode_1.30.zip&amp;diff=25670</id>
		<title>File:NSIS Simple Service Plugin Unicode 1.30.zip</title>
		<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/mediawiki/index.php?title=File:NSIS_Simple_Service_Plugin_Unicode_1.30.zip&amp;diff=25670"/>
		<updated>2021-05-02T18:00:43Z</updated>

		<summary type="html">&lt;p&gt;Speed78: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Speed78</name></author>
	</entry>
	<entry>
		<id>https://nsis.sourceforge.io/mediawiki/index.php?title=NSIS_Simple_Firewall_Plugin&amp;diff=24361</id>
		<title>NSIS Simple Firewall Plugin</title>
		<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/mediawiki/index.php?title=NSIS_Simple_Firewall_Plugin&amp;diff=24361"/>
		<updated>2014-12-06T12:51:30Z</updated>

		<summary type="html">&lt;p&gt;Speed78: /* Changelog */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This plugin can be used to configure the Windows firewall. This plugin contains functions to enable, check, add or remove programs or ports to the firewall exception list. It also contains functions for checking the firewall status, enable or disable the firewall and so on.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This plugin is using the MPL License or alternatively the LGPL License.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
&amp;lt;attach&amp;gt;NSIS_Simple_Firewall_Plugin_1.20.zip&amp;lt;/attach&amp;gt; The ZIP file containing a precompiled plugin DLL (to be saved in NSIS&#039; plugin directory) and the sources.&lt;br /&gt;
&lt;br /&gt;
== Short Reference ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
SimpleFC::EnableDisableFirewall [status]&lt;br /&gt;
SimpleFC::IsFirewallEnabled  &lt;br /&gt;
 &lt;br /&gt;
SimpleFC::AllowDisallowExceptionsNotAllowed [status]&lt;br /&gt;
SimpleFC::AreExceptionsNotAllowed  &lt;br /&gt;
 &lt;br /&gt;
SimpleFC::EnableDisableNotifications [status]&lt;br /&gt;
SimpleFC::AreNotificationsEnabled  &lt;br /&gt;
 &lt;br /&gt;
SimpleFC::StartStopFirewallService [status]&lt;br /&gt;
SimpleFC::IsFirewallServiceRunning  &lt;br /&gt;
 &lt;br /&gt;
SimpleFC::AddPort [port] [name] [protocol] [scope] [ip_version] [remote_addresses] [status]&lt;br /&gt;
SimpleFC::IsPortAdded [port] [protocol]&lt;br /&gt;
SimpleFC::RemovePort [port] [protocol]&lt;br /&gt;
 &lt;br /&gt;
SimpleFC::IsPortEnabled [port] [protocol]&lt;br /&gt;
SimpleFC::EnableDisablePort [port] [protocol]&lt;br /&gt;
 &lt;br /&gt;
SimpleFC::AddApplication [name] [path] [scope] [ip_version] [remote_addresses] [status]&lt;br /&gt;
SimpleFC::IsApplicationAdded [path]&lt;br /&gt;
SimpleFC::RemoveApplication [path]&lt;br /&gt;
 &lt;br /&gt;
SimpleFC::IsApplicationEnabled [path]&lt;br /&gt;
SimpleFC::EnableDisableApplication [path]&lt;br /&gt;
&lt;br /&gt;
SimpleFC::RestoreDefaults&lt;br /&gt;
&lt;br /&gt;
SimpleFC::AllowDisallowIcmpOutboundDestinationUnreachable [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpRedirect [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpInboundEchoRequest [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpOutboundTimeExceeded [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpOutboundParameterProblem [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpOutboundSourceQuench [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpInboundRouterRequest [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpInboundTimestampRequest [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpInboundMaskRequest [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpOutboundPacketTooBig [status]&lt;br /&gt;
SimpleFC::IsIcmpTypeAllowed [ip_version] [local_address] [icmp_type]&lt;br /&gt;
&lt;br /&gt;
SimpleFC::AdvAddRule [name] [description] [protocol] [direction] &lt;br /&gt;
  [status] [profile] [action] [application] [service_name] [icmp_types_and_codes] &lt;br /&gt;
  [group] [local_ports] [remote_ports] [local_address] [remote_address]&lt;br /&gt;
SimpleFC::AdvRemoveRule [name]&lt;br /&gt;
SimpleFC::AdvExistsRule [name]&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
*port - TCP/UDP port which should be opened/closed&lt;br /&gt;
*name - The name of the application/port/rule&lt;br /&gt;
*description - Description of the rule&lt;br /&gt;
*protocol - One of the following protocol&lt;br /&gt;
**1 - ICMPv4&lt;br /&gt;
**6 - TCP&lt;br /&gt;
**17 - UDP&lt;br /&gt;
**58 - ICMPv6&lt;br /&gt;
**256 - Any protocol&lt;br /&gt;
*scope - One of the following scope&lt;br /&gt;
**0 - All networks&lt;br /&gt;
**1 - Only local subnets&lt;br /&gt;
**2 - Custom scope&lt;br /&gt;
**3 - Max scope&lt;br /&gt;
**NOTE: If you use custom you must define remote_addresses&lt;br /&gt;
*ip_version&lt;br /&gt;
**0 - IPv4&lt;br /&gt;
**1 - IPv6&lt;br /&gt;
**2 - Any version&lt;br /&gt;
*icmp_type&lt;br /&gt;
**3 - Outbound Destination Unreachable (ICMPv4)&lt;br /&gt;
**4 - Outbound Source Quench (ICMPv4)&lt;br /&gt;
**5 - Redirect (ICMPv4)&lt;br /&gt;
**8 - Inbound Echo Request (ICMPv4)&lt;br /&gt;
**9 - Inbound Router Request (ICMPv4)&lt;br /&gt;
**11 - Outbound Time Exceeded (ICMPv4)&lt;br /&gt;
**12 - Outbound Parameter Problem (ICMPv4)&lt;br /&gt;
**13 - Inbound Timespamp Request (ICMPv4)&lt;br /&gt;
**17 - Inbound Mask Request (ICMPv4)&lt;br /&gt;
**1 - Outbound Destination Unreachable (ICMPv6)&lt;br /&gt;
**2 - Outbound Packet Too Big (ICMPv6)&lt;br /&gt;
**3 - Outbound Time Exceeded (ICMPv6)&lt;br /&gt;
**4 - Outbound Parameter Problem (ICMPv6)&lt;br /&gt;
**128 - Inbound Echo Request (ICMPv6)&lt;br /&gt;
**137 - Redirect (ICMPv6)&lt;br /&gt;
*direction&lt;br /&gt;
**1 - In&lt;br /&gt;
**2 - Out&lt;br /&gt;
*profile&lt;br /&gt;
**1 - Domain &lt;br /&gt;
**2 - Private&lt;br /&gt;
**4 - Public&lt;br /&gt;
**2147483647 - All profiles&lt;br /&gt;
*action&lt;br /&gt;
**0 - Block&lt;br /&gt;
**1 - Allow&lt;br /&gt;
*application - Path of the application (can be empty)&lt;br /&gt;
servicename - Specifies the service name property of the application (can be empty). &lt;br /&gt;
**&#039;&#039;&#039;Note&#039;&#039;&#039;: A serviceName value of &amp;quot;*&amp;quot; indicates that a service, not an application, must be sending or receiving traffic.&lt;br /&gt;
*icmp_types_and_codes - Specified icmp types and codes (can be empty)&lt;br /&gt;
*group - Put the rule in this specified group (can be empty) &lt;br /&gt;
**&#039;&#039;&#039;Note&#039;&#039;&#039;: On Vista the group must the a resource string in a exe/dll e.g. &amp;quot;@C:\Program Files\My Application\myapp.exe,-10000&amp;quot;. On all other supported operating systems it can be a string value.&lt;br /&gt;
*local_ports - Local ports (The protocol property must be set before - Otherwise can be empty)&lt;br /&gt;
**&#039;&#039;&#039;Note&#039;&#039;&#039;: The following port keywords are valid addionally: &amp;quot;RPC&amp;quot;, &amp;quot;RPC-EPMap&amp;quot;, &amp;quot;Teredo&amp;quot;, &amp;quot;IPTLSIn&amp;quot;, &amp;quot;IPHTTPSIn&amp;quot; and &amp;quot;Ply2Disc&amp;quot;&lt;br /&gt;
*remote_ports - Remote ports (The protocol property must be set before - Otherwise can be empty)&lt;br /&gt;
**&#039;&#039;&#039;Note&#039;&#039;&#039;: The following port keywords are valid addionally: &amp;quot;RPC&amp;quot;, &amp;quot;RPC-EPMap&amp;quot;, &amp;quot;Teredo&amp;quot;, &amp;quot;IPTLSIn&amp;quot;, &amp;quot;IPHTTPSIn&amp;quot; and &amp;quot;Ply2Disc&amp;quot;&lt;br /&gt;
*local_address - Local addresses from which the port can listen for traffic (can be empty)&lt;br /&gt;
*remote_address - Remote addresses from which the port can listen for traffic (can be empty)&lt;br /&gt;
*status - Status of the port, application, rule, firewall or service for example enabled/disabled, start/stop or allow/disallow&lt;br /&gt;
**0 - Disabled, stop or disallow&lt;br /&gt;
**1 - Enabled, start, or allow&lt;br /&gt;
&lt;br /&gt;
== The Sample Script ==&lt;br /&gt;
In this script you can find the two most used functions. If you are searching for some special firewall exceptions please look at &amp;quot;The Sample Script (All Functions)&amp;quot;. &lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
; Add an application to the firewall exception list - All Networks - All IP Version - Enabled&lt;br /&gt;
  SimpleFC::AddApplication &amp;quot;My Application&amp;quot; &amp;quot;PathToApplication&amp;quot; 0 2 &amp;quot;&amp;quot; 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Remove an application from the firewall exception list&lt;br /&gt;
  SimpleFC::RemoveApplication &amp;quot;PathToApplication&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== The Sample Script (All Functions) ==&lt;br /&gt;
In this script you can find the examples of all functions provided by this plugin.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Add the port 37/TCP to the firewall exception list - All Networks - All IP Version - Enabled&lt;br /&gt;
  SimpleFC::AddPort 37 &amp;quot;My Application&amp;quot; 6 0 2 &amp;quot;&amp;quot; 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if the port 37/TCP is added to the firewall exception list&lt;br /&gt;
  SimpleFC::IsPortAdded 37 6&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Added/0=Not added&lt;br /&gt;
&lt;br /&gt;
; Remove the port 37/TCP from the firewall exception list&lt;br /&gt;
  SimpleFC::RemovePort 37 6&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if the port 37/TCP is enabled/disabled&lt;br /&gt;
  SimpleFC::IsPortEnabled 37 6&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Enabled/0=Not enabled&lt;br /&gt;
&lt;br /&gt;
; Disable the port 37/TCP&lt;br /&gt;
  SimpleFC::EnableDisablePort 37 6 0&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable the port 37/TCP&lt;br /&gt;
  SimpleFC::EnableDisablePort 37 6 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if an application is enabled/disabled&lt;br /&gt;
  SimpleFC::IsApplicationEnabled &amp;quot;PathToApplication&amp;quot; &lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Enabled/0=Not enabled&lt;br /&gt;
&lt;br /&gt;
; Disable the application&lt;br /&gt;
  SimpleFC::EnableDisableApplication &amp;quot;PathToApplication&amp;quot; 0&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable the application&lt;br /&gt;
  SimpleFC::EnableDisableApplication &amp;quot;PathToApplication&amp;quot; 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Add an application to the firewall exception list - All Networks - All IP Version - Enabled&lt;br /&gt;
  SimpleFC::AddApplication &amp;quot;My Application&amp;quot; &amp;quot;PathToApplication&amp;quot; 0 2 &amp;quot;&amp;quot; 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if the application is added to the firewall exception list&lt;br /&gt;
  SimpleFC::IsApplicationAdded &amp;quot;PathToApplication&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Added/0=Not added&lt;br /&gt;
&lt;br /&gt;
; Remove an application from the firewall exception list&lt;br /&gt;
  SimpleFC::RemoveApplication &amp;quot;PathToApplication&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Disable the windows firewall&lt;br /&gt;
  SimpleFC::EnableDisableFirewall 0&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable the windows firewall&lt;br /&gt;
  SimpleFC::EnableDisableFirewall 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if the firewall is enabled&lt;br /&gt;
  SimpleFC::IsFirewallEnabled &lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Enabled/0=Disabled&lt;br /&gt;
&lt;br /&gt;
; Enable exceptions are not allowed on the windows firewall&lt;br /&gt;
  SimpleFC::AllowDisallowExceptionsNotAllowed 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Disable exceptions are not allowed on the windows firewall&lt;br /&gt;
  SimpleFC::AllowDisallowExceptionsNotAllowed 0&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if exceptions are not allowed&lt;br /&gt;
  SimpleFC::AreExceptionsNotAllowed&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Exceptions are not allowed is &lt;br /&gt;
         ; activated/0=Exception are not allowed is deactivated&lt;br /&gt;
&lt;br /&gt;
; Enable notifications on the windows firewall&lt;br /&gt;
  SimpleFC::EnableDisableNotifications 1&lt;br /&gt;
&lt;br /&gt;
; Disable notifications on the windows firewall&lt;br /&gt;
  SimpleFC::EnableDisableNotifications 0&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if notifications are enabled/disabled&lt;br /&gt;
  SimpleFC::AreNotificationsEnabled &lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Enabled/0=Disabled&lt;br /&gt;
&lt;br /&gt;
; Starts the windows firewall service&lt;br /&gt;
  SimpleFC::StartStopFirewallService 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Stops the windows firewall service&lt;br /&gt;
  SimpleFC::StartStopFirewallService 0&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if windows firewall service is running&lt;br /&gt;
  SimpleFC::IsFirewallServiceRunning&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=IsRunning/0=Not Running&lt;br /&gt;
&lt;br /&gt;
; Sets the windows firewall to default settings&lt;br /&gt;
  SimpleFC::RestoreDefaults&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP outbound destination unreachable state&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpOutboundDestinationUnreachable 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP redirect state&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpRedirect 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP inbound echo request &lt;br /&gt;
  SimpleFC::AllowDisallowIcmpInboundEchoRequest 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP outbound time exceeded&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpOutboundTimeExceeded 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP outbound parameter problem&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpOutboundParameterProblem 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP outbound source quench&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpOutboundSourceQuench 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP inbound router request&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpInboundRouterRequest 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP inbound timestamp request&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpInboundTimestampRequest 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP inbound mask request&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpInboundMaskRequest 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP outbound packet too big&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpOutboundPacketTooBig 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if ICMPv4 echo request is allowed&lt;br /&gt;
  SimpleFC::IsIcmpTypeAllowed &amp;quot;0&amp;quot; &amp;quot;&amp;quot; &amp;quot;8&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Restricted/0=Not restricted&lt;br /&gt;
  Pop $2 ; return 1=Allowed/0=Not allowed &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Some example rules for the windows firewall with advanced security.&lt;br /&gt;
; Please note this functions are very powerful, so for a detailed &lt;br /&gt;
; description please read the windows firewall with advanced &lt;br /&gt;
; security api reference:&lt;br /&gt;
; http://msdn2.microsoft.com/en-us/library/aa365309.aspx&lt;br /&gt;
&lt;br /&gt;
; Adds an ICMPv4 rule to allow incoming echo reply messages (IcmpCodeAndType = 0:0)&lt;br /&gt;
  SimpleFC::AdvAddRule &amp;quot;Echo-Reply (ICMPv4 incoming)&amp;quot; \&lt;br /&gt;
    &amp;quot;Allows incoming Echo Replies messages.&amp;quot; &amp;quot;1&amp;quot; &amp;quot;1&amp;quot; &amp;quot;1&amp;quot; &amp;quot;7&amp;quot; &amp;quot;1&amp;quot; &amp;quot;&amp;quot; \ &lt;br /&gt;
    &amp;quot;&amp;quot; &amp;quot;0:0&amp;quot; &amp;quot;@PathToApplication,-10000&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Adds an ICMPv4 rule to allow incoming echo request messages (IcmpCodeAndType = 8:0)&lt;br /&gt;
  SimpleFC::AdvAddRule &amp;quot;Echo-Request (ICMPv4 incoming)&amp;quot; \&lt;br /&gt;
    &amp;quot;Allows incoming ICMP Echo messages.&amp;quot; &amp;quot;1&amp;quot; &amp;quot;1&amp;quot; &amp;quot;1&amp;quot; &amp;quot;7&amp;quot; &amp;quot;1&amp;quot; &amp;quot;&amp;quot; \&lt;br /&gt;
    &amp;quot;&amp;quot; &amp;quot;8:0&amp;quot; &amp;quot;@PathToApplication,-10000&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Add an application rule to allow incoming TCP access on this application&lt;br /&gt;
  SimpleFC::AdvAddRule &amp;quot;Incoming requests (TCP incoming)&amp;quot; \ &lt;br /&gt;
    &amp;quot;Allows incoming requests.&amp;quot; &amp;quot;6&amp;quot; &amp;quot;1&amp;quot; &amp;quot;1&amp;quot; &amp;quot;7&amp;quot; &amp;quot;1&amp;quot; &amp;quot;PathToApplication&amp;quot; \ &lt;br /&gt;
    &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;@PathToApplication,-10000&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Add an application rule to allow incoming UDP access on this application&lt;br /&gt;
  SimpleFC::AdvAddRule &amp;quot;Incoming requests (UDP incoming)&amp;quot; \&lt;br /&gt;
    &amp;quot;Allows incoming requests.&amp;quot; &amp;quot;17&amp;quot; &amp;quot;1&amp;quot; &amp;quot;1&amp;quot; &amp;quot;7&amp;quot; &amp;quot;1&amp;quot; &amp;quot;PathToApplication&amp;quot; \ &lt;br /&gt;
    &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;@PathToApplication,-10000&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Removes a firewall rule&lt;br /&gt;
  SimpleFC::AdvRemoveRule &amp;quot;Incoming requests (UDP incoming)&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if the firewall exists&lt;br /&gt;
  SimpleFC::AdvExistsRule &amp;quot;Incoming requests (UDP incoming)&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Exists/0=DoesnÂ´t exists&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Changelog ==&lt;br /&gt;
*Version 1.20 (2014-06-12)&lt;br /&gt;
**Added &amp;quot;ServiceName&amp;quot; parameter to function &amp;quot;AdvAddRule&amp;quot;&lt;br /&gt;
**Documentation updated&lt;br /&gt;
*Version 1.19 (2012-07-16)&lt;br /&gt;
**Documentation updated&lt;br /&gt;
*Version 1.18 (2010-02-23)&lt;br /&gt;
**Documentation updated&lt;br /&gt;
*Version 1.17 (2009-09-05)&lt;br /&gt;
**Added changes from the service manager&lt;br /&gt;
**The following functions are now case insensitive:&lt;br /&gt;
***SimpleFC::IsApplicationAdded&lt;br /&gt;
***SimpleFC::IsApplicationEnabled&lt;br /&gt;
***SimpleFC::EnableDisableApplication&lt;br /&gt;
***SimpleFC::AdvExistsRule&lt;br /&gt;
*Version 1.16 (2009-04-13)&lt;br /&gt;
**Added changes from the service manager&lt;br /&gt;
*Version 1.15 (2008-08-18)&lt;br /&gt;
**Added changes from the service manager and checked removed compiler optimization to avoid a false-positive virusscan.&lt;br /&gt;
*Version 1.14 (2008-02-05)&lt;br /&gt;
** Added changes from the service manager&lt;br /&gt;
*Version 1.13 (2008-01-29)&lt;br /&gt;
** Added changes from the service manager&lt;br /&gt;
*Version 1.12 (2007-11-13)&lt;br /&gt;
** Fixed wrong documentation about SimpleFC::AdvExistsRule&lt;br /&gt;
*Version 1.11 (2007-08-07)&lt;br /&gt;
** Fixed potential endless loop bug in SimpleFC::StartStopFirewallService&lt;br /&gt;
*Version 1.10 (2007-08-02)&lt;br /&gt;
** Added default firewall functions:&lt;br /&gt;
*** SimpleFC::RestoreDefaults&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpOutboundDestinationUnreachable&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpRedirect&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpInboundEchoRequest&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpOutboundTimeExceeded&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpOutboundParameterProblem&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpOutboundSourceQuench&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpInboundRouterRequest&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpInboundTimestampRequest&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpInboundMaskRequest&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpOutboundPacketTooBig&lt;br /&gt;
*** SimpleFC::IsIcmpTypeAllowed&lt;br /&gt;
** Added functions for Windows Firewall with Advanced Security&lt;br /&gt;
*** SimpleFC::AdvAddRule&lt;br /&gt;
*** SimpleFC::AdvRemoveRule&lt;br /&gt;
*** SimpleFC::AdvExistsRule&lt;br /&gt;
*Version 1.01 (2007-07-05)&lt;br /&gt;
**Changed missing documentation about the function SimpleFC::IsFirewallEnabled&lt;br /&gt;
*Version 1.0 (2007-05-02)&lt;br /&gt;
**First offical version&lt;br /&gt;
&lt;br /&gt;
== Important Notes ==&lt;br /&gt;
&lt;br /&gt;
*This plugin is running on Windows XP SP2, Windows 2003, Windows Vista, Windows 7, Windows 8, Windows Server 2012, Windows Server 8.1, Windows Server 2012 R2&lt;br /&gt;
*Before you execute some plugin commands it is recommend to check for windows firewall service is running (SimpleFC::IsFirewallServiceRunning).&lt;br /&gt;
*All functions with the prefix &amp;quot;Adv&amp;quot; are only for Windows Firewall with Advanced Security (Windows Vista and above). It is recommend to use these functions on the operating systems which supports the Windows Firewall with Advanced Security. Nethertheless, the default functions without the prefix &amp;quot;Adv&amp;quot; can be used.&lt;br /&gt;
* If you have any suggestions, comments or questions please mail me: mailto:rainer@speed-soft.de&lt;br /&gt;
&lt;br /&gt;
[[Category:Plugins]]&lt;/div&gt;</summary>
		<author><name>Speed78</name></author>
	</entry>
	<entry>
		<id>https://nsis.sourceforge.io/mediawiki/index.php?title=NSIS_Simple_Firewall_Plugin&amp;diff=24360</id>
		<title>NSIS Simple Firewall Plugin</title>
		<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/mediawiki/index.php?title=NSIS_Simple_Firewall_Plugin&amp;diff=24360"/>
		<updated>2014-12-06T12:43:18Z</updated>

		<summary type="html">&lt;p&gt;Speed78: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This plugin can be used to configure the Windows firewall. This plugin contains functions to enable, check, add or remove programs or ports to the firewall exception list. It also contains functions for checking the firewall status, enable or disable the firewall and so on.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This plugin is using the MPL License or alternatively the LGPL License.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
&amp;lt;attach&amp;gt;NSIS_Simple_Firewall_Plugin_1.20.zip&amp;lt;/attach&amp;gt; The ZIP file containing a precompiled plugin DLL (to be saved in NSIS&#039; plugin directory) and the sources.&lt;br /&gt;
&lt;br /&gt;
== Short Reference ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
SimpleFC::EnableDisableFirewall [status]&lt;br /&gt;
SimpleFC::IsFirewallEnabled  &lt;br /&gt;
 &lt;br /&gt;
SimpleFC::AllowDisallowExceptionsNotAllowed [status]&lt;br /&gt;
SimpleFC::AreExceptionsNotAllowed  &lt;br /&gt;
 &lt;br /&gt;
SimpleFC::EnableDisableNotifications [status]&lt;br /&gt;
SimpleFC::AreNotificationsEnabled  &lt;br /&gt;
 &lt;br /&gt;
SimpleFC::StartStopFirewallService [status]&lt;br /&gt;
SimpleFC::IsFirewallServiceRunning  &lt;br /&gt;
 &lt;br /&gt;
SimpleFC::AddPort [port] [name] [protocol] [scope] [ip_version] [remote_addresses] [status]&lt;br /&gt;
SimpleFC::IsPortAdded [port] [protocol]&lt;br /&gt;
SimpleFC::RemovePort [port] [protocol]&lt;br /&gt;
 &lt;br /&gt;
SimpleFC::IsPortEnabled [port] [protocol]&lt;br /&gt;
SimpleFC::EnableDisablePort [port] [protocol]&lt;br /&gt;
 &lt;br /&gt;
SimpleFC::AddApplication [name] [path] [scope] [ip_version] [remote_addresses] [status]&lt;br /&gt;
SimpleFC::IsApplicationAdded [path]&lt;br /&gt;
SimpleFC::RemoveApplication [path]&lt;br /&gt;
 &lt;br /&gt;
SimpleFC::IsApplicationEnabled [path]&lt;br /&gt;
SimpleFC::EnableDisableApplication [path]&lt;br /&gt;
&lt;br /&gt;
SimpleFC::RestoreDefaults&lt;br /&gt;
&lt;br /&gt;
SimpleFC::AllowDisallowIcmpOutboundDestinationUnreachable [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpRedirect [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpInboundEchoRequest [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpOutboundTimeExceeded [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpOutboundParameterProblem [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpOutboundSourceQuench [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpInboundRouterRequest [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpInboundTimestampRequest [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpInboundMaskRequest [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpOutboundPacketTooBig [status]&lt;br /&gt;
SimpleFC::IsIcmpTypeAllowed [ip_version] [local_address] [icmp_type]&lt;br /&gt;
&lt;br /&gt;
SimpleFC::AdvAddRule [name] [description] [protocol] [direction] &lt;br /&gt;
  [status] [profile] [action] [application] [service_name] [icmp_types_and_codes] &lt;br /&gt;
  [group] [local_ports] [remote_ports] [local_address] [remote_address]&lt;br /&gt;
SimpleFC::AdvRemoveRule [name]&lt;br /&gt;
SimpleFC::AdvExistsRule [name]&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
*port - TCP/UDP port which should be opened/closed&lt;br /&gt;
*name - The name of the application/port/rule&lt;br /&gt;
*description - Description of the rule&lt;br /&gt;
*protocol - One of the following protocol&lt;br /&gt;
**1 - ICMPv4&lt;br /&gt;
**6 - TCP&lt;br /&gt;
**17 - UDP&lt;br /&gt;
**58 - ICMPv6&lt;br /&gt;
**256 - Any protocol&lt;br /&gt;
*scope - One of the following scope&lt;br /&gt;
**0 - All networks&lt;br /&gt;
**1 - Only local subnets&lt;br /&gt;
**2 - Custom scope&lt;br /&gt;
**3 - Max scope&lt;br /&gt;
**NOTE: If you use custom you must define remote_addresses&lt;br /&gt;
*ip_version&lt;br /&gt;
**0 - IPv4&lt;br /&gt;
**1 - IPv6&lt;br /&gt;
**2 - Any version&lt;br /&gt;
*icmp_type&lt;br /&gt;
**3 - Outbound Destination Unreachable (ICMPv4)&lt;br /&gt;
**4 - Outbound Source Quench (ICMPv4)&lt;br /&gt;
**5 - Redirect (ICMPv4)&lt;br /&gt;
**8 - Inbound Echo Request (ICMPv4)&lt;br /&gt;
**9 - Inbound Router Request (ICMPv4)&lt;br /&gt;
**11 - Outbound Time Exceeded (ICMPv4)&lt;br /&gt;
**12 - Outbound Parameter Problem (ICMPv4)&lt;br /&gt;
**13 - Inbound Timespamp Request (ICMPv4)&lt;br /&gt;
**17 - Inbound Mask Request (ICMPv4)&lt;br /&gt;
**1 - Outbound Destination Unreachable (ICMPv6)&lt;br /&gt;
**2 - Outbound Packet Too Big (ICMPv6)&lt;br /&gt;
**3 - Outbound Time Exceeded (ICMPv6)&lt;br /&gt;
**4 - Outbound Parameter Problem (ICMPv6)&lt;br /&gt;
**128 - Inbound Echo Request (ICMPv6)&lt;br /&gt;
**137 - Redirect (ICMPv6)&lt;br /&gt;
*direction&lt;br /&gt;
**1 - In&lt;br /&gt;
**2 - Out&lt;br /&gt;
*profile&lt;br /&gt;
**1 - Domain &lt;br /&gt;
**2 - Private&lt;br /&gt;
**4 - Public&lt;br /&gt;
**2147483647 - All profiles&lt;br /&gt;
*action&lt;br /&gt;
**0 - Block&lt;br /&gt;
**1 - Allow&lt;br /&gt;
*application - Path of the application (can be empty)&lt;br /&gt;
servicename - Specifies the service name property of the application (can be empty). &lt;br /&gt;
**&#039;&#039;&#039;Note&#039;&#039;&#039;: A serviceName value of &amp;quot;*&amp;quot; indicates that a service, not an application, must be sending or receiving traffic.&lt;br /&gt;
*icmp_types_and_codes - Specified icmp types and codes (can be empty)&lt;br /&gt;
*group - Put the rule in this specified group (can be empty) &lt;br /&gt;
**&#039;&#039;&#039;Note&#039;&#039;&#039;: On Vista the group must the a resource string in a exe/dll e.g. &amp;quot;@C:\Program Files\My Application\myapp.exe,-10000&amp;quot;. On all other supported operating systems it can be a string value.&lt;br /&gt;
*local_ports - Local ports (The protocol property must be set before - Otherwise can be empty)&lt;br /&gt;
**&#039;&#039;&#039;Note&#039;&#039;&#039;: The following port keywords are valid addionally: &amp;quot;RPC&amp;quot;, &amp;quot;RPC-EPMap&amp;quot;, &amp;quot;Teredo&amp;quot;, &amp;quot;IPTLSIn&amp;quot;, &amp;quot;IPHTTPSIn&amp;quot; and &amp;quot;Ply2Disc&amp;quot;&lt;br /&gt;
*remote_ports - Remote ports (The protocol property must be set before - Otherwise can be empty)&lt;br /&gt;
**&#039;&#039;&#039;Note&#039;&#039;&#039;: The following port keywords are valid addionally: &amp;quot;RPC&amp;quot;, &amp;quot;RPC-EPMap&amp;quot;, &amp;quot;Teredo&amp;quot;, &amp;quot;IPTLSIn&amp;quot;, &amp;quot;IPHTTPSIn&amp;quot; and &amp;quot;Ply2Disc&amp;quot;&lt;br /&gt;
*local_address - Local addresses from which the port can listen for traffic (can be empty)&lt;br /&gt;
*remote_address - Remote addresses from which the port can listen for traffic (can be empty)&lt;br /&gt;
*status - Status of the port, application, rule, firewall or service for example enabled/disabled, start/stop or allow/disallow&lt;br /&gt;
**0 - Disabled, stop or disallow&lt;br /&gt;
**1 - Enabled, start, or allow&lt;br /&gt;
&lt;br /&gt;
== The Sample Script ==&lt;br /&gt;
In this script you can find the two most used functions. If you are searching for some special firewall exceptions please look at &amp;quot;The Sample Script (All Functions)&amp;quot;. &lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
; Add an application to the firewall exception list - All Networks - All IP Version - Enabled&lt;br /&gt;
  SimpleFC::AddApplication &amp;quot;My Application&amp;quot; &amp;quot;PathToApplication&amp;quot; 0 2 &amp;quot;&amp;quot; 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Remove an application from the firewall exception list&lt;br /&gt;
  SimpleFC::RemoveApplication &amp;quot;PathToApplication&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== The Sample Script (All Functions) ==&lt;br /&gt;
In this script you can find the examples of all functions provided by this plugin.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Add the port 37/TCP to the firewall exception list - All Networks - All IP Version - Enabled&lt;br /&gt;
  SimpleFC::AddPort 37 &amp;quot;My Application&amp;quot; 6 0 2 &amp;quot;&amp;quot; 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if the port 37/TCP is added to the firewall exception list&lt;br /&gt;
  SimpleFC::IsPortAdded 37 6&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Added/0=Not added&lt;br /&gt;
&lt;br /&gt;
; Remove the port 37/TCP from the firewall exception list&lt;br /&gt;
  SimpleFC::RemovePort 37 6&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if the port 37/TCP is enabled/disabled&lt;br /&gt;
  SimpleFC::IsPortEnabled 37 6&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Enabled/0=Not enabled&lt;br /&gt;
&lt;br /&gt;
; Disable the port 37/TCP&lt;br /&gt;
  SimpleFC::EnableDisablePort 37 6 0&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable the port 37/TCP&lt;br /&gt;
  SimpleFC::EnableDisablePort 37 6 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if an application is enabled/disabled&lt;br /&gt;
  SimpleFC::IsApplicationEnabled &amp;quot;PathToApplication&amp;quot; &lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Enabled/0=Not enabled&lt;br /&gt;
&lt;br /&gt;
; Disable the application&lt;br /&gt;
  SimpleFC::EnableDisableApplication &amp;quot;PathToApplication&amp;quot; 0&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable the application&lt;br /&gt;
  SimpleFC::EnableDisableApplication &amp;quot;PathToApplication&amp;quot; 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Add an application to the firewall exception list - All Networks - All IP Version - Enabled&lt;br /&gt;
  SimpleFC::AddApplication &amp;quot;My Application&amp;quot; &amp;quot;PathToApplication&amp;quot; 0 2 &amp;quot;&amp;quot; 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if the application is added to the firewall exception list&lt;br /&gt;
  SimpleFC::IsApplicationAdded &amp;quot;PathToApplication&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Added/0=Not added&lt;br /&gt;
&lt;br /&gt;
; Remove an application from the firewall exception list&lt;br /&gt;
  SimpleFC::RemoveApplication &amp;quot;PathToApplication&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Disable the windows firewall&lt;br /&gt;
  SimpleFC::EnableDisableFirewall 0&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable the windows firewall&lt;br /&gt;
  SimpleFC::EnableDisableFirewall 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if the firewall is enabled&lt;br /&gt;
  SimpleFC::IsFirewallEnabled &lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Enabled/0=Disabled&lt;br /&gt;
&lt;br /&gt;
; Enable exceptions are not allowed on the windows firewall&lt;br /&gt;
  SimpleFC::AllowDisallowExceptionsNotAllowed 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Disable exceptions are not allowed on the windows firewall&lt;br /&gt;
  SimpleFC::AllowDisallowExceptionsNotAllowed 0&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if exceptions are not allowed&lt;br /&gt;
  SimpleFC::AreExceptionsNotAllowed&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Exceptions are not allowed is &lt;br /&gt;
         ; activated/0=Exception are not allowed is deactivated&lt;br /&gt;
&lt;br /&gt;
; Enable notifications on the windows firewall&lt;br /&gt;
  SimpleFC::EnableDisableNotifications 1&lt;br /&gt;
&lt;br /&gt;
; Disable notifications on the windows firewall&lt;br /&gt;
  SimpleFC::EnableDisableNotifications 0&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if notifications are enabled/disabled&lt;br /&gt;
  SimpleFC::AreNotificationsEnabled &lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Enabled/0=Disabled&lt;br /&gt;
&lt;br /&gt;
; Starts the windows firewall service&lt;br /&gt;
  SimpleFC::StartStopFirewallService 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Stops the windows firewall service&lt;br /&gt;
  SimpleFC::StartStopFirewallService 0&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if windows firewall service is running&lt;br /&gt;
  SimpleFC::IsFirewallServiceRunning&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=IsRunning/0=Not Running&lt;br /&gt;
&lt;br /&gt;
; Sets the windows firewall to default settings&lt;br /&gt;
  SimpleFC::RestoreDefaults&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP outbound destination unreachable state&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpOutboundDestinationUnreachable 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP redirect state&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpRedirect 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP inbound echo request &lt;br /&gt;
  SimpleFC::AllowDisallowIcmpInboundEchoRequest 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP outbound time exceeded&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpOutboundTimeExceeded 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP outbound parameter problem&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpOutboundParameterProblem 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP outbound source quench&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpOutboundSourceQuench 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP inbound router request&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpInboundRouterRequest 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP inbound timestamp request&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpInboundTimestampRequest 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP inbound mask request&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpInboundMaskRequest 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP outbound packet too big&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpOutboundPacketTooBig 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if ICMPv4 echo request is allowed&lt;br /&gt;
  SimpleFC::IsIcmpTypeAllowed &amp;quot;0&amp;quot; &amp;quot;&amp;quot; &amp;quot;8&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Restricted/0=Not restricted&lt;br /&gt;
  Pop $2 ; return 1=Allowed/0=Not allowed &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Some example rules for the windows firewall with advanced security.&lt;br /&gt;
; Please note this functions are very powerful, so for a detailed &lt;br /&gt;
; description please read the windows firewall with advanced &lt;br /&gt;
; security api reference:&lt;br /&gt;
; http://msdn2.microsoft.com/en-us/library/aa365309.aspx&lt;br /&gt;
&lt;br /&gt;
; Adds an ICMPv4 rule to allow incoming echo reply messages (IcmpCodeAndType = 0:0)&lt;br /&gt;
  SimpleFC::AdvAddRule &amp;quot;Echo-Reply (ICMPv4 incoming)&amp;quot; \&lt;br /&gt;
    &amp;quot;Allows incoming Echo Replies messages.&amp;quot; &amp;quot;1&amp;quot; &amp;quot;1&amp;quot; &amp;quot;1&amp;quot; &amp;quot;7&amp;quot; &amp;quot;1&amp;quot; &amp;quot;&amp;quot; \ &lt;br /&gt;
    &amp;quot;&amp;quot; &amp;quot;0:0&amp;quot; &amp;quot;@PathToApplication,-10000&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Adds an ICMPv4 rule to allow incoming echo request messages (IcmpCodeAndType = 8:0)&lt;br /&gt;
  SimpleFC::AdvAddRule &amp;quot;Echo-Request (ICMPv4 incoming)&amp;quot; \&lt;br /&gt;
    &amp;quot;Allows incoming ICMP Echo messages.&amp;quot; &amp;quot;1&amp;quot; &amp;quot;1&amp;quot; &amp;quot;1&amp;quot; &amp;quot;7&amp;quot; &amp;quot;1&amp;quot; &amp;quot;&amp;quot; \&lt;br /&gt;
    &amp;quot;&amp;quot; &amp;quot;8:0&amp;quot; &amp;quot;@PathToApplication,-10000&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Add an application rule to allow incoming TCP access on this application&lt;br /&gt;
  SimpleFC::AdvAddRule &amp;quot;Incoming requests (TCP incoming)&amp;quot; \ &lt;br /&gt;
    &amp;quot;Allows incoming requests.&amp;quot; &amp;quot;6&amp;quot; &amp;quot;1&amp;quot; &amp;quot;1&amp;quot; &amp;quot;7&amp;quot; &amp;quot;1&amp;quot; &amp;quot;PathToApplication&amp;quot; \ &lt;br /&gt;
    &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;@PathToApplication,-10000&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Add an application rule to allow incoming UDP access on this application&lt;br /&gt;
  SimpleFC::AdvAddRule &amp;quot;Incoming requests (UDP incoming)&amp;quot; \&lt;br /&gt;
    &amp;quot;Allows incoming requests.&amp;quot; &amp;quot;17&amp;quot; &amp;quot;1&amp;quot; &amp;quot;1&amp;quot; &amp;quot;7&amp;quot; &amp;quot;1&amp;quot; &amp;quot;PathToApplication&amp;quot; \ &lt;br /&gt;
    &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;@PathToApplication,-10000&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Removes a firewall rule&lt;br /&gt;
  SimpleFC::AdvRemoveRule &amp;quot;Incoming requests (UDP incoming)&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if the firewall exists&lt;br /&gt;
  SimpleFC::AdvExistsRule &amp;quot;Incoming requests (UDP incoming)&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Exists/0=DoesnÂ´t exists&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Changelog ==&lt;br /&gt;
*Version 1.19 (2012-07-16)&lt;br /&gt;
**Documentation updated&lt;br /&gt;
*Version 1.18 (2010-02-23)&lt;br /&gt;
**Documentation updated&lt;br /&gt;
*Version 1.17 (2009-09-05)&lt;br /&gt;
**Added changes from the service manager&lt;br /&gt;
**The following functions are now case insensitive:&lt;br /&gt;
***SimpleFC::IsApplicationAdded&lt;br /&gt;
***SimpleFC::IsApplicationEnabled&lt;br /&gt;
***SimpleFC::EnableDisableApplication&lt;br /&gt;
***SimpleFC::AdvExistsRule&lt;br /&gt;
*Version 1.16 (2009-04-13)&lt;br /&gt;
**Added changes from the service manager&lt;br /&gt;
*Version 1.15 (2008-08-18)&lt;br /&gt;
**Added changes from the service manager and checked removed compiler optimization to avoid a false-positive virusscan.&lt;br /&gt;
*Version 1.14 (2008-02-05)&lt;br /&gt;
** Added changes from the service manager&lt;br /&gt;
*Version 1.13 (2008-01-29)&lt;br /&gt;
** Added changes from the service manager&lt;br /&gt;
*Version 1.12 (2007-11-13)&lt;br /&gt;
** Fixed wrong documentation about SimpleFC::AdvExistsRule&lt;br /&gt;
*Version 1.11 (2007-08-07)&lt;br /&gt;
** Fixed potential endless loop bug in SimpleFC::StartStopFirewallService&lt;br /&gt;
*Version 1.10 (2007-08-02)&lt;br /&gt;
** Added default firewall functions:&lt;br /&gt;
*** SimpleFC::RestoreDefaults&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpOutboundDestinationUnreachable&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpRedirect&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpInboundEchoRequest&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpOutboundTimeExceeded&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpOutboundParameterProblem&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpOutboundSourceQuench&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpInboundRouterRequest&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpInboundTimestampRequest&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpInboundMaskRequest&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpOutboundPacketTooBig&lt;br /&gt;
*** SimpleFC::IsIcmpTypeAllowed&lt;br /&gt;
** Added functions for Windows Firewall with Advanced Security&lt;br /&gt;
*** SimpleFC::AdvAddRule&lt;br /&gt;
*** SimpleFC::AdvRemoveRule&lt;br /&gt;
*** SimpleFC::AdvExistsRule&lt;br /&gt;
*Version 1.01 (2007-07-05)&lt;br /&gt;
**Changed missing documentation about the function SimpleFC::IsFirewallEnabled&lt;br /&gt;
*Version 1.0 (2007-05-02)&lt;br /&gt;
**First offical version&lt;br /&gt;
&lt;br /&gt;
== Important Notes ==&lt;br /&gt;
&lt;br /&gt;
*This plugin is running on Windows XP SP2, Windows 2003, Windows Vista, Windows 7, Windows 8, Windows Server 2012, Windows Server 8.1, Windows Server 2012 R2&lt;br /&gt;
*Before you execute some plugin commands it is recommend to check for windows firewall service is running (SimpleFC::IsFirewallServiceRunning).&lt;br /&gt;
*All functions with the prefix &amp;quot;Adv&amp;quot; are only for Windows Firewall with Advanced Security (Windows Vista and above). It is recommend to use these functions on the operating systems which supports the Windows Firewall with Advanced Security. Nethertheless, the default functions without the prefix &amp;quot;Adv&amp;quot; can be used.&lt;br /&gt;
* If you have any suggestions, comments or questions please mail me: mailto:rainer@speed-soft.de&lt;br /&gt;
&lt;br /&gt;
[[Category:Plugins]]&lt;/div&gt;</summary>
		<author><name>Speed78</name></author>
	</entry>
	<entry>
		<id>https://nsis.sourceforge.io/mediawiki/index.php?title=File:NSIS_Simple_Firewall_Plugin_1.20.zip&amp;diff=24359</id>
		<title>File:NSIS Simple Firewall Plugin 1.20.zip</title>
		<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/mediawiki/index.php?title=File:NSIS_Simple_Firewall_Plugin_1.20.zip&amp;diff=24359"/>
		<updated>2014-12-06T12:42:43Z</updated>

		<summary type="html">&lt;p&gt;Speed78: Speed78 uploaded a new version of &amp;amp;quot;File:NSIS Simple Firewall Plugin 1.20.zip&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;NSIS Simple Firewall Plugin 1.20&lt;/div&gt;</summary>
		<author><name>Speed78</name></author>
	</entry>
	<entry>
		<id>https://nsis.sourceforge.io/mediawiki/index.php?title=File:NSIS_Simple_Firewall_Plugin_1.20.zip&amp;diff=24358</id>
		<title>File:NSIS Simple Firewall Plugin 1.20.zip</title>
		<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/mediawiki/index.php?title=File:NSIS_Simple_Firewall_Plugin_1.20.zip&amp;diff=24358"/>
		<updated>2014-12-06T12:35:23Z</updated>

		<summary type="html">&lt;p&gt;Speed78: NSIS Simple Firewall Plugin 1.20&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;NSIS Simple Firewall Plugin 1.20&lt;/div&gt;</summary>
		<author><name>Speed78</name></author>
	</entry>
	<entry>
		<id>https://nsis.sourceforge.io/mediawiki/index.php?title=Talk:NSIS_Simple_Firewall_Plugin&amp;diff=24137</id>
		<title>Talk:NSIS Simple Firewall Plugin</title>
		<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/mediawiki/index.php?title=Talk:NSIS_Simple_Firewall_Plugin&amp;diff=24137"/>
		<updated>2014-04-02T20:22:41Z</updated>

		<summary type="html">&lt;p&gt;Speed78: Blanked the page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Speed78</name></author>
	</entry>
	<entry>
		<id>https://nsis.sourceforge.io/mediawiki/index.php?title=NSIS_Simple_Firewall_Plugin&amp;diff=22172</id>
		<title>NSIS Simple Firewall Plugin</title>
		<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/mediawiki/index.php?title=NSIS_Simple_Firewall_Plugin&amp;diff=22172"/>
		<updated>2012-07-16T19:58:40Z</updated>

		<summary type="html">&lt;p&gt;Speed78: /* Changelog */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This plugin can be used to configure the Windows firewall. This plugin contains functions to enable, check, add or remove programs or ports to the firewall exception list. It also contains functions for checking the firewall status, enable or disable the firewall and so on.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This plugin is using the MPL License or alternatively the LGPL License.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
&amp;lt;attach&amp;gt;NSIS_Simple_Firewall_Plugin_1.19.zip&amp;lt;/attach&amp;gt; The ZIP file containing a precompiled plugin DLL (to be saved in NSIS&#039; plugin directory) and the sources.&lt;br /&gt;
&lt;br /&gt;
== Donation ==&lt;br /&gt;
If you believe that I am doing a good job and you want to support me please [http://www.speed-soft.de/donation/index.php?language=en donate] any amount via PayPal.&lt;br /&gt;
&lt;br /&gt;
== Short Reference ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
SimpleFC::EnableDisableFirewall [status]&lt;br /&gt;
SimpleFC::IsFirewallEnabled  &lt;br /&gt;
 &lt;br /&gt;
SimpleFC::AllowDisallowExceptionsNotAllowed [status]&lt;br /&gt;
SimpleFC::AreExceptionsNotAllowed  &lt;br /&gt;
 &lt;br /&gt;
SimpleFC::EnableDisableNotifications [status]&lt;br /&gt;
SimpleFC::AreNotificationsEnabled  &lt;br /&gt;
 &lt;br /&gt;
SimpleFC::StartStopFirewallService [status]&lt;br /&gt;
SimpleFC::IsFirewallServiceRunning  &lt;br /&gt;
 &lt;br /&gt;
SimpleFC::AddPort [port] [name] [protocol] [scope] [ip_version] [remote_addresses] [status]&lt;br /&gt;
SimpleFC::IsPortAdded [port] [protocol]&lt;br /&gt;
SimpleFC::RemovePort [port] [protocol]&lt;br /&gt;
 &lt;br /&gt;
SimpleFC::IsPortEnabled [port] [protocol]&lt;br /&gt;
SimpleFC::EnableDisablePort [port] [protocol]&lt;br /&gt;
 &lt;br /&gt;
SimpleFC::AddApplication [name] [path] [scope] [ip_version] [remote_addresses] [status]&lt;br /&gt;
SimpleFC::IsApplicationAdded [path]&lt;br /&gt;
SimpleFC::RemoveApplication [path]&lt;br /&gt;
 &lt;br /&gt;
SimpleFC::IsApplicationEnabled [path]&lt;br /&gt;
SimpleFC::EnableDisableApplication [path]&lt;br /&gt;
&lt;br /&gt;
SimpleFC::RestoreDefaults&lt;br /&gt;
&lt;br /&gt;
SimpleFC::AllowDisallowIcmpOutboundDestinationUnreachable [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpRedirect [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpInboundEchoRequest [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpOutboundTimeExceeded [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpOutboundParameterProblem [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpOutboundSourceQuench [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpInboundRouterRequest [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpInboundTimestampRequest [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpInboundMaskRequest [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpOutboundPacketTooBig [status]&lt;br /&gt;
SimpleFC::IsIcmpTypeAllowed [ip_version] [local_address] [icmp_type]&lt;br /&gt;
&lt;br /&gt;
SimpleFC::AdvAddRule [name] [description] [protocol] [direction] &lt;br /&gt;
  [status] [profile] [action] [application] [icmp_types_and_codes] &lt;br /&gt;
  [group] [local_ports] [remote_ports] [local_address] [remote_address]&lt;br /&gt;
SimpleFC::AdvRemoveRule [name]&lt;br /&gt;
SimpleFC::AdvExistsRule [name]&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
*port - TCP/UDP port which should be opened/closed&lt;br /&gt;
*name - The name of the application/port/rule&lt;br /&gt;
*description - Description of the rule&lt;br /&gt;
*protocol - One of the following protocol&lt;br /&gt;
**1 - ICMPv4&lt;br /&gt;
**6 - TCP&lt;br /&gt;
**17 - UDP&lt;br /&gt;
**58 - ICMPv6&lt;br /&gt;
**256 - Any protocol&lt;br /&gt;
*scope - One of the following scope&lt;br /&gt;
**0 - All networks&lt;br /&gt;
**1 - Only local subnets&lt;br /&gt;
**2 - Custom scope&lt;br /&gt;
**3 - Max scope&lt;br /&gt;
**NOTE: If you use custom you must define remote_addresses&lt;br /&gt;
*ip_version&lt;br /&gt;
**0 - IPv4&lt;br /&gt;
**1 - IPv6&lt;br /&gt;
**2 - Any version&lt;br /&gt;
*icmp_type&lt;br /&gt;
**3 - Outbound Destination Unreachable (ICMPv4)&lt;br /&gt;
**4 - Outbound Source Quench (ICMPv4)&lt;br /&gt;
**5 - Redirect (ICMPv4)&lt;br /&gt;
**8 - Inbound Echo Request (ICMPv4)&lt;br /&gt;
**9 - Inbound Router Request (ICMPv4)&lt;br /&gt;
**11 - Outbound Time Exceeded (ICMPv4)&lt;br /&gt;
**12 - Outbound Parameter Problem (ICMPv4)&lt;br /&gt;
**13 - Inbound Timespamp Request (ICMPv4)&lt;br /&gt;
**17 - Inbound Mask Request (ICMPv4)&lt;br /&gt;
**1 - Outbound Destination Unreachable (ICMPv6)&lt;br /&gt;
**2 - Outbound Packet Too Big (ICMPv6)&lt;br /&gt;
**3 - Outbound Time Exceeded (ICMPv6)&lt;br /&gt;
**4 - Outbound Parameter Problem (ICMPv6)&lt;br /&gt;
**128 - Inbound Echo Request (ICMPv6)&lt;br /&gt;
**137 - Redirect (ICMPv6)&lt;br /&gt;
*direction&lt;br /&gt;
**1 - In&lt;br /&gt;
**2 - Out&lt;br /&gt;
*profile&lt;br /&gt;
**1 - Domain &lt;br /&gt;
**2 - Private&lt;br /&gt;
**4 - Public&lt;br /&gt;
**2147483647 - All profiles&lt;br /&gt;
*action&lt;br /&gt;
**0 - Block&lt;br /&gt;
**1 - Allow&lt;br /&gt;
*application - Path of the application (can be empty)&lt;br /&gt;
*icmp_types_and_codes - Specified icmp types and codes (can be empty)&lt;br /&gt;
*group - Put the rule in this specified group (can be empty) &lt;br /&gt;
**&#039;&#039;&#039;Note&#039;&#039;&#039;: On Vista the group must the a resource string in a exe/dll e.g. &amp;quot;@C:\Program Files\My Application\myapp.exe,-10000&amp;quot;. On all other supported operating systems it can be a string value.&lt;br /&gt;
*local_ports - Local ports (The protocol property must be set before - Otherwise can be empty)&lt;br /&gt;
*remote_ports - Remote ports (The protocol property must be set before - Otherwise can be empty)&lt;br /&gt;
*local_address - Local addresses from which the port can listen for traffic (can be empty)&lt;br /&gt;
*remote_address - Remote addresses from which the port can listen for traffic (can be empty)&lt;br /&gt;
*status - Status of the port, application, rule, firewall or service for example enabled/disabled, start/stop or allow/disallow&lt;br /&gt;
**0 - Disabled, stop or disallow&lt;br /&gt;
**1 - Enabled, start, or allow&lt;br /&gt;
&lt;br /&gt;
== The Sample Script ==&lt;br /&gt;
In this script you can find the two most used functions. If you are searching for some special firewall exceptions please look at &amp;quot;The Sample Script (All Functions)&amp;quot;. &lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
; Add an application to the firewall exception list - All Networks - All IP Version - Enabled&lt;br /&gt;
  SimpleFC::AddApplication &amp;quot;My Application&amp;quot; &amp;quot;PathToApplication&amp;quot; 0 2 &amp;quot;&amp;quot; 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Remove an application from the firewall exception list&lt;br /&gt;
  SimpleFC::RemoveApplication &amp;quot;PathToApplication&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== The Sample Script (All Functions) ==&lt;br /&gt;
In this script you can find the examples of all functions provided by this plugin.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Add the port 37/TCP to the firewall exception list - All Networks - All IP Version - Enabled&lt;br /&gt;
  SimpleFC::AddPort 37 &amp;quot;My Application&amp;quot; 6 0 2 &amp;quot;&amp;quot; 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if the port 37/TCP is added to the firewall exception list&lt;br /&gt;
  SimpleFC::IsPortAdded 37 6&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Added/0=Not added&lt;br /&gt;
&lt;br /&gt;
; Remove the port 37/TCP from the firewall exception list&lt;br /&gt;
  SimpleFC::RemovePort 37 6&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if the port 37/TCP is enabled/disabled&lt;br /&gt;
  SimpleFC::IsPortEnabled 37 6&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Enabled/0=Not enabled&lt;br /&gt;
&lt;br /&gt;
; Disable the port 37/TCP&lt;br /&gt;
  SimpleFC::EnableDisablePort 37 6 0&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable the port 37/TCP&lt;br /&gt;
  SimpleFC::EnableDisablePort 37 6 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if an application is enabled/disabled&lt;br /&gt;
  SimpleFC::IsApplicationEnabled &amp;quot;PathToApplication&amp;quot; &lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Enabled/0=Not enabled&lt;br /&gt;
&lt;br /&gt;
; Disable the application&lt;br /&gt;
  SimpleFC::EnableDisableApplication &amp;quot;PathToApplication&amp;quot; 0&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable the application&lt;br /&gt;
  SimpleFC::EnableDisableApplication &amp;quot;PathToApplication&amp;quot; 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Add an application to the firewall exception list - All Networks - All IP Version - Enabled&lt;br /&gt;
  SimpleFC::AddApplication &amp;quot;My Application&amp;quot; &amp;quot;PathToApplication&amp;quot; 0 2 &amp;quot;&amp;quot; 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if the application is added to the firewall exception list&lt;br /&gt;
  SimpleFC::IsApplicationAdded &amp;quot;PathToApplication&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Added/0=Not added&lt;br /&gt;
&lt;br /&gt;
; Remove an application from the firewall exception list&lt;br /&gt;
  SimpleFC::RemoveApplication &amp;quot;PathToApplication&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Disable the windows firewall&lt;br /&gt;
  SimpleFC::EnableDisableFirewall 0&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable the windows firewall&lt;br /&gt;
  SimpleFC::EnableDisableFirewall 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if the firewall is enabled&lt;br /&gt;
  SimpleFC::IsFirewallEnabled &lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Enabled/0=Disabled&lt;br /&gt;
&lt;br /&gt;
; Enable exceptions are not allowed on the windows firewall&lt;br /&gt;
  SimpleFC::AllowDisallowExceptionsNotAllowed 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Disable exceptions are not allowed on the windows firewall&lt;br /&gt;
  SimpleFC::AllowDisallowExceptionsNotAllowed 0&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if exceptions are not allowed&lt;br /&gt;
  SimpleFC::AreExceptionsNotAllowed&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Exceptions are not allowed is &lt;br /&gt;
         ; activated/0=Exception are not allowed is deactivated&lt;br /&gt;
&lt;br /&gt;
; Enable notifications on the windows firewall&lt;br /&gt;
  SimpleFC::EnableDisableNotifications 1&lt;br /&gt;
&lt;br /&gt;
; Disable notifications on the windows firewall&lt;br /&gt;
  SimpleFC::EnableDisableNotifications 0&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if notifications are enabled/disabled&lt;br /&gt;
  SimpleFC::AreNotificationsEnabled &lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Enabled/0=Disabled&lt;br /&gt;
&lt;br /&gt;
; Starts the windows firewall service&lt;br /&gt;
  SimpleFC::StartStopFirewallService 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Stops the windows firewall service&lt;br /&gt;
  SimpleFC::StartStopFirewallService 0&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if windows firewall service is running&lt;br /&gt;
  SimpleFC::IsFirewallServiceRunning&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=IsRunning/0=Not Running&lt;br /&gt;
&lt;br /&gt;
; Sets the windows firewall to default settings&lt;br /&gt;
  SimpleFC::RestoreDefaults&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP outbound destination unreachable state&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpOutboundDestinationUnreachable 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP redirect state&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpRedirect 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP inbound echo request &lt;br /&gt;
  SimpleFC::AllowDisallowIcmpInboundEchoRequest 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP outbound time exceeded&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpOutboundTimeExceeded 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP outbound parameter problem&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpOutboundParameterProblem 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP outbound source quench&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpOutboundSourceQuench 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP inbound router request&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpInboundRouterRequest 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP inbound timestamp request&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpInboundTimestampRequest 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP inbound mask request&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpInboundMaskRequest 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP outbound packet too big&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpOutboundPacketTooBig 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if ICMPv4 echo request is allowed&lt;br /&gt;
  SimpleFC::IsIcmpTypeAllowed &amp;quot;0&amp;quot; &amp;quot;&amp;quot; &amp;quot;8&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Restricted/0=Not restricted&lt;br /&gt;
  Pop $2 ; return 1=Allowed/0=Not allowed &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Some example rules for the windows firewall with advanced security.&lt;br /&gt;
; Please note this functions are very powerful, so for a detailed &lt;br /&gt;
; description please read the windows firewall with advanced &lt;br /&gt;
; security api reference:&lt;br /&gt;
; http://msdn2.microsoft.com/en-us/library/aa365309.aspx&lt;br /&gt;
&lt;br /&gt;
; Adds an ICMPv4 rule to allow incoming echo reply messages (IcmpCodeAndType = 0:0)&lt;br /&gt;
  SimpleFC::AdvAddRule &amp;quot;Echo-Reply (ICMPv4 incoming)&amp;quot; \&lt;br /&gt;
    &amp;quot;Allows incoming Echo Replies messages.&amp;quot; &amp;quot;1&amp;quot; &amp;quot;1&amp;quot; &amp;quot;1&amp;quot; &amp;quot;7&amp;quot; &amp;quot;1&amp;quot; &amp;quot;&amp;quot; \ &lt;br /&gt;
    &amp;quot;0:0&amp;quot; &amp;quot;@PathToApplication,-10000&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Adds an ICMPv4 rule to allow incoming echo request messages (IcmpCodeAndType = 8:0)&lt;br /&gt;
  SimpleFC::AdvAddRule &amp;quot;Echo-Request (ICMPv4 incoming)&amp;quot; \&lt;br /&gt;
    &amp;quot;Allows incoming ICMP Echo messages.&amp;quot; &amp;quot;1&amp;quot; &amp;quot;1&amp;quot; &amp;quot;1&amp;quot; &amp;quot;7&amp;quot; &amp;quot;1&amp;quot; &amp;quot;&amp;quot; \&lt;br /&gt;
    &amp;quot;8:0&amp;quot; &amp;quot;@PathToApplication,-10000&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Add an application rule to allow incoming TCP access on this application&lt;br /&gt;
  SimpleFC::AdvAddRule &amp;quot;Incoming requests (TCP incoming)&amp;quot; \ &lt;br /&gt;
    &amp;quot;Allows incoming requests.&amp;quot; &amp;quot;6&amp;quot; &amp;quot;1&amp;quot; &amp;quot;1&amp;quot; &amp;quot;7&amp;quot; &amp;quot;1&amp;quot; &amp;quot;PathToApplication&amp;quot; \ &lt;br /&gt;
    &amp;quot;&amp;quot; &amp;quot;@PathToApplication,-10000&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Add an application rule to allow incoming UDP access on this application&lt;br /&gt;
  SimpleFC::AdvAddRule &amp;quot;Incoming requests (UDP incoming)&amp;quot; \&lt;br /&gt;
    &amp;quot;Allows incoming requests.&amp;quot; &amp;quot;17&amp;quot; &amp;quot;1&amp;quot; &amp;quot;1&amp;quot; &amp;quot;7&amp;quot; &amp;quot;1&amp;quot; &amp;quot;PathToApplication&amp;quot; \ &lt;br /&gt;
    &amp;quot;&amp;quot; &amp;quot;@PathToApplication,-10000&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Removes a firewall rule&lt;br /&gt;
  SimpleFC::AdvRemoveRule &amp;quot;Incoming requests (UDP incoming)&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if the firewall exists&lt;br /&gt;
  SimpleFC::AdvExistsRule &amp;quot;Incoming requests (UDP incoming)&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Exists/0=DoesnÂ´t exists&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Changelog ==&lt;br /&gt;
*Version 1.19 (2012-07-16)&lt;br /&gt;
**Documentation updated&lt;br /&gt;
*Version 1.18 (2010-02-23)&lt;br /&gt;
**Documentation updated&lt;br /&gt;
*Version 1.17 (2009-09-05)&lt;br /&gt;
**Added changes from the service manager&lt;br /&gt;
**The following functions are now case insensitive:&lt;br /&gt;
***SimpleFC::IsApplicationAdded&lt;br /&gt;
***SimpleFC::IsApplicationEnabled&lt;br /&gt;
***SimpleFC::EnableDisableApplication&lt;br /&gt;
***SimpleFC::AdvExistsRule&lt;br /&gt;
*Version 1.16 (2009-04-13)&lt;br /&gt;
**Added changes from the service manager&lt;br /&gt;
*Version 1.15 (2008-08-18)&lt;br /&gt;
**Added changes from the service manager and checked removed compiler optimization to avoid a false-positive virusscan.&lt;br /&gt;
*Version 1.14 (2008-02-05)&lt;br /&gt;
** Added changes from the service manager&lt;br /&gt;
*Version 1.13 (2008-01-29)&lt;br /&gt;
** Added changes from the service manager&lt;br /&gt;
*Version 1.12 (2007-11-13)&lt;br /&gt;
** Fixed wrong documentation about SimpleFC::AdvExistsRule&lt;br /&gt;
*Version 1.11 (2007-08-07)&lt;br /&gt;
** Fixed potential endless loop bug in SimpleFC::StartStopFirewallService&lt;br /&gt;
*Version 1.10 (2007-08-02)&lt;br /&gt;
** Added default firewall functions:&lt;br /&gt;
*** SimpleFC::RestoreDefaults&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpOutboundDestinationUnreachable&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpRedirect&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpInboundEchoRequest&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpOutboundTimeExceeded&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpOutboundParameterProblem&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpOutboundSourceQuench&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpInboundRouterRequest&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpInboundTimestampRequest&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpInboundMaskRequest&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpOutboundPacketTooBig&lt;br /&gt;
*** SimpleFC::IsIcmpTypeAllowed&lt;br /&gt;
** Added functions for Windows Firewall with Advanced Security&lt;br /&gt;
*** SimpleFC::AdvAddRule&lt;br /&gt;
*** SimpleFC::AdvRemoveRule&lt;br /&gt;
*** SimpleFC::AdvExistsRule&lt;br /&gt;
*Version 1.01 (2007-07-05)&lt;br /&gt;
**Changed missing documentation about the function SimpleFC::IsFirewallEnabled&lt;br /&gt;
*Version 1.0 (2007-05-02)&lt;br /&gt;
**First offical version&lt;br /&gt;
&lt;br /&gt;
== Important Notes ==&lt;br /&gt;
&lt;br /&gt;
*This plugin is running on Windows XP SP2, Windows 2003, Windows Vista, Windows 2008 and Windows 7&lt;br /&gt;
*Before you execute some plugin commands it is recommend to check for windows firewall service is running (SimpleFC::IsFirewallServiceRunning).&lt;br /&gt;
*All functions with the prefix &amp;quot;Adv&amp;quot; are only for Windows Firewall with Advanced Security (Windows Vista and above). It is recommend to use these functions on the operating systems which supports the Windows Firewall with Advanced Security. Nethertheless, the default functions without the prefix &amp;quot;Adv&amp;quot; can be used.&lt;br /&gt;
* If you have any suggestions, comments or questions please mail me: mailto:rainer@speed-soft.de&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Plugins]]&lt;/div&gt;</summary>
		<author><name>Speed78</name></author>
	</entry>
	<entry>
		<id>https://nsis.sourceforge.io/mediawiki/index.php?title=NSIS_Simple_Firewall_Plugin&amp;diff=22171</id>
		<title>NSIS Simple Firewall Plugin</title>
		<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/mediawiki/index.php?title=NSIS_Simple_Firewall_Plugin&amp;diff=22171"/>
		<updated>2012-07-16T19:57:50Z</updated>

		<summary type="html">&lt;p&gt;Speed78: /* Links */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This plugin can be used to configure the Windows firewall. This plugin contains functions to enable, check, add or remove programs or ports to the firewall exception list. It also contains functions for checking the firewall status, enable or disable the firewall and so on.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This plugin is using the MPL License or alternatively the LGPL License.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
&amp;lt;attach&amp;gt;NSIS_Simple_Firewall_Plugin_1.19.zip&amp;lt;/attach&amp;gt; The ZIP file containing a precompiled plugin DLL (to be saved in NSIS&#039; plugin directory) and the sources.&lt;br /&gt;
&lt;br /&gt;
== Donation ==&lt;br /&gt;
If you believe that I am doing a good job and you want to support me please [http://www.speed-soft.de/donation/index.php?language=en donate] any amount via PayPal.&lt;br /&gt;
&lt;br /&gt;
== Short Reference ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
SimpleFC::EnableDisableFirewall [status]&lt;br /&gt;
SimpleFC::IsFirewallEnabled  &lt;br /&gt;
 &lt;br /&gt;
SimpleFC::AllowDisallowExceptionsNotAllowed [status]&lt;br /&gt;
SimpleFC::AreExceptionsNotAllowed  &lt;br /&gt;
 &lt;br /&gt;
SimpleFC::EnableDisableNotifications [status]&lt;br /&gt;
SimpleFC::AreNotificationsEnabled  &lt;br /&gt;
 &lt;br /&gt;
SimpleFC::StartStopFirewallService [status]&lt;br /&gt;
SimpleFC::IsFirewallServiceRunning  &lt;br /&gt;
 &lt;br /&gt;
SimpleFC::AddPort [port] [name] [protocol] [scope] [ip_version] [remote_addresses] [status]&lt;br /&gt;
SimpleFC::IsPortAdded [port] [protocol]&lt;br /&gt;
SimpleFC::RemovePort [port] [protocol]&lt;br /&gt;
 &lt;br /&gt;
SimpleFC::IsPortEnabled [port] [protocol]&lt;br /&gt;
SimpleFC::EnableDisablePort [port] [protocol]&lt;br /&gt;
 &lt;br /&gt;
SimpleFC::AddApplication [name] [path] [scope] [ip_version] [remote_addresses] [status]&lt;br /&gt;
SimpleFC::IsApplicationAdded [path]&lt;br /&gt;
SimpleFC::RemoveApplication [path]&lt;br /&gt;
 &lt;br /&gt;
SimpleFC::IsApplicationEnabled [path]&lt;br /&gt;
SimpleFC::EnableDisableApplication [path]&lt;br /&gt;
&lt;br /&gt;
SimpleFC::RestoreDefaults&lt;br /&gt;
&lt;br /&gt;
SimpleFC::AllowDisallowIcmpOutboundDestinationUnreachable [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpRedirect [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpInboundEchoRequest [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpOutboundTimeExceeded [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpOutboundParameterProblem [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpOutboundSourceQuench [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpInboundRouterRequest [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpInboundTimestampRequest [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpInboundMaskRequest [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpOutboundPacketTooBig [status]&lt;br /&gt;
SimpleFC::IsIcmpTypeAllowed [ip_version] [local_address] [icmp_type]&lt;br /&gt;
&lt;br /&gt;
SimpleFC::AdvAddRule [name] [description] [protocol] [direction] &lt;br /&gt;
  [status] [profile] [action] [application] [icmp_types_and_codes] &lt;br /&gt;
  [group] [local_ports] [remote_ports] [local_address] [remote_address]&lt;br /&gt;
SimpleFC::AdvRemoveRule [name]&lt;br /&gt;
SimpleFC::AdvExistsRule [name]&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
*port - TCP/UDP port which should be opened/closed&lt;br /&gt;
*name - The name of the application/port/rule&lt;br /&gt;
*description - Description of the rule&lt;br /&gt;
*protocol - One of the following protocol&lt;br /&gt;
**1 - ICMPv4&lt;br /&gt;
**6 - TCP&lt;br /&gt;
**17 - UDP&lt;br /&gt;
**58 - ICMPv6&lt;br /&gt;
**256 - Any protocol&lt;br /&gt;
*scope - One of the following scope&lt;br /&gt;
**0 - All networks&lt;br /&gt;
**1 - Only local subnets&lt;br /&gt;
**2 - Custom scope&lt;br /&gt;
**3 - Max scope&lt;br /&gt;
**NOTE: If you use custom you must define remote_addresses&lt;br /&gt;
*ip_version&lt;br /&gt;
**0 - IPv4&lt;br /&gt;
**1 - IPv6&lt;br /&gt;
**2 - Any version&lt;br /&gt;
*icmp_type&lt;br /&gt;
**3 - Outbound Destination Unreachable (ICMPv4)&lt;br /&gt;
**4 - Outbound Source Quench (ICMPv4)&lt;br /&gt;
**5 - Redirect (ICMPv4)&lt;br /&gt;
**8 - Inbound Echo Request (ICMPv4)&lt;br /&gt;
**9 - Inbound Router Request (ICMPv4)&lt;br /&gt;
**11 - Outbound Time Exceeded (ICMPv4)&lt;br /&gt;
**12 - Outbound Parameter Problem (ICMPv4)&lt;br /&gt;
**13 - Inbound Timespamp Request (ICMPv4)&lt;br /&gt;
**17 - Inbound Mask Request (ICMPv4)&lt;br /&gt;
**1 - Outbound Destination Unreachable (ICMPv6)&lt;br /&gt;
**2 - Outbound Packet Too Big (ICMPv6)&lt;br /&gt;
**3 - Outbound Time Exceeded (ICMPv6)&lt;br /&gt;
**4 - Outbound Parameter Problem (ICMPv6)&lt;br /&gt;
**128 - Inbound Echo Request (ICMPv6)&lt;br /&gt;
**137 - Redirect (ICMPv6)&lt;br /&gt;
*direction&lt;br /&gt;
**1 - In&lt;br /&gt;
**2 - Out&lt;br /&gt;
*profile&lt;br /&gt;
**1 - Domain &lt;br /&gt;
**2 - Private&lt;br /&gt;
**4 - Public&lt;br /&gt;
**2147483647 - All profiles&lt;br /&gt;
*action&lt;br /&gt;
**0 - Block&lt;br /&gt;
**1 - Allow&lt;br /&gt;
*application - Path of the application (can be empty)&lt;br /&gt;
*icmp_types_and_codes - Specified icmp types and codes (can be empty)&lt;br /&gt;
*group - Put the rule in this specified group (can be empty) &lt;br /&gt;
**&#039;&#039;&#039;Note&#039;&#039;&#039;: On Vista the group must the a resource string in a exe/dll e.g. &amp;quot;@C:\Program Files\My Application\myapp.exe,-10000&amp;quot;. On all other supported operating systems it can be a string value.&lt;br /&gt;
*local_ports - Local ports (The protocol property must be set before - Otherwise can be empty)&lt;br /&gt;
*remote_ports - Remote ports (The protocol property must be set before - Otherwise can be empty)&lt;br /&gt;
*local_address - Local addresses from which the port can listen for traffic (can be empty)&lt;br /&gt;
*remote_address - Remote addresses from which the port can listen for traffic (can be empty)&lt;br /&gt;
*status - Status of the port, application, rule, firewall or service for example enabled/disabled, start/stop or allow/disallow&lt;br /&gt;
**0 - Disabled, stop or disallow&lt;br /&gt;
**1 - Enabled, start, or allow&lt;br /&gt;
&lt;br /&gt;
== The Sample Script ==&lt;br /&gt;
In this script you can find the two most used functions. If you are searching for some special firewall exceptions please look at &amp;quot;The Sample Script (All Functions)&amp;quot;. &lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
; Add an application to the firewall exception list - All Networks - All IP Version - Enabled&lt;br /&gt;
  SimpleFC::AddApplication &amp;quot;My Application&amp;quot; &amp;quot;PathToApplication&amp;quot; 0 2 &amp;quot;&amp;quot; 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Remove an application from the firewall exception list&lt;br /&gt;
  SimpleFC::RemoveApplication &amp;quot;PathToApplication&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== The Sample Script (All Functions) ==&lt;br /&gt;
In this script you can find the examples of all functions provided by this plugin.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Add the port 37/TCP to the firewall exception list - All Networks - All IP Version - Enabled&lt;br /&gt;
  SimpleFC::AddPort 37 &amp;quot;My Application&amp;quot; 6 0 2 &amp;quot;&amp;quot; 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if the port 37/TCP is added to the firewall exception list&lt;br /&gt;
  SimpleFC::IsPortAdded 37 6&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Added/0=Not added&lt;br /&gt;
&lt;br /&gt;
; Remove the port 37/TCP from the firewall exception list&lt;br /&gt;
  SimpleFC::RemovePort 37 6&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if the port 37/TCP is enabled/disabled&lt;br /&gt;
  SimpleFC::IsPortEnabled 37 6&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Enabled/0=Not enabled&lt;br /&gt;
&lt;br /&gt;
; Disable the port 37/TCP&lt;br /&gt;
  SimpleFC::EnableDisablePort 37 6 0&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable the port 37/TCP&lt;br /&gt;
  SimpleFC::EnableDisablePort 37 6 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if an application is enabled/disabled&lt;br /&gt;
  SimpleFC::IsApplicationEnabled &amp;quot;PathToApplication&amp;quot; &lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Enabled/0=Not enabled&lt;br /&gt;
&lt;br /&gt;
; Disable the application&lt;br /&gt;
  SimpleFC::EnableDisableApplication &amp;quot;PathToApplication&amp;quot; 0&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable the application&lt;br /&gt;
  SimpleFC::EnableDisableApplication &amp;quot;PathToApplication&amp;quot; 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Add an application to the firewall exception list - All Networks - All IP Version - Enabled&lt;br /&gt;
  SimpleFC::AddApplication &amp;quot;My Application&amp;quot; &amp;quot;PathToApplication&amp;quot; 0 2 &amp;quot;&amp;quot; 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if the application is added to the firewall exception list&lt;br /&gt;
  SimpleFC::IsApplicationAdded &amp;quot;PathToApplication&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Added/0=Not added&lt;br /&gt;
&lt;br /&gt;
; Remove an application from the firewall exception list&lt;br /&gt;
  SimpleFC::RemoveApplication &amp;quot;PathToApplication&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Disable the windows firewall&lt;br /&gt;
  SimpleFC::EnableDisableFirewall 0&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable the windows firewall&lt;br /&gt;
  SimpleFC::EnableDisableFirewall 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if the firewall is enabled&lt;br /&gt;
  SimpleFC::IsFirewallEnabled &lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Enabled/0=Disabled&lt;br /&gt;
&lt;br /&gt;
; Enable exceptions are not allowed on the windows firewall&lt;br /&gt;
  SimpleFC::AllowDisallowExceptionsNotAllowed 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Disable exceptions are not allowed on the windows firewall&lt;br /&gt;
  SimpleFC::AllowDisallowExceptionsNotAllowed 0&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if exceptions are not allowed&lt;br /&gt;
  SimpleFC::AreExceptionsNotAllowed&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Exceptions are not allowed is &lt;br /&gt;
         ; activated/0=Exception are not allowed is deactivated&lt;br /&gt;
&lt;br /&gt;
; Enable notifications on the windows firewall&lt;br /&gt;
  SimpleFC::EnableDisableNotifications 1&lt;br /&gt;
&lt;br /&gt;
; Disable notifications on the windows firewall&lt;br /&gt;
  SimpleFC::EnableDisableNotifications 0&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if notifications are enabled/disabled&lt;br /&gt;
  SimpleFC::AreNotificationsEnabled &lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Enabled/0=Disabled&lt;br /&gt;
&lt;br /&gt;
; Starts the windows firewall service&lt;br /&gt;
  SimpleFC::StartStopFirewallService 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Stops the windows firewall service&lt;br /&gt;
  SimpleFC::StartStopFirewallService 0&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if windows firewall service is running&lt;br /&gt;
  SimpleFC::IsFirewallServiceRunning&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=IsRunning/0=Not Running&lt;br /&gt;
&lt;br /&gt;
; Sets the windows firewall to default settings&lt;br /&gt;
  SimpleFC::RestoreDefaults&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP outbound destination unreachable state&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpOutboundDestinationUnreachable 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP redirect state&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpRedirect 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP inbound echo request &lt;br /&gt;
  SimpleFC::AllowDisallowIcmpInboundEchoRequest 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP outbound time exceeded&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpOutboundTimeExceeded 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP outbound parameter problem&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpOutboundParameterProblem 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP outbound source quench&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpOutboundSourceQuench 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP inbound router request&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpInboundRouterRequest 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP inbound timestamp request&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpInboundTimestampRequest 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP inbound mask request&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpInboundMaskRequest 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP outbound packet too big&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpOutboundPacketTooBig 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if ICMPv4 echo request is allowed&lt;br /&gt;
  SimpleFC::IsIcmpTypeAllowed &amp;quot;0&amp;quot; &amp;quot;&amp;quot; &amp;quot;8&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Restricted/0=Not restricted&lt;br /&gt;
  Pop $2 ; return 1=Allowed/0=Not allowed &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Some example rules for the windows firewall with advanced security.&lt;br /&gt;
; Please note this functions are very powerful, so for a detailed &lt;br /&gt;
; description please read the windows firewall with advanced &lt;br /&gt;
; security api reference:&lt;br /&gt;
; http://msdn2.microsoft.com/en-us/library/aa365309.aspx&lt;br /&gt;
&lt;br /&gt;
; Adds an ICMPv4 rule to allow incoming echo reply messages (IcmpCodeAndType = 0:0)&lt;br /&gt;
  SimpleFC::AdvAddRule &amp;quot;Echo-Reply (ICMPv4 incoming)&amp;quot; \&lt;br /&gt;
    &amp;quot;Allows incoming Echo Replies messages.&amp;quot; &amp;quot;1&amp;quot; &amp;quot;1&amp;quot; &amp;quot;1&amp;quot; &amp;quot;7&amp;quot; &amp;quot;1&amp;quot; &amp;quot;&amp;quot; \ &lt;br /&gt;
    &amp;quot;0:0&amp;quot; &amp;quot;@PathToApplication,-10000&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Adds an ICMPv4 rule to allow incoming echo request messages (IcmpCodeAndType = 8:0)&lt;br /&gt;
  SimpleFC::AdvAddRule &amp;quot;Echo-Request (ICMPv4 incoming)&amp;quot; \&lt;br /&gt;
    &amp;quot;Allows incoming ICMP Echo messages.&amp;quot; &amp;quot;1&amp;quot; &amp;quot;1&amp;quot; &amp;quot;1&amp;quot; &amp;quot;7&amp;quot; &amp;quot;1&amp;quot; &amp;quot;&amp;quot; \&lt;br /&gt;
    &amp;quot;8:0&amp;quot; &amp;quot;@PathToApplication,-10000&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Add an application rule to allow incoming TCP access on this application&lt;br /&gt;
  SimpleFC::AdvAddRule &amp;quot;Incoming requests (TCP incoming)&amp;quot; \ &lt;br /&gt;
    &amp;quot;Allows incoming requests.&amp;quot; &amp;quot;6&amp;quot; &amp;quot;1&amp;quot; &amp;quot;1&amp;quot; &amp;quot;7&amp;quot; &amp;quot;1&amp;quot; &amp;quot;PathToApplication&amp;quot; \ &lt;br /&gt;
    &amp;quot;&amp;quot; &amp;quot;@PathToApplication,-10000&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Add an application rule to allow incoming UDP access on this application&lt;br /&gt;
  SimpleFC::AdvAddRule &amp;quot;Incoming requests (UDP incoming)&amp;quot; \&lt;br /&gt;
    &amp;quot;Allows incoming requests.&amp;quot; &amp;quot;17&amp;quot; &amp;quot;1&amp;quot; &amp;quot;1&amp;quot; &amp;quot;7&amp;quot; &amp;quot;1&amp;quot; &amp;quot;PathToApplication&amp;quot; \ &lt;br /&gt;
    &amp;quot;&amp;quot; &amp;quot;@PathToApplication,-10000&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Removes a firewall rule&lt;br /&gt;
  SimpleFC::AdvRemoveRule &amp;quot;Incoming requests (UDP incoming)&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if the firewall exists&lt;br /&gt;
  SimpleFC::AdvExistsRule &amp;quot;Incoming requests (UDP incoming)&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Exists/0=DoesnÂ´t exists&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Changelog ==&lt;br /&gt;
*Version 1.18 (2010-02-23)&lt;br /&gt;
**Documentation updated&lt;br /&gt;
*Version 1.17 (2009-09-05)&lt;br /&gt;
**Added changes from the service manager&lt;br /&gt;
**The following functions are now case insensitive:&lt;br /&gt;
***SimpleFC::IsApplicationAdded&lt;br /&gt;
***SimpleFC::IsApplicationEnabled&lt;br /&gt;
***SimpleFC::EnableDisableApplication&lt;br /&gt;
***SimpleFC::AdvExistsRule&lt;br /&gt;
*Version 1.16 (2009-04-13)&lt;br /&gt;
**Added changes from the service manager&lt;br /&gt;
*Version 1.15 (2008-08-18)&lt;br /&gt;
**Added changes from the service manager and checked removed compiler optimization to avoid a false-positive virusscan.&lt;br /&gt;
*Version 1.14 (2008-02-05)&lt;br /&gt;
** Added changes from the service manager&lt;br /&gt;
*Version 1.13 (2008-01-29)&lt;br /&gt;
** Added changes from the service manager&lt;br /&gt;
*Version 1.12 (2007-11-13)&lt;br /&gt;
** Fixed wrong documentation about SimpleFC::AdvExistsRule&lt;br /&gt;
*Version 1.11 (2007-08-07)&lt;br /&gt;
** Fixed potential endless loop bug in SimpleFC::StartStopFirewallService&lt;br /&gt;
*Version 1.10 (2007-08-02)&lt;br /&gt;
** Added default firewall functions:&lt;br /&gt;
*** SimpleFC::RestoreDefaults&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpOutboundDestinationUnreachable&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpRedirect&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpInboundEchoRequest&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpOutboundTimeExceeded&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpOutboundParameterProblem&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpOutboundSourceQuench&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpInboundRouterRequest&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpInboundTimestampRequest&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpInboundMaskRequest&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpOutboundPacketTooBig&lt;br /&gt;
*** SimpleFC::IsIcmpTypeAllowed&lt;br /&gt;
** Added functions for Windows Firewall with Advanced Security&lt;br /&gt;
*** SimpleFC::AdvAddRule&lt;br /&gt;
*** SimpleFC::AdvRemoveRule&lt;br /&gt;
*** SimpleFC::AdvExistsRule&lt;br /&gt;
*Version 1.01 (2007-07-05)&lt;br /&gt;
**Changed missing documentation about the function SimpleFC::IsFirewallEnabled&lt;br /&gt;
*Version 1.0 (2007-05-02)&lt;br /&gt;
**First offical version&lt;br /&gt;
&lt;br /&gt;
== Important Notes ==&lt;br /&gt;
&lt;br /&gt;
*This plugin is running on Windows XP SP2, Windows 2003, Windows Vista, Windows 2008 and Windows 7&lt;br /&gt;
*Before you execute some plugin commands it is recommend to check for windows firewall service is running (SimpleFC::IsFirewallServiceRunning).&lt;br /&gt;
*All functions with the prefix &amp;quot;Adv&amp;quot; are only for Windows Firewall with Advanced Security (Windows Vista and above). It is recommend to use these functions on the operating systems which supports the Windows Firewall with Advanced Security. Nethertheless, the default functions without the prefix &amp;quot;Adv&amp;quot; can be used.&lt;br /&gt;
* If you have any suggestions, comments or questions please mail me: mailto:rainer@speed-soft.de&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Plugins]]&lt;/div&gt;</summary>
		<author><name>Speed78</name></author>
	</entry>
	<entry>
		<id>https://nsis.sourceforge.io/mediawiki/index.php?title=File:NSIS_Simple_Firewall_Plugin_1.19.zip&amp;diff=22170</id>
		<title>File:NSIS Simple Firewall Plugin 1.19.zip</title>
		<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/mediawiki/index.php?title=File:NSIS_Simple_Firewall_Plugin_1.19.zip&amp;diff=22170"/>
		<updated>2012-07-16T19:55:36Z</updated>

		<summary type="html">&lt;p&gt;Speed78: NSIS Simple Firewall Plugin&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;NSIS Simple Firewall Plugin&lt;/div&gt;</summary>
		<author><name>Speed78</name></author>
	</entry>
	<entry>
		<id>https://nsis.sourceforge.io/mediawiki/index.php?title=NSIS_Simple_Firewall_Plugin&amp;diff=22169</id>
		<title>NSIS Simple Firewall Plugin</title>
		<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/mediawiki/index.php?title=NSIS_Simple_Firewall_Plugin&amp;diff=22169"/>
		<updated>2012-07-16T19:05:37Z</updated>

		<summary type="html">&lt;p&gt;Speed78: /* Short Reference */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This plugin can be used to configure the Windows firewall. This plugin contains functions to enable, check, add or remove programs or ports to the firewall exception list. It also contains functions for checking the firewall status, enable or disable the firewall and so on.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This plugin is using the MPL License or alternatively the LGPL License.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
&amp;lt;attach&amp;gt;NSIS_Simple_Firewall_Plugin_1.18.zip&amp;lt;/attach&amp;gt; The ZIP file containing a precompiled plugin DLL (to be saved in NSIS&#039; plugin directory) and the sources.&lt;br /&gt;
&lt;br /&gt;
== Donation ==&lt;br /&gt;
If you believe that I am doing a good job and you want to support me please [http://www.speed-soft.de/donation/index.php?language=en donate] any amount via PayPal.&lt;br /&gt;
&lt;br /&gt;
== Short Reference ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
SimpleFC::EnableDisableFirewall [status]&lt;br /&gt;
SimpleFC::IsFirewallEnabled  &lt;br /&gt;
 &lt;br /&gt;
SimpleFC::AllowDisallowExceptionsNotAllowed [status]&lt;br /&gt;
SimpleFC::AreExceptionsNotAllowed  &lt;br /&gt;
 &lt;br /&gt;
SimpleFC::EnableDisableNotifications [status]&lt;br /&gt;
SimpleFC::AreNotificationsEnabled  &lt;br /&gt;
 &lt;br /&gt;
SimpleFC::StartStopFirewallService [status]&lt;br /&gt;
SimpleFC::IsFirewallServiceRunning  &lt;br /&gt;
 &lt;br /&gt;
SimpleFC::AddPort [port] [name] [protocol] [scope] [ip_version] [remote_addresses] [status]&lt;br /&gt;
SimpleFC::IsPortAdded [port] [protocol]&lt;br /&gt;
SimpleFC::RemovePort [port] [protocol]&lt;br /&gt;
 &lt;br /&gt;
SimpleFC::IsPortEnabled [port] [protocol]&lt;br /&gt;
SimpleFC::EnableDisablePort [port] [protocol]&lt;br /&gt;
 &lt;br /&gt;
SimpleFC::AddApplication [name] [path] [scope] [ip_version] [remote_addresses] [status]&lt;br /&gt;
SimpleFC::IsApplicationAdded [path]&lt;br /&gt;
SimpleFC::RemoveApplication [path]&lt;br /&gt;
 &lt;br /&gt;
SimpleFC::IsApplicationEnabled [path]&lt;br /&gt;
SimpleFC::EnableDisableApplication [path]&lt;br /&gt;
&lt;br /&gt;
SimpleFC::RestoreDefaults&lt;br /&gt;
&lt;br /&gt;
SimpleFC::AllowDisallowIcmpOutboundDestinationUnreachable [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpRedirect [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpInboundEchoRequest [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpOutboundTimeExceeded [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpOutboundParameterProblem [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpOutboundSourceQuench [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpInboundRouterRequest [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpInboundTimestampRequest [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpInboundMaskRequest [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpOutboundPacketTooBig [status]&lt;br /&gt;
SimpleFC::IsIcmpTypeAllowed [ip_version] [local_address] [icmp_type]&lt;br /&gt;
&lt;br /&gt;
SimpleFC::AdvAddRule [name] [description] [protocol] [direction] &lt;br /&gt;
  [status] [profile] [action] [application] [icmp_types_and_codes] &lt;br /&gt;
  [group] [local_ports] [remote_ports] [local_address] [remote_address]&lt;br /&gt;
SimpleFC::AdvRemoveRule [name]&lt;br /&gt;
SimpleFC::AdvExistsRule [name]&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
*port - TCP/UDP port which should be opened/closed&lt;br /&gt;
*name - The name of the application/port/rule&lt;br /&gt;
*description - Description of the rule&lt;br /&gt;
*protocol - One of the following protocol&lt;br /&gt;
**1 - ICMPv4&lt;br /&gt;
**6 - TCP&lt;br /&gt;
**17 - UDP&lt;br /&gt;
**58 - ICMPv6&lt;br /&gt;
**256 - Any protocol&lt;br /&gt;
*scope - One of the following scope&lt;br /&gt;
**0 - All networks&lt;br /&gt;
**1 - Only local subnets&lt;br /&gt;
**2 - Custom scope&lt;br /&gt;
**3 - Max scope&lt;br /&gt;
**NOTE: If you use custom you must define remote_addresses&lt;br /&gt;
*ip_version&lt;br /&gt;
**0 - IPv4&lt;br /&gt;
**1 - IPv6&lt;br /&gt;
**2 - Any version&lt;br /&gt;
*icmp_type&lt;br /&gt;
**3 - Outbound Destination Unreachable (ICMPv4)&lt;br /&gt;
**4 - Outbound Source Quench (ICMPv4)&lt;br /&gt;
**5 - Redirect (ICMPv4)&lt;br /&gt;
**8 - Inbound Echo Request (ICMPv4)&lt;br /&gt;
**9 - Inbound Router Request (ICMPv4)&lt;br /&gt;
**11 - Outbound Time Exceeded (ICMPv4)&lt;br /&gt;
**12 - Outbound Parameter Problem (ICMPv4)&lt;br /&gt;
**13 - Inbound Timespamp Request (ICMPv4)&lt;br /&gt;
**17 - Inbound Mask Request (ICMPv4)&lt;br /&gt;
**1 - Outbound Destination Unreachable (ICMPv6)&lt;br /&gt;
**2 - Outbound Packet Too Big (ICMPv6)&lt;br /&gt;
**3 - Outbound Time Exceeded (ICMPv6)&lt;br /&gt;
**4 - Outbound Parameter Problem (ICMPv6)&lt;br /&gt;
**128 - Inbound Echo Request (ICMPv6)&lt;br /&gt;
**137 - Redirect (ICMPv6)&lt;br /&gt;
*direction&lt;br /&gt;
**1 - In&lt;br /&gt;
**2 - Out&lt;br /&gt;
*profile&lt;br /&gt;
**1 - Domain &lt;br /&gt;
**2 - Private&lt;br /&gt;
**4 - Public&lt;br /&gt;
**2147483647 - All profiles&lt;br /&gt;
*action&lt;br /&gt;
**0 - Block&lt;br /&gt;
**1 - Allow&lt;br /&gt;
*application - Path of the application (can be empty)&lt;br /&gt;
*icmp_types_and_codes - Specified icmp types and codes (can be empty)&lt;br /&gt;
*group - Put the rule in this specified group (can be empty) &lt;br /&gt;
**&#039;&#039;&#039;Note&#039;&#039;&#039;: On Vista the group must the a resource string in a exe/dll e.g. &amp;quot;@C:\Program Files\My Application\myapp.exe,-10000&amp;quot;. On all other supported operating systems it can be a string value.&lt;br /&gt;
*local_ports - Local ports (The protocol property must be set before - Otherwise can be empty)&lt;br /&gt;
*remote_ports - Remote ports (The protocol property must be set before - Otherwise can be empty)&lt;br /&gt;
*local_address - Local addresses from which the port can listen for traffic (can be empty)&lt;br /&gt;
*remote_address - Remote addresses from which the port can listen for traffic (can be empty)&lt;br /&gt;
*status - Status of the port, application, rule, firewall or service for example enabled/disabled, start/stop or allow/disallow&lt;br /&gt;
**0 - Disabled, stop or disallow&lt;br /&gt;
**1 - Enabled, start, or allow&lt;br /&gt;
&lt;br /&gt;
== The Sample Script ==&lt;br /&gt;
In this script you can find the two most used functions. If you are searching for some special firewall exceptions please look at &amp;quot;The Sample Script (All Functions)&amp;quot;. &lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
; Add an application to the firewall exception list - All Networks - All IP Version - Enabled&lt;br /&gt;
  SimpleFC::AddApplication &amp;quot;My Application&amp;quot; &amp;quot;PathToApplication&amp;quot; 0 2 &amp;quot;&amp;quot; 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Remove an application from the firewall exception list&lt;br /&gt;
  SimpleFC::RemoveApplication &amp;quot;PathToApplication&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== The Sample Script (All Functions) ==&lt;br /&gt;
In this script you can find the examples of all functions provided by this plugin.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Add the port 37/TCP to the firewall exception list - All Networks - All IP Version - Enabled&lt;br /&gt;
  SimpleFC::AddPort 37 &amp;quot;My Application&amp;quot; 6 0 2 &amp;quot;&amp;quot; 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if the port 37/TCP is added to the firewall exception list&lt;br /&gt;
  SimpleFC::IsPortAdded 37 6&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Added/0=Not added&lt;br /&gt;
&lt;br /&gt;
; Remove the port 37/TCP from the firewall exception list&lt;br /&gt;
  SimpleFC::RemovePort 37 6&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if the port 37/TCP is enabled/disabled&lt;br /&gt;
  SimpleFC::IsPortEnabled 37 6&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Enabled/0=Not enabled&lt;br /&gt;
&lt;br /&gt;
; Disable the port 37/TCP&lt;br /&gt;
  SimpleFC::EnableDisablePort 37 6 0&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable the port 37/TCP&lt;br /&gt;
  SimpleFC::EnableDisablePort 37 6 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if an application is enabled/disabled&lt;br /&gt;
  SimpleFC::IsApplicationEnabled &amp;quot;PathToApplication&amp;quot; &lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Enabled/0=Not enabled&lt;br /&gt;
&lt;br /&gt;
; Disable the application&lt;br /&gt;
  SimpleFC::EnableDisableApplication &amp;quot;PathToApplication&amp;quot; 0&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable the application&lt;br /&gt;
  SimpleFC::EnableDisableApplication &amp;quot;PathToApplication&amp;quot; 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Add an application to the firewall exception list - All Networks - All IP Version - Enabled&lt;br /&gt;
  SimpleFC::AddApplication &amp;quot;My Application&amp;quot; &amp;quot;PathToApplication&amp;quot; 0 2 &amp;quot;&amp;quot; 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if the application is added to the firewall exception list&lt;br /&gt;
  SimpleFC::IsApplicationAdded &amp;quot;PathToApplication&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Added/0=Not added&lt;br /&gt;
&lt;br /&gt;
; Remove an application from the firewall exception list&lt;br /&gt;
  SimpleFC::RemoveApplication &amp;quot;PathToApplication&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Disable the windows firewall&lt;br /&gt;
  SimpleFC::EnableDisableFirewall 0&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable the windows firewall&lt;br /&gt;
  SimpleFC::EnableDisableFirewall 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if the firewall is enabled&lt;br /&gt;
  SimpleFC::IsFirewallEnabled &lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Enabled/0=Disabled&lt;br /&gt;
&lt;br /&gt;
; Enable exceptions are not allowed on the windows firewall&lt;br /&gt;
  SimpleFC::AllowDisallowExceptionsNotAllowed 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Disable exceptions are not allowed on the windows firewall&lt;br /&gt;
  SimpleFC::AllowDisallowExceptionsNotAllowed 0&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if exceptions are not allowed&lt;br /&gt;
  SimpleFC::AreExceptionsNotAllowed&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Exceptions are not allowed is &lt;br /&gt;
         ; activated/0=Exception are not allowed is deactivated&lt;br /&gt;
&lt;br /&gt;
; Enable notifications on the windows firewall&lt;br /&gt;
  SimpleFC::EnableDisableNotifications 1&lt;br /&gt;
&lt;br /&gt;
; Disable notifications on the windows firewall&lt;br /&gt;
  SimpleFC::EnableDisableNotifications 0&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if notifications are enabled/disabled&lt;br /&gt;
  SimpleFC::AreNotificationsEnabled &lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Enabled/0=Disabled&lt;br /&gt;
&lt;br /&gt;
; Starts the windows firewall service&lt;br /&gt;
  SimpleFC::StartStopFirewallService 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Stops the windows firewall service&lt;br /&gt;
  SimpleFC::StartStopFirewallService 0&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if windows firewall service is running&lt;br /&gt;
  SimpleFC::IsFirewallServiceRunning&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=IsRunning/0=Not Running&lt;br /&gt;
&lt;br /&gt;
; Sets the windows firewall to default settings&lt;br /&gt;
  SimpleFC::RestoreDefaults&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP outbound destination unreachable state&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpOutboundDestinationUnreachable 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP redirect state&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpRedirect 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP inbound echo request &lt;br /&gt;
  SimpleFC::AllowDisallowIcmpInboundEchoRequest 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP outbound time exceeded&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpOutboundTimeExceeded 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP outbound parameter problem&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpOutboundParameterProblem 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP outbound source quench&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpOutboundSourceQuench 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP inbound router request&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpInboundRouterRequest 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP inbound timestamp request&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpInboundTimestampRequest 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP inbound mask request&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpInboundMaskRequest 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP outbound packet too big&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpOutboundPacketTooBig 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if ICMPv4 echo request is allowed&lt;br /&gt;
  SimpleFC::IsIcmpTypeAllowed &amp;quot;0&amp;quot; &amp;quot;&amp;quot; &amp;quot;8&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Restricted/0=Not restricted&lt;br /&gt;
  Pop $2 ; return 1=Allowed/0=Not allowed &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Some example rules for the windows firewall with advanced security.&lt;br /&gt;
; Please note this functions are very powerful, so for a detailed &lt;br /&gt;
; description please read the windows firewall with advanced &lt;br /&gt;
; security api reference:&lt;br /&gt;
; http://msdn2.microsoft.com/en-us/library/aa365309.aspx&lt;br /&gt;
&lt;br /&gt;
; Adds an ICMPv4 rule to allow incoming echo reply messages (IcmpCodeAndType = 0:0)&lt;br /&gt;
  SimpleFC::AdvAddRule &amp;quot;Echo-Reply (ICMPv4 incoming)&amp;quot; \&lt;br /&gt;
    &amp;quot;Allows incoming Echo Replies messages.&amp;quot; &amp;quot;1&amp;quot; &amp;quot;1&amp;quot; &amp;quot;1&amp;quot; &amp;quot;7&amp;quot; &amp;quot;1&amp;quot; &amp;quot;&amp;quot; \ &lt;br /&gt;
    &amp;quot;0:0&amp;quot; &amp;quot;@PathToApplication,-10000&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Adds an ICMPv4 rule to allow incoming echo request messages (IcmpCodeAndType = 8:0)&lt;br /&gt;
  SimpleFC::AdvAddRule &amp;quot;Echo-Request (ICMPv4 incoming)&amp;quot; \&lt;br /&gt;
    &amp;quot;Allows incoming ICMP Echo messages.&amp;quot; &amp;quot;1&amp;quot; &amp;quot;1&amp;quot; &amp;quot;1&amp;quot; &amp;quot;7&amp;quot; &amp;quot;1&amp;quot; &amp;quot;&amp;quot; \&lt;br /&gt;
    &amp;quot;8:0&amp;quot; &amp;quot;@PathToApplication,-10000&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Add an application rule to allow incoming TCP access on this application&lt;br /&gt;
  SimpleFC::AdvAddRule &amp;quot;Incoming requests (TCP incoming)&amp;quot; \ &lt;br /&gt;
    &amp;quot;Allows incoming requests.&amp;quot; &amp;quot;6&amp;quot; &amp;quot;1&amp;quot; &amp;quot;1&amp;quot; &amp;quot;7&amp;quot; &amp;quot;1&amp;quot; &amp;quot;PathToApplication&amp;quot; \ &lt;br /&gt;
    &amp;quot;&amp;quot; &amp;quot;@PathToApplication,-10000&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Add an application rule to allow incoming UDP access on this application&lt;br /&gt;
  SimpleFC::AdvAddRule &amp;quot;Incoming requests (UDP incoming)&amp;quot; \&lt;br /&gt;
    &amp;quot;Allows incoming requests.&amp;quot; &amp;quot;17&amp;quot; &amp;quot;1&amp;quot; &amp;quot;1&amp;quot; &amp;quot;7&amp;quot; &amp;quot;1&amp;quot; &amp;quot;PathToApplication&amp;quot; \ &lt;br /&gt;
    &amp;quot;&amp;quot; &amp;quot;@PathToApplication,-10000&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Removes a firewall rule&lt;br /&gt;
  SimpleFC::AdvRemoveRule &amp;quot;Incoming requests (UDP incoming)&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if the firewall exists&lt;br /&gt;
  SimpleFC::AdvExistsRule &amp;quot;Incoming requests (UDP incoming)&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Exists/0=DoesnÂ´t exists&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Changelog ==&lt;br /&gt;
*Version 1.18 (2010-02-23)&lt;br /&gt;
**Documentation updated&lt;br /&gt;
*Version 1.17 (2009-09-05)&lt;br /&gt;
**Added changes from the service manager&lt;br /&gt;
**The following functions are now case insensitive:&lt;br /&gt;
***SimpleFC::IsApplicationAdded&lt;br /&gt;
***SimpleFC::IsApplicationEnabled&lt;br /&gt;
***SimpleFC::EnableDisableApplication&lt;br /&gt;
***SimpleFC::AdvExistsRule&lt;br /&gt;
*Version 1.16 (2009-04-13)&lt;br /&gt;
**Added changes from the service manager&lt;br /&gt;
*Version 1.15 (2008-08-18)&lt;br /&gt;
**Added changes from the service manager and checked removed compiler optimization to avoid a false-positive virusscan.&lt;br /&gt;
*Version 1.14 (2008-02-05)&lt;br /&gt;
** Added changes from the service manager&lt;br /&gt;
*Version 1.13 (2008-01-29)&lt;br /&gt;
** Added changes from the service manager&lt;br /&gt;
*Version 1.12 (2007-11-13)&lt;br /&gt;
** Fixed wrong documentation about SimpleFC::AdvExistsRule&lt;br /&gt;
*Version 1.11 (2007-08-07)&lt;br /&gt;
** Fixed potential endless loop bug in SimpleFC::StartStopFirewallService&lt;br /&gt;
*Version 1.10 (2007-08-02)&lt;br /&gt;
** Added default firewall functions:&lt;br /&gt;
*** SimpleFC::RestoreDefaults&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpOutboundDestinationUnreachable&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpRedirect&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpInboundEchoRequest&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpOutboundTimeExceeded&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpOutboundParameterProblem&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpOutboundSourceQuench&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpInboundRouterRequest&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpInboundTimestampRequest&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpInboundMaskRequest&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpOutboundPacketTooBig&lt;br /&gt;
*** SimpleFC::IsIcmpTypeAllowed&lt;br /&gt;
** Added functions for Windows Firewall with Advanced Security&lt;br /&gt;
*** SimpleFC::AdvAddRule&lt;br /&gt;
*** SimpleFC::AdvRemoveRule&lt;br /&gt;
*** SimpleFC::AdvExistsRule&lt;br /&gt;
*Version 1.01 (2007-07-05)&lt;br /&gt;
**Changed missing documentation about the function SimpleFC::IsFirewallEnabled&lt;br /&gt;
*Version 1.0 (2007-05-02)&lt;br /&gt;
**First offical version&lt;br /&gt;
&lt;br /&gt;
== Important Notes ==&lt;br /&gt;
&lt;br /&gt;
*This plugin is running on Windows XP SP2, Windows 2003, Windows Vista, Windows 2008 and Windows 7&lt;br /&gt;
*Before you execute some plugin commands it is recommend to check for windows firewall service is running (SimpleFC::IsFirewallServiceRunning).&lt;br /&gt;
*All functions with the prefix &amp;quot;Adv&amp;quot; are only for Windows Firewall with Advanced Security (Windows Vista and above). It is recommend to use these functions on the operating systems which supports the Windows Firewall with Advanced Security. Nethertheless, the default functions without the prefix &amp;quot;Adv&amp;quot; can be used.&lt;br /&gt;
* If you have any suggestions, comments or questions please mail me: mailto:rainer@speed-soft.de&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Plugins]]&lt;/div&gt;</summary>
		<author><name>Speed78</name></author>
	</entry>
	<entry>
		<id>https://nsis.sourceforge.io/mediawiki/index.php?title=NSIS_Simple_Service_Plugin&amp;diff=20843</id>
		<title>NSIS Simple Service Plugin</title>
		<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/mediawiki/index.php?title=NSIS_Simple_Service_Plugin&amp;diff=20843"/>
		<updated>2011-08-15T21:15:32Z</updated>

		<summary type="html">&lt;p&gt;Speed78: /* Links */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This plugin contains basic service functions like start, stop the service or checking the service status. It also contains advanced service functions for example setting the service description, changed the logon account, granting or removing the service logon privilege.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This plugin is using the MPL License or alternatively the LGPL License.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
&amp;lt;attach&amp;gt;NSIS_Simple_Service_Plugin_1.30.zip&amp;lt;/attach&amp;gt; The ZIP file containing a precompiled plugin DLL (to be saved in NSIS&#039; plugin directory) and the sources. If you update from a previous version it is strongly &#039;&#039;&#039;recommend&#039;&#039;&#039; to take look at the changelog.&lt;br /&gt;
&lt;br /&gt;
== Donation ==&lt;br /&gt;
If you believe that I am doing a good job and you want to support me please [http://www.speed-soft.de/donation/index.php?language=en donate] any amount via PayPal.&lt;br /&gt;
&lt;br /&gt;
== Short Reference ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
SimpleSC::InstallService [name_of_service] [display_name] [service_type] [start_type] &lt;br /&gt;
  [binary_path] [dependencies] [account] [password]&lt;br /&gt;
SimpleSC::RemoveService [name_of_service]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::StartService [name_of_service] [arguments] [timeout]&lt;br /&gt;
SimpleSC::StopService [name_of_service] [wait_for_file_release] [timeout]&lt;br /&gt;
SimpleSC::PauseService [name_of_service] [timeout]&lt;br /&gt;
SimpleSC::ContinueService [name_of_service] [timeout]&lt;br /&gt;
SimpleSC::RestartService [name_of_service] [arguments] [timeout]&lt;br /&gt;
SimpleSC::ExistsService [name_of_service]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::GetServiceDisplayName [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceName [display_name]&lt;br /&gt;
SimpleSC::GetServiceStatus [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceDescription [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceStartType [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceBinaryPath [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceLogon [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceFailure [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceFailureFlag [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceDelayedAutoStartInfo [name_of_service]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::SetServiceDescription [name_of_service] [service_description]&lt;br /&gt;
SimpleSC::SetServiceStartType [name_of_service] [start_type]&lt;br /&gt;
SimpleSC::SetServiceBinaryPath [name_of_service] [binary_path]&lt;br /&gt;
SimpleSC::SetServiceLogon [name_of_service] [account] [password]&lt;br /&gt;
SimpleSC::SetServiceFailure [name_of_service] [reset_period] [reboot_message] [command] &lt;br /&gt;
  [action_type_1] [action_delay_1] [action_type_2] [action_delay_2] [action_type_3] &lt;br /&gt;
  [action_delay_3]&lt;br /&gt;
SimpleSC::SetServiceFailureFlag [name_of_service] [failure_actions_on_non_crash_failures]&lt;br /&gt;
SimpleSC::SetServiceDelayedAutoStartInfo [name_of_service] [delayed_autostart]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::GrantServiceLogonPrivilege [account]&lt;br /&gt;
SimpleSC::RemoveServiceLogonPrivilege [account]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::ServiceIsPaused [name_of_service]&lt;br /&gt;
SimpleSC::ServiceIsRunning [name_of_service]&lt;br /&gt;
SimpleSC::ServiceIsStopped [name_of_service]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::GetErrorMessage [error_code]&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
*name_of_service - The name of the service used for Start/Stop commands and all further commands &lt;br /&gt;
*display_name - The name as shown in the service control manager applet in system control &lt;br /&gt;
*service_type - One of the following codes &lt;br /&gt;
**1 - SERVICE_KERNEL_DRIVER - Driver service.&lt;br /&gt;
**2 - SERVICE_FILE_SYSTEM_DRIVER - File system driver service.&lt;br /&gt;
**16 - SERVICE_WIN32_OWN_PROCESS - Service that runs in its own process. (Should be used in most cases)&lt;br /&gt;
**32 - SERVICE_WIN32_SHARE_PROCESS - Service that shares a process with one or more other services. &lt;br /&gt;
**256 - SERVICE_INTERACTIVE_PROCESS - The service can interact with the desktop. &lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: If you specify either SERVICE_WIN32_OWN_PROCESS or SERVICE_WIN32_SHARE_PROCESS,          and the service is running in the context of the LocalSystem account,          you can also specify this value. Example: SERVICE_WIN32_OWN_PROCESS or SERVICE_INTERACTIVE_PROCESS - (16 or 256) = 272&lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: Services cannot directly interact with a user as of Windows Vista.             Therefore, this technique should not be used in new code. See for more information: http://msdn2.microsoft.com/en-us/library/ms683502(VS.85).aspx          &lt;br /&gt;
&lt;br /&gt;
*start_type - one of the following codes &lt;br /&gt;
**0 - SERVICE_BOOT_START - Driver boot stage start &lt;br /&gt;
**1 - SERVICE_SYSTEM_START - Driver scm stage start &lt;br /&gt;
**2 - SERVICE_AUTO_START - Service auto start (Should be used in most cases)&lt;br /&gt;
**3 - SERVICE_DEMAND_START - Driver/service manual start &lt;br /&gt;
**4 - SERVICE_DISABLED - Driver/service disabled&lt;br /&gt;
*service_status - one of the following codes&lt;br /&gt;
**1 - SERVICE_STOPPED&lt;br /&gt;
**2 - SERVICE_START_PENDING&lt;br /&gt;
**3 - SERVICE_STOP_PENDING&lt;br /&gt;
**4 - SERVICE_RUNNING&lt;br /&gt;
**5 - SERVICE_CONTINUE_PENDING&lt;br /&gt;
**6 - SERVICE_PAUSE_PENDING&lt;br /&gt;
**7 - SERVICE_PAUSED&lt;br /&gt;
*binary_path - The path to the binary including all necessary parameters &lt;br /&gt;
*dependencies - Needed services, controls which services have to be started before this one; use the forward slash &amp;quot;/&amp;quot; to add more more than one service&lt;br /&gt;
*account - The username/account which should be used &lt;br /&gt;
*password - Password of the aforementioned account to be able to logon as a service &lt;br /&gt;
**&#039;&#039;&#039;Note&#039;&#039;&#039;: If you do not specify account/password, the local system account will be used to run the service&lt;br /&gt;
*arguments - Arguments passed to the service main function. &lt;br /&gt;
**&#039;&#039;&#039;Note&#039;&#039;&#039;: Driver services do not receive these arguments.&lt;br /&gt;
*reset_period - The time after which to reset the failure count to zero if there are no failures, in seconds. Specify 0 (INFINITE) to indicate that this value should never be reset&lt;br /&gt;
*reboot_message - The message to be broadcast to server users before rebooting&lt;br /&gt;
*command - The command line of the process to execute in response to the SC_ACTION_RUN_COMMAND service controller action. This process runs under the same account as the service&lt;br /&gt;
*timeout - Timeout in seconds of the function&lt;br /&gt;
*action_type_x - one of the following codes for the action to be performed&lt;br /&gt;
**0 - SC_ACTION_NONE - No action&lt;br /&gt;
**1 - SC_ACTION_RESTART - Restart the service&lt;br /&gt;
**2 - SC_ACTION_REBOOT - Reboot the computer (Note: The service user must have the SE_SHUTDOWN_NAME privilege)&lt;br /&gt;
**3 - SC_ACTION_RUN_COMMAND - Run a command&lt;br /&gt;
*action_delay_x - The time to wait before performing the specified action, in milliseconds&lt;br /&gt;
*failure_actions_on_non_crash_failures - This setting determines when failure actions are to be executed&lt;br /&gt;
**0 - The failure actions executed only if the service terminates without reporting a status of SERVICE_STOPPED&lt;br /&gt;
**1 - The failure actions executed if the status of a service is SERVICE_STOPPED but the exit code of the service is not 0&lt;br /&gt;
*delayed_autostart - The delayed auto-start setting of an auto-start service&lt;br /&gt;
**0 - The service will be started during system boot.&lt;br /&gt;
**1 - The service will be started after other auto-start services are started plus a short delay&lt;br /&gt;
*error_code - Error code of a function&lt;br /&gt;
*service_description - The description as shown in the service control manager applet in system control&lt;br /&gt;
*wait_for_file_release - Wait for file release after the service is stopped. This is useful if the binary file will be overwritten after stopping the service.&lt;br /&gt;
**0 - NO_WAIT - No wait for file release&lt;br /&gt;
**1 - WAIT - Wait for file release &lt;br /&gt;
**&#039;&#039;&#039;Note&#039;&#039;&#039;: If SERVICE_WIN32_OWN_PROCESS is used this option should be set to WAIT.	If SERVICE_WIN32_SHARE_PROCESS is used this option should only be set to WAIT if the last service in the process is stopped.&lt;br /&gt;
&lt;br /&gt;
== The Sample Script ==&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
; Install a service - ServiceType own process - StartType automatic - NoDependencies - Logon as System Account&lt;br /&gt;
  SimpleSC::InstallService &amp;quot;MyService&amp;quot; &amp;quot;My Service Display Name&amp;quot; &amp;quot;16&amp;quot; &amp;quot;2&amp;quot; &amp;quot;C:\MyPath\MyService.exe&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Install a service - ServiceType interact with desktop - StartType automatic - Dependencies on &amp;quot;Windows Time Service&amp;quot; (w32time) and &amp;quot;WWW Publishing Service&amp;quot; (w3svc) - Logon as System Account&lt;br /&gt;
  SimpleSC::InstallService &amp;quot;MyService&amp;quot; &amp;quot;My Service Display Name&amp;quot; &amp;quot;272&amp;quot; &amp;quot;2&amp;quot; &amp;quot;C:\MyPath\MyService.exe&amp;quot; &amp;quot;w32time/w3svc&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Remove a service&lt;br /&gt;
  SimpleSC::RemoveService &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Start a service&lt;br /&gt;
  SimpleSC::StartService &amp;quot;MyService&amp;quot; &amp;quot;&amp;quot; 30&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Start a service with two arguments &amp;quot;/param1=true&amp;quot; &amp;quot;/param2=1&amp;quot;&lt;br /&gt;
  SimpleSC::StartService &amp;quot;MyService&amp;quot; &amp;quot;/param1=true /param2=1&amp;quot; 30&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
 &lt;br /&gt;
; Start a service with two arguments &amp;quot;-p param1&amp;quot; &amp;quot;-param2&amp;quot;&lt;br /&gt;
  SimpleSC::StartService &amp;quot;MyService&amp;quot; &#039;&amp;quot;-p param1&amp;quot; -param2&#039; 30&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Stop a service and waits for file release&lt;br /&gt;
  SimpleSC::StopService &amp;quot;MyService&amp;quot; 1 30&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Stops two services and waits for file release after the last service is stopped&lt;br /&gt;
  SimpleSC::StopService &amp;quot;MyService1&amp;quot; 0 30&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  SimpleSC::StopService &amp;quot;MyService2&amp;quot; 1 30&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Pause a service&lt;br /&gt;
  SimpleSC::PauseService &amp;quot;MyService&amp;quot; 30&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Continue a service&lt;br /&gt;
  SimpleSC::ContinueService &amp;quot;MyService&amp;quot; 30&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Restart a service&lt;br /&gt;
  SimpleSC::RestartService &amp;quot;MyService&amp;quot; &amp;quot;&amp;quot; 30&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Restart a service with two arguments &amp;quot;/param1=true&amp;quot; &amp;quot;/param2=1&amp;quot;&lt;br /&gt;
  SimpleSC::RestartService &amp;quot;MyService&amp;quot; &amp;quot;/param1=true /param2=1&amp;quot; 30&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Start a service with two arguments &amp;quot;-p param1&amp;quot; &amp;quot;-param2&amp;quot;&lt;br /&gt;
  SimpleSC::RestartService &amp;quot;MyService&amp;quot; &#039;&amp;quot;-p param1&amp;quot; -param2&#039; 30&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Check if the service exists&lt;br /&gt;
  SimpleSC::ExistsService &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode if the service doesn´t exists (&amp;lt;&amp;gt;0)/service exists (0)&lt;br /&gt;
&lt;br /&gt;
; Get the displayname of a service&lt;br /&gt;
  SimpleSC::GetServiceDisplayName &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the displayname of the service&lt;br /&gt;
&lt;br /&gt;
; Get the servicename of a service by the displayname&lt;br /&gt;
  SimpleSC::GetServiceName &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the servicename of the service&lt;br /&gt;
&lt;br /&gt;
; Get the current status of a service&lt;br /&gt;
  SimpleSC::GetServiceStatus &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; return the status of the service (See &amp;quot;service_status&amp;quot; in the parameters)&lt;br /&gt;
&lt;br /&gt;
; Get the description of a service&lt;br /&gt;
  SimpleSC::GetServiceDescription &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the description of the service&lt;br /&gt;
 &lt;br /&gt;
; Get the start type of the service&lt;br /&gt;
  SimpleSC::GetServiceStartType &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the start type of the service (see &amp;quot;start_type&amp;quot; in the parameters)&lt;br /&gt;
&lt;br /&gt;
; Get the binary path of a service&lt;br /&gt;
  SimpleSC::GetServiceBinaryPath &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the binary path of the service&lt;br /&gt;
&lt;br /&gt;
; Get the logon user of the service&lt;br /&gt;
  SimpleSC::GetServiceLogon &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the logon username of the service  &lt;br /&gt;
&lt;br /&gt;
; Get the failure configuration of a service&lt;br /&gt;
  SimpleSC::GetServiceFailure &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the reset period &lt;br /&gt;
  Pop $2 ; returns the reboot message&lt;br /&gt;
  Pop $3 ; returns the command&lt;br /&gt;
  Pop $4 ; returns the first action (See &amp;quot;action_type_x&amp;quot; in the parameters)&lt;br /&gt;
  Pop $5 ; returns the first action delay &lt;br /&gt;
  Pop $6 ; returns the second action (See &amp;quot;action_type_x&amp;quot; in the parameters)&lt;br /&gt;
  Pop $7 ; returns the second action delay &lt;br /&gt;
  Pop $8 ; returns the third action (See &amp;quot;action_type_x&amp;quot; in the parameters)&lt;br /&gt;
  Pop $9 ; returns the third action delay &lt;br /&gt;
&lt;br /&gt;
; Get the failure flag configuration of a service&lt;br /&gt;
  SimpleSC::GetServiceFailureFlag &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the service flag&lt;br /&gt;
&lt;br /&gt;
; Get the delayed auto-start configuration of a service&lt;br /&gt;
  SimpleSC::GetServiceDelayedAutoStartInfo &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the delayed auto-start configuration&lt;br /&gt;
&lt;br /&gt;
; Set the description of a service&lt;br /&gt;
  SimpleSC::SetServiceDescription &amp;quot;MyService&amp;quot; &amp;quot;Sample Description&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Set the starttype to automatic of a service&lt;br /&gt;
  SimpleSC::SetServiceStartType &amp;quot;MyService&amp;quot; &amp;quot;2&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Sets the service binary path&lt;br /&gt;
  SimpleSC::SetServiceBinaryPath &amp;quot;MyService&amp;quot; &amp;quot;C:\MySoftware\MyService.exe&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Sets the service logon to a user and grant the user the &amp;quot;SeServiceLogonPrivilege&amp;quot;&lt;br /&gt;
  SimpleSC::SetServiceLogon &amp;quot;MyService&amp;quot; &amp;quot;MyServiceUser&amp;quot; &amp;quot;MyServiceUserPassword&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  IntCmp $0 0 +1 Done Done ; If successful grant the service logon privilege to &amp;quot;MyServiceUser&amp;quot;&lt;br /&gt;
    ; Note: Every serviceuser must have the ServiceLogonPrivilege to start the service&lt;br /&gt;
    SimpleSC::GrantServiceLogonPrivilege &amp;quot;MyServiceUser&amp;quot;&lt;br /&gt;
    Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Done:&lt;br /&gt;
&lt;br /&gt;
; Sets the service failure configuration - First action: Restart the service after one minute - Second action: Reboot the computer after five minutes&lt;br /&gt;
  SimpleSC::SetServiceFailure &amp;quot;MyService&amp;quot; &amp;quot;0&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;1&amp;quot; &amp;quot;60000&amp;quot; &amp;quot;2&amp;quot; &amp;quot;300000&amp;quot; &amp;quot;0&amp;quot; &amp;quot;0&amp;quot; &lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Sets the failure flag configuration of a service&lt;br /&gt;
  SimpleSC::SetServiceFailureFlag &amp;quot;MyService&amp;quot; &amp;quot;1&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Sets the delayed auto-start configuration of a service&lt;br /&gt;
  SimpleSC::SetServiceDelayedAutoStartInfo &amp;quot;MyService&amp;quot; &amp;quot;1&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Remove the &amp;quot;SeServiceLogonPrivilege&amp;quot; from a user&lt;br /&gt;
  SimpleSC::RemoveServiceLogonPrivilege &amp;quot;MyServiceUser&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Check if the service is paused&lt;br /&gt;
  SimpleSC::ServiceIsPaused &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns 1 (service is paused) - returns 0 (service is not paused)&lt;br /&gt;
&lt;br /&gt;
; Check if the service is running&lt;br /&gt;
  SimpleSC::ServiceIsRunning &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns 1 (service is running) - returns 0 (service is not running)&lt;br /&gt;
&lt;br /&gt;
; Check if the service is stopped&lt;br /&gt;
  SimpleSC::ServiceIsStopped &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns 1 (service is stopped) - returns 0 (service is not stopped)&lt;br /&gt;
&lt;br /&gt;
; Show the error message if a function fails &lt;br /&gt;
  SimpleSC::StopService &amp;quot;MyService&amp;quot; 1 30&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  IntCmp $0 0 Done +1 +1 &lt;br /&gt;
    Push $0&lt;br /&gt;
    SimpleSC::GetErrorMessage&lt;br /&gt;
    Pop $0&lt;br /&gt;
    MessageBox MB_OK|MB_ICONSTOP &amp;quot;Stopping fails - Reason: $0&amp;quot;&lt;br /&gt;
  Done:&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Changelog ==&lt;br /&gt;
* Version 1.30 (2011-08-15)&lt;br /&gt;
**SimpleSC::RemoveService doesn&#039;t stop the service now.&lt;br /&gt;
**SimpleSC::StartService, SimpleSC::StopService, SimpleSC::PauseService, SimpleSC::ContinueService and SimpleSC::RestartService got a new &amp;quot;Timeout&amp;quot; parameter. It is recommend to use a timeout of 30.&lt;br /&gt;
* Version 1.29 (2011-04-16)&lt;br /&gt;
**SimpleSC::GetServiceFailureFlag added&lt;br /&gt;
**SimpleSC::SetServiceFailureFlag added&lt;br /&gt;
**SimpleSC::GetServiceDelayedAutoStartInfo added&lt;br /&gt;
**SimpleSC::SetServiceDelayedAutoStartInfo added&lt;br /&gt;
* Version 1.28 (2010-09-14)&lt;br /&gt;
**SimpleSC::GetServiceFailure function added&lt;br /&gt;
**SimpleSC::SetServiceFailure function added&lt;br /&gt;
**SimpleSC::StopService WaitForFileRelease feature added (For details take a look at the documentation)&lt;br /&gt;
* Version 1.27 (2010-03-23)&lt;br /&gt;
**Documentation updated&lt;br /&gt;
* Version 1.26 (2009-05-21)&lt;br /&gt;
**Fixed wait for status bug on starting, stopping, pausing or continuing a service &lt;br /&gt;
* Version 1.25 (2009-04-23)&lt;br /&gt;
**SimpleSC::SetServiceLogon supports now non-domain username without the &amp;quot;.\&amp;quot;-prefix&lt;br /&gt;
**SimpleSC::SetServiceBinaryPath function added&lt;br /&gt;
*Version 1.24 (2009-04-13)&lt;br /&gt;
**Fixed wait for status bug if the service status changed. Now, if a service stops, starts aso. the plugin will work like the recommendations in the MSDN.&lt;br /&gt;
*Version 1.23 (2008-08-23)&lt;br /&gt;
**Removed compiler optimization to avoid a false-positive virusscan.&lt;br /&gt;
*Version 1.22 (2008-08-17)&lt;br /&gt;
**SimpleSC::GrantServiceLogonPrivilege and SimpleSC::RemoveServiceLogonPrivilege works now correct with domain names like MyDomain\MyUser.&lt;br /&gt;
**Added function SimpleSC::GetServiceLogon to get the logon username of a service.&lt;br /&gt;
*Version 1.21 (2008-02-10)&lt;br /&gt;
**SimpleSC::ExistsService results now 0 if the service exists and &amp;lt;&amp;gt; 0 if the service doensnÂ´t exists.&lt;br /&gt;
*Version 1.20 (2008-02-05)&lt;br /&gt;
**Every function now returns &amp;lt;&amp;gt; 0 if there is an error. Use SimpleSC::GetErrorMessage to get the message of a function result.&lt;br /&gt;
**Added function SimpleSC::GetErrorMessage to get the message of a function result.&lt;br /&gt;
**SimpleSC::ExistsService results now 0 if the service exists and &amp;lt;&amp;gt; 0 if the service doensnÂ´t exists.&lt;br /&gt;
**SimpleSC::RestartService supports now arguments.&lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: The signature has been changed. If you update from a previous version you must check your parameters.&lt;br /&gt;
*Version 1.10 (2008-01-29)&lt;br /&gt;
**SimpleSC::InstallService supports now more than one dependencies (delimitter is the forward slash).&lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: The signature has been changed. If you update from a previous version you must check your parameters.&lt;br /&gt;
**SimpleSC::InstallService supports now more service types e.g. to create an interactive service.&lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: The signature has been changed. If you update from a previous version you must check your parameters.&lt;br /&gt;
**SimpleSC::StartService supports now arguments. &lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: The signature has been changed. If you update from a previous version you must check your parameters.&lt;br /&gt;
*Version 1.05 (2008-01-12)&lt;br /&gt;
**The functions SimpleSC::StopService and SimpleSC::RestartService are now improved. Now all dependent services are stopping recursively too.&lt;br /&gt;
*Version 1.04 (2007-08-07)&lt;br /&gt;
**Fixed bug for possible endless loops. This concerns to the functions StartService, StopService, ContinueService and PauseService. &lt;br /&gt;
*Version 1.03 (2007-08-02)&lt;br /&gt;
**Added function SimpleSC::GetServiceBinaryPath to get the binary path of a specified service.&lt;br /&gt;
*Version 1.02 (2007-05-29)&lt;br /&gt;
**Changed wrong documentation informations about the functions SimpleSC::InstallService and SimpleSC::RemoveService.&lt;br /&gt;
*Version 1.01 (2007-05-07)&lt;br /&gt;
**Changed wrong status-results in Readme.txt. This concerns to the functions ServiceIsPaused, ServiceIsRunning and ServiceIsStopped.&lt;br /&gt;
**Changed the access privileges of the plugin. The plugin now uses the lowest privlege of each function to execute.&lt;br /&gt;
*Version 1.0 (2007-05-02)&lt;br /&gt;
**First offical version&lt;br /&gt;
&lt;br /&gt;
== Important Notes ==&lt;br /&gt;
*The function &amp;quot;SetServiceLogon&amp;quot; only works if the servicetype is &amp;quot;SERVICE_WIN32_OWN_PROCESS&amp;quot;.&lt;br /&gt;
* The functions &amp;quot;GetServiceDescription&amp;quot; or &amp;quot;SetServiceDescription&amp;quot; are only available on systems higher than Windows NT.&lt;br /&gt;
* The function &amp;quot;GetServiceFailureFlag&amp;quot;, &amp;quot;SetServiceFailureFlag&amp;quot;, &amp;quot;GetServiceDelayedAutoStartInfo&amp;quot; and &amp;quot;SetServiceDelayedAutoStartInfo&amp;quot; are only available on systems higher than Windows 2003.&lt;br /&gt;
* If you change the logon of an service to a new user you have to grant him the Service Logon Privilege. Otherwise the service cannot be started by the user you have assigned.&lt;br /&gt;
* The functions StartService, StopService, PauseService and ContinueService uses a timeout of 30 seconds. This means the function must be executed within 30 seconds, otherwise the functions will return an error.&lt;br /&gt;
* If you have any suggestions, comments or questions please mail me: mailto:rainer@speed-soft.de&lt;br /&gt;
&lt;br /&gt;
[[Category:Plugins]]&lt;/div&gt;</summary>
		<author><name>Speed78</name></author>
	</entry>
	<entry>
		<id>https://nsis.sourceforge.io/mediawiki/index.php?title=File:NSIS_Simple_Service_Plugin_1.30.zip&amp;diff=20842</id>
		<title>File:NSIS Simple Service Plugin 1.30.zip</title>
		<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/mediawiki/index.php?title=File:NSIS_Simple_Service_Plugin_1.30.zip&amp;diff=20842"/>
		<updated>2011-08-15T21:04:18Z</updated>

		<summary type="html">&lt;p&gt;Speed78: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Speed78</name></author>
	</entry>
	<entry>
		<id>https://nsis.sourceforge.io/mediawiki/index.php?title=NSIS_Simple_Service_Plugin&amp;diff=20840</id>
		<title>NSIS Simple Service Plugin</title>
		<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/mediawiki/index.php?title=NSIS_Simple_Service_Plugin&amp;diff=20840"/>
		<updated>2011-08-15T20:28:41Z</updated>

		<summary type="html">&lt;p&gt;Speed78: /* Changelog */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This plugin contains basic service functions like start, stop the service or checking the service status. It also contains advanced service functions for example setting the service description, changed the logon account, granting or removing the service logon privilege.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This plugin is using the MPL License or alternatively the LGPL License.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
&amp;lt;attach&amp;gt;NSIS_Simple_Service_Plugin_1.29.zip&amp;lt;/attach&amp;gt; The ZIP file containing a precompiled plugin DLL (to be saved in NSIS&#039; plugin directory) and the sources. If you update from a previous version it is strongly &#039;&#039;&#039;recommend&#039;&#039;&#039; to take look at the changelog.&lt;br /&gt;
&lt;br /&gt;
== Donation ==&lt;br /&gt;
If you believe that I am doing a good job and you want to support me please [http://www.speed-soft.de/donation/index.php?language=en donate] any amount via PayPal.&lt;br /&gt;
&lt;br /&gt;
== Short Reference ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
SimpleSC::InstallService [name_of_service] [display_name] [service_type] [start_type] &lt;br /&gt;
  [binary_path] [dependencies] [account] [password]&lt;br /&gt;
SimpleSC::RemoveService [name_of_service]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::StartService [name_of_service] [arguments] [timeout]&lt;br /&gt;
SimpleSC::StopService [name_of_service] [wait_for_file_release] [timeout]&lt;br /&gt;
SimpleSC::PauseService [name_of_service] [timeout]&lt;br /&gt;
SimpleSC::ContinueService [name_of_service] [timeout]&lt;br /&gt;
SimpleSC::RestartService [name_of_service] [arguments] [timeout]&lt;br /&gt;
SimpleSC::ExistsService [name_of_service]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::GetServiceDisplayName [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceName [display_name]&lt;br /&gt;
SimpleSC::GetServiceStatus [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceDescription [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceStartType [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceBinaryPath [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceLogon [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceFailure [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceFailureFlag [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceDelayedAutoStartInfo [name_of_service]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::SetServiceDescription [name_of_service] [service_description]&lt;br /&gt;
SimpleSC::SetServiceStartType [name_of_service] [start_type]&lt;br /&gt;
SimpleSC::SetServiceBinaryPath [name_of_service] [binary_path]&lt;br /&gt;
SimpleSC::SetServiceLogon [name_of_service] [account] [password]&lt;br /&gt;
SimpleSC::SetServiceFailure [name_of_service] [reset_period] [reboot_message] [command] &lt;br /&gt;
  [action_type_1] [action_delay_1] [action_type_2] [action_delay_2] [action_type_3] &lt;br /&gt;
  [action_delay_3]&lt;br /&gt;
SimpleSC::SetServiceFailureFlag [name_of_service] [failure_actions_on_non_crash_failures]&lt;br /&gt;
SimpleSC::SetServiceDelayedAutoStartInfo [name_of_service] [delayed_autostart]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::GrantServiceLogonPrivilege [account]&lt;br /&gt;
SimpleSC::RemoveServiceLogonPrivilege [account]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::ServiceIsPaused [name_of_service]&lt;br /&gt;
SimpleSC::ServiceIsRunning [name_of_service]&lt;br /&gt;
SimpleSC::ServiceIsStopped [name_of_service]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::GetErrorMessage [error_code]&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
*name_of_service - The name of the service used for Start/Stop commands and all further commands &lt;br /&gt;
*display_name - The name as shown in the service control manager applet in system control &lt;br /&gt;
*service_type - One of the following codes &lt;br /&gt;
**1 - SERVICE_KERNEL_DRIVER - Driver service.&lt;br /&gt;
**2 - SERVICE_FILE_SYSTEM_DRIVER - File system driver service.&lt;br /&gt;
**16 - SERVICE_WIN32_OWN_PROCESS - Service that runs in its own process. (Should be used in most cases)&lt;br /&gt;
**32 - SERVICE_WIN32_SHARE_PROCESS - Service that shares a process with one or more other services. &lt;br /&gt;
**256 - SERVICE_INTERACTIVE_PROCESS - The service can interact with the desktop. &lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: If you specify either SERVICE_WIN32_OWN_PROCESS or SERVICE_WIN32_SHARE_PROCESS,          and the service is running in the context of the LocalSystem account,          you can also specify this value. Example: SERVICE_WIN32_OWN_PROCESS or SERVICE_INTERACTIVE_PROCESS - (16 or 256) = 272&lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: Services cannot directly interact with a user as of Windows Vista.             Therefore, this technique should not be used in new code. See for more information: http://msdn2.microsoft.com/en-us/library/ms683502(VS.85).aspx          &lt;br /&gt;
&lt;br /&gt;
*start_type - one of the following codes &lt;br /&gt;
**0 - SERVICE_BOOT_START - Driver boot stage start &lt;br /&gt;
**1 - SERVICE_SYSTEM_START - Driver scm stage start &lt;br /&gt;
**2 - SERVICE_AUTO_START - Service auto start (Should be used in most cases)&lt;br /&gt;
**3 - SERVICE_DEMAND_START - Driver/service manual start &lt;br /&gt;
**4 - SERVICE_DISABLED - Driver/service disabled&lt;br /&gt;
*service_status - one of the following codes&lt;br /&gt;
**1 - SERVICE_STOPPED&lt;br /&gt;
**2 - SERVICE_START_PENDING&lt;br /&gt;
**3 - SERVICE_STOP_PENDING&lt;br /&gt;
**4 - SERVICE_RUNNING&lt;br /&gt;
**5 - SERVICE_CONTINUE_PENDING&lt;br /&gt;
**6 - SERVICE_PAUSE_PENDING&lt;br /&gt;
**7 - SERVICE_PAUSED&lt;br /&gt;
*binary_path - The path to the binary including all necessary parameters &lt;br /&gt;
*dependencies - Needed services, controls which services have to be started before this one; use the forward slash &amp;quot;/&amp;quot; to add more more than one service&lt;br /&gt;
*account - The username/account which should be used &lt;br /&gt;
*password - Password of the aforementioned account to be able to logon as a service &lt;br /&gt;
**&#039;&#039;&#039;Note&#039;&#039;&#039;: If you do not specify account/password, the local system account will be used to run the service&lt;br /&gt;
*arguments - Arguments passed to the service main function. &lt;br /&gt;
**&#039;&#039;&#039;Note&#039;&#039;&#039;: Driver services do not receive these arguments.&lt;br /&gt;
*reset_period - The time after which to reset the failure count to zero if there are no failures, in seconds. Specify 0 (INFINITE) to indicate that this value should never be reset&lt;br /&gt;
*reboot_message - The message to be broadcast to server users before rebooting&lt;br /&gt;
*command - The command line of the process to execute in response to the SC_ACTION_RUN_COMMAND service controller action. This process runs under the same account as the service&lt;br /&gt;
*timeout - Timeout in seconds of the function&lt;br /&gt;
*action_type_x - one of the following codes for the action to be performed&lt;br /&gt;
**0 - SC_ACTION_NONE - No action&lt;br /&gt;
**1 - SC_ACTION_RESTART - Restart the service&lt;br /&gt;
**2 - SC_ACTION_REBOOT - Reboot the computer (Note: The service user must have the SE_SHUTDOWN_NAME privilege)&lt;br /&gt;
**3 - SC_ACTION_RUN_COMMAND - Run a command&lt;br /&gt;
*action_delay_x - The time to wait before performing the specified action, in milliseconds&lt;br /&gt;
*failure_actions_on_non_crash_failures - This setting determines when failure actions are to be executed&lt;br /&gt;
**0 - The failure actions executed only if the service terminates without reporting a status of SERVICE_STOPPED&lt;br /&gt;
**1 - The failure actions executed if the status of a service is SERVICE_STOPPED but the exit code of the service is not 0&lt;br /&gt;
*delayed_autostart - The delayed auto-start setting of an auto-start service&lt;br /&gt;
**0 - The service will be started during system boot.&lt;br /&gt;
**1 - The service will be started after other auto-start services are started plus a short delay&lt;br /&gt;
*error_code - Error code of a function&lt;br /&gt;
*service_description - The description as shown in the service control manager applet in system control&lt;br /&gt;
*wait_for_file_release - Wait for file release after the service is stopped. This is useful if the binary file will be overwritten after stopping the service.&lt;br /&gt;
**0 - NO_WAIT - No wait for file release&lt;br /&gt;
**1 - WAIT - Wait for file release &lt;br /&gt;
**&#039;&#039;&#039;Note&#039;&#039;&#039;: If SERVICE_WIN32_OWN_PROCESS is used this option should be set to WAIT.	If SERVICE_WIN32_SHARE_PROCESS is used this option should only be set to WAIT if the last service in the process is stopped.&lt;br /&gt;
&lt;br /&gt;
== The Sample Script ==&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
; Install a service - ServiceType own process - StartType automatic - NoDependencies - Logon as System Account&lt;br /&gt;
  SimpleSC::InstallService &amp;quot;MyService&amp;quot; &amp;quot;My Service Display Name&amp;quot; &amp;quot;16&amp;quot; &amp;quot;2&amp;quot; &amp;quot;C:\MyPath\MyService.exe&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Install a service - ServiceType interact with desktop - StartType automatic - Dependencies on &amp;quot;Windows Time Service&amp;quot; (w32time) and &amp;quot;WWW Publishing Service&amp;quot; (w3svc) - Logon as System Account&lt;br /&gt;
  SimpleSC::InstallService &amp;quot;MyService&amp;quot; &amp;quot;My Service Display Name&amp;quot; &amp;quot;272&amp;quot; &amp;quot;2&amp;quot; &amp;quot;C:\MyPath\MyService.exe&amp;quot; &amp;quot;w32time/w3svc&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Remove a service&lt;br /&gt;
  SimpleSC::RemoveService &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Start a service&lt;br /&gt;
  SimpleSC::StartService &amp;quot;MyService&amp;quot; &amp;quot;&amp;quot; 30&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Start a service with two arguments &amp;quot;/param1=true&amp;quot; &amp;quot;/param2=1&amp;quot;&lt;br /&gt;
  SimpleSC::StartService &amp;quot;MyService&amp;quot; &amp;quot;/param1=true /param2=1&amp;quot; 30&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
 &lt;br /&gt;
; Start a service with two arguments &amp;quot;-p param1&amp;quot; &amp;quot;-param2&amp;quot;&lt;br /&gt;
  SimpleSC::StartService &amp;quot;MyService&amp;quot; &#039;&amp;quot;-p param1&amp;quot; -param2&#039; 30&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Stop a service and waits for file release&lt;br /&gt;
  SimpleSC::StopService &amp;quot;MyService&amp;quot; 1 30&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Stops two services and waits for file release after the last service is stopped&lt;br /&gt;
  SimpleSC::StopService &amp;quot;MyService1&amp;quot; 0 30&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  SimpleSC::StopService &amp;quot;MyService2&amp;quot; 1 30&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Pause a service&lt;br /&gt;
  SimpleSC::PauseService &amp;quot;MyService&amp;quot; 30&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Continue a service&lt;br /&gt;
  SimpleSC::ContinueService &amp;quot;MyService&amp;quot; 30&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Restart a service&lt;br /&gt;
  SimpleSC::RestartService &amp;quot;MyService&amp;quot; &amp;quot;&amp;quot; 30&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Restart a service with two arguments &amp;quot;/param1=true&amp;quot; &amp;quot;/param2=1&amp;quot;&lt;br /&gt;
  SimpleSC::RestartService &amp;quot;MyService&amp;quot; &amp;quot;/param1=true /param2=1&amp;quot; 30&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Start a service with two arguments &amp;quot;-p param1&amp;quot; &amp;quot;-param2&amp;quot;&lt;br /&gt;
  SimpleSC::RestartService &amp;quot;MyService&amp;quot; &#039;&amp;quot;-p param1&amp;quot; -param2&#039; 30&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Check if the service exists&lt;br /&gt;
  SimpleSC::ExistsService &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode if the service doesn´t exists (&amp;lt;&amp;gt;0)/service exists (0)&lt;br /&gt;
&lt;br /&gt;
; Get the displayname of a service&lt;br /&gt;
  SimpleSC::GetServiceDisplayName &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the displayname of the service&lt;br /&gt;
&lt;br /&gt;
; Get the servicename of a service by the displayname&lt;br /&gt;
  SimpleSC::GetServiceName &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the servicename of the service&lt;br /&gt;
&lt;br /&gt;
; Get the current status of a service&lt;br /&gt;
  SimpleSC::GetServiceStatus &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; return the status of the service (See &amp;quot;service_status&amp;quot; in the parameters)&lt;br /&gt;
&lt;br /&gt;
; Get the description of a service&lt;br /&gt;
  SimpleSC::GetServiceDescription &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the description of the service&lt;br /&gt;
 &lt;br /&gt;
; Get the start type of the service&lt;br /&gt;
  SimpleSC::GetServiceStartType &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the start type of the service (see &amp;quot;start_type&amp;quot; in the parameters)&lt;br /&gt;
&lt;br /&gt;
; Get the binary path of a service&lt;br /&gt;
  SimpleSC::GetServiceBinaryPath &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the binary path of the service&lt;br /&gt;
&lt;br /&gt;
; Get the logon user of the service&lt;br /&gt;
  SimpleSC::GetServiceLogon &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the logon username of the service  &lt;br /&gt;
&lt;br /&gt;
; Get the failure configuration of a service&lt;br /&gt;
  SimpleSC::GetServiceFailure &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the reset period &lt;br /&gt;
  Pop $2 ; returns the reboot message&lt;br /&gt;
  Pop $3 ; returns the command&lt;br /&gt;
  Pop $4 ; returns the first action (See &amp;quot;action_type_x&amp;quot; in the parameters)&lt;br /&gt;
  Pop $5 ; returns the first action delay &lt;br /&gt;
  Pop $6 ; returns the second action (See &amp;quot;action_type_x&amp;quot; in the parameters)&lt;br /&gt;
  Pop $7 ; returns the second action delay &lt;br /&gt;
  Pop $8 ; returns the third action (See &amp;quot;action_type_x&amp;quot; in the parameters)&lt;br /&gt;
  Pop $9 ; returns the third action delay &lt;br /&gt;
&lt;br /&gt;
; Get the failure flag configuration of a service&lt;br /&gt;
  SimpleSC::GetServiceFailureFlag &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the service flag&lt;br /&gt;
&lt;br /&gt;
; Get the delayed auto-start configuration of a service&lt;br /&gt;
  SimpleSC::GetServiceDelayedAutoStartInfo &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the delayed auto-start configuration&lt;br /&gt;
&lt;br /&gt;
; Set the description of a service&lt;br /&gt;
  SimpleSC::SetServiceDescription &amp;quot;MyService&amp;quot; &amp;quot;Sample Description&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Set the starttype to automatic of a service&lt;br /&gt;
  SimpleSC::SetServiceStartType &amp;quot;MyService&amp;quot; &amp;quot;2&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Sets the service binary path&lt;br /&gt;
  SimpleSC::SetServiceBinaryPath &amp;quot;MyService&amp;quot; &amp;quot;C:\MySoftware\MyService.exe&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Sets the service logon to a user and grant the user the &amp;quot;SeServiceLogonPrivilege&amp;quot;&lt;br /&gt;
  SimpleSC::SetServiceLogon &amp;quot;MyService&amp;quot; &amp;quot;MyServiceUser&amp;quot; &amp;quot;MyServiceUserPassword&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  IntCmp $0 0 +1 Done Done ; If successful grant the service logon privilege to &amp;quot;MyServiceUser&amp;quot;&lt;br /&gt;
    ; Note: Every serviceuser must have the ServiceLogonPrivilege to start the service&lt;br /&gt;
    SimpleSC::GrantServiceLogonPrivilege &amp;quot;MyServiceUser&amp;quot;&lt;br /&gt;
    Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Done:&lt;br /&gt;
&lt;br /&gt;
; Sets the service failure configuration - First action: Restart the service after one minute - Second action: Reboot the computer after five minutes&lt;br /&gt;
  SimpleSC::SetServiceFailure &amp;quot;MyService&amp;quot; &amp;quot;0&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;1&amp;quot; &amp;quot;60000&amp;quot; &amp;quot;2&amp;quot; &amp;quot;300000&amp;quot; &amp;quot;0&amp;quot; &amp;quot;0&amp;quot; &lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Sets the failure flag configuration of a service&lt;br /&gt;
  SimpleSC::SetServiceFailureFlag &amp;quot;MyService&amp;quot; &amp;quot;1&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Sets the delayed auto-start configuration of a service&lt;br /&gt;
  SimpleSC::SetServiceDelayedAutoStartInfo &amp;quot;MyService&amp;quot; &amp;quot;1&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Remove the &amp;quot;SeServiceLogonPrivilege&amp;quot; from a user&lt;br /&gt;
  SimpleSC::RemoveServiceLogonPrivilege &amp;quot;MyServiceUser&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Check if the service is paused&lt;br /&gt;
  SimpleSC::ServiceIsPaused &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns 1 (service is paused) - returns 0 (service is not paused)&lt;br /&gt;
&lt;br /&gt;
; Check if the service is running&lt;br /&gt;
  SimpleSC::ServiceIsRunning &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns 1 (service is running) - returns 0 (service is not running)&lt;br /&gt;
&lt;br /&gt;
; Check if the service is stopped&lt;br /&gt;
  SimpleSC::ServiceIsStopped &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns 1 (service is stopped) - returns 0 (service is not stopped)&lt;br /&gt;
&lt;br /&gt;
; Show the error message if a function fails &lt;br /&gt;
  SimpleSC::StopService &amp;quot;MyService&amp;quot; 1 30&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  IntCmp $0 0 Done +1 +1 &lt;br /&gt;
    Push $0&lt;br /&gt;
    SimpleSC::GetErrorMessage&lt;br /&gt;
    Pop $0&lt;br /&gt;
    MessageBox MB_OK|MB_ICONSTOP &amp;quot;Stopping fails - Reason: $0&amp;quot;&lt;br /&gt;
  Done:&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Changelog ==&lt;br /&gt;
* Version 1.30 (2011-08-15)&lt;br /&gt;
**SimpleSC::RemoveService doesn&#039;t stop the service now.&lt;br /&gt;
**SimpleSC::StartService, SimpleSC::StopService, SimpleSC::PauseService, SimpleSC::ContinueService and SimpleSC::RestartService got a new &amp;quot;Timeout&amp;quot; parameter. It is recommend to use a timeout of 30.&lt;br /&gt;
* Version 1.29 (2011-04-16)&lt;br /&gt;
**SimpleSC::GetServiceFailureFlag added&lt;br /&gt;
**SimpleSC::SetServiceFailureFlag added&lt;br /&gt;
**SimpleSC::GetServiceDelayedAutoStartInfo added&lt;br /&gt;
**SimpleSC::SetServiceDelayedAutoStartInfo added&lt;br /&gt;
* Version 1.28 (2010-09-14)&lt;br /&gt;
**SimpleSC::GetServiceFailure function added&lt;br /&gt;
**SimpleSC::SetServiceFailure function added&lt;br /&gt;
**SimpleSC::StopService WaitForFileRelease feature added (For details take a look at the documentation)&lt;br /&gt;
* Version 1.27 (2010-03-23)&lt;br /&gt;
**Documentation updated&lt;br /&gt;
* Version 1.26 (2009-05-21)&lt;br /&gt;
**Fixed wait for status bug on starting, stopping, pausing or continuing a service &lt;br /&gt;
* Version 1.25 (2009-04-23)&lt;br /&gt;
**SimpleSC::SetServiceLogon supports now non-domain username without the &amp;quot;.\&amp;quot;-prefix&lt;br /&gt;
**SimpleSC::SetServiceBinaryPath function added&lt;br /&gt;
*Version 1.24 (2009-04-13)&lt;br /&gt;
**Fixed wait for status bug if the service status changed. Now, if a service stops, starts aso. the plugin will work like the recommendations in the MSDN.&lt;br /&gt;
*Version 1.23 (2008-08-23)&lt;br /&gt;
**Removed compiler optimization to avoid a false-positive virusscan.&lt;br /&gt;
*Version 1.22 (2008-08-17)&lt;br /&gt;
**SimpleSC::GrantServiceLogonPrivilege and SimpleSC::RemoveServiceLogonPrivilege works now correct with domain names like MyDomain\MyUser.&lt;br /&gt;
**Added function SimpleSC::GetServiceLogon to get the logon username of a service.&lt;br /&gt;
*Version 1.21 (2008-02-10)&lt;br /&gt;
**SimpleSC::ExistsService results now 0 if the service exists and &amp;lt;&amp;gt; 0 if the service doensnÂ´t exists.&lt;br /&gt;
*Version 1.20 (2008-02-05)&lt;br /&gt;
**Every function now returns &amp;lt;&amp;gt; 0 if there is an error. Use SimpleSC::GetErrorMessage to get the message of a function result.&lt;br /&gt;
**Added function SimpleSC::GetErrorMessage to get the message of a function result.&lt;br /&gt;
**SimpleSC::ExistsService results now 0 if the service exists and &amp;lt;&amp;gt; 0 if the service doensnÂ´t exists.&lt;br /&gt;
**SimpleSC::RestartService supports now arguments.&lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: The signature has been changed. If you update from a previous version you must check your parameters.&lt;br /&gt;
*Version 1.10 (2008-01-29)&lt;br /&gt;
**SimpleSC::InstallService supports now more than one dependencies (delimitter is the forward slash).&lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: The signature has been changed. If you update from a previous version you must check your parameters.&lt;br /&gt;
**SimpleSC::InstallService supports now more service types e.g. to create an interactive service.&lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: The signature has been changed. If you update from a previous version you must check your parameters.&lt;br /&gt;
**SimpleSC::StartService supports now arguments. &lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: The signature has been changed. If you update from a previous version you must check your parameters.&lt;br /&gt;
*Version 1.05 (2008-01-12)&lt;br /&gt;
**The functions SimpleSC::StopService and SimpleSC::RestartService are now improved. Now all dependent services are stopping recursively too.&lt;br /&gt;
*Version 1.04 (2007-08-07)&lt;br /&gt;
**Fixed bug for possible endless loops. This concerns to the functions StartService, StopService, ContinueService and PauseService. &lt;br /&gt;
*Version 1.03 (2007-08-02)&lt;br /&gt;
**Added function SimpleSC::GetServiceBinaryPath to get the binary path of a specified service.&lt;br /&gt;
*Version 1.02 (2007-05-29)&lt;br /&gt;
**Changed wrong documentation informations about the functions SimpleSC::InstallService and SimpleSC::RemoveService.&lt;br /&gt;
*Version 1.01 (2007-05-07)&lt;br /&gt;
**Changed wrong status-results in Readme.txt. This concerns to the functions ServiceIsPaused, ServiceIsRunning and ServiceIsStopped.&lt;br /&gt;
**Changed the access privileges of the plugin. The plugin now uses the lowest privlege of each function to execute.&lt;br /&gt;
*Version 1.0 (2007-05-02)&lt;br /&gt;
**First offical version&lt;br /&gt;
&lt;br /&gt;
== Important Notes ==&lt;br /&gt;
*The function &amp;quot;SetServiceLogon&amp;quot; only works if the servicetype is &amp;quot;SERVICE_WIN32_OWN_PROCESS&amp;quot;.&lt;br /&gt;
* The functions &amp;quot;GetServiceDescription&amp;quot; or &amp;quot;SetServiceDescription&amp;quot; are only available on systems higher than Windows NT.&lt;br /&gt;
* The function &amp;quot;GetServiceFailureFlag&amp;quot;, &amp;quot;SetServiceFailureFlag&amp;quot;, &amp;quot;GetServiceDelayedAutoStartInfo&amp;quot; and &amp;quot;SetServiceDelayedAutoStartInfo&amp;quot; are only available on systems higher than Windows 2003.&lt;br /&gt;
* If you change the logon of an service to a new user you have to grant him the Service Logon Privilege. Otherwise the service cannot be started by the user you have assigned.&lt;br /&gt;
* The functions StartService, StopService, PauseService and ContinueService uses a timeout of 30 seconds. This means the function must be executed within 30 seconds, otherwise the functions will return an error.&lt;br /&gt;
* If you have any suggestions, comments or questions please mail me: mailto:rainer@speed-soft.de&lt;br /&gt;
&lt;br /&gt;
[[Category:Plugins]]&lt;/div&gt;</summary>
		<author><name>Speed78</name></author>
	</entry>
	<entry>
		<id>https://nsis.sourceforge.io/mediawiki/index.php?title=NSIS_Simple_Service_Plugin&amp;diff=20839</id>
		<title>NSIS Simple Service Plugin</title>
		<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/mediawiki/index.php?title=NSIS_Simple_Service_Plugin&amp;diff=20839"/>
		<updated>2011-08-15T20:21:24Z</updated>

		<summary type="html">&lt;p&gt;Speed78: /* The Sample Script */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This plugin contains basic service functions like start, stop the service or checking the service status. It also contains advanced service functions for example setting the service description, changed the logon account, granting or removing the service logon privilege.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This plugin is using the MPL License or alternatively the LGPL License.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
&amp;lt;attach&amp;gt;NSIS_Simple_Service_Plugin_1.29.zip&amp;lt;/attach&amp;gt; The ZIP file containing a precompiled plugin DLL (to be saved in NSIS&#039; plugin directory) and the sources. If you update from a previous version it is strongly &#039;&#039;&#039;recommend&#039;&#039;&#039; to take look at the changelog.&lt;br /&gt;
&lt;br /&gt;
== Donation ==&lt;br /&gt;
If you believe that I am doing a good job and you want to support me please [http://www.speed-soft.de/donation/index.php?language=en donate] any amount via PayPal.&lt;br /&gt;
&lt;br /&gt;
== Short Reference ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
SimpleSC::InstallService [name_of_service] [display_name] [service_type] [start_type] &lt;br /&gt;
  [binary_path] [dependencies] [account] [password]&lt;br /&gt;
SimpleSC::RemoveService [name_of_service]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::StartService [name_of_service] [arguments] [timeout]&lt;br /&gt;
SimpleSC::StopService [name_of_service] [wait_for_file_release] [timeout]&lt;br /&gt;
SimpleSC::PauseService [name_of_service] [timeout]&lt;br /&gt;
SimpleSC::ContinueService [name_of_service] [timeout]&lt;br /&gt;
SimpleSC::RestartService [name_of_service] [arguments] [timeout]&lt;br /&gt;
SimpleSC::ExistsService [name_of_service]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::GetServiceDisplayName [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceName [display_name]&lt;br /&gt;
SimpleSC::GetServiceStatus [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceDescription [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceStartType [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceBinaryPath [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceLogon [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceFailure [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceFailureFlag [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceDelayedAutoStartInfo [name_of_service]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::SetServiceDescription [name_of_service] [service_description]&lt;br /&gt;
SimpleSC::SetServiceStartType [name_of_service] [start_type]&lt;br /&gt;
SimpleSC::SetServiceBinaryPath [name_of_service] [binary_path]&lt;br /&gt;
SimpleSC::SetServiceLogon [name_of_service] [account] [password]&lt;br /&gt;
SimpleSC::SetServiceFailure [name_of_service] [reset_period] [reboot_message] [command] &lt;br /&gt;
  [action_type_1] [action_delay_1] [action_type_2] [action_delay_2] [action_type_3] &lt;br /&gt;
  [action_delay_3]&lt;br /&gt;
SimpleSC::SetServiceFailureFlag [name_of_service] [failure_actions_on_non_crash_failures]&lt;br /&gt;
SimpleSC::SetServiceDelayedAutoStartInfo [name_of_service] [delayed_autostart]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::GrantServiceLogonPrivilege [account]&lt;br /&gt;
SimpleSC::RemoveServiceLogonPrivilege [account]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::ServiceIsPaused [name_of_service]&lt;br /&gt;
SimpleSC::ServiceIsRunning [name_of_service]&lt;br /&gt;
SimpleSC::ServiceIsStopped [name_of_service]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::GetErrorMessage [error_code]&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
*name_of_service - The name of the service used for Start/Stop commands and all further commands &lt;br /&gt;
*display_name - The name as shown in the service control manager applet in system control &lt;br /&gt;
*service_type - One of the following codes &lt;br /&gt;
**1 - SERVICE_KERNEL_DRIVER - Driver service.&lt;br /&gt;
**2 - SERVICE_FILE_SYSTEM_DRIVER - File system driver service.&lt;br /&gt;
**16 - SERVICE_WIN32_OWN_PROCESS - Service that runs in its own process. (Should be used in most cases)&lt;br /&gt;
**32 - SERVICE_WIN32_SHARE_PROCESS - Service that shares a process with one or more other services. &lt;br /&gt;
**256 - SERVICE_INTERACTIVE_PROCESS - The service can interact with the desktop. &lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: If you specify either SERVICE_WIN32_OWN_PROCESS or SERVICE_WIN32_SHARE_PROCESS,          and the service is running in the context of the LocalSystem account,          you can also specify this value. Example: SERVICE_WIN32_OWN_PROCESS or SERVICE_INTERACTIVE_PROCESS - (16 or 256) = 272&lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: Services cannot directly interact with a user as of Windows Vista.             Therefore, this technique should not be used in new code. See for more information: http://msdn2.microsoft.com/en-us/library/ms683502(VS.85).aspx          &lt;br /&gt;
&lt;br /&gt;
*start_type - one of the following codes &lt;br /&gt;
**0 - SERVICE_BOOT_START - Driver boot stage start &lt;br /&gt;
**1 - SERVICE_SYSTEM_START - Driver scm stage start &lt;br /&gt;
**2 - SERVICE_AUTO_START - Service auto start (Should be used in most cases)&lt;br /&gt;
**3 - SERVICE_DEMAND_START - Driver/service manual start &lt;br /&gt;
**4 - SERVICE_DISABLED - Driver/service disabled&lt;br /&gt;
*service_status - one of the following codes&lt;br /&gt;
**1 - SERVICE_STOPPED&lt;br /&gt;
**2 - SERVICE_START_PENDING&lt;br /&gt;
**3 - SERVICE_STOP_PENDING&lt;br /&gt;
**4 - SERVICE_RUNNING&lt;br /&gt;
**5 - SERVICE_CONTINUE_PENDING&lt;br /&gt;
**6 - SERVICE_PAUSE_PENDING&lt;br /&gt;
**7 - SERVICE_PAUSED&lt;br /&gt;
*binary_path - The path to the binary including all necessary parameters &lt;br /&gt;
*dependencies - Needed services, controls which services have to be started before this one; use the forward slash &amp;quot;/&amp;quot; to add more more than one service&lt;br /&gt;
*account - The username/account which should be used &lt;br /&gt;
*password - Password of the aforementioned account to be able to logon as a service &lt;br /&gt;
**&#039;&#039;&#039;Note&#039;&#039;&#039;: If you do not specify account/password, the local system account will be used to run the service&lt;br /&gt;
*arguments - Arguments passed to the service main function. &lt;br /&gt;
**&#039;&#039;&#039;Note&#039;&#039;&#039;: Driver services do not receive these arguments.&lt;br /&gt;
*reset_period - The time after which to reset the failure count to zero if there are no failures, in seconds. Specify 0 (INFINITE) to indicate that this value should never be reset&lt;br /&gt;
*reboot_message - The message to be broadcast to server users before rebooting&lt;br /&gt;
*command - The command line of the process to execute in response to the SC_ACTION_RUN_COMMAND service controller action. This process runs under the same account as the service&lt;br /&gt;
*timeout - Timeout in seconds of the function&lt;br /&gt;
*action_type_x - one of the following codes for the action to be performed&lt;br /&gt;
**0 - SC_ACTION_NONE - No action&lt;br /&gt;
**1 - SC_ACTION_RESTART - Restart the service&lt;br /&gt;
**2 - SC_ACTION_REBOOT - Reboot the computer (Note: The service user must have the SE_SHUTDOWN_NAME privilege)&lt;br /&gt;
**3 - SC_ACTION_RUN_COMMAND - Run a command&lt;br /&gt;
*action_delay_x - The time to wait before performing the specified action, in milliseconds&lt;br /&gt;
*failure_actions_on_non_crash_failures - This setting determines when failure actions are to be executed&lt;br /&gt;
**0 - The failure actions executed only if the service terminates without reporting a status of SERVICE_STOPPED&lt;br /&gt;
**1 - The failure actions executed if the status of a service is SERVICE_STOPPED but the exit code of the service is not 0&lt;br /&gt;
*delayed_autostart - The delayed auto-start setting of an auto-start service&lt;br /&gt;
**0 - The service will be started during system boot.&lt;br /&gt;
**1 - The service will be started after other auto-start services are started plus a short delay&lt;br /&gt;
*error_code - Error code of a function&lt;br /&gt;
*service_description - The description as shown in the service control manager applet in system control&lt;br /&gt;
*wait_for_file_release - Wait for file release after the service is stopped. This is useful if the binary file will be overwritten after stopping the service.&lt;br /&gt;
**0 - NO_WAIT - No wait for file release&lt;br /&gt;
**1 - WAIT - Wait for file release &lt;br /&gt;
**&#039;&#039;&#039;Note&#039;&#039;&#039;: If SERVICE_WIN32_OWN_PROCESS is used this option should be set to WAIT.	If SERVICE_WIN32_SHARE_PROCESS is used this option should only be set to WAIT if the last service in the process is stopped.&lt;br /&gt;
&lt;br /&gt;
== The Sample Script ==&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
; Install a service - ServiceType own process - StartType automatic - NoDependencies - Logon as System Account&lt;br /&gt;
  SimpleSC::InstallService &amp;quot;MyService&amp;quot; &amp;quot;My Service Display Name&amp;quot; &amp;quot;16&amp;quot; &amp;quot;2&amp;quot; &amp;quot;C:\MyPath\MyService.exe&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Install a service - ServiceType interact with desktop - StartType automatic - Dependencies on &amp;quot;Windows Time Service&amp;quot; (w32time) and &amp;quot;WWW Publishing Service&amp;quot; (w3svc) - Logon as System Account&lt;br /&gt;
  SimpleSC::InstallService &amp;quot;MyService&amp;quot; &amp;quot;My Service Display Name&amp;quot; &amp;quot;272&amp;quot; &amp;quot;2&amp;quot; &amp;quot;C:\MyPath\MyService.exe&amp;quot; &amp;quot;w32time/w3svc&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Remove a service&lt;br /&gt;
  SimpleSC::RemoveService &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Start a service&lt;br /&gt;
  SimpleSC::StartService &amp;quot;MyService&amp;quot; &amp;quot;&amp;quot; 30&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Start a service with two arguments &amp;quot;/param1=true&amp;quot; &amp;quot;/param2=1&amp;quot;&lt;br /&gt;
  SimpleSC::StartService &amp;quot;MyService&amp;quot; &amp;quot;/param1=true /param2=1&amp;quot; 30&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
 &lt;br /&gt;
; Start a service with two arguments &amp;quot;-p param1&amp;quot; &amp;quot;-param2&amp;quot;&lt;br /&gt;
  SimpleSC::StartService &amp;quot;MyService&amp;quot; &#039;&amp;quot;-p param1&amp;quot; -param2&#039; 30&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Stop a service and waits for file release&lt;br /&gt;
  SimpleSC::StopService &amp;quot;MyService&amp;quot; 1 30&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Stops two services and waits for file release after the last service is stopped&lt;br /&gt;
  SimpleSC::StopService &amp;quot;MyService1&amp;quot; 0 30&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  SimpleSC::StopService &amp;quot;MyService2&amp;quot; 1 30&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Pause a service&lt;br /&gt;
  SimpleSC::PauseService &amp;quot;MyService&amp;quot; 30&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Continue a service&lt;br /&gt;
  SimpleSC::ContinueService &amp;quot;MyService&amp;quot; 30&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Restart a service&lt;br /&gt;
  SimpleSC::RestartService &amp;quot;MyService&amp;quot; &amp;quot;&amp;quot; 30&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Restart a service with two arguments &amp;quot;/param1=true&amp;quot; &amp;quot;/param2=1&amp;quot;&lt;br /&gt;
  SimpleSC::RestartService &amp;quot;MyService&amp;quot; &amp;quot;/param1=true /param2=1&amp;quot; 30&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Start a service with two arguments &amp;quot;-p param1&amp;quot; &amp;quot;-param2&amp;quot;&lt;br /&gt;
  SimpleSC::RestartService &amp;quot;MyService&amp;quot; &#039;&amp;quot;-p param1&amp;quot; -param2&#039; 30&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Check if the service exists&lt;br /&gt;
  SimpleSC::ExistsService &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode if the service doesn´t exists (&amp;lt;&amp;gt;0)/service exists (0)&lt;br /&gt;
&lt;br /&gt;
; Get the displayname of a service&lt;br /&gt;
  SimpleSC::GetServiceDisplayName &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the displayname of the service&lt;br /&gt;
&lt;br /&gt;
; Get the servicename of a service by the displayname&lt;br /&gt;
  SimpleSC::GetServiceName &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the servicename of the service&lt;br /&gt;
&lt;br /&gt;
; Get the current status of a service&lt;br /&gt;
  SimpleSC::GetServiceStatus &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; return the status of the service (See &amp;quot;service_status&amp;quot; in the parameters)&lt;br /&gt;
&lt;br /&gt;
; Get the description of a service&lt;br /&gt;
  SimpleSC::GetServiceDescription &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the description of the service&lt;br /&gt;
 &lt;br /&gt;
; Get the start type of the service&lt;br /&gt;
  SimpleSC::GetServiceStartType &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the start type of the service (see &amp;quot;start_type&amp;quot; in the parameters)&lt;br /&gt;
&lt;br /&gt;
; Get the binary path of a service&lt;br /&gt;
  SimpleSC::GetServiceBinaryPath &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the binary path of the service&lt;br /&gt;
&lt;br /&gt;
; Get the logon user of the service&lt;br /&gt;
  SimpleSC::GetServiceLogon &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the logon username of the service  &lt;br /&gt;
&lt;br /&gt;
; Get the failure configuration of a service&lt;br /&gt;
  SimpleSC::GetServiceFailure &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the reset period &lt;br /&gt;
  Pop $2 ; returns the reboot message&lt;br /&gt;
  Pop $3 ; returns the command&lt;br /&gt;
  Pop $4 ; returns the first action (See &amp;quot;action_type_x&amp;quot; in the parameters)&lt;br /&gt;
  Pop $5 ; returns the first action delay &lt;br /&gt;
  Pop $6 ; returns the second action (See &amp;quot;action_type_x&amp;quot; in the parameters)&lt;br /&gt;
  Pop $7 ; returns the second action delay &lt;br /&gt;
  Pop $8 ; returns the third action (See &amp;quot;action_type_x&amp;quot; in the parameters)&lt;br /&gt;
  Pop $9 ; returns the third action delay &lt;br /&gt;
&lt;br /&gt;
; Get the failure flag configuration of a service&lt;br /&gt;
  SimpleSC::GetServiceFailureFlag &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the service flag&lt;br /&gt;
&lt;br /&gt;
; Get the delayed auto-start configuration of a service&lt;br /&gt;
  SimpleSC::GetServiceDelayedAutoStartInfo &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the delayed auto-start configuration&lt;br /&gt;
&lt;br /&gt;
; Set the description of a service&lt;br /&gt;
  SimpleSC::SetServiceDescription &amp;quot;MyService&amp;quot; &amp;quot;Sample Description&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Set the starttype to automatic of a service&lt;br /&gt;
  SimpleSC::SetServiceStartType &amp;quot;MyService&amp;quot; &amp;quot;2&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Sets the service binary path&lt;br /&gt;
  SimpleSC::SetServiceBinaryPath &amp;quot;MyService&amp;quot; &amp;quot;C:\MySoftware\MyService.exe&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Sets the service logon to a user and grant the user the &amp;quot;SeServiceLogonPrivilege&amp;quot;&lt;br /&gt;
  SimpleSC::SetServiceLogon &amp;quot;MyService&amp;quot; &amp;quot;MyServiceUser&amp;quot; &amp;quot;MyServiceUserPassword&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  IntCmp $0 0 +1 Done Done ; If successful grant the service logon privilege to &amp;quot;MyServiceUser&amp;quot;&lt;br /&gt;
    ; Note: Every serviceuser must have the ServiceLogonPrivilege to start the service&lt;br /&gt;
    SimpleSC::GrantServiceLogonPrivilege &amp;quot;MyServiceUser&amp;quot;&lt;br /&gt;
    Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Done:&lt;br /&gt;
&lt;br /&gt;
; Sets the service failure configuration - First action: Restart the service after one minute - Second action: Reboot the computer after five minutes&lt;br /&gt;
  SimpleSC::SetServiceFailure &amp;quot;MyService&amp;quot; &amp;quot;0&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;1&amp;quot; &amp;quot;60000&amp;quot; &amp;quot;2&amp;quot; &amp;quot;300000&amp;quot; &amp;quot;0&amp;quot; &amp;quot;0&amp;quot; &lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Sets the failure flag configuration of a service&lt;br /&gt;
  SimpleSC::SetServiceFailureFlag &amp;quot;MyService&amp;quot; &amp;quot;1&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Sets the delayed auto-start configuration of a service&lt;br /&gt;
  SimpleSC::SetServiceDelayedAutoStartInfo &amp;quot;MyService&amp;quot; &amp;quot;1&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Remove the &amp;quot;SeServiceLogonPrivilege&amp;quot; from a user&lt;br /&gt;
  SimpleSC::RemoveServiceLogonPrivilege &amp;quot;MyServiceUser&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Check if the service is paused&lt;br /&gt;
  SimpleSC::ServiceIsPaused &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns 1 (service is paused) - returns 0 (service is not paused)&lt;br /&gt;
&lt;br /&gt;
; Check if the service is running&lt;br /&gt;
  SimpleSC::ServiceIsRunning &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns 1 (service is running) - returns 0 (service is not running)&lt;br /&gt;
&lt;br /&gt;
; Check if the service is stopped&lt;br /&gt;
  SimpleSC::ServiceIsStopped &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns 1 (service is stopped) - returns 0 (service is not stopped)&lt;br /&gt;
&lt;br /&gt;
; Show the error message if a function fails &lt;br /&gt;
  SimpleSC::StopService &amp;quot;MyService&amp;quot; 1 30&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  IntCmp $0 0 Done +1 +1 &lt;br /&gt;
    Push $0&lt;br /&gt;
    SimpleSC::GetErrorMessage&lt;br /&gt;
    Pop $0&lt;br /&gt;
    MessageBox MB_OK|MB_ICONSTOP &amp;quot;Stopping fails - Reason: $0&amp;quot;&lt;br /&gt;
  Done:&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Changelog ==&lt;br /&gt;
* Version 1.29 (2011-04-16)&lt;br /&gt;
**SimpleSC::GetServiceFailureFlag added&lt;br /&gt;
**SimpleSC::SetServiceFailureFlag added&lt;br /&gt;
**SimpleSC::GetServiceDelayedAutoStartInfo added&lt;br /&gt;
**SimpleSC::SetServiceDelayedAutoStartInfo added&lt;br /&gt;
* Version 1.28 (2010-09-14)&lt;br /&gt;
**SimpleSC::GetServiceFailure function added&lt;br /&gt;
**SimpleSC::SetServiceFailure function added&lt;br /&gt;
**SimpleSC::StopService WaitForFileRelease feature added (For details take a look at the documentation)&lt;br /&gt;
* Version 1.27 (2010-03-23)&lt;br /&gt;
**Documentation updated&lt;br /&gt;
* Version 1.26 (2009-05-21)&lt;br /&gt;
**Fixed wait for status bug on starting, stopping, pausing or continuing a service &lt;br /&gt;
* Version 1.25 (2009-04-23)&lt;br /&gt;
**SimpleSC::SetServiceLogon supports now non-domain username without the &amp;quot;.\&amp;quot;-prefix&lt;br /&gt;
**SimpleSC::SetServiceBinaryPath function added&lt;br /&gt;
*Version 1.24 (2009-04-13)&lt;br /&gt;
**Fixed wait for status bug if the service status changed. Now, if a service stops, starts aso. the plugin will work like the recommendations in the MSDN.&lt;br /&gt;
*Version 1.23 (2008-08-23)&lt;br /&gt;
**Removed compiler optimization to avoid a false-positive virusscan.&lt;br /&gt;
*Version 1.22 (2008-08-17)&lt;br /&gt;
**SimpleSC::GrantServiceLogonPrivilege and SimpleSC::RemoveServiceLogonPrivilege works now correct with domain names like MyDomain\MyUser.&lt;br /&gt;
**Added function SimpleSC::GetServiceLogon to get the logon username of a service.&lt;br /&gt;
*Version 1.21 (2008-02-10)&lt;br /&gt;
**SimpleSC::ExistsService results now 0 if the service exists and &amp;lt;&amp;gt; 0 if the service doensnÂ´t exists.&lt;br /&gt;
*Version 1.20 (2008-02-05)&lt;br /&gt;
**Every function now returns &amp;lt;&amp;gt; 0 if there is an error. Use SimpleSC::GetErrorMessage to get the message of a function result.&lt;br /&gt;
**Added function SimpleSC::GetErrorMessage to get the message of a function result.&lt;br /&gt;
**SimpleSC::ExistsService results now 0 if the service exists and &amp;lt;&amp;gt; 0 if the service doensnÂ´t exists.&lt;br /&gt;
**SimpleSC::RestartService supports now arguments.&lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: The signature has been changed. If you update from a previous version you must check your parameters.&lt;br /&gt;
*Version 1.10 (2008-01-29)&lt;br /&gt;
**SimpleSC::InstallService supports now more than one dependencies (delimitter is the forward slash).&lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: The signature has been changed. If you update from a previous version you must check your parameters.&lt;br /&gt;
**SimpleSC::InstallService supports now more service types e.g. to create an interactive service.&lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: The signature has been changed. If you update from a previous version you must check your parameters.&lt;br /&gt;
**SimpleSC::StartService supports now arguments. &lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: The signature has been changed. If you update from a previous version you must check your parameters.&lt;br /&gt;
*Version 1.05 (2008-01-12)&lt;br /&gt;
**The functions SimpleSC::StopService and SimpleSC::RestartService are now improved. Now all dependent services are stopping recursively too.&lt;br /&gt;
*Version 1.04 (2007-08-07)&lt;br /&gt;
**Fixed bug for possible endless loops. This concerns to the functions StartService, StopService, ContinueService and PauseService. &lt;br /&gt;
*Version 1.03 (2007-08-02)&lt;br /&gt;
**Added function SimpleSC::GetServiceBinaryPath to get the binary path of a specified service.&lt;br /&gt;
*Version 1.02 (2007-05-29)&lt;br /&gt;
**Changed wrong documentation informations about the functions SimpleSC::InstallService and SimpleSC::RemoveService.&lt;br /&gt;
*Version 1.01 (2007-05-07)&lt;br /&gt;
**Changed wrong status-results in Readme.txt. This concerns to the functions ServiceIsPaused, ServiceIsRunning and ServiceIsStopped.&lt;br /&gt;
**Changed the access privileges of the plugin. The plugin now uses the lowest privlege of each function to execute.&lt;br /&gt;
*Version 1.0 (2007-05-02)&lt;br /&gt;
**First offical version&lt;br /&gt;
&lt;br /&gt;
== Important Notes ==&lt;br /&gt;
*The function &amp;quot;SetServiceLogon&amp;quot; only works if the servicetype is &amp;quot;SERVICE_WIN32_OWN_PROCESS&amp;quot;.&lt;br /&gt;
* The functions &amp;quot;GetServiceDescription&amp;quot; or &amp;quot;SetServiceDescription&amp;quot; are only available on systems higher than Windows NT.&lt;br /&gt;
* The function &amp;quot;GetServiceFailureFlag&amp;quot;, &amp;quot;SetServiceFailureFlag&amp;quot;, &amp;quot;GetServiceDelayedAutoStartInfo&amp;quot; and &amp;quot;SetServiceDelayedAutoStartInfo&amp;quot; are only available on systems higher than Windows 2003.&lt;br /&gt;
* If you change the logon of an service to a new user you have to grant him the Service Logon Privilege. Otherwise the service cannot be started by the user you have assigned.&lt;br /&gt;
* The functions StartService, StopService, PauseService and ContinueService uses a timeout of 30 seconds. This means the function must be executed within 30 seconds, otherwise the functions will return an error.&lt;br /&gt;
* If you have any suggestions, comments or questions please mail me: mailto:rainer@speed-soft.de&lt;br /&gt;
&lt;br /&gt;
[[Category:Plugins]]&lt;/div&gt;</summary>
		<author><name>Speed78</name></author>
	</entry>
	<entry>
		<id>https://nsis.sourceforge.io/mediawiki/index.php?title=NSIS_Simple_Service_Plugin&amp;diff=20838</id>
		<title>NSIS Simple Service Plugin</title>
		<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/mediawiki/index.php?title=NSIS_Simple_Service_Plugin&amp;diff=20838"/>
		<updated>2011-08-15T20:19:00Z</updated>

		<summary type="html">&lt;p&gt;Speed78: /* Short Reference */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This plugin contains basic service functions like start, stop the service or checking the service status. It also contains advanced service functions for example setting the service description, changed the logon account, granting or removing the service logon privilege.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This plugin is using the MPL License or alternatively the LGPL License.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
&amp;lt;attach&amp;gt;NSIS_Simple_Service_Plugin_1.29.zip&amp;lt;/attach&amp;gt; The ZIP file containing a precompiled plugin DLL (to be saved in NSIS&#039; plugin directory) and the sources. If you update from a previous version it is strongly &#039;&#039;&#039;recommend&#039;&#039;&#039; to take look at the changelog.&lt;br /&gt;
&lt;br /&gt;
== Donation ==&lt;br /&gt;
If you believe that I am doing a good job and you want to support me please [http://www.speed-soft.de/donation/index.php?language=en donate] any amount via PayPal.&lt;br /&gt;
&lt;br /&gt;
== Short Reference ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
SimpleSC::InstallService [name_of_service] [display_name] [service_type] [start_type] &lt;br /&gt;
  [binary_path] [dependencies] [account] [password]&lt;br /&gt;
SimpleSC::RemoveService [name_of_service]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::StartService [name_of_service] [arguments] [timeout]&lt;br /&gt;
SimpleSC::StopService [name_of_service] [wait_for_file_release] [timeout]&lt;br /&gt;
SimpleSC::PauseService [name_of_service] [timeout]&lt;br /&gt;
SimpleSC::ContinueService [name_of_service] [timeout]&lt;br /&gt;
SimpleSC::RestartService [name_of_service] [arguments] [timeout]&lt;br /&gt;
SimpleSC::ExistsService [name_of_service]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::GetServiceDisplayName [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceName [display_name]&lt;br /&gt;
SimpleSC::GetServiceStatus [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceDescription [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceStartType [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceBinaryPath [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceLogon [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceFailure [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceFailureFlag [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceDelayedAutoStartInfo [name_of_service]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::SetServiceDescription [name_of_service] [service_description]&lt;br /&gt;
SimpleSC::SetServiceStartType [name_of_service] [start_type]&lt;br /&gt;
SimpleSC::SetServiceBinaryPath [name_of_service] [binary_path]&lt;br /&gt;
SimpleSC::SetServiceLogon [name_of_service] [account] [password]&lt;br /&gt;
SimpleSC::SetServiceFailure [name_of_service] [reset_period] [reboot_message] [command] &lt;br /&gt;
  [action_type_1] [action_delay_1] [action_type_2] [action_delay_2] [action_type_3] &lt;br /&gt;
  [action_delay_3]&lt;br /&gt;
SimpleSC::SetServiceFailureFlag [name_of_service] [failure_actions_on_non_crash_failures]&lt;br /&gt;
SimpleSC::SetServiceDelayedAutoStartInfo [name_of_service] [delayed_autostart]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::GrantServiceLogonPrivilege [account]&lt;br /&gt;
SimpleSC::RemoveServiceLogonPrivilege [account]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::ServiceIsPaused [name_of_service]&lt;br /&gt;
SimpleSC::ServiceIsRunning [name_of_service]&lt;br /&gt;
SimpleSC::ServiceIsStopped [name_of_service]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::GetErrorMessage [error_code]&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
*name_of_service - The name of the service used for Start/Stop commands and all further commands &lt;br /&gt;
*display_name - The name as shown in the service control manager applet in system control &lt;br /&gt;
*service_type - One of the following codes &lt;br /&gt;
**1 - SERVICE_KERNEL_DRIVER - Driver service.&lt;br /&gt;
**2 - SERVICE_FILE_SYSTEM_DRIVER - File system driver service.&lt;br /&gt;
**16 - SERVICE_WIN32_OWN_PROCESS - Service that runs in its own process. (Should be used in most cases)&lt;br /&gt;
**32 - SERVICE_WIN32_SHARE_PROCESS - Service that shares a process with one or more other services. &lt;br /&gt;
**256 - SERVICE_INTERACTIVE_PROCESS - The service can interact with the desktop. &lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: If you specify either SERVICE_WIN32_OWN_PROCESS or SERVICE_WIN32_SHARE_PROCESS,          and the service is running in the context of the LocalSystem account,          you can also specify this value. Example: SERVICE_WIN32_OWN_PROCESS or SERVICE_INTERACTIVE_PROCESS - (16 or 256) = 272&lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: Services cannot directly interact with a user as of Windows Vista.             Therefore, this technique should not be used in new code. See for more information: http://msdn2.microsoft.com/en-us/library/ms683502(VS.85).aspx          &lt;br /&gt;
&lt;br /&gt;
*start_type - one of the following codes &lt;br /&gt;
**0 - SERVICE_BOOT_START - Driver boot stage start &lt;br /&gt;
**1 - SERVICE_SYSTEM_START - Driver scm stage start &lt;br /&gt;
**2 - SERVICE_AUTO_START - Service auto start (Should be used in most cases)&lt;br /&gt;
**3 - SERVICE_DEMAND_START - Driver/service manual start &lt;br /&gt;
**4 - SERVICE_DISABLED - Driver/service disabled&lt;br /&gt;
*service_status - one of the following codes&lt;br /&gt;
**1 - SERVICE_STOPPED&lt;br /&gt;
**2 - SERVICE_START_PENDING&lt;br /&gt;
**3 - SERVICE_STOP_PENDING&lt;br /&gt;
**4 - SERVICE_RUNNING&lt;br /&gt;
**5 - SERVICE_CONTINUE_PENDING&lt;br /&gt;
**6 - SERVICE_PAUSE_PENDING&lt;br /&gt;
**7 - SERVICE_PAUSED&lt;br /&gt;
*binary_path - The path to the binary including all necessary parameters &lt;br /&gt;
*dependencies - Needed services, controls which services have to be started before this one; use the forward slash &amp;quot;/&amp;quot; to add more more than one service&lt;br /&gt;
*account - The username/account which should be used &lt;br /&gt;
*password - Password of the aforementioned account to be able to logon as a service &lt;br /&gt;
**&#039;&#039;&#039;Note&#039;&#039;&#039;: If you do not specify account/password, the local system account will be used to run the service&lt;br /&gt;
*arguments - Arguments passed to the service main function. &lt;br /&gt;
**&#039;&#039;&#039;Note&#039;&#039;&#039;: Driver services do not receive these arguments.&lt;br /&gt;
*reset_period - The time after which to reset the failure count to zero if there are no failures, in seconds. Specify 0 (INFINITE) to indicate that this value should never be reset&lt;br /&gt;
*reboot_message - The message to be broadcast to server users before rebooting&lt;br /&gt;
*command - The command line of the process to execute in response to the SC_ACTION_RUN_COMMAND service controller action. This process runs under the same account as the service&lt;br /&gt;
*timeout - Timeout in seconds of the function&lt;br /&gt;
*action_type_x - one of the following codes for the action to be performed&lt;br /&gt;
**0 - SC_ACTION_NONE - No action&lt;br /&gt;
**1 - SC_ACTION_RESTART - Restart the service&lt;br /&gt;
**2 - SC_ACTION_REBOOT - Reboot the computer (Note: The service user must have the SE_SHUTDOWN_NAME privilege)&lt;br /&gt;
**3 - SC_ACTION_RUN_COMMAND - Run a command&lt;br /&gt;
*action_delay_x - The time to wait before performing the specified action, in milliseconds&lt;br /&gt;
*failure_actions_on_non_crash_failures - This setting determines when failure actions are to be executed&lt;br /&gt;
**0 - The failure actions executed only if the service terminates without reporting a status of SERVICE_STOPPED&lt;br /&gt;
**1 - The failure actions executed if the status of a service is SERVICE_STOPPED but the exit code of the service is not 0&lt;br /&gt;
*delayed_autostart - The delayed auto-start setting of an auto-start service&lt;br /&gt;
**0 - The service will be started during system boot.&lt;br /&gt;
**1 - The service will be started after other auto-start services are started plus a short delay&lt;br /&gt;
*error_code - Error code of a function&lt;br /&gt;
*service_description - The description as shown in the service control manager applet in system control&lt;br /&gt;
*wait_for_file_release - Wait for file release after the service is stopped. This is useful if the binary file will be overwritten after stopping the service.&lt;br /&gt;
**0 - NO_WAIT - No wait for file release&lt;br /&gt;
**1 - WAIT - Wait for file release &lt;br /&gt;
**&#039;&#039;&#039;Note&#039;&#039;&#039;: If SERVICE_WIN32_OWN_PROCESS is used this option should be set to WAIT.	If SERVICE_WIN32_SHARE_PROCESS is used this option should only be set to WAIT if the last service in the process is stopped.&lt;br /&gt;
&lt;br /&gt;
== The Sample Script ==&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
; Install a service - ServiceType own process - StartType automatic - NoDependencies -  Logon as System Account&lt;br /&gt;
  SimpleSC::InstallService &amp;quot;MyService&amp;quot; &amp;quot;My Service Display Name&amp;quot; &amp;quot;16&amp;quot; &amp;quot;2&amp;quot; &amp;quot;C:\MyPath\MyService.exe&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Install a service - ServiceType interact with desktop - StartType automatic - Dependencies on &amp;quot;Windows Time Service&amp;quot; (w32time) and &amp;quot;WWW Publishing Service&amp;quot; (w3svc) - Logon as System Account&lt;br /&gt;
  SimpleSC::InstallService &amp;quot;MyService&amp;quot; &amp;quot;My Service Display Name&amp;quot; &amp;quot;272&amp;quot; &amp;quot;2&amp;quot; &amp;quot;C:\MyPath\MyService.exe&amp;quot; &amp;quot;w32time/w3svc&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Remove a service&lt;br /&gt;
  SimpleSC::RemoveService &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Start a service&lt;br /&gt;
  SimpleSC::StartService &amp;quot;MyService&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Start a service with two arguments &amp;quot;/param1=true&amp;quot; &amp;quot;/param2=1&amp;quot;&lt;br /&gt;
  SimpleSC::StartService &amp;quot;MyService&amp;quot; &amp;quot;/param1=true /param2=1&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
 &lt;br /&gt;
; Start a service with two arguments &amp;quot;-p param1&amp;quot; &amp;quot;-param2&amp;quot;&lt;br /&gt;
  SimpleSC::StartService &amp;quot;MyService&amp;quot; &#039;&amp;quot;-p param1&amp;quot; -param2&#039;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Stop a service and waits for file release&lt;br /&gt;
  SimpleSC::StopService &amp;quot;MyService&amp;quot; 1&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Stops two services and waits for file release after the last service is stopped&lt;br /&gt;
  SimpleSC::StopService &amp;quot;MyService1&amp;quot; 0&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  SimpleSC::StopService &amp;quot;MyService2&amp;quot; 1&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Pause a service&lt;br /&gt;
  SimpleSC::PauseService &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Continue a service&lt;br /&gt;
  SimpleSC::ContinueService &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Restart a service&lt;br /&gt;
  SimpleSC::RestartService &amp;quot;MyService&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Restart a service with two arguments &amp;quot;/param1=true&amp;quot; &amp;quot;/param2=1&amp;quot;&lt;br /&gt;
  SimpleSC::RestartService &amp;quot;MyService&amp;quot; &amp;quot;/param1=true /param2=1&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Start a service with two arguments &amp;quot;-p param1&amp;quot; &amp;quot;-param2&amp;quot;&lt;br /&gt;
  SimpleSC::RestartService &amp;quot;MyService&amp;quot; &#039;&amp;quot;-p param1&amp;quot; -param2&#039;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Check if the service exists&lt;br /&gt;
  SimpleSC::ExistsService &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode if the service doesnÂ´t exists (&amp;lt;&amp;gt;0)/service exists (0)&lt;br /&gt;
&lt;br /&gt;
; Get the displayname of a service&lt;br /&gt;
  SimpleSC::GetServiceDisplayName &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the displayname of the service&lt;br /&gt;
&lt;br /&gt;
; Get the servicename of a service by the displayname&lt;br /&gt;
  SimpleSC::GetServiceName &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the servicename of the service&lt;br /&gt;
&lt;br /&gt;
; Get the current status of a service&lt;br /&gt;
  SimpleSC::GetServiceStatus &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; return the status of the service (See &amp;quot;service_status&amp;quot; in the parameters)&lt;br /&gt;
&lt;br /&gt;
; Get the description of a service&lt;br /&gt;
  SimpleSC::GetServiceDescription &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the description of the service&lt;br /&gt;
 &lt;br /&gt;
; Get the start type of the service&lt;br /&gt;
  SimpleSC::GetServiceStartType &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the start type of the service (see &amp;quot;start_type&amp;quot; in the parameters)&lt;br /&gt;
&lt;br /&gt;
; Get the binary path of a service&lt;br /&gt;
  SimpleSC::GetServiceBinaryPath &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the binary path of the service&lt;br /&gt;
&lt;br /&gt;
; Get the logon user of the service&lt;br /&gt;
  SimpleSC::GetServiceLogon &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the logon username of the service  &lt;br /&gt;
&lt;br /&gt;
; Get the failure configuration of a service&lt;br /&gt;
  SimpleSC::GetServiceFailure &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the reset period &lt;br /&gt;
  Pop $2 ; returns the reboot message&lt;br /&gt;
  Pop $3 ; returns the command&lt;br /&gt;
  Pop $4 ; returns the first action (See &amp;quot;action_type_x&amp;quot; in the parameters)&lt;br /&gt;
  Pop $5 ; returns the first action delay &lt;br /&gt;
  Pop $6 ; returns the second action (See &amp;quot;action_type_x&amp;quot; in the parameters)&lt;br /&gt;
  Pop $7 ; returns the second action delay &lt;br /&gt;
  Pop $8 ; returns the third action (See &amp;quot;action_type_x&amp;quot; in the parameters)&lt;br /&gt;
  Pop $9 ; returns the third action delay &lt;br /&gt;
&lt;br /&gt;
; Get the failure flag configuration of a service&lt;br /&gt;
  SimpleSC::GetServiceFailureFlag &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the service flag&lt;br /&gt;
&lt;br /&gt;
; Get the delayed auto-start configuration of a service&lt;br /&gt;
  SimpleSC::GetServiceDelayedAutoStartInfo &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the delayed auto-start configuration&lt;br /&gt;
&lt;br /&gt;
; Set the description of a service&lt;br /&gt;
  SimpleSC::SetServiceDescription &amp;quot;MyService&amp;quot; &amp;quot;Sample Description&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Set the starttype to automatic of a service&lt;br /&gt;
  SimpleSC::SetServiceStartType &amp;quot;MyService&amp;quot; &amp;quot;2&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Sets the service binary path&lt;br /&gt;
  SimpleSC::SetServiceBinaryPath &amp;quot;MyService&amp;quot; &amp;quot;C:\MySoftware\MyService.exe&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Sets the service logon to a user and grant the user the &amp;quot;SeServiceLogonPrivilege&amp;quot;&lt;br /&gt;
  SimpleSC::SetServiceLogon &amp;quot;MyService&amp;quot; &amp;quot;MyServiceUser&amp;quot; &amp;quot;MyServiceUserPassword&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  IntCmp $0 0 +1 Done Done ; If successful grant the service logon privilege to &amp;quot;MyServiceUser&amp;quot;&lt;br /&gt;
    ; Note: Every serviceuser must have the ServiceLogonPrivilege to start the service&lt;br /&gt;
    SimpleSC::GrantServiceLogonPrivilege &amp;quot;MyServiceUser&amp;quot;&lt;br /&gt;
    Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Done:&lt;br /&gt;
&lt;br /&gt;
; Sets the service failure configuration - First action: Restart the service after one minute - Second action: Reboot the computer after five minutes&lt;br /&gt;
  SimpleSC::SetServiceFailure &amp;quot;MyService&amp;quot; &amp;quot;0&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;1&amp;quot; &amp;quot;60000&amp;quot; &amp;quot;2&amp;quot; &amp;quot;300000&amp;quot; &amp;quot;0&amp;quot; &amp;quot;0&amp;quot; &lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Sets the failure flag configuration of a service&lt;br /&gt;
  SimpleSC::SetServiceFailureFlag &amp;quot;MyService&amp;quot; &amp;quot;1&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Sets the delayed auto-start configuration of a service&lt;br /&gt;
  SimpleSC::SetServiceDelayedAutoStartInfo &amp;quot;MyService&amp;quot; &amp;quot;1&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Remove the &amp;quot;SeServiceLogonPrivilege&amp;quot; from a user&lt;br /&gt;
  SimpleSC::RemoveServiceLogonPrivilege &amp;quot;MyServiceUser&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Check if the service is paused&lt;br /&gt;
  SimpleSC::ServiceIsPaused &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns 1 (service is paused) - returns 0 (service is not paused)&lt;br /&gt;
&lt;br /&gt;
; Check if the service is running&lt;br /&gt;
  SimpleSC::ServiceIsRunning &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns 1 (service is running) - returns 0 (service is not running)&lt;br /&gt;
&lt;br /&gt;
; Check if the service is stopped&lt;br /&gt;
  SimpleSC::ServiceIsStopped &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns 1 (service is stopped) - returns 0 (service is not stopped)&lt;br /&gt;
&lt;br /&gt;
; Show the error message if a function fails &lt;br /&gt;
  SimpleSC::StopService &amp;quot;MyService&amp;quot; 1&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  IntCmp $0 0 Done +1 +1 &lt;br /&gt;
    Push $0&lt;br /&gt;
    SimpleSC::GetErrorMessage&lt;br /&gt;
    Pop $0&lt;br /&gt;
    MessageBox MB_OK|MB_ICONSTOP &amp;quot;Stopping fails - Reason: $0&amp;quot;&lt;br /&gt;
  Done:&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Changelog ==&lt;br /&gt;
* Version 1.29 (2011-04-16)&lt;br /&gt;
**SimpleSC::GetServiceFailureFlag added&lt;br /&gt;
**SimpleSC::SetServiceFailureFlag added&lt;br /&gt;
**SimpleSC::GetServiceDelayedAutoStartInfo added&lt;br /&gt;
**SimpleSC::SetServiceDelayedAutoStartInfo added&lt;br /&gt;
* Version 1.28 (2010-09-14)&lt;br /&gt;
**SimpleSC::GetServiceFailure function added&lt;br /&gt;
**SimpleSC::SetServiceFailure function added&lt;br /&gt;
**SimpleSC::StopService WaitForFileRelease feature added (For details take a look at the documentation)&lt;br /&gt;
* Version 1.27 (2010-03-23)&lt;br /&gt;
**Documentation updated&lt;br /&gt;
* Version 1.26 (2009-05-21)&lt;br /&gt;
**Fixed wait for status bug on starting, stopping, pausing or continuing a service &lt;br /&gt;
* Version 1.25 (2009-04-23)&lt;br /&gt;
**SimpleSC::SetServiceLogon supports now non-domain username without the &amp;quot;.\&amp;quot;-prefix&lt;br /&gt;
**SimpleSC::SetServiceBinaryPath function added&lt;br /&gt;
*Version 1.24 (2009-04-13)&lt;br /&gt;
**Fixed wait for status bug if the service status changed. Now, if a service stops, starts aso. the plugin will work like the recommendations in the MSDN.&lt;br /&gt;
*Version 1.23 (2008-08-23)&lt;br /&gt;
**Removed compiler optimization to avoid a false-positive virusscan.&lt;br /&gt;
*Version 1.22 (2008-08-17)&lt;br /&gt;
**SimpleSC::GrantServiceLogonPrivilege and SimpleSC::RemoveServiceLogonPrivilege works now correct with domain names like MyDomain\MyUser.&lt;br /&gt;
**Added function SimpleSC::GetServiceLogon to get the logon username of a service.&lt;br /&gt;
*Version 1.21 (2008-02-10)&lt;br /&gt;
**SimpleSC::ExistsService results now 0 if the service exists and &amp;lt;&amp;gt; 0 if the service doensnÂ´t exists.&lt;br /&gt;
*Version 1.20 (2008-02-05)&lt;br /&gt;
**Every function now returns &amp;lt;&amp;gt; 0 if there is an error. Use SimpleSC::GetErrorMessage to get the message of a function result.&lt;br /&gt;
**Added function SimpleSC::GetErrorMessage to get the message of a function result.&lt;br /&gt;
**SimpleSC::ExistsService results now 0 if the service exists and &amp;lt;&amp;gt; 0 if the service doensnÂ´t exists.&lt;br /&gt;
**SimpleSC::RestartService supports now arguments.&lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: The signature has been changed. If you update from a previous version you must check your parameters.&lt;br /&gt;
*Version 1.10 (2008-01-29)&lt;br /&gt;
**SimpleSC::InstallService supports now more than one dependencies (delimitter is the forward slash).&lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: The signature has been changed. If you update from a previous version you must check your parameters.&lt;br /&gt;
**SimpleSC::InstallService supports now more service types e.g. to create an interactive service.&lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: The signature has been changed. If you update from a previous version you must check your parameters.&lt;br /&gt;
**SimpleSC::StartService supports now arguments. &lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: The signature has been changed. If you update from a previous version you must check your parameters.&lt;br /&gt;
*Version 1.05 (2008-01-12)&lt;br /&gt;
**The functions SimpleSC::StopService and SimpleSC::RestartService are now improved. Now all dependent services are stopping recursively too.&lt;br /&gt;
*Version 1.04 (2007-08-07)&lt;br /&gt;
**Fixed bug for possible endless loops. This concerns to the functions StartService, StopService, ContinueService and PauseService. &lt;br /&gt;
*Version 1.03 (2007-08-02)&lt;br /&gt;
**Added function SimpleSC::GetServiceBinaryPath to get the binary path of a specified service.&lt;br /&gt;
*Version 1.02 (2007-05-29)&lt;br /&gt;
**Changed wrong documentation informations about the functions SimpleSC::InstallService and SimpleSC::RemoveService.&lt;br /&gt;
*Version 1.01 (2007-05-07)&lt;br /&gt;
**Changed wrong status-results in Readme.txt. This concerns to the functions ServiceIsPaused, ServiceIsRunning and ServiceIsStopped.&lt;br /&gt;
**Changed the access privileges of the plugin. The plugin now uses the lowest privlege of each function to execute.&lt;br /&gt;
*Version 1.0 (2007-05-02)&lt;br /&gt;
**First offical version&lt;br /&gt;
&lt;br /&gt;
== Important Notes ==&lt;br /&gt;
*The function &amp;quot;SetServiceLogon&amp;quot; only works if the servicetype is &amp;quot;SERVICE_WIN32_OWN_PROCESS&amp;quot;.&lt;br /&gt;
* The functions &amp;quot;GetServiceDescription&amp;quot; or &amp;quot;SetServiceDescription&amp;quot; are only available on systems higher than Windows NT.&lt;br /&gt;
* The function &amp;quot;GetServiceFailureFlag&amp;quot;, &amp;quot;SetServiceFailureFlag&amp;quot;, &amp;quot;GetServiceDelayedAutoStartInfo&amp;quot; and &amp;quot;SetServiceDelayedAutoStartInfo&amp;quot; are only available on systems higher than Windows 2003.&lt;br /&gt;
* If you change the logon of an service to a new user you have to grant him the Service Logon Privilege. Otherwise the service cannot be started by the user you have assigned.&lt;br /&gt;
* The functions StartService, StopService, PauseService and ContinueService uses a timeout of 30 seconds. This means the function must be executed within 30 seconds, otherwise the functions will return an error.&lt;br /&gt;
* If you have any suggestions, comments or questions please mail me: mailto:rainer@speed-soft.de&lt;br /&gt;
&lt;br /&gt;
[[Category:Plugins]]&lt;/div&gt;</summary>
		<author><name>Speed78</name></author>
	</entry>
	<entry>
		<id>https://nsis.sourceforge.io/mediawiki/index.php?title=NSIS_Simple_Service_Plugin&amp;diff=20837</id>
		<title>NSIS Simple Service Plugin</title>
		<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/mediawiki/index.php?title=NSIS_Simple_Service_Plugin&amp;diff=20837"/>
		<updated>2011-08-15T20:17:43Z</updated>

		<summary type="html">&lt;p&gt;Speed78: /* Short Reference */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This plugin contains basic service functions like start, stop the service or checking the service status. It also contains advanced service functions for example setting the service description, changed the logon account, granting or removing the service logon privilege.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This plugin is using the MPL License or alternatively the LGPL License.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
&amp;lt;attach&amp;gt;NSIS_Simple_Service_Plugin_1.29.zip&amp;lt;/attach&amp;gt; The ZIP file containing a precompiled plugin DLL (to be saved in NSIS&#039; plugin directory) and the sources. If you update from a previous version it is strongly &#039;&#039;&#039;recommend&#039;&#039;&#039; to take look at the changelog.&lt;br /&gt;
&lt;br /&gt;
== Donation ==&lt;br /&gt;
If you believe that I am doing a good job and you want to support me please [http://www.speed-soft.de/donation/index.php?language=en donate] any amount via PayPal.&lt;br /&gt;
&lt;br /&gt;
== Short Reference ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
SimpleSC::InstallService [name_of_service] [display_name] [service_type] [start_type] &lt;br /&gt;
  [binary_path] [dependencies] [account] [password]&lt;br /&gt;
SimpleSC::RemoveService [name_of_service]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::StartService [name_of_service] [arguments] [timeout]&lt;br /&gt;
SimpleSC::StopService [name_of_service] [wait_for_file_release] [timeout]&lt;br /&gt;
SimpleSC::PauseService [name_of_service] [timeout]&lt;br /&gt;
SimpleSC::ContinueService [name_of_service] [timeout]&lt;br /&gt;
SimpleSC::RestartService [name_of_service] [arguments] [timeout]&lt;br /&gt;
SimpleSC::ExistsService [name_of_service]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::GetServiceDisplayName [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceName [display_name]&lt;br /&gt;
SimpleSC::GetServiceStatus [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceDescription [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceStartType [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceBinaryPath [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceLogon [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceFailure [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceFailureFlag [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceDelayedAutoStartInfo [name_of_service]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::SetServiceDescription [name_of_service] [service_description]&lt;br /&gt;
SimpleSC::SetServiceStartType [name_of_service] [start_type]&lt;br /&gt;
SimpleSC::SetServiceBinaryPath [name_of_service] [binary_path]&lt;br /&gt;
SimpleSC::SetServiceLogon [name_of_service] [account] [password]&lt;br /&gt;
SimpleSC::SetServiceFailure [name_of_service] [reset_period] [reboot_message] [command] &lt;br /&gt;
  [action_type_1] [action_delay_1] [action_type_2] [action_delay_2] [action_type_3] &lt;br /&gt;
  [action_delay_3]&lt;br /&gt;
SimpleSC::SetServiceFailureFlag [name_of_service] [failure_actions_on_non_crash_failures]&lt;br /&gt;
SimpleSC::SetServiceDelayedAutoStartInfo [name_of_service] [delayed_autostart]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::GrantServiceLogonPrivilege [account]&lt;br /&gt;
SimpleSC::RemoveServiceLogonPrivilege [account]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::ServiceIsPaused [name_of_service]&lt;br /&gt;
SimpleSC::ServiceIsRunning [name_of_service]&lt;br /&gt;
SimpleSC::ServiceIsStopped [name_of_service]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::GetErrorMessage [error_code]&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
*name_of_service - The name of the service used for Start/Stop commands and all further commands &lt;br /&gt;
*display_name - The name as shown in the service control manager applet in system control &lt;br /&gt;
*service_type - One of the following codes &lt;br /&gt;
**1 - SERVICE_KERNEL_DRIVER - Driver service.&lt;br /&gt;
**2 - SERVICE_FILE_SYSTEM_DRIVER - File system driver service.&lt;br /&gt;
**16 - SERVICE_WIN32_OWN_PROCESS - Service that runs in its own process. (Should be used in most cases)&lt;br /&gt;
**32 - SERVICE_WIN32_SHARE_PROCESS - Service that shares a process with one or more other services. &lt;br /&gt;
**256 - SERVICE_INTERACTIVE_PROCESS - The service can interact with the desktop. &lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: If you specify either SERVICE_WIN32_OWN_PROCESS or SERVICE_WIN32_SHARE_PROCESS,          and the service is running in the context of the LocalSystem account,          you can also specify this value. Example: SERVICE_WIN32_OWN_PROCESS or SERVICE_INTERACTIVE_PROCESS - (16 or 256) = 272&lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: Services cannot directly interact with a user as of Windows Vista.             Therefore, this technique should not be used in new code. See for more information: http://msdn2.microsoft.com/en-us/library/ms683502(VS.85).aspx          &lt;br /&gt;
&lt;br /&gt;
*start_type - one of the following codes &lt;br /&gt;
**0 - SERVICE_BOOT_START - Driver boot stage start &lt;br /&gt;
**1 - SERVICE_SYSTEM_START - Driver scm stage start &lt;br /&gt;
**2 - SERVICE_AUTO_START - Service auto start (Should be used in most cases)&lt;br /&gt;
**3 - SERVICE_DEMAND_START - Driver/service manual start &lt;br /&gt;
**4 - SERVICE_DISABLED - Driver/service disabled&lt;br /&gt;
*service_status - one of the following codes&lt;br /&gt;
**1 - SERVICE_STOPPED&lt;br /&gt;
**2 - SERVICE_START_PENDING&lt;br /&gt;
**3 - SERVICE_STOP_PENDING&lt;br /&gt;
**4 - SERVICE_RUNNING&lt;br /&gt;
**5 - SERVICE_CONTINUE_PENDING&lt;br /&gt;
**6 - SERVICE_PAUSE_PENDING&lt;br /&gt;
**7 - SERVICE_PAUSED&lt;br /&gt;
*binary_path - The path to the binary including all necessary parameters &lt;br /&gt;
*dependencies - Needed services, controls which services have to be started before this one; use the forward slash &amp;quot;/&amp;quot; to add more more than one service&lt;br /&gt;
*account - The username/account which should be used &lt;br /&gt;
*password - Password of the aforementioned account to be able to logon as a service &lt;br /&gt;
**&#039;&#039;&#039;Note&#039;&#039;&#039;: If you do not specify account/password, the local system account will be used to run the service&lt;br /&gt;
*arguments - Arguments passed to the service main function. &lt;br /&gt;
**&#039;&#039;&#039;Note&#039;&#039;&#039;: Driver services do not receive these arguments.&lt;br /&gt;
*reset_period - The time after which to reset the failure count to zero if there are no failures, in seconds. Specify 0 (INFINITE) to indicate that this value should never be reset&lt;br /&gt;
*reboot_message - The message to be broadcast to server users before rebooting&lt;br /&gt;
*command - The command line of the process to execute in response to the SC_ACTION_RUN_COMMAND service controller action. This process runs under the same account as the service&lt;br /&gt;
*action_type_x - one of the following codes for the action to be performed&lt;br /&gt;
**0 - SC_ACTION_NONE - No action&lt;br /&gt;
**1 - SC_ACTION_RESTART - Restart the service&lt;br /&gt;
**2 - SC_ACTION_REBOOT - Reboot the computer (Note: The service user must have the SE_SHUTDOWN_NAME privilege)&lt;br /&gt;
**3 - SC_ACTION_RUN_COMMAND - Run a command&lt;br /&gt;
*action_delay_x - The time to wait before performing the specified action, in milliseconds&lt;br /&gt;
*failure_actions_on_non_crash_failures - This setting determines when failure actions are to be executed&lt;br /&gt;
**0 - The failure actions executed only if the service terminates without reporting a status of SERVICE_STOPPED&lt;br /&gt;
**1 - The failure actions executed if the status of a service is SERVICE_STOPPED but the exit code of the service is not 0&lt;br /&gt;
*delayed_autostart - The delayed auto-start setting of an auto-start service&lt;br /&gt;
**0 - The service will be started during system boot.&lt;br /&gt;
**1 - The service will be started after other auto-start services are started plus a short delay&lt;br /&gt;
*error_code - Error code of a function&lt;br /&gt;
*service_description - The description as shown in the service control manager applet in system control&lt;br /&gt;
*wait_for_file_release - Wait for file release after the service is stopped. This is useful if the binary file will be overwritten after stopping the service.&lt;br /&gt;
**0 - NO_WAIT - No wait for file release&lt;br /&gt;
**1 - WAIT - Wait for file release &lt;br /&gt;
**&#039;&#039;&#039;Note&#039;&#039;&#039;: If SERVICE_WIN32_OWN_PROCESS is used this option should be set to WAIT.	If SERVICE_WIN32_SHARE_PROCESS is used this option should only be set to WAIT if the last service in the process is stopped.&lt;br /&gt;
&lt;br /&gt;
== The Sample Script ==&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
; Install a service - ServiceType own process - StartType automatic - NoDependencies -  Logon as System Account&lt;br /&gt;
  SimpleSC::InstallService &amp;quot;MyService&amp;quot; &amp;quot;My Service Display Name&amp;quot; &amp;quot;16&amp;quot; &amp;quot;2&amp;quot; &amp;quot;C:\MyPath\MyService.exe&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Install a service - ServiceType interact with desktop - StartType automatic - Dependencies on &amp;quot;Windows Time Service&amp;quot; (w32time) and &amp;quot;WWW Publishing Service&amp;quot; (w3svc) - Logon as System Account&lt;br /&gt;
  SimpleSC::InstallService &amp;quot;MyService&amp;quot; &amp;quot;My Service Display Name&amp;quot; &amp;quot;272&amp;quot; &amp;quot;2&amp;quot; &amp;quot;C:\MyPath\MyService.exe&amp;quot; &amp;quot;w32time/w3svc&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Remove a service&lt;br /&gt;
  SimpleSC::RemoveService &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Start a service&lt;br /&gt;
  SimpleSC::StartService &amp;quot;MyService&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Start a service with two arguments &amp;quot;/param1=true&amp;quot; &amp;quot;/param2=1&amp;quot;&lt;br /&gt;
  SimpleSC::StartService &amp;quot;MyService&amp;quot; &amp;quot;/param1=true /param2=1&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
 &lt;br /&gt;
; Start a service with two arguments &amp;quot;-p param1&amp;quot; &amp;quot;-param2&amp;quot;&lt;br /&gt;
  SimpleSC::StartService &amp;quot;MyService&amp;quot; &#039;&amp;quot;-p param1&amp;quot; -param2&#039;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Stop a service and waits for file release&lt;br /&gt;
  SimpleSC::StopService &amp;quot;MyService&amp;quot; 1&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Stops two services and waits for file release after the last service is stopped&lt;br /&gt;
  SimpleSC::StopService &amp;quot;MyService1&amp;quot; 0&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  SimpleSC::StopService &amp;quot;MyService2&amp;quot; 1&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Pause a service&lt;br /&gt;
  SimpleSC::PauseService &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Continue a service&lt;br /&gt;
  SimpleSC::ContinueService &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Restart a service&lt;br /&gt;
  SimpleSC::RestartService &amp;quot;MyService&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Restart a service with two arguments &amp;quot;/param1=true&amp;quot; &amp;quot;/param2=1&amp;quot;&lt;br /&gt;
  SimpleSC::RestartService &amp;quot;MyService&amp;quot; &amp;quot;/param1=true /param2=1&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Start a service with two arguments &amp;quot;-p param1&amp;quot; &amp;quot;-param2&amp;quot;&lt;br /&gt;
  SimpleSC::RestartService &amp;quot;MyService&amp;quot; &#039;&amp;quot;-p param1&amp;quot; -param2&#039;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Check if the service exists&lt;br /&gt;
  SimpleSC::ExistsService &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode if the service doesnÂ´t exists (&amp;lt;&amp;gt;0)/service exists (0)&lt;br /&gt;
&lt;br /&gt;
; Get the displayname of a service&lt;br /&gt;
  SimpleSC::GetServiceDisplayName &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the displayname of the service&lt;br /&gt;
&lt;br /&gt;
; Get the servicename of a service by the displayname&lt;br /&gt;
  SimpleSC::GetServiceName &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the servicename of the service&lt;br /&gt;
&lt;br /&gt;
; Get the current status of a service&lt;br /&gt;
  SimpleSC::GetServiceStatus &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; return the status of the service (See &amp;quot;service_status&amp;quot; in the parameters)&lt;br /&gt;
&lt;br /&gt;
; Get the description of a service&lt;br /&gt;
  SimpleSC::GetServiceDescription &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the description of the service&lt;br /&gt;
 &lt;br /&gt;
; Get the start type of the service&lt;br /&gt;
  SimpleSC::GetServiceStartType &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the start type of the service (see &amp;quot;start_type&amp;quot; in the parameters)&lt;br /&gt;
&lt;br /&gt;
; Get the binary path of a service&lt;br /&gt;
  SimpleSC::GetServiceBinaryPath &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the binary path of the service&lt;br /&gt;
&lt;br /&gt;
; Get the logon user of the service&lt;br /&gt;
  SimpleSC::GetServiceLogon &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the logon username of the service  &lt;br /&gt;
&lt;br /&gt;
; Get the failure configuration of a service&lt;br /&gt;
  SimpleSC::GetServiceFailure &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the reset period &lt;br /&gt;
  Pop $2 ; returns the reboot message&lt;br /&gt;
  Pop $3 ; returns the command&lt;br /&gt;
  Pop $4 ; returns the first action (See &amp;quot;action_type_x&amp;quot; in the parameters)&lt;br /&gt;
  Pop $5 ; returns the first action delay &lt;br /&gt;
  Pop $6 ; returns the second action (See &amp;quot;action_type_x&amp;quot; in the parameters)&lt;br /&gt;
  Pop $7 ; returns the second action delay &lt;br /&gt;
  Pop $8 ; returns the third action (See &amp;quot;action_type_x&amp;quot; in the parameters)&lt;br /&gt;
  Pop $9 ; returns the third action delay &lt;br /&gt;
&lt;br /&gt;
; Get the failure flag configuration of a service&lt;br /&gt;
  SimpleSC::GetServiceFailureFlag &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the service flag&lt;br /&gt;
&lt;br /&gt;
; Get the delayed auto-start configuration of a service&lt;br /&gt;
  SimpleSC::GetServiceDelayedAutoStartInfo &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the delayed auto-start configuration&lt;br /&gt;
&lt;br /&gt;
; Set the description of a service&lt;br /&gt;
  SimpleSC::SetServiceDescription &amp;quot;MyService&amp;quot; &amp;quot;Sample Description&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Set the starttype to automatic of a service&lt;br /&gt;
  SimpleSC::SetServiceStartType &amp;quot;MyService&amp;quot; &amp;quot;2&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Sets the service binary path&lt;br /&gt;
  SimpleSC::SetServiceBinaryPath &amp;quot;MyService&amp;quot; &amp;quot;C:\MySoftware\MyService.exe&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Sets the service logon to a user and grant the user the &amp;quot;SeServiceLogonPrivilege&amp;quot;&lt;br /&gt;
  SimpleSC::SetServiceLogon &amp;quot;MyService&amp;quot; &amp;quot;MyServiceUser&amp;quot; &amp;quot;MyServiceUserPassword&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  IntCmp $0 0 +1 Done Done ; If successful grant the service logon privilege to &amp;quot;MyServiceUser&amp;quot;&lt;br /&gt;
    ; Note: Every serviceuser must have the ServiceLogonPrivilege to start the service&lt;br /&gt;
    SimpleSC::GrantServiceLogonPrivilege &amp;quot;MyServiceUser&amp;quot;&lt;br /&gt;
    Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Done:&lt;br /&gt;
&lt;br /&gt;
; Sets the service failure configuration - First action: Restart the service after one minute - Second action: Reboot the computer after five minutes&lt;br /&gt;
  SimpleSC::SetServiceFailure &amp;quot;MyService&amp;quot; &amp;quot;0&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;1&amp;quot; &amp;quot;60000&amp;quot; &amp;quot;2&amp;quot; &amp;quot;300000&amp;quot; &amp;quot;0&amp;quot; &amp;quot;0&amp;quot; &lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Sets the failure flag configuration of a service&lt;br /&gt;
  SimpleSC::SetServiceFailureFlag &amp;quot;MyService&amp;quot; &amp;quot;1&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Sets the delayed auto-start configuration of a service&lt;br /&gt;
  SimpleSC::SetServiceDelayedAutoStartInfo &amp;quot;MyService&amp;quot; &amp;quot;1&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Remove the &amp;quot;SeServiceLogonPrivilege&amp;quot; from a user&lt;br /&gt;
  SimpleSC::RemoveServiceLogonPrivilege &amp;quot;MyServiceUser&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Check if the service is paused&lt;br /&gt;
  SimpleSC::ServiceIsPaused &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns 1 (service is paused) - returns 0 (service is not paused)&lt;br /&gt;
&lt;br /&gt;
; Check if the service is running&lt;br /&gt;
  SimpleSC::ServiceIsRunning &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns 1 (service is running) - returns 0 (service is not running)&lt;br /&gt;
&lt;br /&gt;
; Check if the service is stopped&lt;br /&gt;
  SimpleSC::ServiceIsStopped &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns 1 (service is stopped) - returns 0 (service is not stopped)&lt;br /&gt;
&lt;br /&gt;
; Show the error message if a function fails &lt;br /&gt;
  SimpleSC::StopService &amp;quot;MyService&amp;quot; 1&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  IntCmp $0 0 Done +1 +1 &lt;br /&gt;
    Push $0&lt;br /&gt;
    SimpleSC::GetErrorMessage&lt;br /&gt;
    Pop $0&lt;br /&gt;
    MessageBox MB_OK|MB_ICONSTOP &amp;quot;Stopping fails - Reason: $0&amp;quot;&lt;br /&gt;
  Done:&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Changelog ==&lt;br /&gt;
* Version 1.29 (2011-04-16)&lt;br /&gt;
**SimpleSC::GetServiceFailureFlag added&lt;br /&gt;
**SimpleSC::SetServiceFailureFlag added&lt;br /&gt;
**SimpleSC::GetServiceDelayedAutoStartInfo added&lt;br /&gt;
**SimpleSC::SetServiceDelayedAutoStartInfo added&lt;br /&gt;
* Version 1.28 (2010-09-14)&lt;br /&gt;
**SimpleSC::GetServiceFailure function added&lt;br /&gt;
**SimpleSC::SetServiceFailure function added&lt;br /&gt;
**SimpleSC::StopService WaitForFileRelease feature added (For details take a look at the documentation)&lt;br /&gt;
* Version 1.27 (2010-03-23)&lt;br /&gt;
**Documentation updated&lt;br /&gt;
* Version 1.26 (2009-05-21)&lt;br /&gt;
**Fixed wait for status bug on starting, stopping, pausing or continuing a service &lt;br /&gt;
* Version 1.25 (2009-04-23)&lt;br /&gt;
**SimpleSC::SetServiceLogon supports now non-domain username without the &amp;quot;.\&amp;quot;-prefix&lt;br /&gt;
**SimpleSC::SetServiceBinaryPath function added&lt;br /&gt;
*Version 1.24 (2009-04-13)&lt;br /&gt;
**Fixed wait for status bug if the service status changed. Now, if a service stops, starts aso. the plugin will work like the recommendations in the MSDN.&lt;br /&gt;
*Version 1.23 (2008-08-23)&lt;br /&gt;
**Removed compiler optimization to avoid a false-positive virusscan.&lt;br /&gt;
*Version 1.22 (2008-08-17)&lt;br /&gt;
**SimpleSC::GrantServiceLogonPrivilege and SimpleSC::RemoveServiceLogonPrivilege works now correct with domain names like MyDomain\MyUser.&lt;br /&gt;
**Added function SimpleSC::GetServiceLogon to get the logon username of a service.&lt;br /&gt;
*Version 1.21 (2008-02-10)&lt;br /&gt;
**SimpleSC::ExistsService results now 0 if the service exists and &amp;lt;&amp;gt; 0 if the service doensnÂ´t exists.&lt;br /&gt;
*Version 1.20 (2008-02-05)&lt;br /&gt;
**Every function now returns &amp;lt;&amp;gt; 0 if there is an error. Use SimpleSC::GetErrorMessage to get the message of a function result.&lt;br /&gt;
**Added function SimpleSC::GetErrorMessage to get the message of a function result.&lt;br /&gt;
**SimpleSC::ExistsService results now 0 if the service exists and &amp;lt;&amp;gt; 0 if the service doensnÂ´t exists.&lt;br /&gt;
**SimpleSC::RestartService supports now arguments.&lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: The signature has been changed. If you update from a previous version you must check your parameters.&lt;br /&gt;
*Version 1.10 (2008-01-29)&lt;br /&gt;
**SimpleSC::InstallService supports now more than one dependencies (delimitter is the forward slash).&lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: The signature has been changed. If you update from a previous version you must check your parameters.&lt;br /&gt;
**SimpleSC::InstallService supports now more service types e.g. to create an interactive service.&lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: The signature has been changed. If you update from a previous version you must check your parameters.&lt;br /&gt;
**SimpleSC::StartService supports now arguments. &lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: The signature has been changed. If you update from a previous version you must check your parameters.&lt;br /&gt;
*Version 1.05 (2008-01-12)&lt;br /&gt;
**The functions SimpleSC::StopService and SimpleSC::RestartService are now improved. Now all dependent services are stopping recursively too.&lt;br /&gt;
*Version 1.04 (2007-08-07)&lt;br /&gt;
**Fixed bug for possible endless loops. This concerns to the functions StartService, StopService, ContinueService and PauseService. &lt;br /&gt;
*Version 1.03 (2007-08-02)&lt;br /&gt;
**Added function SimpleSC::GetServiceBinaryPath to get the binary path of a specified service.&lt;br /&gt;
*Version 1.02 (2007-05-29)&lt;br /&gt;
**Changed wrong documentation informations about the functions SimpleSC::InstallService and SimpleSC::RemoveService.&lt;br /&gt;
*Version 1.01 (2007-05-07)&lt;br /&gt;
**Changed wrong status-results in Readme.txt. This concerns to the functions ServiceIsPaused, ServiceIsRunning and ServiceIsStopped.&lt;br /&gt;
**Changed the access privileges of the plugin. The plugin now uses the lowest privlege of each function to execute.&lt;br /&gt;
*Version 1.0 (2007-05-02)&lt;br /&gt;
**First offical version&lt;br /&gt;
&lt;br /&gt;
== Important Notes ==&lt;br /&gt;
*The function &amp;quot;SetServiceLogon&amp;quot; only works if the servicetype is &amp;quot;SERVICE_WIN32_OWN_PROCESS&amp;quot;.&lt;br /&gt;
* The functions &amp;quot;GetServiceDescription&amp;quot; or &amp;quot;SetServiceDescription&amp;quot; are only available on systems higher than Windows NT.&lt;br /&gt;
* The function &amp;quot;GetServiceFailureFlag&amp;quot;, &amp;quot;SetServiceFailureFlag&amp;quot;, &amp;quot;GetServiceDelayedAutoStartInfo&amp;quot; and &amp;quot;SetServiceDelayedAutoStartInfo&amp;quot; are only available on systems higher than Windows 2003.&lt;br /&gt;
* If you change the logon of an service to a new user you have to grant him the Service Logon Privilege. Otherwise the service cannot be started by the user you have assigned.&lt;br /&gt;
* The functions StartService, StopService, PauseService and ContinueService uses a timeout of 30 seconds. This means the function must be executed within 30 seconds, otherwise the functions will return an error.&lt;br /&gt;
* If you have any suggestions, comments or questions please mail me: mailto:rainer@speed-soft.de&lt;br /&gt;
&lt;br /&gt;
[[Category:Plugins]]&lt;/div&gt;</summary>
		<author><name>Speed78</name></author>
	</entry>
	<entry>
		<id>https://nsis.sourceforge.io/mediawiki/index.php?title=NSIS_Simple_Service_Plugin&amp;diff=19835</id>
		<title>NSIS Simple Service Plugin</title>
		<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/mediawiki/index.php?title=NSIS_Simple_Service_Plugin&amp;diff=19835"/>
		<updated>2011-04-16T14:52:06Z</updated>

		<summary type="html">&lt;p&gt;Speed78: /* Links */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This plugin contains basic service functions like start, stop the service or checking the service status. It also contains advanced service functions for example setting the service description, changed the logon account, granting or removing the service logon privilege.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This plugin is using the MPL License or alternatively the LGPL License.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
&amp;lt;attach&amp;gt;NSIS_Simple_Service_Plugin_1.29.zip&amp;lt;/attach&amp;gt; The ZIP file containing a precompiled plugin DLL (to be saved in NSIS&#039; plugin directory) and the sources. If you update from a previous version it is strongly &#039;&#039;&#039;recommend&#039;&#039;&#039; to take look at the changelog.&lt;br /&gt;
&lt;br /&gt;
== Donation ==&lt;br /&gt;
If you believe that I am doing a good job and you want to support me please [http://www.speed-soft.de/donation/index.php?language=en donate] any amount via PayPal.&lt;br /&gt;
&lt;br /&gt;
== Short Reference ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
SimpleSC::InstallService [name_of_service] [display_name] [service_type] [start_type] &lt;br /&gt;
  [binary_path] [dependencies] [account] [password]&lt;br /&gt;
SimpleSC::RemoveService [name_of_service]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::StartService [name_of_service] [arguments]&lt;br /&gt;
SimpleSC::StopService [name_of_service] [wait_for_file_release]&lt;br /&gt;
SimpleSC::PauseService [name_of_service] &lt;br /&gt;
SimpleSC::ContinueService [name_of_service]&lt;br /&gt;
SimpleSC::RestartService [name_of_service] [arguments]&lt;br /&gt;
SimpleSC::ExistsService [name_of_service]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::GetServiceDisplayName [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceName [display_name]&lt;br /&gt;
SimpleSC::GetServiceStatus [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceDescription [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceStartType [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceBinaryPath [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceLogon [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceFailure [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceFailureFlag [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceDelayedAutoStartInfo [name_of_service]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::SetServiceDescription [name_of_service] [service_description]&lt;br /&gt;
SimpleSC::SetServiceStartType [name_of_service] [start_type]&lt;br /&gt;
SimpleSC::SetServiceBinaryPath [name_of_service] [binary_path]&lt;br /&gt;
SimpleSC::SetServiceLogon [name_of_service] [account] [password]&lt;br /&gt;
SimpleSC::SetServiceFailure [name_of_service] [reset_period] [reboot_message] [command] &lt;br /&gt;
  [action_type_1] [action_delay_1] [action_type_2] [action_delay_2] [action_type_3] &lt;br /&gt;
  [action_delay_3]&lt;br /&gt;
SimpleSC::SetServiceFailureFlag [name_of_service] [failure_actions_on_non_crash_failures]&lt;br /&gt;
SimpleSC::SetServiceDelayedAutoStartInfo [name_of_service] [delayed_autostart]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::GrantServiceLogonPrivilege [account]&lt;br /&gt;
SimpleSC::RemoveServiceLogonPrivilege [account]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::ServiceIsPaused [name_of_service]&lt;br /&gt;
SimpleSC::ServiceIsRunning [name_of_service]&lt;br /&gt;
SimpleSC::ServiceIsStopped [name_of_service]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::GetErrorMessage [error_code]&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
*name_of_service - The name of the service used for Start/Stop commands and all further commands &lt;br /&gt;
*display_name - The name as shown in the service control manager applet in system control &lt;br /&gt;
*service_type - One of the following codes &lt;br /&gt;
**1 - SERVICE_KERNEL_DRIVER - Driver service.&lt;br /&gt;
**2 - SERVICE_FILE_SYSTEM_DRIVER - File system driver service.&lt;br /&gt;
**16 - SERVICE_WIN32_OWN_PROCESS - Service that runs in its own process. (Should be used in most cases)&lt;br /&gt;
**32 - SERVICE_WIN32_SHARE_PROCESS - Service that shares a process with one or more other services. &lt;br /&gt;
**256 - SERVICE_INTERACTIVE_PROCESS - The service can interact with the desktop. &lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: If you specify either SERVICE_WIN32_OWN_PROCESS or SERVICE_WIN32_SHARE_PROCESS,          and the service is running in the context of the LocalSystem account,          you can also specify this value. Example: SERVICE_WIN32_OWN_PROCESS or SERVICE_INTERACTIVE_PROCESS - (16 or 256) = 272&lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: Services cannot directly interact with a user as of Windows Vista.             Therefore, this technique should not be used in new code. See for more information: http://msdn2.microsoft.com/en-us/library/ms683502(VS.85).aspx          &lt;br /&gt;
&lt;br /&gt;
*start_type - one of the following codes &lt;br /&gt;
**0 - SERVICE_BOOT_START - Driver boot stage start &lt;br /&gt;
**1 - SERVICE_SYSTEM_START - Driver scm stage start &lt;br /&gt;
**2 - SERVICE_AUTO_START - Service auto start (Should be used in most cases)&lt;br /&gt;
**3 - SERVICE_DEMAND_START - Driver/service manual start &lt;br /&gt;
**4 - SERVICE_DISABLED - Driver/service disabled&lt;br /&gt;
*service_status - one of the following codes&lt;br /&gt;
**1 - SERVICE_STOPPED&lt;br /&gt;
**2 - SERVICE_START_PENDING&lt;br /&gt;
**3 - SERVICE_STOP_PENDING&lt;br /&gt;
**4 - SERVICE_RUNNING&lt;br /&gt;
**5 - SERVICE_CONTINUE_PENDING&lt;br /&gt;
**6 - SERVICE_PAUSE_PENDING&lt;br /&gt;
**7 - SERVICE_PAUSED&lt;br /&gt;
*binary_path - The path to the binary including all necessary parameters &lt;br /&gt;
*dependencies - Needed services, controls which services have to be started before this one; use the forward slash &amp;quot;/&amp;quot; to add more more than one service&lt;br /&gt;
*account - The username/account which should be used &lt;br /&gt;
*password - Password of the aforementioned account to be able to logon as a service &lt;br /&gt;
**&#039;&#039;&#039;Note&#039;&#039;&#039;: If you do not specify account/password, the local system account will be used to run the service&lt;br /&gt;
*arguments - Arguments passed to the service main function. &lt;br /&gt;
**&#039;&#039;&#039;Note&#039;&#039;&#039;: Driver services do not receive these arguments.&lt;br /&gt;
*reset_period - The time after which to reset the failure count to zero if there are no failures, in seconds. Specify 0 (INFINITE) to indicate that this value should never be reset&lt;br /&gt;
*reboot_message - The message to be broadcast to server users before rebooting&lt;br /&gt;
*command - The command line of the process to execute in response to the SC_ACTION_RUN_COMMAND service controller action. This process runs under the same account as the service&lt;br /&gt;
*action_type_x - one of the following codes for the action to be performed&lt;br /&gt;
**0 - SC_ACTION_NONE - No action&lt;br /&gt;
**1 - SC_ACTION_RESTART - Restart the service&lt;br /&gt;
**2 - SC_ACTION_REBOOT - Reboot the computer (Note: The service user must have the SE_SHUTDOWN_NAME privilege)&lt;br /&gt;
**3 - SC_ACTION_RUN_COMMAND - Run a command&lt;br /&gt;
*action_delay_x - The time to wait before performing the specified action, in milliseconds&lt;br /&gt;
*failure_actions_on_non_crash_failures - This setting determines when failure actions are to be executed&lt;br /&gt;
**0 - The failure actions executed only if the service terminates without reporting a status of SERVICE_STOPPED&lt;br /&gt;
**1 - The failure actions executed if the status of a service is SERVICE_STOPPED but the exit code of the service is not 0&lt;br /&gt;
*delayed_autostart - The delayed auto-start setting of an auto-start service&lt;br /&gt;
**0 - The service will be started during system boot.&lt;br /&gt;
**1 - The service will be started after other auto-start services are started plus a short delay&lt;br /&gt;
*error_code - Error code of a function&lt;br /&gt;
*service_description - The description as shown in the service control manager applet in system control&lt;br /&gt;
*wait_for_file_release - Wait for file release after the service is stopped. This is useful if the binary file will be overwritten after stopping the service.&lt;br /&gt;
**0 - NO_WAIT - No wait for file release&lt;br /&gt;
**1 - WAIT - Wait for file release &lt;br /&gt;
**&#039;&#039;&#039;Note&#039;&#039;&#039;: If SERVICE_WIN32_OWN_PROCESS is used this option should be set to WAIT.	If SERVICE_WIN32_SHARE_PROCESS is used this option should only be set to WAIT if the last service in the process is stopped.&lt;br /&gt;
&lt;br /&gt;
== The Sample Script ==&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
; Install a service - ServiceType own process - StartType automatic - NoDependencies -  Logon as System Account&lt;br /&gt;
  SimpleSC::InstallService &amp;quot;MyService&amp;quot; &amp;quot;My Service Display Name&amp;quot; &amp;quot;16&amp;quot; &amp;quot;2&amp;quot; &amp;quot;C:\MyPath\MyService.exe&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Install a service - ServiceType interact with desktop - StartType automatic - Dependencies on &amp;quot;Windows Time Service&amp;quot; (w32time) and &amp;quot;WWW Publishing Service&amp;quot; (w3svc) - Logon as System Account&lt;br /&gt;
  SimpleSC::InstallService &amp;quot;MyService&amp;quot; &amp;quot;My Service Display Name&amp;quot; &amp;quot;272&amp;quot; &amp;quot;2&amp;quot; &amp;quot;C:\MyPath\MyService.exe&amp;quot; &amp;quot;w32time/w3svc&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Remove a service&lt;br /&gt;
  SimpleSC::RemoveService &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Start a service&lt;br /&gt;
  SimpleSC::StartService &amp;quot;MyService&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Start a service with two arguments &amp;quot;/param1=true&amp;quot; &amp;quot;/param2=1&amp;quot;&lt;br /&gt;
  SimpleSC::StartService &amp;quot;MyService&amp;quot; &amp;quot;/param1=true /param2=1&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
 &lt;br /&gt;
; Start a service with two arguments &amp;quot;-p param1&amp;quot; &amp;quot;-param2&amp;quot;&lt;br /&gt;
  SimpleSC::StartService &amp;quot;MyService&amp;quot; &#039;&amp;quot;-p param1&amp;quot; -param2&#039;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Stop a service and waits for file release&lt;br /&gt;
  SimpleSC::StopService &amp;quot;MyService&amp;quot; 1&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Stops two services and waits for file release after the last service is stopped&lt;br /&gt;
  SimpleSC::StopService &amp;quot;MyService1&amp;quot; 0&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  SimpleSC::StopService &amp;quot;MyService2&amp;quot; 1&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Pause a service&lt;br /&gt;
  SimpleSC::PauseService &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Continue a service&lt;br /&gt;
  SimpleSC::ContinueService &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Restart a service&lt;br /&gt;
  SimpleSC::RestartService &amp;quot;MyService&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Restart a service with two arguments &amp;quot;/param1=true&amp;quot; &amp;quot;/param2=1&amp;quot;&lt;br /&gt;
  SimpleSC::RestartService &amp;quot;MyService&amp;quot; &amp;quot;/param1=true /param2=1&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Start a service with two arguments &amp;quot;-p param1&amp;quot; &amp;quot;-param2&amp;quot;&lt;br /&gt;
  SimpleSC::RestartService &amp;quot;MyService&amp;quot; &#039;&amp;quot;-p param1&amp;quot; -param2&#039;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Check if the service exists&lt;br /&gt;
  SimpleSC::ExistsService &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode if the service doesnÂ´t exists (&amp;lt;&amp;gt;0)/service exists (0)&lt;br /&gt;
&lt;br /&gt;
; Get the displayname of a service&lt;br /&gt;
  SimpleSC::GetServiceDisplayName &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the displayname of the service&lt;br /&gt;
&lt;br /&gt;
; Get the servicename of a service by the displayname&lt;br /&gt;
  SimpleSC::GetServiceName &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the servicename of the service&lt;br /&gt;
&lt;br /&gt;
; Get the current status of a service&lt;br /&gt;
  SimpleSC::GetServiceStatus &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; return the status of the service (See &amp;quot;service_status&amp;quot; in the parameters)&lt;br /&gt;
&lt;br /&gt;
; Get the description of a service&lt;br /&gt;
  SimpleSC::GetServiceDescription &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the description of the service&lt;br /&gt;
 &lt;br /&gt;
; Get the start type of the service&lt;br /&gt;
  SimpleSC::GetServiceStartType &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the start type of the service (see &amp;quot;start_type&amp;quot; in the parameters)&lt;br /&gt;
&lt;br /&gt;
; Get the binary path of a service&lt;br /&gt;
  SimpleSC::GetServiceBinaryPath &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the binary path of the service&lt;br /&gt;
&lt;br /&gt;
; Get the logon user of the service&lt;br /&gt;
  SimpleSC::GetServiceLogon &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the logon username of the service  &lt;br /&gt;
&lt;br /&gt;
; Get the failure configuration of a service&lt;br /&gt;
  SimpleSC::GetServiceFailure &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the reset period &lt;br /&gt;
  Pop $2 ; returns the reboot message&lt;br /&gt;
  Pop $3 ; returns the command&lt;br /&gt;
  Pop $4 ; returns the first action (See &amp;quot;action_type_x&amp;quot; in the parameters)&lt;br /&gt;
  Pop $5 ; returns the first action delay &lt;br /&gt;
  Pop $6 ; returns the second action (See &amp;quot;action_type_x&amp;quot; in the parameters)&lt;br /&gt;
  Pop $7 ; returns the second action delay &lt;br /&gt;
  Pop $8 ; returns the third action (See &amp;quot;action_type_x&amp;quot; in the parameters)&lt;br /&gt;
  Pop $9 ; returns the third action delay &lt;br /&gt;
&lt;br /&gt;
; Get the failure flag configuration of a service&lt;br /&gt;
  SimpleSC::GetServiceFailureFlag &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the service flag&lt;br /&gt;
&lt;br /&gt;
; Get the delayed auto-start configuration of a service&lt;br /&gt;
  SimpleSC::GetServiceDelayedAutoStartInfo &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the delayed auto-start configuration&lt;br /&gt;
&lt;br /&gt;
; Set the description of a service&lt;br /&gt;
  SimpleSC::SetServiceDescription &amp;quot;MyService&amp;quot; &amp;quot;Sample Description&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Set the starttype to automatic of a service&lt;br /&gt;
  SimpleSC::SetServiceStartType &amp;quot;MyService&amp;quot; &amp;quot;2&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Sets the service binary path&lt;br /&gt;
  SimpleSC::SetServiceBinaryPath &amp;quot;MyService&amp;quot; &amp;quot;C:\MySoftware\MyService.exe&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Sets the service logon to a user and grant the user the &amp;quot;SeServiceLogonPrivilege&amp;quot;&lt;br /&gt;
  SimpleSC::SetServiceLogon &amp;quot;MyService&amp;quot; &amp;quot;MyServiceUser&amp;quot; &amp;quot;MyServiceUserPassword&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  IntCmp $0 0 +1 Done Done ; If successful grant the service logon privilege to &amp;quot;MyServiceUser&amp;quot;&lt;br /&gt;
    ; Note: Every serviceuser must have the ServiceLogonPrivilege to start the service&lt;br /&gt;
    SimpleSC::GrantServiceLogonPrivilege &amp;quot;MyServiceUser&amp;quot;&lt;br /&gt;
    Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Done:&lt;br /&gt;
&lt;br /&gt;
; Sets the service failure configuration - First action: Restart the service after one minute - Second action: Reboot the computer after five minutes&lt;br /&gt;
  SimpleSC::SetServiceFailure &amp;quot;MyService&amp;quot; &amp;quot;0&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;1&amp;quot; &amp;quot;60000&amp;quot; &amp;quot;2&amp;quot; &amp;quot;300000&amp;quot; &amp;quot;0&amp;quot; &amp;quot;0&amp;quot; &lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Sets the failure flag configuration of a service&lt;br /&gt;
  SimpleSC::SetServiceFailureFlag &amp;quot;MyService&amp;quot; &amp;quot;1&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Sets the delayed auto-start configuration of a service&lt;br /&gt;
  SimpleSC::SetServiceDelayedAutoStartInfo &amp;quot;MyService&amp;quot; &amp;quot;1&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Remove the &amp;quot;SeServiceLogonPrivilege&amp;quot; from a user&lt;br /&gt;
  SimpleSC::RemoveServiceLogonPrivilege &amp;quot;MyServiceUser&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Check if the service is paused&lt;br /&gt;
  SimpleSC::ServiceIsPaused &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns 1 (service is paused) - returns 0 (service is not paused)&lt;br /&gt;
&lt;br /&gt;
; Check if the service is running&lt;br /&gt;
  SimpleSC::ServiceIsRunning &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns 1 (service is running) - returns 0 (service is not running)&lt;br /&gt;
&lt;br /&gt;
; Check if the service is stopped&lt;br /&gt;
  SimpleSC::ServiceIsStopped &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns 1 (service is stopped) - returns 0 (service is not stopped)&lt;br /&gt;
&lt;br /&gt;
; Show the error message if a function fails &lt;br /&gt;
  SimpleSC::StopService &amp;quot;MyService&amp;quot; 1&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  IntCmp $0 0 Done +1 +1 &lt;br /&gt;
    Push $0&lt;br /&gt;
    SimpleSC::GetErrorMessage&lt;br /&gt;
    Pop $0&lt;br /&gt;
    MessageBox MB_OK|MB_ICONSTOP &amp;quot;Stopping fails - Reason: $0&amp;quot;&lt;br /&gt;
  Done:&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Changelog ==&lt;br /&gt;
* Version 1.29 (2011-04-16)&lt;br /&gt;
**SimpleSC::GetServiceFailureFlag added&lt;br /&gt;
**SimpleSC::SetServiceFailureFlag added&lt;br /&gt;
**SimpleSC::GetServiceDelayedAutoStartInfo added&lt;br /&gt;
**SimpleSC::SetServiceDelayedAutoStartInfo added&lt;br /&gt;
* Version 1.28 (2010-09-14)&lt;br /&gt;
**SimpleSC::GetServiceFailure function added&lt;br /&gt;
**SimpleSC::SetServiceFailure function added&lt;br /&gt;
**SimpleSC::StopService WaitForFileRelease feature added (For details take a look at the documentation)&lt;br /&gt;
* Version 1.27 (2010-03-23)&lt;br /&gt;
**Documentation updated&lt;br /&gt;
* Version 1.26 (2009-05-21)&lt;br /&gt;
**Fixed wait for status bug on starting, stopping, pausing or continuing a service &lt;br /&gt;
* Version 1.25 (2009-04-23)&lt;br /&gt;
**SimpleSC::SetServiceLogon supports now non-domain username without the &amp;quot;.\&amp;quot;-prefix&lt;br /&gt;
**SimpleSC::SetServiceBinaryPath function added&lt;br /&gt;
*Version 1.24 (2009-04-13)&lt;br /&gt;
**Fixed wait for status bug if the service status changed. Now, if a service stops, starts aso. the plugin will work like the recommendations in the MSDN.&lt;br /&gt;
*Version 1.23 (2008-08-23)&lt;br /&gt;
**Removed compiler optimization to avoid a false-positive virusscan.&lt;br /&gt;
*Version 1.22 (2008-08-17)&lt;br /&gt;
**SimpleSC::GrantServiceLogonPrivilege and SimpleSC::RemoveServiceLogonPrivilege works now correct with domain names like MyDomain\MyUser.&lt;br /&gt;
**Added function SimpleSC::GetServiceLogon to get the logon username of a service.&lt;br /&gt;
*Version 1.21 (2008-02-10)&lt;br /&gt;
**SimpleSC::ExistsService results now 0 if the service exists and &amp;lt;&amp;gt; 0 if the service doensnÂ´t exists.&lt;br /&gt;
*Version 1.20 (2008-02-05)&lt;br /&gt;
**Every function now returns &amp;lt;&amp;gt; 0 if there is an error. Use SimpleSC::GetErrorMessage to get the message of a function result.&lt;br /&gt;
**Added function SimpleSC::GetErrorMessage to get the message of a function result.&lt;br /&gt;
**SimpleSC::ExistsService results now 0 if the service exists and &amp;lt;&amp;gt; 0 if the service doensnÂ´t exists.&lt;br /&gt;
**SimpleSC::RestartService supports now arguments.&lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: The signature has been changed. If you update from a previous version you must check your parameters.&lt;br /&gt;
*Version 1.10 (2008-01-29)&lt;br /&gt;
**SimpleSC::InstallService supports now more than one dependencies (delimitter is the forward slash).&lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: The signature has been changed. If you update from a previous version you must check your parameters.&lt;br /&gt;
**SimpleSC::InstallService supports now more service types e.g. to create an interactive service.&lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: The signature has been changed. If you update from a previous version you must check your parameters.&lt;br /&gt;
**SimpleSC::StartService supports now arguments. &lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: The signature has been changed. If you update from a previous version you must check your parameters.&lt;br /&gt;
*Version 1.05 (2008-01-12)&lt;br /&gt;
**The functions SimpleSC::StopService and SimpleSC::RestartService are now improved. Now all dependent services are stopping recursively too.&lt;br /&gt;
*Version 1.04 (2007-08-07)&lt;br /&gt;
**Fixed bug for possible endless loops. This concerns to the functions StartService, StopService, ContinueService and PauseService. &lt;br /&gt;
*Version 1.03 (2007-08-02)&lt;br /&gt;
**Added function SimpleSC::GetServiceBinaryPath to get the binary path of a specified service.&lt;br /&gt;
*Version 1.02 (2007-05-29)&lt;br /&gt;
**Changed wrong documentation informations about the functions SimpleSC::InstallService and SimpleSC::RemoveService.&lt;br /&gt;
*Version 1.01 (2007-05-07)&lt;br /&gt;
**Changed wrong status-results in Readme.txt. This concerns to the functions ServiceIsPaused, ServiceIsRunning and ServiceIsStopped.&lt;br /&gt;
**Changed the access privileges of the plugin. The plugin now uses the lowest privlege of each function to execute.&lt;br /&gt;
*Version 1.0 (2007-05-02)&lt;br /&gt;
**First offical version&lt;br /&gt;
&lt;br /&gt;
== Important Notes ==&lt;br /&gt;
*The function &amp;quot;SetServiceLogon&amp;quot; only works if the servicetype is &amp;quot;SERVICE_WIN32_OWN_PROCESS&amp;quot;.&lt;br /&gt;
* The functions &amp;quot;GetServiceDescription&amp;quot; or &amp;quot;SetServiceDescription&amp;quot; are only available on systems higher than Windows NT.&lt;br /&gt;
* The function &amp;quot;GetServiceFailureFlag&amp;quot;, &amp;quot;SetServiceFailureFlag&amp;quot;, &amp;quot;GetServiceDelayedAutoStartInfo&amp;quot; and &amp;quot;SetServiceDelayedAutoStartInfo&amp;quot; are only available on systems higher than Windows 2003.&lt;br /&gt;
* If you change the logon of an service to a new user you have to grant him the Service Logon Privilege. Otherwise the service cannot be started by the user you have assigned.&lt;br /&gt;
* The functions StartService, StopService, PauseService and ContinueService uses a timeout of 30 seconds. This means the function must be executed within 30 seconds, otherwise the functions will return an error.&lt;br /&gt;
* If you have any suggestions, comments or questions please mail me: mailto:rainer@speed-soft.de&lt;br /&gt;
&lt;br /&gt;
[[Category:Plugins]]&lt;/div&gt;</summary>
		<author><name>Speed78</name></author>
	</entry>
	<entry>
		<id>https://nsis.sourceforge.io/mediawiki/index.php?title=File:NSIS_Simple_Service_Plugin_1.29.zip&amp;diff=19834</id>
		<title>File:NSIS Simple Service Plugin 1.29.zip</title>
		<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/mediawiki/index.php?title=File:NSIS_Simple_Service_Plugin_1.29.zip&amp;diff=19834"/>
		<updated>2011-04-16T14:51:40Z</updated>

		<summary type="html">&lt;p&gt;Speed78: NSIS Simple Service Plugin&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;NSIS Simple Service Plugin&lt;/div&gt;</summary>
		<author><name>Speed78</name></author>
	</entry>
	<entry>
		<id>https://nsis.sourceforge.io/mediawiki/index.php?title=NSIS_Simple_Service_Plugin&amp;diff=19833</id>
		<title>NSIS Simple Service Plugin</title>
		<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/mediawiki/index.php?title=NSIS_Simple_Service_Plugin&amp;diff=19833"/>
		<updated>2011-04-16T14:39:43Z</updated>

		<summary type="html">&lt;p&gt;Speed78: /* Changelog */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This plugin contains basic service functions like start, stop the service or checking the service status. It also contains advanced service functions for example setting the service description, changed the logon account, granting or removing the service logon privilege.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This plugin is using the MPL License or alternatively the LGPL License.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
&amp;lt;attach&amp;gt;NSIS_Simple_Service_Plugin_1.28.zip&amp;lt;/attach&amp;gt; The ZIP file containing a precompiled plugin DLL (to be saved in NSIS&#039; plugin directory) and the sources. If you update from a previous version it is strongly &#039;&#039;&#039;recommend&#039;&#039;&#039; to take look at the changelog.&lt;br /&gt;
&lt;br /&gt;
== Donation ==&lt;br /&gt;
If you believe that I am doing a good job and you want to support me please [http://www.speed-soft.de/donation/index.php?language=en donate] any amount via PayPal.&lt;br /&gt;
&lt;br /&gt;
== Short Reference ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
SimpleSC::InstallService [name_of_service] [display_name] [service_type] [start_type] &lt;br /&gt;
  [binary_path] [dependencies] [account] [password]&lt;br /&gt;
SimpleSC::RemoveService [name_of_service]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::StartService [name_of_service] [arguments]&lt;br /&gt;
SimpleSC::StopService [name_of_service] [wait_for_file_release]&lt;br /&gt;
SimpleSC::PauseService [name_of_service] &lt;br /&gt;
SimpleSC::ContinueService [name_of_service]&lt;br /&gt;
SimpleSC::RestartService [name_of_service] [arguments]&lt;br /&gt;
SimpleSC::ExistsService [name_of_service]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::GetServiceDisplayName [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceName [display_name]&lt;br /&gt;
SimpleSC::GetServiceStatus [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceDescription [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceStartType [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceBinaryPath [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceLogon [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceFailure [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceFailureFlag [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceDelayedAutoStartInfo [name_of_service]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::SetServiceDescription [name_of_service] [service_description]&lt;br /&gt;
SimpleSC::SetServiceStartType [name_of_service] [start_type]&lt;br /&gt;
SimpleSC::SetServiceBinaryPath [name_of_service] [binary_path]&lt;br /&gt;
SimpleSC::SetServiceLogon [name_of_service] [account] [password]&lt;br /&gt;
SimpleSC::SetServiceFailure [name_of_service] [reset_period] [reboot_message] [command] &lt;br /&gt;
  [action_type_1] [action_delay_1] [action_type_2] [action_delay_2] [action_type_3] &lt;br /&gt;
  [action_delay_3]&lt;br /&gt;
SimpleSC::SetServiceFailureFlag [name_of_service] [failure_actions_on_non_crash_failures]&lt;br /&gt;
SimpleSC::SetServiceDelayedAutoStartInfo [name_of_service] [delayed_autostart]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::GrantServiceLogonPrivilege [account]&lt;br /&gt;
SimpleSC::RemoveServiceLogonPrivilege [account]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::ServiceIsPaused [name_of_service]&lt;br /&gt;
SimpleSC::ServiceIsRunning [name_of_service]&lt;br /&gt;
SimpleSC::ServiceIsStopped [name_of_service]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::GetErrorMessage [error_code]&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
*name_of_service - The name of the service used for Start/Stop commands and all further commands &lt;br /&gt;
*display_name - The name as shown in the service control manager applet in system control &lt;br /&gt;
*service_type - One of the following codes &lt;br /&gt;
**1 - SERVICE_KERNEL_DRIVER - Driver service.&lt;br /&gt;
**2 - SERVICE_FILE_SYSTEM_DRIVER - File system driver service.&lt;br /&gt;
**16 - SERVICE_WIN32_OWN_PROCESS - Service that runs in its own process. (Should be used in most cases)&lt;br /&gt;
**32 - SERVICE_WIN32_SHARE_PROCESS - Service that shares a process with one or more other services. &lt;br /&gt;
**256 - SERVICE_INTERACTIVE_PROCESS - The service can interact with the desktop. &lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: If you specify either SERVICE_WIN32_OWN_PROCESS or SERVICE_WIN32_SHARE_PROCESS,          and the service is running in the context of the LocalSystem account,          you can also specify this value. Example: SERVICE_WIN32_OWN_PROCESS or SERVICE_INTERACTIVE_PROCESS - (16 or 256) = 272&lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: Services cannot directly interact with a user as of Windows Vista.             Therefore, this technique should not be used in new code. See for more information: http://msdn2.microsoft.com/en-us/library/ms683502(VS.85).aspx          &lt;br /&gt;
&lt;br /&gt;
*start_type - one of the following codes &lt;br /&gt;
**0 - SERVICE_BOOT_START - Driver boot stage start &lt;br /&gt;
**1 - SERVICE_SYSTEM_START - Driver scm stage start &lt;br /&gt;
**2 - SERVICE_AUTO_START - Service auto start (Should be used in most cases)&lt;br /&gt;
**3 - SERVICE_DEMAND_START - Driver/service manual start &lt;br /&gt;
**4 - SERVICE_DISABLED - Driver/service disabled&lt;br /&gt;
*service_status - one of the following codes&lt;br /&gt;
**1 - SERVICE_STOPPED&lt;br /&gt;
**2 - SERVICE_START_PENDING&lt;br /&gt;
**3 - SERVICE_STOP_PENDING&lt;br /&gt;
**4 - SERVICE_RUNNING&lt;br /&gt;
**5 - SERVICE_CONTINUE_PENDING&lt;br /&gt;
**6 - SERVICE_PAUSE_PENDING&lt;br /&gt;
**7 - SERVICE_PAUSED&lt;br /&gt;
*binary_path - The path to the binary including all necessary parameters &lt;br /&gt;
*dependencies - Needed services, controls which services have to be started before this one; use the forward slash &amp;quot;/&amp;quot; to add more more than one service&lt;br /&gt;
*account - The username/account which should be used &lt;br /&gt;
*password - Password of the aforementioned account to be able to logon as a service &lt;br /&gt;
**&#039;&#039;&#039;Note&#039;&#039;&#039;: If you do not specify account/password, the local system account will be used to run the service&lt;br /&gt;
*arguments - Arguments passed to the service main function. &lt;br /&gt;
**&#039;&#039;&#039;Note&#039;&#039;&#039;: Driver services do not receive these arguments.&lt;br /&gt;
*reset_period - The time after which to reset the failure count to zero if there are no failures, in seconds. Specify 0 (INFINITE) to indicate that this value should never be reset&lt;br /&gt;
*reboot_message - The message to be broadcast to server users before rebooting&lt;br /&gt;
*command - The command line of the process to execute in response to the SC_ACTION_RUN_COMMAND service controller action. This process runs under the same account as the service&lt;br /&gt;
*action_type_x - one of the following codes for the action to be performed&lt;br /&gt;
**0 - SC_ACTION_NONE - No action&lt;br /&gt;
**1 - SC_ACTION_RESTART - Restart the service&lt;br /&gt;
**2 - SC_ACTION_REBOOT - Reboot the computer (Note: The service user must have the SE_SHUTDOWN_NAME privilege)&lt;br /&gt;
**3 - SC_ACTION_RUN_COMMAND - Run a command&lt;br /&gt;
*action_delay_x - The time to wait before performing the specified action, in milliseconds&lt;br /&gt;
*failure_actions_on_non_crash_failures - This setting determines when failure actions are to be executed&lt;br /&gt;
**0 - The failure actions executed only if the service terminates without reporting a status of SERVICE_STOPPED&lt;br /&gt;
**1 - The failure actions executed if the status of a service is SERVICE_STOPPED but the exit code of the service is not 0&lt;br /&gt;
*delayed_autostart - The delayed auto-start setting of an auto-start service&lt;br /&gt;
**0 - The service will be started during system boot.&lt;br /&gt;
**1 - The service will be started after other auto-start services are started plus a short delay&lt;br /&gt;
*error_code - Error code of a function&lt;br /&gt;
*service_description - The description as shown in the service control manager applet in system control&lt;br /&gt;
*wait_for_file_release - Wait for file release after the service is stopped. This is useful if the binary file will be overwritten after stopping the service.&lt;br /&gt;
**0 - NO_WAIT - No wait for file release&lt;br /&gt;
**1 - WAIT - Wait for file release &lt;br /&gt;
**&#039;&#039;&#039;Note&#039;&#039;&#039;: If SERVICE_WIN32_OWN_PROCESS is used this option should be set to WAIT.	If SERVICE_WIN32_SHARE_PROCESS is used this option should only be set to WAIT if the last service in the process is stopped.&lt;br /&gt;
&lt;br /&gt;
== The Sample Script ==&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
; Install a service - ServiceType own process - StartType automatic - NoDependencies -  Logon as System Account&lt;br /&gt;
  SimpleSC::InstallService &amp;quot;MyService&amp;quot; &amp;quot;My Service Display Name&amp;quot; &amp;quot;16&amp;quot; &amp;quot;2&amp;quot; &amp;quot;C:\MyPath\MyService.exe&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Install a service - ServiceType interact with desktop - StartType automatic - Dependencies on &amp;quot;Windows Time Service&amp;quot; (w32time) and &amp;quot;WWW Publishing Service&amp;quot; (w3svc) - Logon as System Account&lt;br /&gt;
  SimpleSC::InstallService &amp;quot;MyService&amp;quot; &amp;quot;My Service Display Name&amp;quot; &amp;quot;272&amp;quot; &amp;quot;2&amp;quot; &amp;quot;C:\MyPath\MyService.exe&amp;quot; &amp;quot;w32time/w3svc&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Remove a service&lt;br /&gt;
  SimpleSC::RemoveService &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Start a service&lt;br /&gt;
  SimpleSC::StartService &amp;quot;MyService&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Start a service with two arguments &amp;quot;/param1=true&amp;quot; &amp;quot;/param2=1&amp;quot;&lt;br /&gt;
  SimpleSC::StartService &amp;quot;MyService&amp;quot; &amp;quot;/param1=true /param2=1&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
 &lt;br /&gt;
; Start a service with two arguments &amp;quot;-p param1&amp;quot; &amp;quot;-param2&amp;quot;&lt;br /&gt;
  SimpleSC::StartService &amp;quot;MyService&amp;quot; &#039;&amp;quot;-p param1&amp;quot; -param2&#039;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Stop a service and waits for file release&lt;br /&gt;
  SimpleSC::StopService &amp;quot;MyService&amp;quot; 1&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Stops two services and waits for file release after the last service is stopped&lt;br /&gt;
  SimpleSC::StopService &amp;quot;MyService1&amp;quot; 0&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  SimpleSC::StopService &amp;quot;MyService2&amp;quot; 1&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Pause a service&lt;br /&gt;
  SimpleSC::PauseService &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Continue a service&lt;br /&gt;
  SimpleSC::ContinueService &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Restart a service&lt;br /&gt;
  SimpleSC::RestartService &amp;quot;MyService&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Restart a service with two arguments &amp;quot;/param1=true&amp;quot; &amp;quot;/param2=1&amp;quot;&lt;br /&gt;
  SimpleSC::RestartService &amp;quot;MyService&amp;quot; &amp;quot;/param1=true /param2=1&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Start a service with two arguments &amp;quot;-p param1&amp;quot; &amp;quot;-param2&amp;quot;&lt;br /&gt;
  SimpleSC::RestartService &amp;quot;MyService&amp;quot; &#039;&amp;quot;-p param1&amp;quot; -param2&#039;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Check if the service exists&lt;br /&gt;
  SimpleSC::ExistsService &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode if the service doesnÂ´t exists (&amp;lt;&amp;gt;0)/service exists (0)&lt;br /&gt;
&lt;br /&gt;
; Get the displayname of a service&lt;br /&gt;
  SimpleSC::GetServiceDisplayName &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the displayname of the service&lt;br /&gt;
&lt;br /&gt;
; Get the servicename of a service by the displayname&lt;br /&gt;
  SimpleSC::GetServiceName &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the servicename of the service&lt;br /&gt;
&lt;br /&gt;
; Get the current status of a service&lt;br /&gt;
  SimpleSC::GetServiceStatus &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; return the status of the service (See &amp;quot;service_status&amp;quot; in the parameters)&lt;br /&gt;
&lt;br /&gt;
; Get the description of a service&lt;br /&gt;
  SimpleSC::GetServiceDescription &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the description of the service&lt;br /&gt;
 &lt;br /&gt;
; Get the start type of the service&lt;br /&gt;
  SimpleSC::GetServiceStartType &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the start type of the service (see &amp;quot;start_type&amp;quot; in the parameters)&lt;br /&gt;
&lt;br /&gt;
; Get the binary path of a service&lt;br /&gt;
  SimpleSC::GetServiceBinaryPath &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the binary path of the service&lt;br /&gt;
&lt;br /&gt;
; Get the logon user of the service&lt;br /&gt;
  SimpleSC::GetServiceLogon &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the logon username of the service  &lt;br /&gt;
&lt;br /&gt;
; Get the failure configuration of a service&lt;br /&gt;
  SimpleSC::GetServiceFailure &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the reset period &lt;br /&gt;
  Pop $2 ; returns the reboot message&lt;br /&gt;
  Pop $3 ; returns the command&lt;br /&gt;
  Pop $4 ; returns the first action (See &amp;quot;action_type_x&amp;quot; in the parameters)&lt;br /&gt;
  Pop $5 ; returns the first action delay &lt;br /&gt;
  Pop $6 ; returns the second action (See &amp;quot;action_type_x&amp;quot; in the parameters)&lt;br /&gt;
  Pop $7 ; returns the second action delay &lt;br /&gt;
  Pop $8 ; returns the third action (See &amp;quot;action_type_x&amp;quot; in the parameters)&lt;br /&gt;
  Pop $9 ; returns the third action delay &lt;br /&gt;
&lt;br /&gt;
; Get the failure flag configuration of a service&lt;br /&gt;
  SimpleSC::GetServiceFailureFlag &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the service flag&lt;br /&gt;
&lt;br /&gt;
; Get the delayed auto-start configuration of a service&lt;br /&gt;
  SimpleSC::GetServiceDelayedAutoStartInfo &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the delayed auto-start configuration&lt;br /&gt;
&lt;br /&gt;
; Set the description of a service&lt;br /&gt;
  SimpleSC::SetServiceDescription &amp;quot;MyService&amp;quot; &amp;quot;Sample Description&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Set the starttype to automatic of a service&lt;br /&gt;
  SimpleSC::SetServiceStartType &amp;quot;MyService&amp;quot; &amp;quot;2&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Sets the service binary path&lt;br /&gt;
  SimpleSC::SetServiceBinaryPath &amp;quot;MyService&amp;quot; &amp;quot;C:\MySoftware\MyService.exe&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Sets the service logon to a user and grant the user the &amp;quot;SeServiceLogonPrivilege&amp;quot;&lt;br /&gt;
  SimpleSC::SetServiceLogon &amp;quot;MyService&amp;quot; &amp;quot;MyServiceUser&amp;quot; &amp;quot;MyServiceUserPassword&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  IntCmp $0 0 +1 Done Done ; If successful grant the service logon privilege to &amp;quot;MyServiceUser&amp;quot;&lt;br /&gt;
    ; Note: Every serviceuser must have the ServiceLogonPrivilege to start the service&lt;br /&gt;
    SimpleSC::GrantServiceLogonPrivilege &amp;quot;MyServiceUser&amp;quot;&lt;br /&gt;
    Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Done:&lt;br /&gt;
&lt;br /&gt;
; Sets the service failure configuration - First action: Restart the service after one minute - Second action: Reboot the computer after five minutes&lt;br /&gt;
  SimpleSC::SetServiceFailure &amp;quot;MyService&amp;quot; &amp;quot;0&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;1&amp;quot; &amp;quot;60000&amp;quot; &amp;quot;2&amp;quot; &amp;quot;300000&amp;quot; &amp;quot;0&amp;quot; &amp;quot;0&amp;quot; &lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Sets the failure flag configuration of a service&lt;br /&gt;
  SimpleSC::SetServiceFailureFlag &amp;quot;MyService&amp;quot; &amp;quot;1&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Sets the delayed auto-start configuration of a service&lt;br /&gt;
  SimpleSC::SetServiceDelayedAutoStartInfo &amp;quot;MyService&amp;quot; &amp;quot;1&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Remove the &amp;quot;SeServiceLogonPrivilege&amp;quot; from a user&lt;br /&gt;
  SimpleSC::RemoveServiceLogonPrivilege &amp;quot;MyServiceUser&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Check if the service is paused&lt;br /&gt;
  SimpleSC::ServiceIsPaused &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns 1 (service is paused) - returns 0 (service is not paused)&lt;br /&gt;
&lt;br /&gt;
; Check if the service is running&lt;br /&gt;
  SimpleSC::ServiceIsRunning &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns 1 (service is running) - returns 0 (service is not running)&lt;br /&gt;
&lt;br /&gt;
; Check if the service is stopped&lt;br /&gt;
  SimpleSC::ServiceIsStopped &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns 1 (service is stopped) - returns 0 (service is not stopped)&lt;br /&gt;
&lt;br /&gt;
; Show the error message if a function fails &lt;br /&gt;
  SimpleSC::StopService &amp;quot;MyService&amp;quot; 1&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  IntCmp $0 0 Done +1 +1 &lt;br /&gt;
    Push $0&lt;br /&gt;
    SimpleSC::GetErrorMessage&lt;br /&gt;
    Pop $0&lt;br /&gt;
    MessageBox MB_OK|MB_ICONSTOP &amp;quot;Stopping fails - Reason: $0&amp;quot;&lt;br /&gt;
  Done:&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Changelog ==&lt;br /&gt;
* Version 1.29 (2011-04-16)&lt;br /&gt;
**SimpleSC::GetServiceFailureFlag added&lt;br /&gt;
**SimpleSC::SetServiceFailureFlag added&lt;br /&gt;
**SimpleSC::GetServiceDelayedAutoStartInfo added&lt;br /&gt;
**SimpleSC::SetServiceDelayedAutoStartInfo added&lt;br /&gt;
* Version 1.28 (2010-09-14)&lt;br /&gt;
**SimpleSC::GetServiceFailure function added&lt;br /&gt;
**SimpleSC::SetServiceFailure function added&lt;br /&gt;
**SimpleSC::StopService WaitForFileRelease feature added (For details take a look at the documentation)&lt;br /&gt;
* Version 1.27 (2010-03-23)&lt;br /&gt;
**Documentation updated&lt;br /&gt;
* Version 1.26 (2009-05-21)&lt;br /&gt;
**Fixed wait for status bug on starting, stopping, pausing or continuing a service &lt;br /&gt;
* Version 1.25 (2009-04-23)&lt;br /&gt;
**SimpleSC::SetServiceLogon supports now non-domain username without the &amp;quot;.\&amp;quot;-prefix&lt;br /&gt;
**SimpleSC::SetServiceBinaryPath function added&lt;br /&gt;
*Version 1.24 (2009-04-13)&lt;br /&gt;
**Fixed wait for status bug if the service status changed. Now, if a service stops, starts aso. the plugin will work like the recommendations in the MSDN.&lt;br /&gt;
*Version 1.23 (2008-08-23)&lt;br /&gt;
**Removed compiler optimization to avoid a false-positive virusscan.&lt;br /&gt;
*Version 1.22 (2008-08-17)&lt;br /&gt;
**SimpleSC::GrantServiceLogonPrivilege and SimpleSC::RemoveServiceLogonPrivilege works now correct with domain names like MyDomain\MyUser.&lt;br /&gt;
**Added function SimpleSC::GetServiceLogon to get the logon username of a service.&lt;br /&gt;
*Version 1.21 (2008-02-10)&lt;br /&gt;
**SimpleSC::ExistsService results now 0 if the service exists and &amp;lt;&amp;gt; 0 if the service doensnÂ´t exists.&lt;br /&gt;
*Version 1.20 (2008-02-05)&lt;br /&gt;
**Every function now returns &amp;lt;&amp;gt; 0 if there is an error. Use SimpleSC::GetErrorMessage to get the message of a function result.&lt;br /&gt;
**Added function SimpleSC::GetErrorMessage to get the message of a function result.&lt;br /&gt;
**SimpleSC::ExistsService results now 0 if the service exists and &amp;lt;&amp;gt; 0 if the service doensnÂ´t exists.&lt;br /&gt;
**SimpleSC::RestartService supports now arguments.&lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: The signature has been changed. If you update from a previous version you must check your parameters.&lt;br /&gt;
*Version 1.10 (2008-01-29)&lt;br /&gt;
**SimpleSC::InstallService supports now more than one dependencies (delimitter is the forward slash).&lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: The signature has been changed. If you update from a previous version you must check your parameters.&lt;br /&gt;
**SimpleSC::InstallService supports now more service types e.g. to create an interactive service.&lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: The signature has been changed. If you update from a previous version you must check your parameters.&lt;br /&gt;
**SimpleSC::StartService supports now arguments. &lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: The signature has been changed. If you update from a previous version you must check your parameters.&lt;br /&gt;
*Version 1.05 (2008-01-12)&lt;br /&gt;
**The functions SimpleSC::StopService and SimpleSC::RestartService are now improved. Now all dependent services are stopping recursively too.&lt;br /&gt;
*Version 1.04 (2007-08-07)&lt;br /&gt;
**Fixed bug for possible endless loops. This concerns to the functions StartService, StopService, ContinueService and PauseService. &lt;br /&gt;
*Version 1.03 (2007-08-02)&lt;br /&gt;
**Added function SimpleSC::GetServiceBinaryPath to get the binary path of a specified service.&lt;br /&gt;
*Version 1.02 (2007-05-29)&lt;br /&gt;
**Changed wrong documentation informations about the functions SimpleSC::InstallService and SimpleSC::RemoveService.&lt;br /&gt;
*Version 1.01 (2007-05-07)&lt;br /&gt;
**Changed wrong status-results in Readme.txt. This concerns to the functions ServiceIsPaused, ServiceIsRunning and ServiceIsStopped.&lt;br /&gt;
**Changed the access privileges of the plugin. The plugin now uses the lowest privlege of each function to execute.&lt;br /&gt;
*Version 1.0 (2007-05-02)&lt;br /&gt;
**First offical version&lt;br /&gt;
&lt;br /&gt;
== Important Notes ==&lt;br /&gt;
*The function &amp;quot;SetServiceLogon&amp;quot; only works if the servicetype is &amp;quot;SERVICE_WIN32_OWN_PROCESS&amp;quot;.&lt;br /&gt;
* The functions &amp;quot;GetServiceDescription&amp;quot; or &amp;quot;SetServiceDescription&amp;quot; are only available on systems higher than Windows NT.&lt;br /&gt;
* The function &amp;quot;GetServiceFailureFlag&amp;quot;, &amp;quot;SetServiceFailureFlag&amp;quot;, &amp;quot;GetServiceDelayedAutoStartInfo&amp;quot; and &amp;quot;SetServiceDelayedAutoStartInfo&amp;quot; are only available on systems higher than Windows 2003.&lt;br /&gt;
* If you change the logon of an service to a new user you have to grant him the Service Logon Privilege. Otherwise the service cannot be started by the user you have assigned.&lt;br /&gt;
* The functions StartService, StopService, PauseService and ContinueService uses a timeout of 30 seconds. This means the function must be executed within 30 seconds, otherwise the functions will return an error.&lt;br /&gt;
* If you have any suggestions, comments or questions please mail me: mailto:rainer@speed-soft.de&lt;br /&gt;
&lt;br /&gt;
[[Category:Plugins]]&lt;/div&gt;</summary>
		<author><name>Speed78</name></author>
	</entry>
	<entry>
		<id>https://nsis.sourceforge.io/mediawiki/index.php?title=NSIS_Simple_Service_Plugin&amp;diff=19832</id>
		<title>NSIS Simple Service Plugin</title>
		<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/mediawiki/index.php?title=NSIS_Simple_Service_Plugin&amp;diff=19832"/>
		<updated>2011-04-16T14:37:56Z</updated>

		<summary type="html">&lt;p&gt;Speed78: /* Important Notes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This plugin contains basic service functions like start, stop the service or checking the service status. It also contains advanced service functions for example setting the service description, changed the logon account, granting or removing the service logon privilege.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This plugin is using the MPL License or alternatively the LGPL License.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
&amp;lt;attach&amp;gt;NSIS_Simple_Service_Plugin_1.28.zip&amp;lt;/attach&amp;gt; The ZIP file containing a precompiled plugin DLL (to be saved in NSIS&#039; plugin directory) and the sources. If you update from a previous version it is strongly &#039;&#039;&#039;recommend&#039;&#039;&#039; to take look at the changelog.&lt;br /&gt;
&lt;br /&gt;
== Donation ==&lt;br /&gt;
If you believe that I am doing a good job and you want to support me please [http://www.speed-soft.de/donation/index.php?language=en donate] any amount via PayPal.&lt;br /&gt;
&lt;br /&gt;
== Short Reference ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
SimpleSC::InstallService [name_of_service] [display_name] [service_type] [start_type] &lt;br /&gt;
  [binary_path] [dependencies] [account] [password]&lt;br /&gt;
SimpleSC::RemoveService [name_of_service]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::StartService [name_of_service] [arguments]&lt;br /&gt;
SimpleSC::StopService [name_of_service] [wait_for_file_release]&lt;br /&gt;
SimpleSC::PauseService [name_of_service] &lt;br /&gt;
SimpleSC::ContinueService [name_of_service]&lt;br /&gt;
SimpleSC::RestartService [name_of_service] [arguments]&lt;br /&gt;
SimpleSC::ExistsService [name_of_service]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::GetServiceDisplayName [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceName [display_name]&lt;br /&gt;
SimpleSC::GetServiceStatus [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceDescription [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceStartType [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceBinaryPath [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceLogon [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceFailure [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceFailureFlag [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceDelayedAutoStartInfo [name_of_service]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::SetServiceDescription [name_of_service] [service_description]&lt;br /&gt;
SimpleSC::SetServiceStartType [name_of_service] [start_type]&lt;br /&gt;
SimpleSC::SetServiceBinaryPath [name_of_service] [binary_path]&lt;br /&gt;
SimpleSC::SetServiceLogon [name_of_service] [account] [password]&lt;br /&gt;
SimpleSC::SetServiceFailure [name_of_service] [reset_period] [reboot_message] [command] &lt;br /&gt;
  [action_type_1] [action_delay_1] [action_type_2] [action_delay_2] [action_type_3] &lt;br /&gt;
  [action_delay_3]&lt;br /&gt;
SimpleSC::SetServiceFailureFlag [name_of_service] [failure_actions_on_non_crash_failures]&lt;br /&gt;
SimpleSC::SetServiceDelayedAutoStartInfo [name_of_service] [delayed_autostart]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::GrantServiceLogonPrivilege [account]&lt;br /&gt;
SimpleSC::RemoveServiceLogonPrivilege [account]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::ServiceIsPaused [name_of_service]&lt;br /&gt;
SimpleSC::ServiceIsRunning [name_of_service]&lt;br /&gt;
SimpleSC::ServiceIsStopped [name_of_service]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::GetErrorMessage [error_code]&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
*name_of_service - The name of the service used for Start/Stop commands and all further commands &lt;br /&gt;
*display_name - The name as shown in the service control manager applet in system control &lt;br /&gt;
*service_type - One of the following codes &lt;br /&gt;
**1 - SERVICE_KERNEL_DRIVER - Driver service.&lt;br /&gt;
**2 - SERVICE_FILE_SYSTEM_DRIVER - File system driver service.&lt;br /&gt;
**16 - SERVICE_WIN32_OWN_PROCESS - Service that runs in its own process. (Should be used in most cases)&lt;br /&gt;
**32 - SERVICE_WIN32_SHARE_PROCESS - Service that shares a process with one or more other services. &lt;br /&gt;
**256 - SERVICE_INTERACTIVE_PROCESS - The service can interact with the desktop. &lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: If you specify either SERVICE_WIN32_OWN_PROCESS or SERVICE_WIN32_SHARE_PROCESS,          and the service is running in the context of the LocalSystem account,          you can also specify this value. Example: SERVICE_WIN32_OWN_PROCESS or SERVICE_INTERACTIVE_PROCESS - (16 or 256) = 272&lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: Services cannot directly interact with a user as of Windows Vista.             Therefore, this technique should not be used in new code. See for more information: http://msdn2.microsoft.com/en-us/library/ms683502(VS.85).aspx          &lt;br /&gt;
&lt;br /&gt;
*start_type - one of the following codes &lt;br /&gt;
**0 - SERVICE_BOOT_START - Driver boot stage start &lt;br /&gt;
**1 - SERVICE_SYSTEM_START - Driver scm stage start &lt;br /&gt;
**2 - SERVICE_AUTO_START - Service auto start (Should be used in most cases)&lt;br /&gt;
**3 - SERVICE_DEMAND_START - Driver/service manual start &lt;br /&gt;
**4 - SERVICE_DISABLED - Driver/service disabled&lt;br /&gt;
*service_status - one of the following codes&lt;br /&gt;
**1 - SERVICE_STOPPED&lt;br /&gt;
**2 - SERVICE_START_PENDING&lt;br /&gt;
**3 - SERVICE_STOP_PENDING&lt;br /&gt;
**4 - SERVICE_RUNNING&lt;br /&gt;
**5 - SERVICE_CONTINUE_PENDING&lt;br /&gt;
**6 - SERVICE_PAUSE_PENDING&lt;br /&gt;
**7 - SERVICE_PAUSED&lt;br /&gt;
*binary_path - The path to the binary including all necessary parameters &lt;br /&gt;
*dependencies - Needed services, controls which services have to be started before this one; use the forward slash &amp;quot;/&amp;quot; to add more more than one service&lt;br /&gt;
*account - The username/account which should be used &lt;br /&gt;
*password - Password of the aforementioned account to be able to logon as a service &lt;br /&gt;
**&#039;&#039;&#039;Note&#039;&#039;&#039;: If you do not specify account/password, the local system account will be used to run the service&lt;br /&gt;
*arguments - Arguments passed to the service main function. &lt;br /&gt;
**&#039;&#039;&#039;Note&#039;&#039;&#039;: Driver services do not receive these arguments.&lt;br /&gt;
*reset_period - The time after which to reset the failure count to zero if there are no failures, in seconds. Specify 0 (INFINITE) to indicate that this value should never be reset&lt;br /&gt;
*reboot_message - The message to be broadcast to server users before rebooting&lt;br /&gt;
*command - The command line of the process to execute in response to the SC_ACTION_RUN_COMMAND service controller action. This process runs under the same account as the service&lt;br /&gt;
*action_type_x - one of the following codes for the action to be performed&lt;br /&gt;
**0 - SC_ACTION_NONE - No action&lt;br /&gt;
**1 - SC_ACTION_RESTART - Restart the service&lt;br /&gt;
**2 - SC_ACTION_REBOOT - Reboot the computer (Note: The service user must have the SE_SHUTDOWN_NAME privilege)&lt;br /&gt;
**3 - SC_ACTION_RUN_COMMAND - Run a command&lt;br /&gt;
*action_delay_x - The time to wait before performing the specified action, in milliseconds&lt;br /&gt;
*failure_actions_on_non_crash_failures - This setting determines when failure actions are to be executed&lt;br /&gt;
**0 - The failure actions executed only if the service terminates without reporting a status of SERVICE_STOPPED&lt;br /&gt;
**1 - The failure actions executed if the status of a service is SERVICE_STOPPED but the exit code of the service is not 0&lt;br /&gt;
*delayed_autostart - The delayed auto-start setting of an auto-start service&lt;br /&gt;
**0 - The service will be started during system boot.&lt;br /&gt;
**1 - The service will be started after other auto-start services are started plus a short delay&lt;br /&gt;
*error_code - Error code of a function&lt;br /&gt;
*service_description - The description as shown in the service control manager applet in system control&lt;br /&gt;
*wait_for_file_release - Wait for file release after the service is stopped. This is useful if the binary file will be overwritten after stopping the service.&lt;br /&gt;
**0 - NO_WAIT - No wait for file release&lt;br /&gt;
**1 - WAIT - Wait for file release &lt;br /&gt;
**&#039;&#039;&#039;Note&#039;&#039;&#039;: If SERVICE_WIN32_OWN_PROCESS is used this option should be set to WAIT.	If SERVICE_WIN32_SHARE_PROCESS is used this option should only be set to WAIT if the last service in the process is stopped.&lt;br /&gt;
&lt;br /&gt;
== The Sample Script ==&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
; Install a service - ServiceType own process - StartType automatic - NoDependencies -  Logon as System Account&lt;br /&gt;
  SimpleSC::InstallService &amp;quot;MyService&amp;quot; &amp;quot;My Service Display Name&amp;quot; &amp;quot;16&amp;quot; &amp;quot;2&amp;quot; &amp;quot;C:\MyPath\MyService.exe&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Install a service - ServiceType interact with desktop - StartType automatic - Dependencies on &amp;quot;Windows Time Service&amp;quot; (w32time) and &amp;quot;WWW Publishing Service&amp;quot; (w3svc) - Logon as System Account&lt;br /&gt;
  SimpleSC::InstallService &amp;quot;MyService&amp;quot; &amp;quot;My Service Display Name&amp;quot; &amp;quot;272&amp;quot; &amp;quot;2&amp;quot; &amp;quot;C:\MyPath\MyService.exe&amp;quot; &amp;quot;w32time/w3svc&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Remove a service&lt;br /&gt;
  SimpleSC::RemoveService &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Start a service&lt;br /&gt;
  SimpleSC::StartService &amp;quot;MyService&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Start a service with two arguments &amp;quot;/param1=true&amp;quot; &amp;quot;/param2=1&amp;quot;&lt;br /&gt;
  SimpleSC::StartService &amp;quot;MyService&amp;quot; &amp;quot;/param1=true /param2=1&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
 &lt;br /&gt;
; Start a service with two arguments &amp;quot;-p param1&amp;quot; &amp;quot;-param2&amp;quot;&lt;br /&gt;
  SimpleSC::StartService &amp;quot;MyService&amp;quot; &#039;&amp;quot;-p param1&amp;quot; -param2&#039;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Stop a service and waits for file release&lt;br /&gt;
  SimpleSC::StopService &amp;quot;MyService&amp;quot; 1&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Stops two services and waits for file release after the last service is stopped&lt;br /&gt;
  SimpleSC::StopService &amp;quot;MyService1&amp;quot; 0&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  SimpleSC::StopService &amp;quot;MyService2&amp;quot; 1&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Pause a service&lt;br /&gt;
  SimpleSC::PauseService &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Continue a service&lt;br /&gt;
  SimpleSC::ContinueService &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Restart a service&lt;br /&gt;
  SimpleSC::RestartService &amp;quot;MyService&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Restart a service with two arguments &amp;quot;/param1=true&amp;quot; &amp;quot;/param2=1&amp;quot;&lt;br /&gt;
  SimpleSC::RestartService &amp;quot;MyService&amp;quot; &amp;quot;/param1=true /param2=1&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Start a service with two arguments &amp;quot;-p param1&amp;quot; &amp;quot;-param2&amp;quot;&lt;br /&gt;
  SimpleSC::RestartService &amp;quot;MyService&amp;quot; &#039;&amp;quot;-p param1&amp;quot; -param2&#039;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Check if the service exists&lt;br /&gt;
  SimpleSC::ExistsService &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode if the service doesnÂ´t exists (&amp;lt;&amp;gt;0)/service exists (0)&lt;br /&gt;
&lt;br /&gt;
; Get the displayname of a service&lt;br /&gt;
  SimpleSC::GetServiceDisplayName &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the displayname of the service&lt;br /&gt;
&lt;br /&gt;
; Get the servicename of a service by the displayname&lt;br /&gt;
  SimpleSC::GetServiceName &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the servicename of the service&lt;br /&gt;
&lt;br /&gt;
; Get the current status of a service&lt;br /&gt;
  SimpleSC::GetServiceStatus &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; return the status of the service (See &amp;quot;service_status&amp;quot; in the parameters)&lt;br /&gt;
&lt;br /&gt;
; Get the description of a service&lt;br /&gt;
  SimpleSC::GetServiceDescription &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the description of the service&lt;br /&gt;
 &lt;br /&gt;
; Get the start type of the service&lt;br /&gt;
  SimpleSC::GetServiceStartType &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the start type of the service (see &amp;quot;start_type&amp;quot; in the parameters)&lt;br /&gt;
&lt;br /&gt;
; Get the binary path of a service&lt;br /&gt;
  SimpleSC::GetServiceBinaryPath &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the binary path of the service&lt;br /&gt;
&lt;br /&gt;
; Get the logon user of the service&lt;br /&gt;
  SimpleSC::GetServiceLogon &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the logon username of the service  &lt;br /&gt;
&lt;br /&gt;
; Get the failure configuration of a service&lt;br /&gt;
  SimpleSC::GetServiceFailure &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the reset period &lt;br /&gt;
  Pop $2 ; returns the reboot message&lt;br /&gt;
  Pop $3 ; returns the command&lt;br /&gt;
  Pop $4 ; returns the first action (See &amp;quot;action_type_x&amp;quot; in the parameters)&lt;br /&gt;
  Pop $5 ; returns the first action delay &lt;br /&gt;
  Pop $6 ; returns the second action (See &amp;quot;action_type_x&amp;quot; in the parameters)&lt;br /&gt;
  Pop $7 ; returns the second action delay &lt;br /&gt;
  Pop $8 ; returns the third action (See &amp;quot;action_type_x&amp;quot; in the parameters)&lt;br /&gt;
  Pop $9 ; returns the third action delay &lt;br /&gt;
&lt;br /&gt;
; Get the failure flag configuration of a service&lt;br /&gt;
  SimpleSC::GetServiceFailureFlag &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the service flag&lt;br /&gt;
&lt;br /&gt;
; Get the delayed auto-start configuration of a service&lt;br /&gt;
  SimpleSC::GetServiceDelayedAutoStartInfo &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the delayed auto-start configuration&lt;br /&gt;
&lt;br /&gt;
; Set the description of a service&lt;br /&gt;
  SimpleSC::SetServiceDescription &amp;quot;MyService&amp;quot; &amp;quot;Sample Description&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Set the starttype to automatic of a service&lt;br /&gt;
  SimpleSC::SetServiceStartType &amp;quot;MyService&amp;quot; &amp;quot;2&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Sets the service binary path&lt;br /&gt;
  SimpleSC::SetServiceBinaryPath &amp;quot;MyService&amp;quot; &amp;quot;C:\MySoftware\MyService.exe&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Sets the service logon to a user and grant the user the &amp;quot;SeServiceLogonPrivilege&amp;quot;&lt;br /&gt;
  SimpleSC::SetServiceLogon &amp;quot;MyService&amp;quot; &amp;quot;MyServiceUser&amp;quot; &amp;quot;MyServiceUserPassword&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  IntCmp $0 0 +1 Done Done ; If successful grant the service logon privilege to &amp;quot;MyServiceUser&amp;quot;&lt;br /&gt;
    ; Note: Every serviceuser must have the ServiceLogonPrivilege to start the service&lt;br /&gt;
    SimpleSC::GrantServiceLogonPrivilege &amp;quot;MyServiceUser&amp;quot;&lt;br /&gt;
    Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Done:&lt;br /&gt;
&lt;br /&gt;
; Sets the service failure configuration - First action: Restart the service after one minute - Second action: Reboot the computer after five minutes&lt;br /&gt;
  SimpleSC::SetServiceFailure &amp;quot;MyService&amp;quot; &amp;quot;0&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;1&amp;quot; &amp;quot;60000&amp;quot; &amp;quot;2&amp;quot; &amp;quot;300000&amp;quot; &amp;quot;0&amp;quot; &amp;quot;0&amp;quot; &lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Sets the failure flag configuration of a service&lt;br /&gt;
  SimpleSC::SetServiceFailureFlag &amp;quot;MyService&amp;quot; &amp;quot;1&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Sets the delayed auto-start configuration of a service&lt;br /&gt;
  SimpleSC::SetServiceDelayedAutoStartInfo &amp;quot;MyService&amp;quot; &amp;quot;1&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Remove the &amp;quot;SeServiceLogonPrivilege&amp;quot; from a user&lt;br /&gt;
  SimpleSC::RemoveServiceLogonPrivilege &amp;quot;MyServiceUser&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Check if the service is paused&lt;br /&gt;
  SimpleSC::ServiceIsPaused &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns 1 (service is paused) - returns 0 (service is not paused)&lt;br /&gt;
&lt;br /&gt;
; Check if the service is running&lt;br /&gt;
  SimpleSC::ServiceIsRunning &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns 1 (service is running) - returns 0 (service is not running)&lt;br /&gt;
&lt;br /&gt;
; Check if the service is stopped&lt;br /&gt;
  SimpleSC::ServiceIsStopped &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns 1 (service is stopped) - returns 0 (service is not stopped)&lt;br /&gt;
&lt;br /&gt;
; Show the error message if a function fails &lt;br /&gt;
  SimpleSC::StopService &amp;quot;MyService&amp;quot; 1&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  IntCmp $0 0 Done +1 +1 &lt;br /&gt;
    Push $0&lt;br /&gt;
    SimpleSC::GetErrorMessage&lt;br /&gt;
    Pop $0&lt;br /&gt;
    MessageBox MB_OK|MB_ICONSTOP &amp;quot;Stopping fails - Reason: $0&amp;quot;&lt;br /&gt;
  Done:&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Changelog ==&lt;br /&gt;
* Version 1.28 (2010-09-14)&lt;br /&gt;
**SimpleSC::GetServiceFailure function added&lt;br /&gt;
**SimpleSC::SetServiceFailure function added&lt;br /&gt;
**SimpleSC::StopService WaitForFileRelease feature added (For details take a look at the documentation)&lt;br /&gt;
* Version 1.27 (2010-03-23)&lt;br /&gt;
**Documentation updated&lt;br /&gt;
* Version 1.26 (2009-05-21)&lt;br /&gt;
**Fixed wait for status bug on starting, stopping, pausing or continuing a service &lt;br /&gt;
* Version 1.25 (2009-04-23)&lt;br /&gt;
**SimpleSC::SetServiceLogon supports now non-domain username without the &amp;quot;.\&amp;quot;-prefix&lt;br /&gt;
**SimpleSC::SetServiceBinaryPath function added&lt;br /&gt;
*Version 1.24 (2009-04-13)&lt;br /&gt;
**Fixed wait for status bug if the service status changed. Now, if a service stops, starts aso. the plugin will work like the recommendations in the MSDN.&lt;br /&gt;
*Version 1.23 (2008-08-23)&lt;br /&gt;
**Removed compiler optimization to avoid a false-positive virusscan.&lt;br /&gt;
*Version 1.22 (2008-08-17)&lt;br /&gt;
**SimpleSC::GrantServiceLogonPrivilege and SimpleSC::RemoveServiceLogonPrivilege works now correct with domain names like MyDomain\MyUser.&lt;br /&gt;
**Added function SimpleSC::GetServiceLogon to get the logon username of a service.&lt;br /&gt;
*Version 1.21 (2008-02-10)&lt;br /&gt;
**SimpleSC::ExistsService results now 0 if the service exists and &amp;lt;&amp;gt; 0 if the service doensnÂ´t exists.&lt;br /&gt;
*Version 1.20 (2008-02-05)&lt;br /&gt;
**Every function now returns &amp;lt;&amp;gt; 0 if there is an error. Use SimpleSC::GetErrorMessage to get the message of a function result.&lt;br /&gt;
**Added function SimpleSC::GetErrorMessage to get the message of a function result.&lt;br /&gt;
**SimpleSC::ExistsService results now 0 if the service exists and &amp;lt;&amp;gt; 0 if the service doensnÂ´t exists.&lt;br /&gt;
**SimpleSC::RestartService supports now arguments.&lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: The signature has been changed. If you update from a previous version you must check your parameters.&lt;br /&gt;
*Version 1.10 (2008-01-29)&lt;br /&gt;
**SimpleSC::InstallService supports now more than one dependencies (delimitter is the forward slash).&lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: The signature has been changed. If you update from a previous version you must check your parameters.&lt;br /&gt;
**SimpleSC::InstallService supports now more service types e.g. to create an interactive service.&lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: The signature has been changed. If you update from a previous version you must check your parameters.&lt;br /&gt;
**SimpleSC::StartService supports now arguments. &lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: The signature has been changed. If you update from a previous version you must check your parameters.&lt;br /&gt;
*Version 1.05 (2008-01-12)&lt;br /&gt;
**The functions SimpleSC::StopService and SimpleSC::RestartService are now improved. Now all dependent services are stopping recursively too.&lt;br /&gt;
*Version 1.04 (2007-08-07)&lt;br /&gt;
**Fixed bug for possible endless loops. This concerns to the functions StartService, StopService, ContinueService and PauseService. &lt;br /&gt;
*Version 1.03 (2007-08-02)&lt;br /&gt;
**Added function SimpleSC::GetServiceBinaryPath to get the binary path of a specified service.&lt;br /&gt;
*Version 1.02 (2007-05-29)&lt;br /&gt;
**Changed wrong documentation informations about the functions SimpleSC::InstallService and SimpleSC::RemoveService.&lt;br /&gt;
*Version 1.01 (2007-05-07)&lt;br /&gt;
**Changed wrong status-results in Readme.txt. This concerns to the functions ServiceIsPaused, ServiceIsRunning and ServiceIsStopped.&lt;br /&gt;
**Changed the access privileges of the plugin. The plugin now uses the lowest privlege of each function to execute.&lt;br /&gt;
*Version 1.0 (2007-05-02)&lt;br /&gt;
**First offical version&lt;br /&gt;
&lt;br /&gt;
== Important Notes ==&lt;br /&gt;
*The function &amp;quot;SetServiceLogon&amp;quot; only works if the servicetype is &amp;quot;SERVICE_WIN32_OWN_PROCESS&amp;quot;.&lt;br /&gt;
* The functions &amp;quot;GetServiceDescription&amp;quot; or &amp;quot;SetServiceDescription&amp;quot; are only available on systems higher than Windows NT.&lt;br /&gt;
* The function &amp;quot;GetServiceFailureFlag&amp;quot;, &amp;quot;SetServiceFailureFlag&amp;quot;, &amp;quot;GetServiceDelayedAutoStartInfo&amp;quot; and &amp;quot;SetServiceDelayedAutoStartInfo&amp;quot; are only available on systems higher than Windows 2003.&lt;br /&gt;
* If you change the logon of an service to a new user you have to grant him the Service Logon Privilege. Otherwise the service cannot be started by the user you have assigned.&lt;br /&gt;
* The functions StartService, StopService, PauseService and ContinueService uses a timeout of 30 seconds. This means the function must be executed within 30 seconds, otherwise the functions will return an error.&lt;br /&gt;
* If you have any suggestions, comments or questions please mail me: mailto:rainer@speed-soft.de&lt;br /&gt;
&lt;br /&gt;
[[Category:Plugins]]&lt;/div&gt;</summary>
		<author><name>Speed78</name></author>
	</entry>
	<entry>
		<id>https://nsis.sourceforge.io/mediawiki/index.php?title=NSIS_Simple_Service_Plugin&amp;diff=19831</id>
		<title>NSIS Simple Service Plugin</title>
		<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/mediawiki/index.php?title=NSIS_Simple_Service_Plugin&amp;diff=19831"/>
		<updated>2011-04-16T14:37:23Z</updated>

		<summary type="html">&lt;p&gt;Speed78: /* Important Notes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This plugin contains basic service functions like start, stop the service or checking the service status. It also contains advanced service functions for example setting the service description, changed the logon account, granting or removing the service logon privilege.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This plugin is using the MPL License or alternatively the LGPL License.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
&amp;lt;attach&amp;gt;NSIS_Simple_Service_Plugin_1.28.zip&amp;lt;/attach&amp;gt; The ZIP file containing a precompiled plugin DLL (to be saved in NSIS&#039; plugin directory) and the sources. If you update from a previous version it is strongly &#039;&#039;&#039;recommend&#039;&#039;&#039; to take look at the changelog.&lt;br /&gt;
&lt;br /&gt;
== Donation ==&lt;br /&gt;
If you believe that I am doing a good job and you want to support me please [http://www.speed-soft.de/donation/index.php?language=en donate] any amount via PayPal.&lt;br /&gt;
&lt;br /&gt;
== Short Reference ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
SimpleSC::InstallService [name_of_service] [display_name] [service_type] [start_type] &lt;br /&gt;
  [binary_path] [dependencies] [account] [password]&lt;br /&gt;
SimpleSC::RemoveService [name_of_service]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::StartService [name_of_service] [arguments]&lt;br /&gt;
SimpleSC::StopService [name_of_service] [wait_for_file_release]&lt;br /&gt;
SimpleSC::PauseService [name_of_service] &lt;br /&gt;
SimpleSC::ContinueService [name_of_service]&lt;br /&gt;
SimpleSC::RestartService [name_of_service] [arguments]&lt;br /&gt;
SimpleSC::ExistsService [name_of_service]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::GetServiceDisplayName [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceName [display_name]&lt;br /&gt;
SimpleSC::GetServiceStatus [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceDescription [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceStartType [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceBinaryPath [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceLogon [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceFailure [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceFailureFlag [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceDelayedAutoStartInfo [name_of_service]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::SetServiceDescription [name_of_service] [service_description]&lt;br /&gt;
SimpleSC::SetServiceStartType [name_of_service] [start_type]&lt;br /&gt;
SimpleSC::SetServiceBinaryPath [name_of_service] [binary_path]&lt;br /&gt;
SimpleSC::SetServiceLogon [name_of_service] [account] [password]&lt;br /&gt;
SimpleSC::SetServiceFailure [name_of_service] [reset_period] [reboot_message] [command] &lt;br /&gt;
  [action_type_1] [action_delay_1] [action_type_2] [action_delay_2] [action_type_3] &lt;br /&gt;
  [action_delay_3]&lt;br /&gt;
SimpleSC::SetServiceFailureFlag [name_of_service] [failure_actions_on_non_crash_failures]&lt;br /&gt;
SimpleSC::SetServiceDelayedAutoStartInfo [name_of_service] [delayed_autostart]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::GrantServiceLogonPrivilege [account]&lt;br /&gt;
SimpleSC::RemoveServiceLogonPrivilege [account]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::ServiceIsPaused [name_of_service]&lt;br /&gt;
SimpleSC::ServiceIsRunning [name_of_service]&lt;br /&gt;
SimpleSC::ServiceIsStopped [name_of_service]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::GetErrorMessage [error_code]&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
*name_of_service - The name of the service used for Start/Stop commands and all further commands &lt;br /&gt;
*display_name - The name as shown in the service control manager applet in system control &lt;br /&gt;
*service_type - One of the following codes &lt;br /&gt;
**1 - SERVICE_KERNEL_DRIVER - Driver service.&lt;br /&gt;
**2 - SERVICE_FILE_SYSTEM_DRIVER - File system driver service.&lt;br /&gt;
**16 - SERVICE_WIN32_OWN_PROCESS - Service that runs in its own process. (Should be used in most cases)&lt;br /&gt;
**32 - SERVICE_WIN32_SHARE_PROCESS - Service that shares a process with one or more other services. &lt;br /&gt;
**256 - SERVICE_INTERACTIVE_PROCESS - The service can interact with the desktop. &lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: If you specify either SERVICE_WIN32_OWN_PROCESS or SERVICE_WIN32_SHARE_PROCESS,          and the service is running in the context of the LocalSystem account,          you can also specify this value. Example: SERVICE_WIN32_OWN_PROCESS or SERVICE_INTERACTIVE_PROCESS - (16 or 256) = 272&lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: Services cannot directly interact with a user as of Windows Vista.             Therefore, this technique should not be used in new code. See for more information: http://msdn2.microsoft.com/en-us/library/ms683502(VS.85).aspx          &lt;br /&gt;
&lt;br /&gt;
*start_type - one of the following codes &lt;br /&gt;
**0 - SERVICE_BOOT_START - Driver boot stage start &lt;br /&gt;
**1 - SERVICE_SYSTEM_START - Driver scm stage start &lt;br /&gt;
**2 - SERVICE_AUTO_START - Service auto start (Should be used in most cases)&lt;br /&gt;
**3 - SERVICE_DEMAND_START - Driver/service manual start &lt;br /&gt;
**4 - SERVICE_DISABLED - Driver/service disabled&lt;br /&gt;
*service_status - one of the following codes&lt;br /&gt;
**1 - SERVICE_STOPPED&lt;br /&gt;
**2 - SERVICE_START_PENDING&lt;br /&gt;
**3 - SERVICE_STOP_PENDING&lt;br /&gt;
**4 - SERVICE_RUNNING&lt;br /&gt;
**5 - SERVICE_CONTINUE_PENDING&lt;br /&gt;
**6 - SERVICE_PAUSE_PENDING&lt;br /&gt;
**7 - SERVICE_PAUSED&lt;br /&gt;
*binary_path - The path to the binary including all necessary parameters &lt;br /&gt;
*dependencies - Needed services, controls which services have to be started before this one; use the forward slash &amp;quot;/&amp;quot; to add more more than one service&lt;br /&gt;
*account - The username/account which should be used &lt;br /&gt;
*password - Password of the aforementioned account to be able to logon as a service &lt;br /&gt;
**&#039;&#039;&#039;Note&#039;&#039;&#039;: If you do not specify account/password, the local system account will be used to run the service&lt;br /&gt;
*arguments - Arguments passed to the service main function. &lt;br /&gt;
**&#039;&#039;&#039;Note&#039;&#039;&#039;: Driver services do not receive these arguments.&lt;br /&gt;
*reset_period - The time after which to reset the failure count to zero if there are no failures, in seconds. Specify 0 (INFINITE) to indicate that this value should never be reset&lt;br /&gt;
*reboot_message - The message to be broadcast to server users before rebooting&lt;br /&gt;
*command - The command line of the process to execute in response to the SC_ACTION_RUN_COMMAND service controller action. This process runs under the same account as the service&lt;br /&gt;
*action_type_x - one of the following codes for the action to be performed&lt;br /&gt;
**0 - SC_ACTION_NONE - No action&lt;br /&gt;
**1 - SC_ACTION_RESTART - Restart the service&lt;br /&gt;
**2 - SC_ACTION_REBOOT - Reboot the computer (Note: The service user must have the SE_SHUTDOWN_NAME privilege)&lt;br /&gt;
**3 - SC_ACTION_RUN_COMMAND - Run a command&lt;br /&gt;
*action_delay_x - The time to wait before performing the specified action, in milliseconds&lt;br /&gt;
*failure_actions_on_non_crash_failures - This setting determines when failure actions are to be executed&lt;br /&gt;
**0 - The failure actions executed only if the service terminates without reporting a status of SERVICE_STOPPED&lt;br /&gt;
**1 - The failure actions executed if the status of a service is SERVICE_STOPPED but the exit code of the service is not 0&lt;br /&gt;
*delayed_autostart - The delayed auto-start setting of an auto-start service&lt;br /&gt;
**0 - The service will be started during system boot.&lt;br /&gt;
**1 - The service will be started after other auto-start services are started plus a short delay&lt;br /&gt;
*error_code - Error code of a function&lt;br /&gt;
*service_description - The description as shown in the service control manager applet in system control&lt;br /&gt;
*wait_for_file_release - Wait for file release after the service is stopped. This is useful if the binary file will be overwritten after stopping the service.&lt;br /&gt;
**0 - NO_WAIT - No wait for file release&lt;br /&gt;
**1 - WAIT - Wait for file release &lt;br /&gt;
**&#039;&#039;&#039;Note&#039;&#039;&#039;: If SERVICE_WIN32_OWN_PROCESS is used this option should be set to WAIT.	If SERVICE_WIN32_SHARE_PROCESS is used this option should only be set to WAIT if the last service in the process is stopped.&lt;br /&gt;
&lt;br /&gt;
== The Sample Script ==&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
; Install a service - ServiceType own process - StartType automatic - NoDependencies -  Logon as System Account&lt;br /&gt;
  SimpleSC::InstallService &amp;quot;MyService&amp;quot; &amp;quot;My Service Display Name&amp;quot; &amp;quot;16&amp;quot; &amp;quot;2&amp;quot; &amp;quot;C:\MyPath\MyService.exe&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Install a service - ServiceType interact with desktop - StartType automatic - Dependencies on &amp;quot;Windows Time Service&amp;quot; (w32time) and &amp;quot;WWW Publishing Service&amp;quot; (w3svc) - Logon as System Account&lt;br /&gt;
  SimpleSC::InstallService &amp;quot;MyService&amp;quot; &amp;quot;My Service Display Name&amp;quot; &amp;quot;272&amp;quot; &amp;quot;2&amp;quot; &amp;quot;C:\MyPath\MyService.exe&amp;quot; &amp;quot;w32time/w3svc&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Remove a service&lt;br /&gt;
  SimpleSC::RemoveService &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Start a service&lt;br /&gt;
  SimpleSC::StartService &amp;quot;MyService&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Start a service with two arguments &amp;quot;/param1=true&amp;quot; &amp;quot;/param2=1&amp;quot;&lt;br /&gt;
  SimpleSC::StartService &amp;quot;MyService&amp;quot; &amp;quot;/param1=true /param2=1&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
 &lt;br /&gt;
; Start a service with two arguments &amp;quot;-p param1&amp;quot; &amp;quot;-param2&amp;quot;&lt;br /&gt;
  SimpleSC::StartService &amp;quot;MyService&amp;quot; &#039;&amp;quot;-p param1&amp;quot; -param2&#039;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Stop a service and waits for file release&lt;br /&gt;
  SimpleSC::StopService &amp;quot;MyService&amp;quot; 1&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Stops two services and waits for file release after the last service is stopped&lt;br /&gt;
  SimpleSC::StopService &amp;quot;MyService1&amp;quot; 0&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  SimpleSC::StopService &amp;quot;MyService2&amp;quot; 1&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Pause a service&lt;br /&gt;
  SimpleSC::PauseService &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Continue a service&lt;br /&gt;
  SimpleSC::ContinueService &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Restart a service&lt;br /&gt;
  SimpleSC::RestartService &amp;quot;MyService&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Restart a service with two arguments &amp;quot;/param1=true&amp;quot; &amp;quot;/param2=1&amp;quot;&lt;br /&gt;
  SimpleSC::RestartService &amp;quot;MyService&amp;quot; &amp;quot;/param1=true /param2=1&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Start a service with two arguments &amp;quot;-p param1&amp;quot; &amp;quot;-param2&amp;quot;&lt;br /&gt;
  SimpleSC::RestartService &amp;quot;MyService&amp;quot; &#039;&amp;quot;-p param1&amp;quot; -param2&#039;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Check if the service exists&lt;br /&gt;
  SimpleSC::ExistsService &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode if the service doesnÂ´t exists (&amp;lt;&amp;gt;0)/service exists (0)&lt;br /&gt;
&lt;br /&gt;
; Get the displayname of a service&lt;br /&gt;
  SimpleSC::GetServiceDisplayName &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the displayname of the service&lt;br /&gt;
&lt;br /&gt;
; Get the servicename of a service by the displayname&lt;br /&gt;
  SimpleSC::GetServiceName &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the servicename of the service&lt;br /&gt;
&lt;br /&gt;
; Get the current status of a service&lt;br /&gt;
  SimpleSC::GetServiceStatus &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; return the status of the service (See &amp;quot;service_status&amp;quot; in the parameters)&lt;br /&gt;
&lt;br /&gt;
; Get the description of a service&lt;br /&gt;
  SimpleSC::GetServiceDescription &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the description of the service&lt;br /&gt;
 &lt;br /&gt;
; Get the start type of the service&lt;br /&gt;
  SimpleSC::GetServiceStartType &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the start type of the service (see &amp;quot;start_type&amp;quot; in the parameters)&lt;br /&gt;
&lt;br /&gt;
; Get the binary path of a service&lt;br /&gt;
  SimpleSC::GetServiceBinaryPath &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the binary path of the service&lt;br /&gt;
&lt;br /&gt;
; Get the logon user of the service&lt;br /&gt;
  SimpleSC::GetServiceLogon &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the logon username of the service  &lt;br /&gt;
&lt;br /&gt;
; Get the failure configuration of a service&lt;br /&gt;
  SimpleSC::GetServiceFailure &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the reset period &lt;br /&gt;
  Pop $2 ; returns the reboot message&lt;br /&gt;
  Pop $3 ; returns the command&lt;br /&gt;
  Pop $4 ; returns the first action (See &amp;quot;action_type_x&amp;quot; in the parameters)&lt;br /&gt;
  Pop $5 ; returns the first action delay &lt;br /&gt;
  Pop $6 ; returns the second action (See &amp;quot;action_type_x&amp;quot; in the parameters)&lt;br /&gt;
  Pop $7 ; returns the second action delay &lt;br /&gt;
  Pop $8 ; returns the third action (See &amp;quot;action_type_x&amp;quot; in the parameters)&lt;br /&gt;
  Pop $9 ; returns the third action delay &lt;br /&gt;
&lt;br /&gt;
; Get the failure flag configuration of a service&lt;br /&gt;
  SimpleSC::GetServiceFailureFlag &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the service flag&lt;br /&gt;
&lt;br /&gt;
; Get the delayed auto-start configuration of a service&lt;br /&gt;
  SimpleSC::GetServiceDelayedAutoStartInfo &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the delayed auto-start configuration&lt;br /&gt;
&lt;br /&gt;
; Set the description of a service&lt;br /&gt;
  SimpleSC::SetServiceDescription &amp;quot;MyService&amp;quot; &amp;quot;Sample Description&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Set the starttype to automatic of a service&lt;br /&gt;
  SimpleSC::SetServiceStartType &amp;quot;MyService&amp;quot; &amp;quot;2&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Sets the service binary path&lt;br /&gt;
  SimpleSC::SetServiceBinaryPath &amp;quot;MyService&amp;quot; &amp;quot;C:\MySoftware\MyService.exe&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Sets the service logon to a user and grant the user the &amp;quot;SeServiceLogonPrivilege&amp;quot;&lt;br /&gt;
  SimpleSC::SetServiceLogon &amp;quot;MyService&amp;quot; &amp;quot;MyServiceUser&amp;quot; &amp;quot;MyServiceUserPassword&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  IntCmp $0 0 +1 Done Done ; If successful grant the service logon privilege to &amp;quot;MyServiceUser&amp;quot;&lt;br /&gt;
    ; Note: Every serviceuser must have the ServiceLogonPrivilege to start the service&lt;br /&gt;
    SimpleSC::GrantServiceLogonPrivilege &amp;quot;MyServiceUser&amp;quot;&lt;br /&gt;
    Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Done:&lt;br /&gt;
&lt;br /&gt;
; Sets the service failure configuration - First action: Restart the service after one minute - Second action: Reboot the computer after five minutes&lt;br /&gt;
  SimpleSC::SetServiceFailure &amp;quot;MyService&amp;quot; &amp;quot;0&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;1&amp;quot; &amp;quot;60000&amp;quot; &amp;quot;2&amp;quot; &amp;quot;300000&amp;quot; &amp;quot;0&amp;quot; &amp;quot;0&amp;quot; &lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Sets the failure flag configuration of a service&lt;br /&gt;
  SimpleSC::SetServiceFailureFlag &amp;quot;MyService&amp;quot; &amp;quot;1&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Sets the delayed auto-start configuration of a service&lt;br /&gt;
  SimpleSC::SetServiceDelayedAutoStartInfo &amp;quot;MyService&amp;quot; &amp;quot;1&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Remove the &amp;quot;SeServiceLogonPrivilege&amp;quot; from a user&lt;br /&gt;
  SimpleSC::RemoveServiceLogonPrivilege &amp;quot;MyServiceUser&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Check if the service is paused&lt;br /&gt;
  SimpleSC::ServiceIsPaused &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns 1 (service is paused) - returns 0 (service is not paused)&lt;br /&gt;
&lt;br /&gt;
; Check if the service is running&lt;br /&gt;
  SimpleSC::ServiceIsRunning &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns 1 (service is running) - returns 0 (service is not running)&lt;br /&gt;
&lt;br /&gt;
; Check if the service is stopped&lt;br /&gt;
  SimpleSC::ServiceIsStopped &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns 1 (service is stopped) - returns 0 (service is not stopped)&lt;br /&gt;
&lt;br /&gt;
; Show the error message if a function fails &lt;br /&gt;
  SimpleSC::StopService &amp;quot;MyService&amp;quot; 1&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  IntCmp $0 0 Done +1 +1 &lt;br /&gt;
    Push $0&lt;br /&gt;
    SimpleSC::GetErrorMessage&lt;br /&gt;
    Pop $0&lt;br /&gt;
    MessageBox MB_OK|MB_ICONSTOP &amp;quot;Stopping fails - Reason: $0&amp;quot;&lt;br /&gt;
  Done:&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Changelog ==&lt;br /&gt;
* Version 1.28 (2010-09-14)&lt;br /&gt;
**SimpleSC::GetServiceFailure function added&lt;br /&gt;
**SimpleSC::SetServiceFailure function added&lt;br /&gt;
**SimpleSC::StopService WaitForFileRelease feature added (For details take a look at the documentation)&lt;br /&gt;
* Version 1.27 (2010-03-23)&lt;br /&gt;
**Documentation updated&lt;br /&gt;
* Version 1.26 (2009-05-21)&lt;br /&gt;
**Fixed wait for status bug on starting, stopping, pausing or continuing a service &lt;br /&gt;
* Version 1.25 (2009-04-23)&lt;br /&gt;
**SimpleSC::SetServiceLogon supports now non-domain username without the &amp;quot;.\&amp;quot;-prefix&lt;br /&gt;
**SimpleSC::SetServiceBinaryPath function added&lt;br /&gt;
*Version 1.24 (2009-04-13)&lt;br /&gt;
**Fixed wait for status bug if the service status changed. Now, if a service stops, starts aso. the plugin will work like the recommendations in the MSDN.&lt;br /&gt;
*Version 1.23 (2008-08-23)&lt;br /&gt;
**Removed compiler optimization to avoid a false-positive virusscan.&lt;br /&gt;
*Version 1.22 (2008-08-17)&lt;br /&gt;
**SimpleSC::GrantServiceLogonPrivilege and SimpleSC::RemoveServiceLogonPrivilege works now correct with domain names like MyDomain\MyUser.&lt;br /&gt;
**Added function SimpleSC::GetServiceLogon to get the logon username of a service.&lt;br /&gt;
*Version 1.21 (2008-02-10)&lt;br /&gt;
**SimpleSC::ExistsService results now 0 if the service exists and &amp;lt;&amp;gt; 0 if the service doensnÂ´t exists.&lt;br /&gt;
*Version 1.20 (2008-02-05)&lt;br /&gt;
**Every function now returns &amp;lt;&amp;gt; 0 if there is an error. Use SimpleSC::GetErrorMessage to get the message of a function result.&lt;br /&gt;
**Added function SimpleSC::GetErrorMessage to get the message of a function result.&lt;br /&gt;
**SimpleSC::ExistsService results now 0 if the service exists and &amp;lt;&amp;gt; 0 if the service doensnÂ´t exists.&lt;br /&gt;
**SimpleSC::RestartService supports now arguments.&lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: The signature has been changed. If you update from a previous version you must check your parameters.&lt;br /&gt;
*Version 1.10 (2008-01-29)&lt;br /&gt;
**SimpleSC::InstallService supports now more than one dependencies (delimitter is the forward slash).&lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: The signature has been changed. If you update from a previous version you must check your parameters.&lt;br /&gt;
**SimpleSC::InstallService supports now more service types e.g. to create an interactive service.&lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: The signature has been changed. If you update from a previous version you must check your parameters.&lt;br /&gt;
**SimpleSC::StartService supports now arguments. &lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: The signature has been changed. If you update from a previous version you must check your parameters.&lt;br /&gt;
*Version 1.05 (2008-01-12)&lt;br /&gt;
**The functions SimpleSC::StopService and SimpleSC::RestartService are now improved. Now all dependent services are stopping recursively too.&lt;br /&gt;
*Version 1.04 (2007-08-07)&lt;br /&gt;
**Fixed bug for possible endless loops. This concerns to the functions StartService, StopService, ContinueService and PauseService. &lt;br /&gt;
*Version 1.03 (2007-08-02)&lt;br /&gt;
**Added function SimpleSC::GetServiceBinaryPath to get the binary path of a specified service.&lt;br /&gt;
*Version 1.02 (2007-05-29)&lt;br /&gt;
**Changed wrong documentation informations about the functions SimpleSC::InstallService and SimpleSC::RemoveService.&lt;br /&gt;
*Version 1.01 (2007-05-07)&lt;br /&gt;
**Changed wrong status-results in Readme.txt. This concerns to the functions ServiceIsPaused, ServiceIsRunning and ServiceIsStopped.&lt;br /&gt;
**Changed the access privileges of the plugin. The plugin now uses the lowest privlege of each function to execute.&lt;br /&gt;
*Version 1.0 (2007-05-02)&lt;br /&gt;
**First offical version&lt;br /&gt;
&lt;br /&gt;
== Important Notes ==&lt;br /&gt;
*The function &amp;quot;SetServiceLogon&amp;quot; only works if the servicetype is &amp;quot;SERVICE_WIN32_OWN_PROCESS&amp;quot;&lt;br /&gt;
* The functions &amp;quot;GetServiceDescription&amp;quot; or &amp;quot;SetServiceDescription&amp;quot; are only available on systems higher than Windows NT.&lt;br /&gt;
* The function &amp;quot;GetServiceFailureFlag&amp;quot;, &amp;quot;SetServiceFailureFlag&amp;quot;, &amp;quot;GetServiceDelayedAutoStartInfo&amp;quot; and &amp;quot;SetServiceDelayedAutoStartInfo&amp;quot; are only available on systems higher than Windows 2003.&lt;br /&gt;
* If you change the logon of an service to a new user you have to grant him the Service Logon Privilege. Otherwise the service cannot be started by the user you have assigned.&lt;br /&gt;
* The functions StartService, StopService, PauseService and ContinueService uses a timeout of 30 seconds. This means the function must be executed within 30 seconds, otherwise the functions will return an error.&lt;br /&gt;
* If you have any suggestions, comments or questions please mail me: mailto:rainer@speed-soft.de&lt;br /&gt;
&lt;br /&gt;
[[Category:Plugins]]&lt;/div&gt;</summary>
		<author><name>Speed78</name></author>
	</entry>
	<entry>
		<id>https://nsis.sourceforge.io/mediawiki/index.php?title=NSIS_Simple_Service_Plugin&amp;diff=19830</id>
		<title>NSIS Simple Service Plugin</title>
		<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/mediawiki/index.php?title=NSIS_Simple_Service_Plugin&amp;diff=19830"/>
		<updated>2011-04-16T14:36:49Z</updated>

		<summary type="html">&lt;p&gt;Speed78: /* The Sample Script */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This plugin contains basic service functions like start, stop the service or checking the service status. It also contains advanced service functions for example setting the service description, changed the logon account, granting or removing the service logon privilege.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This plugin is using the MPL License or alternatively the LGPL License.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
&amp;lt;attach&amp;gt;NSIS_Simple_Service_Plugin_1.28.zip&amp;lt;/attach&amp;gt; The ZIP file containing a precompiled plugin DLL (to be saved in NSIS&#039; plugin directory) and the sources. If you update from a previous version it is strongly &#039;&#039;&#039;recommend&#039;&#039;&#039; to take look at the changelog.&lt;br /&gt;
&lt;br /&gt;
== Donation ==&lt;br /&gt;
If you believe that I am doing a good job and you want to support me please [http://www.speed-soft.de/donation/index.php?language=en donate] any amount via PayPal.&lt;br /&gt;
&lt;br /&gt;
== Short Reference ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
SimpleSC::InstallService [name_of_service] [display_name] [service_type] [start_type] &lt;br /&gt;
  [binary_path] [dependencies] [account] [password]&lt;br /&gt;
SimpleSC::RemoveService [name_of_service]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::StartService [name_of_service] [arguments]&lt;br /&gt;
SimpleSC::StopService [name_of_service] [wait_for_file_release]&lt;br /&gt;
SimpleSC::PauseService [name_of_service] &lt;br /&gt;
SimpleSC::ContinueService [name_of_service]&lt;br /&gt;
SimpleSC::RestartService [name_of_service] [arguments]&lt;br /&gt;
SimpleSC::ExistsService [name_of_service]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::GetServiceDisplayName [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceName [display_name]&lt;br /&gt;
SimpleSC::GetServiceStatus [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceDescription [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceStartType [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceBinaryPath [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceLogon [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceFailure [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceFailureFlag [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceDelayedAutoStartInfo [name_of_service]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::SetServiceDescription [name_of_service] [service_description]&lt;br /&gt;
SimpleSC::SetServiceStartType [name_of_service] [start_type]&lt;br /&gt;
SimpleSC::SetServiceBinaryPath [name_of_service] [binary_path]&lt;br /&gt;
SimpleSC::SetServiceLogon [name_of_service] [account] [password]&lt;br /&gt;
SimpleSC::SetServiceFailure [name_of_service] [reset_period] [reboot_message] [command] &lt;br /&gt;
  [action_type_1] [action_delay_1] [action_type_2] [action_delay_2] [action_type_3] &lt;br /&gt;
  [action_delay_3]&lt;br /&gt;
SimpleSC::SetServiceFailureFlag [name_of_service] [failure_actions_on_non_crash_failures]&lt;br /&gt;
SimpleSC::SetServiceDelayedAutoStartInfo [name_of_service] [delayed_autostart]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::GrantServiceLogonPrivilege [account]&lt;br /&gt;
SimpleSC::RemoveServiceLogonPrivilege [account]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::ServiceIsPaused [name_of_service]&lt;br /&gt;
SimpleSC::ServiceIsRunning [name_of_service]&lt;br /&gt;
SimpleSC::ServiceIsStopped [name_of_service]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::GetErrorMessage [error_code]&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
*name_of_service - The name of the service used for Start/Stop commands and all further commands &lt;br /&gt;
*display_name - The name as shown in the service control manager applet in system control &lt;br /&gt;
*service_type - One of the following codes &lt;br /&gt;
**1 - SERVICE_KERNEL_DRIVER - Driver service.&lt;br /&gt;
**2 - SERVICE_FILE_SYSTEM_DRIVER - File system driver service.&lt;br /&gt;
**16 - SERVICE_WIN32_OWN_PROCESS - Service that runs in its own process. (Should be used in most cases)&lt;br /&gt;
**32 - SERVICE_WIN32_SHARE_PROCESS - Service that shares a process with one or more other services. &lt;br /&gt;
**256 - SERVICE_INTERACTIVE_PROCESS - The service can interact with the desktop. &lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: If you specify either SERVICE_WIN32_OWN_PROCESS or SERVICE_WIN32_SHARE_PROCESS,          and the service is running in the context of the LocalSystem account,          you can also specify this value. Example: SERVICE_WIN32_OWN_PROCESS or SERVICE_INTERACTIVE_PROCESS - (16 or 256) = 272&lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: Services cannot directly interact with a user as of Windows Vista.             Therefore, this technique should not be used in new code. See for more information: http://msdn2.microsoft.com/en-us/library/ms683502(VS.85).aspx          &lt;br /&gt;
&lt;br /&gt;
*start_type - one of the following codes &lt;br /&gt;
**0 - SERVICE_BOOT_START - Driver boot stage start &lt;br /&gt;
**1 - SERVICE_SYSTEM_START - Driver scm stage start &lt;br /&gt;
**2 - SERVICE_AUTO_START - Service auto start (Should be used in most cases)&lt;br /&gt;
**3 - SERVICE_DEMAND_START - Driver/service manual start &lt;br /&gt;
**4 - SERVICE_DISABLED - Driver/service disabled&lt;br /&gt;
*service_status - one of the following codes&lt;br /&gt;
**1 - SERVICE_STOPPED&lt;br /&gt;
**2 - SERVICE_START_PENDING&lt;br /&gt;
**3 - SERVICE_STOP_PENDING&lt;br /&gt;
**4 - SERVICE_RUNNING&lt;br /&gt;
**5 - SERVICE_CONTINUE_PENDING&lt;br /&gt;
**6 - SERVICE_PAUSE_PENDING&lt;br /&gt;
**7 - SERVICE_PAUSED&lt;br /&gt;
*binary_path - The path to the binary including all necessary parameters &lt;br /&gt;
*dependencies - Needed services, controls which services have to be started before this one; use the forward slash &amp;quot;/&amp;quot; to add more more than one service&lt;br /&gt;
*account - The username/account which should be used &lt;br /&gt;
*password - Password of the aforementioned account to be able to logon as a service &lt;br /&gt;
**&#039;&#039;&#039;Note&#039;&#039;&#039;: If you do not specify account/password, the local system account will be used to run the service&lt;br /&gt;
*arguments - Arguments passed to the service main function. &lt;br /&gt;
**&#039;&#039;&#039;Note&#039;&#039;&#039;: Driver services do not receive these arguments.&lt;br /&gt;
*reset_period - The time after which to reset the failure count to zero if there are no failures, in seconds. Specify 0 (INFINITE) to indicate that this value should never be reset&lt;br /&gt;
*reboot_message - The message to be broadcast to server users before rebooting&lt;br /&gt;
*command - The command line of the process to execute in response to the SC_ACTION_RUN_COMMAND service controller action. This process runs under the same account as the service&lt;br /&gt;
*action_type_x - one of the following codes for the action to be performed&lt;br /&gt;
**0 - SC_ACTION_NONE - No action&lt;br /&gt;
**1 - SC_ACTION_RESTART - Restart the service&lt;br /&gt;
**2 - SC_ACTION_REBOOT - Reboot the computer (Note: The service user must have the SE_SHUTDOWN_NAME privilege)&lt;br /&gt;
**3 - SC_ACTION_RUN_COMMAND - Run a command&lt;br /&gt;
*action_delay_x - The time to wait before performing the specified action, in milliseconds&lt;br /&gt;
*failure_actions_on_non_crash_failures - This setting determines when failure actions are to be executed&lt;br /&gt;
**0 - The failure actions executed only if the service terminates without reporting a status of SERVICE_STOPPED&lt;br /&gt;
**1 - The failure actions executed if the status of a service is SERVICE_STOPPED but the exit code of the service is not 0&lt;br /&gt;
*delayed_autostart - The delayed auto-start setting of an auto-start service&lt;br /&gt;
**0 - The service will be started during system boot.&lt;br /&gt;
**1 - The service will be started after other auto-start services are started plus a short delay&lt;br /&gt;
*error_code - Error code of a function&lt;br /&gt;
*service_description - The description as shown in the service control manager applet in system control&lt;br /&gt;
*wait_for_file_release - Wait for file release after the service is stopped. This is useful if the binary file will be overwritten after stopping the service.&lt;br /&gt;
**0 - NO_WAIT - No wait for file release&lt;br /&gt;
**1 - WAIT - Wait for file release &lt;br /&gt;
**&#039;&#039;&#039;Note&#039;&#039;&#039;: If SERVICE_WIN32_OWN_PROCESS is used this option should be set to WAIT.	If SERVICE_WIN32_SHARE_PROCESS is used this option should only be set to WAIT if the last service in the process is stopped.&lt;br /&gt;
&lt;br /&gt;
== The Sample Script ==&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
; Install a service - ServiceType own process - StartType automatic - NoDependencies -  Logon as System Account&lt;br /&gt;
  SimpleSC::InstallService &amp;quot;MyService&amp;quot; &amp;quot;My Service Display Name&amp;quot; &amp;quot;16&amp;quot; &amp;quot;2&amp;quot; &amp;quot;C:\MyPath\MyService.exe&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Install a service - ServiceType interact with desktop - StartType automatic - Dependencies on &amp;quot;Windows Time Service&amp;quot; (w32time) and &amp;quot;WWW Publishing Service&amp;quot; (w3svc) - Logon as System Account&lt;br /&gt;
  SimpleSC::InstallService &amp;quot;MyService&amp;quot; &amp;quot;My Service Display Name&amp;quot; &amp;quot;272&amp;quot; &amp;quot;2&amp;quot; &amp;quot;C:\MyPath\MyService.exe&amp;quot; &amp;quot;w32time/w3svc&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Remove a service&lt;br /&gt;
  SimpleSC::RemoveService &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Start a service&lt;br /&gt;
  SimpleSC::StartService &amp;quot;MyService&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Start a service with two arguments &amp;quot;/param1=true&amp;quot; &amp;quot;/param2=1&amp;quot;&lt;br /&gt;
  SimpleSC::StartService &amp;quot;MyService&amp;quot; &amp;quot;/param1=true /param2=1&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
 &lt;br /&gt;
; Start a service with two arguments &amp;quot;-p param1&amp;quot; &amp;quot;-param2&amp;quot;&lt;br /&gt;
  SimpleSC::StartService &amp;quot;MyService&amp;quot; &#039;&amp;quot;-p param1&amp;quot; -param2&#039;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Stop a service and waits for file release&lt;br /&gt;
  SimpleSC::StopService &amp;quot;MyService&amp;quot; 1&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Stops two services and waits for file release after the last service is stopped&lt;br /&gt;
  SimpleSC::StopService &amp;quot;MyService1&amp;quot; 0&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  SimpleSC::StopService &amp;quot;MyService2&amp;quot; 1&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Pause a service&lt;br /&gt;
  SimpleSC::PauseService &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Continue a service&lt;br /&gt;
  SimpleSC::ContinueService &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Restart a service&lt;br /&gt;
  SimpleSC::RestartService &amp;quot;MyService&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Restart a service with two arguments &amp;quot;/param1=true&amp;quot; &amp;quot;/param2=1&amp;quot;&lt;br /&gt;
  SimpleSC::RestartService &amp;quot;MyService&amp;quot; &amp;quot;/param1=true /param2=1&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Start a service with two arguments &amp;quot;-p param1&amp;quot; &amp;quot;-param2&amp;quot;&lt;br /&gt;
  SimpleSC::RestartService &amp;quot;MyService&amp;quot; &#039;&amp;quot;-p param1&amp;quot; -param2&#039;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Check if the service exists&lt;br /&gt;
  SimpleSC::ExistsService &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode if the service doesnÂ´t exists (&amp;lt;&amp;gt;0)/service exists (0)&lt;br /&gt;
&lt;br /&gt;
; Get the displayname of a service&lt;br /&gt;
  SimpleSC::GetServiceDisplayName &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the displayname of the service&lt;br /&gt;
&lt;br /&gt;
; Get the servicename of a service by the displayname&lt;br /&gt;
  SimpleSC::GetServiceName &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the servicename of the service&lt;br /&gt;
&lt;br /&gt;
; Get the current status of a service&lt;br /&gt;
  SimpleSC::GetServiceStatus &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; return the status of the service (See &amp;quot;service_status&amp;quot; in the parameters)&lt;br /&gt;
&lt;br /&gt;
; Get the description of a service&lt;br /&gt;
  SimpleSC::GetServiceDescription &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the description of the service&lt;br /&gt;
 &lt;br /&gt;
; Get the start type of the service&lt;br /&gt;
  SimpleSC::GetServiceStartType &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the start type of the service (see &amp;quot;start_type&amp;quot; in the parameters)&lt;br /&gt;
&lt;br /&gt;
; Get the binary path of a service&lt;br /&gt;
  SimpleSC::GetServiceBinaryPath &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the binary path of the service&lt;br /&gt;
&lt;br /&gt;
; Get the logon user of the service&lt;br /&gt;
  SimpleSC::GetServiceLogon &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the logon username of the service  &lt;br /&gt;
&lt;br /&gt;
; Get the failure configuration of a service&lt;br /&gt;
  SimpleSC::GetServiceFailure &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the reset period &lt;br /&gt;
  Pop $2 ; returns the reboot message&lt;br /&gt;
  Pop $3 ; returns the command&lt;br /&gt;
  Pop $4 ; returns the first action (See &amp;quot;action_type_x&amp;quot; in the parameters)&lt;br /&gt;
  Pop $5 ; returns the first action delay &lt;br /&gt;
  Pop $6 ; returns the second action (See &amp;quot;action_type_x&amp;quot; in the parameters)&lt;br /&gt;
  Pop $7 ; returns the second action delay &lt;br /&gt;
  Pop $8 ; returns the third action (See &amp;quot;action_type_x&amp;quot; in the parameters)&lt;br /&gt;
  Pop $9 ; returns the third action delay &lt;br /&gt;
&lt;br /&gt;
; Get the failure flag configuration of a service&lt;br /&gt;
  SimpleSC::GetServiceFailureFlag &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the service flag&lt;br /&gt;
&lt;br /&gt;
; Get the delayed auto-start configuration of a service&lt;br /&gt;
  SimpleSC::GetServiceDelayedAutoStartInfo &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the delayed auto-start configuration&lt;br /&gt;
&lt;br /&gt;
; Set the description of a service&lt;br /&gt;
  SimpleSC::SetServiceDescription &amp;quot;MyService&amp;quot; &amp;quot;Sample Description&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Set the starttype to automatic of a service&lt;br /&gt;
  SimpleSC::SetServiceStartType &amp;quot;MyService&amp;quot; &amp;quot;2&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Sets the service binary path&lt;br /&gt;
  SimpleSC::SetServiceBinaryPath &amp;quot;MyService&amp;quot; &amp;quot;C:\MySoftware\MyService.exe&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Sets the service logon to a user and grant the user the &amp;quot;SeServiceLogonPrivilege&amp;quot;&lt;br /&gt;
  SimpleSC::SetServiceLogon &amp;quot;MyService&amp;quot; &amp;quot;MyServiceUser&amp;quot; &amp;quot;MyServiceUserPassword&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  IntCmp $0 0 +1 Done Done ; If successful grant the service logon privilege to &amp;quot;MyServiceUser&amp;quot;&lt;br /&gt;
    ; Note: Every serviceuser must have the ServiceLogonPrivilege to start the service&lt;br /&gt;
    SimpleSC::GrantServiceLogonPrivilege &amp;quot;MyServiceUser&amp;quot;&lt;br /&gt;
    Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Done:&lt;br /&gt;
&lt;br /&gt;
; Sets the service failure configuration - First action: Restart the service after one minute - Second action: Reboot the computer after five minutes&lt;br /&gt;
  SimpleSC::SetServiceFailure &amp;quot;MyService&amp;quot; &amp;quot;0&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;1&amp;quot; &amp;quot;60000&amp;quot; &amp;quot;2&amp;quot; &amp;quot;300000&amp;quot; &amp;quot;0&amp;quot; &amp;quot;0&amp;quot; &lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Sets the failure flag configuration of a service&lt;br /&gt;
  SimpleSC::SetServiceFailureFlag &amp;quot;MyService&amp;quot; &amp;quot;1&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Sets the delayed auto-start configuration of a service&lt;br /&gt;
  SimpleSC::SetServiceDelayedAutoStartInfo &amp;quot;MyService&amp;quot; &amp;quot;1&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Remove the &amp;quot;SeServiceLogonPrivilege&amp;quot; from a user&lt;br /&gt;
  SimpleSC::RemoveServiceLogonPrivilege &amp;quot;MyServiceUser&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Check if the service is paused&lt;br /&gt;
  SimpleSC::ServiceIsPaused &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns 1 (service is paused) - returns 0 (service is not paused)&lt;br /&gt;
&lt;br /&gt;
; Check if the service is running&lt;br /&gt;
  SimpleSC::ServiceIsRunning &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns 1 (service is running) - returns 0 (service is not running)&lt;br /&gt;
&lt;br /&gt;
; Check if the service is stopped&lt;br /&gt;
  SimpleSC::ServiceIsStopped &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns 1 (service is stopped) - returns 0 (service is not stopped)&lt;br /&gt;
&lt;br /&gt;
; Show the error message if a function fails &lt;br /&gt;
  SimpleSC::StopService &amp;quot;MyService&amp;quot; 1&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  IntCmp $0 0 Done +1 +1 &lt;br /&gt;
    Push $0&lt;br /&gt;
    SimpleSC::GetErrorMessage&lt;br /&gt;
    Pop $0&lt;br /&gt;
    MessageBox MB_OK|MB_ICONSTOP &amp;quot;Stopping fails - Reason: $0&amp;quot;&lt;br /&gt;
  Done:&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Changelog ==&lt;br /&gt;
* Version 1.28 (2010-09-14)&lt;br /&gt;
**SimpleSC::GetServiceFailure function added&lt;br /&gt;
**SimpleSC::SetServiceFailure function added&lt;br /&gt;
**SimpleSC::StopService WaitForFileRelease feature added (For details take a look at the documentation)&lt;br /&gt;
* Version 1.27 (2010-03-23)&lt;br /&gt;
**Documentation updated&lt;br /&gt;
* Version 1.26 (2009-05-21)&lt;br /&gt;
**Fixed wait for status bug on starting, stopping, pausing or continuing a service &lt;br /&gt;
* Version 1.25 (2009-04-23)&lt;br /&gt;
**SimpleSC::SetServiceLogon supports now non-domain username without the &amp;quot;.\&amp;quot;-prefix&lt;br /&gt;
**SimpleSC::SetServiceBinaryPath function added&lt;br /&gt;
*Version 1.24 (2009-04-13)&lt;br /&gt;
**Fixed wait for status bug if the service status changed. Now, if a service stops, starts aso. the plugin will work like the recommendations in the MSDN.&lt;br /&gt;
*Version 1.23 (2008-08-23)&lt;br /&gt;
**Removed compiler optimization to avoid a false-positive virusscan.&lt;br /&gt;
*Version 1.22 (2008-08-17)&lt;br /&gt;
**SimpleSC::GrantServiceLogonPrivilege and SimpleSC::RemoveServiceLogonPrivilege works now correct with domain names like MyDomain\MyUser.&lt;br /&gt;
**Added function SimpleSC::GetServiceLogon to get the logon username of a service.&lt;br /&gt;
*Version 1.21 (2008-02-10)&lt;br /&gt;
**SimpleSC::ExistsService results now 0 if the service exists and &amp;lt;&amp;gt; 0 if the service doensnÂ´t exists.&lt;br /&gt;
*Version 1.20 (2008-02-05)&lt;br /&gt;
**Every function now returns &amp;lt;&amp;gt; 0 if there is an error. Use SimpleSC::GetErrorMessage to get the message of a function result.&lt;br /&gt;
**Added function SimpleSC::GetErrorMessage to get the message of a function result.&lt;br /&gt;
**SimpleSC::ExistsService results now 0 if the service exists and &amp;lt;&amp;gt; 0 if the service doensnÂ´t exists.&lt;br /&gt;
**SimpleSC::RestartService supports now arguments.&lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: The signature has been changed. If you update from a previous version you must check your parameters.&lt;br /&gt;
*Version 1.10 (2008-01-29)&lt;br /&gt;
**SimpleSC::InstallService supports now more than one dependencies (delimitter is the forward slash).&lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: The signature has been changed. If you update from a previous version you must check your parameters.&lt;br /&gt;
**SimpleSC::InstallService supports now more service types e.g. to create an interactive service.&lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: The signature has been changed. If you update from a previous version you must check your parameters.&lt;br /&gt;
**SimpleSC::StartService supports now arguments. &lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: The signature has been changed. If you update from a previous version you must check your parameters.&lt;br /&gt;
*Version 1.05 (2008-01-12)&lt;br /&gt;
**The functions SimpleSC::StopService and SimpleSC::RestartService are now improved. Now all dependent services are stopping recursively too.&lt;br /&gt;
*Version 1.04 (2007-08-07)&lt;br /&gt;
**Fixed bug for possible endless loops. This concerns to the functions StartService, StopService, ContinueService and PauseService. &lt;br /&gt;
*Version 1.03 (2007-08-02)&lt;br /&gt;
**Added function SimpleSC::GetServiceBinaryPath to get the binary path of a specified service.&lt;br /&gt;
*Version 1.02 (2007-05-29)&lt;br /&gt;
**Changed wrong documentation informations about the functions SimpleSC::InstallService and SimpleSC::RemoveService.&lt;br /&gt;
*Version 1.01 (2007-05-07)&lt;br /&gt;
**Changed wrong status-results in Readme.txt. This concerns to the functions ServiceIsPaused, ServiceIsRunning and ServiceIsStopped.&lt;br /&gt;
**Changed the access privileges of the plugin. The plugin now uses the lowest privlege of each function to execute.&lt;br /&gt;
*Version 1.0 (2007-05-02)&lt;br /&gt;
**First offical version&lt;br /&gt;
&lt;br /&gt;
== Important Notes ==&lt;br /&gt;
*The function &amp;quot;SetServiceLogon&amp;quot; only works if the servicetype is &amp;quot;SERVICE_WIN32_OWN_PROCESS&amp;quot;&lt;br /&gt;
* The functions &amp;quot;GetServiceDescription&amp;quot; or &amp;quot;SetServiceDescription&amp;quot; are only available on systems higher than Windows NT. &lt;br /&gt;
* If you change the logon of an service to a new user you have to grant him the Service Logon Privilege. Otherwise the service cannot be started by the user you have assigned.&lt;br /&gt;
* The functions StartService, StopService, PauseService and ContinueService uses a timeout of 30 seconds. This means the function must be executed within 30 seconds, otherwise the functions will return an error.&lt;br /&gt;
* If you have any suggestions, comments or questions please mail me: mailto:rainer@speed-soft.de&lt;br /&gt;
&lt;br /&gt;
[[Category:Plugins]]&lt;/div&gt;</summary>
		<author><name>Speed78</name></author>
	</entry>
	<entry>
		<id>https://nsis.sourceforge.io/mediawiki/index.php?title=NSIS_Simple_Service_Plugin&amp;diff=19829</id>
		<title>NSIS Simple Service Plugin</title>
		<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/mediawiki/index.php?title=NSIS_Simple_Service_Plugin&amp;diff=19829"/>
		<updated>2011-04-16T14:33:23Z</updated>

		<summary type="html">&lt;p&gt;Speed78: /* Short Reference */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This plugin contains basic service functions like start, stop the service or checking the service status. It also contains advanced service functions for example setting the service description, changed the logon account, granting or removing the service logon privilege.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This plugin is using the MPL License or alternatively the LGPL License.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
&amp;lt;attach&amp;gt;NSIS_Simple_Service_Plugin_1.28.zip&amp;lt;/attach&amp;gt; The ZIP file containing a precompiled plugin DLL (to be saved in NSIS&#039; plugin directory) and the sources. If you update from a previous version it is strongly &#039;&#039;&#039;recommend&#039;&#039;&#039; to take look at the changelog.&lt;br /&gt;
&lt;br /&gt;
== Donation ==&lt;br /&gt;
If you believe that I am doing a good job and you want to support me please [http://www.speed-soft.de/donation/index.php?language=en donate] any amount via PayPal.&lt;br /&gt;
&lt;br /&gt;
== Short Reference ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
SimpleSC::InstallService [name_of_service] [display_name] [service_type] [start_type] &lt;br /&gt;
  [binary_path] [dependencies] [account] [password]&lt;br /&gt;
SimpleSC::RemoveService [name_of_service]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::StartService [name_of_service] [arguments]&lt;br /&gt;
SimpleSC::StopService [name_of_service] [wait_for_file_release]&lt;br /&gt;
SimpleSC::PauseService [name_of_service] &lt;br /&gt;
SimpleSC::ContinueService [name_of_service]&lt;br /&gt;
SimpleSC::RestartService [name_of_service] [arguments]&lt;br /&gt;
SimpleSC::ExistsService [name_of_service]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::GetServiceDisplayName [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceName [display_name]&lt;br /&gt;
SimpleSC::GetServiceStatus [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceDescription [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceStartType [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceBinaryPath [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceLogon [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceFailure [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceFailureFlag [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceDelayedAutoStartInfo [name_of_service]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::SetServiceDescription [name_of_service] [service_description]&lt;br /&gt;
SimpleSC::SetServiceStartType [name_of_service] [start_type]&lt;br /&gt;
SimpleSC::SetServiceBinaryPath [name_of_service] [binary_path]&lt;br /&gt;
SimpleSC::SetServiceLogon [name_of_service] [account] [password]&lt;br /&gt;
SimpleSC::SetServiceFailure [name_of_service] [reset_period] [reboot_message] [command] &lt;br /&gt;
  [action_type_1] [action_delay_1] [action_type_2] [action_delay_2] [action_type_3] &lt;br /&gt;
  [action_delay_3]&lt;br /&gt;
SimpleSC::SetServiceFailureFlag [name_of_service] [failure_actions_on_non_crash_failures]&lt;br /&gt;
SimpleSC::SetServiceDelayedAutoStartInfo [name_of_service] [delayed_autostart]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::GrantServiceLogonPrivilege [account]&lt;br /&gt;
SimpleSC::RemoveServiceLogonPrivilege [account]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::ServiceIsPaused [name_of_service]&lt;br /&gt;
SimpleSC::ServiceIsRunning [name_of_service]&lt;br /&gt;
SimpleSC::ServiceIsStopped [name_of_service]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::GetErrorMessage [error_code]&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
*name_of_service - The name of the service used for Start/Stop commands and all further commands &lt;br /&gt;
*display_name - The name as shown in the service control manager applet in system control &lt;br /&gt;
*service_type - One of the following codes &lt;br /&gt;
**1 - SERVICE_KERNEL_DRIVER - Driver service.&lt;br /&gt;
**2 - SERVICE_FILE_SYSTEM_DRIVER - File system driver service.&lt;br /&gt;
**16 - SERVICE_WIN32_OWN_PROCESS - Service that runs in its own process. (Should be used in most cases)&lt;br /&gt;
**32 - SERVICE_WIN32_SHARE_PROCESS - Service that shares a process with one or more other services. &lt;br /&gt;
**256 - SERVICE_INTERACTIVE_PROCESS - The service can interact with the desktop. &lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: If you specify either SERVICE_WIN32_OWN_PROCESS or SERVICE_WIN32_SHARE_PROCESS,          and the service is running in the context of the LocalSystem account,          you can also specify this value. Example: SERVICE_WIN32_OWN_PROCESS or SERVICE_INTERACTIVE_PROCESS - (16 or 256) = 272&lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: Services cannot directly interact with a user as of Windows Vista.             Therefore, this technique should not be used in new code. See for more information: http://msdn2.microsoft.com/en-us/library/ms683502(VS.85).aspx          &lt;br /&gt;
&lt;br /&gt;
*start_type - one of the following codes &lt;br /&gt;
**0 - SERVICE_BOOT_START - Driver boot stage start &lt;br /&gt;
**1 - SERVICE_SYSTEM_START - Driver scm stage start &lt;br /&gt;
**2 - SERVICE_AUTO_START - Service auto start (Should be used in most cases)&lt;br /&gt;
**3 - SERVICE_DEMAND_START - Driver/service manual start &lt;br /&gt;
**4 - SERVICE_DISABLED - Driver/service disabled&lt;br /&gt;
*service_status - one of the following codes&lt;br /&gt;
**1 - SERVICE_STOPPED&lt;br /&gt;
**2 - SERVICE_START_PENDING&lt;br /&gt;
**3 - SERVICE_STOP_PENDING&lt;br /&gt;
**4 - SERVICE_RUNNING&lt;br /&gt;
**5 - SERVICE_CONTINUE_PENDING&lt;br /&gt;
**6 - SERVICE_PAUSE_PENDING&lt;br /&gt;
**7 - SERVICE_PAUSED&lt;br /&gt;
*binary_path - The path to the binary including all necessary parameters &lt;br /&gt;
*dependencies - Needed services, controls which services have to be started before this one; use the forward slash &amp;quot;/&amp;quot; to add more more than one service&lt;br /&gt;
*account - The username/account which should be used &lt;br /&gt;
*password - Password of the aforementioned account to be able to logon as a service &lt;br /&gt;
**&#039;&#039;&#039;Note&#039;&#039;&#039;: If you do not specify account/password, the local system account will be used to run the service&lt;br /&gt;
*arguments - Arguments passed to the service main function. &lt;br /&gt;
**&#039;&#039;&#039;Note&#039;&#039;&#039;: Driver services do not receive these arguments.&lt;br /&gt;
*reset_period - The time after which to reset the failure count to zero if there are no failures, in seconds. Specify 0 (INFINITE) to indicate that this value should never be reset&lt;br /&gt;
*reboot_message - The message to be broadcast to server users before rebooting&lt;br /&gt;
*command - The command line of the process to execute in response to the SC_ACTION_RUN_COMMAND service controller action. This process runs under the same account as the service&lt;br /&gt;
*action_type_x - one of the following codes for the action to be performed&lt;br /&gt;
**0 - SC_ACTION_NONE - No action&lt;br /&gt;
**1 - SC_ACTION_RESTART - Restart the service&lt;br /&gt;
**2 - SC_ACTION_REBOOT - Reboot the computer (Note: The service user must have the SE_SHUTDOWN_NAME privilege)&lt;br /&gt;
**3 - SC_ACTION_RUN_COMMAND - Run a command&lt;br /&gt;
*action_delay_x - The time to wait before performing the specified action, in milliseconds&lt;br /&gt;
*failure_actions_on_non_crash_failures - This setting determines when failure actions are to be executed&lt;br /&gt;
**0 - The failure actions executed only if the service terminates without reporting a status of SERVICE_STOPPED&lt;br /&gt;
**1 - The failure actions executed if the status of a service is SERVICE_STOPPED but the exit code of the service is not 0&lt;br /&gt;
*delayed_autostart - The delayed auto-start setting of an auto-start service&lt;br /&gt;
**0 - The service will be started during system boot.&lt;br /&gt;
**1 - The service will be started after other auto-start services are started plus a short delay&lt;br /&gt;
*error_code - Error code of a function&lt;br /&gt;
*service_description - The description as shown in the service control manager applet in system control&lt;br /&gt;
*wait_for_file_release - Wait for file release after the service is stopped. This is useful if the binary file will be overwritten after stopping the service.&lt;br /&gt;
**0 - NO_WAIT - No wait for file release&lt;br /&gt;
**1 - WAIT - Wait for file release &lt;br /&gt;
**&#039;&#039;&#039;Note&#039;&#039;&#039;: If SERVICE_WIN32_OWN_PROCESS is used this option should be set to WAIT.	If SERVICE_WIN32_SHARE_PROCESS is used this option should only be set to WAIT if the last service in the process is stopped.&lt;br /&gt;
&lt;br /&gt;
== The Sample Script ==&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
; Install a service - ServiceType own process - StartType automatic - NoDependencies -  Logon as System Account&lt;br /&gt;
  SimpleSC::InstallService &amp;quot;MyService&amp;quot; &amp;quot;My Service Display Name&amp;quot; &amp;quot;16&amp;quot; &amp;quot;2&amp;quot; &amp;quot;C:\MyPath\MyService.exe&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Install a service - ServiceType interact with desktop - StartType automatic - Dependencies on &amp;quot;Windows Time Service&amp;quot; (w32time) and &amp;quot;WWW Publishing Service&amp;quot; (w3svc) - Logon as System Account&lt;br /&gt;
  SimpleSC::InstallService &amp;quot;MyService&amp;quot; &amp;quot;My Service Display Name&amp;quot; &amp;quot;272&amp;quot; &amp;quot;2&amp;quot; &amp;quot;C:\MyPath\MyService.exe&amp;quot; &amp;quot;w32time/w3svc&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Remove a service&lt;br /&gt;
  SimpleSC::RemoveService &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Start a service&lt;br /&gt;
  SimpleSC::StartService &amp;quot;MyService&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Start a service with two arguments &amp;quot;/param1=true&amp;quot; &amp;quot;/param2=1&amp;quot;&lt;br /&gt;
  SimpleSC::StartService &amp;quot;MyService&amp;quot; &amp;quot;/param1=true /param2=1&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
 &lt;br /&gt;
; Start a service with two arguments &amp;quot;-p param1&amp;quot; &amp;quot;-param2&amp;quot;&lt;br /&gt;
  SimpleSC::StartService &amp;quot;MyService&amp;quot; &#039;&amp;quot;-p param1&amp;quot; -param2&#039;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Stop a service and waits for file release&lt;br /&gt;
  SimpleSC::StopService &amp;quot;MyService&amp;quot; 1&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Stops two services and waits for file release after the last service is stopped&lt;br /&gt;
  SimpleSC::StopService &amp;quot;MyService1&amp;quot; 0&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  SimpleSC::StopService &amp;quot;MyService2&amp;quot; 1&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Pause a service&lt;br /&gt;
  SimpleSC::PauseService &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Continue a service&lt;br /&gt;
  SimpleSC::ContinueService &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Restart a service&lt;br /&gt;
  SimpleSC::RestartService &amp;quot;MyService&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Restart a service with two arguments &amp;quot;/param1=true&amp;quot; &amp;quot;/param2=1&amp;quot;&lt;br /&gt;
  SimpleSC::RestartService &amp;quot;MyService&amp;quot; &amp;quot;/param1=true /param2=1&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Start a service with two arguments &amp;quot;-p param1&amp;quot; &amp;quot;-param2&amp;quot;&lt;br /&gt;
  SimpleSC::RestartService &amp;quot;MyService&amp;quot; &#039;&amp;quot;-p param1&amp;quot; -param2&#039;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Check if the service exists&lt;br /&gt;
  SimpleSC::ExistsService &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode if the service doesnÂ´t exists (&amp;lt;&amp;gt;0)/service exists (0)&lt;br /&gt;
&lt;br /&gt;
; Get the displayname of a service&lt;br /&gt;
  SimpleSC::GetServiceDisplayName &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the displayname of the service&lt;br /&gt;
&lt;br /&gt;
; Get the servicename of a service by the displayname&lt;br /&gt;
  SimpleSC::GetServiceName &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the servicename of the service&lt;br /&gt;
&lt;br /&gt;
; Get the current status of a service&lt;br /&gt;
  SimpleSC::GetServiceStatus &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; return the status of the service (See &amp;quot;service_status&amp;quot; in the parameters)&lt;br /&gt;
&lt;br /&gt;
; Get the description of a service&lt;br /&gt;
  SimpleSC::GetServiceDescription &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the description of the service&lt;br /&gt;
 &lt;br /&gt;
; Get the start type of the service&lt;br /&gt;
  SimpleSC::GetServiceStartType &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the start type of the service (see &amp;quot;start_type&amp;quot; in the parameters)&lt;br /&gt;
&lt;br /&gt;
; Get the binary path of a service&lt;br /&gt;
  SimpleSC::GetServiceBinaryPath &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the binary path of the service&lt;br /&gt;
&lt;br /&gt;
; Get the logon user of the service&lt;br /&gt;
  SimpleSC::GetServiceLogon &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the logon username of the service  &lt;br /&gt;
&lt;br /&gt;
; Get the failure configuration of the service&lt;br /&gt;
  SimpleSC::GetServiceFailure &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the reset period &lt;br /&gt;
  Pop $2 ; returns the reboot message&lt;br /&gt;
  Pop $3 ; returns the command&lt;br /&gt;
  Pop $4 ; returns the first action (See &amp;quot;action_type_x&amp;quot; in the parameters)&lt;br /&gt;
  Pop $5 ; returns the first action delay &lt;br /&gt;
  Pop $6 ; returns the second action (See &amp;quot;action_type_x&amp;quot; in the parameters)&lt;br /&gt;
  Pop $7 ; returns the second action delay &lt;br /&gt;
  Pop $8 ; returns the third action (See &amp;quot;action_type_x&amp;quot; in the parameters)&lt;br /&gt;
  Pop $9 ; returns the third action delay &lt;br /&gt;
&lt;br /&gt;
; Set the description of a service (Not supported on Windows NT 4.0)&lt;br /&gt;
  SimpleSC::SetServiceDescription &amp;quot;MyService&amp;quot; &amp;quot;Sample Description&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Set the starttype to automatic of a service&lt;br /&gt;
  SimpleSC::SetServiceStartType &amp;quot;MyService&amp;quot; &amp;quot;2&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Sets the service binary path&lt;br /&gt;
  SimpleSC::SetServiceBinaryPath &amp;quot;MyService&amp;quot; &amp;quot;C:\MySoftware\MyService.exe&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Sets the service logon to a user and grant the user the &amp;quot;SeServiceLogonPrivilege&amp;quot;&lt;br /&gt;
  SimpleSC::SetServiceLogon &amp;quot;MyService&amp;quot; &amp;quot;MyServiceUser&amp;quot; &amp;quot;MyServiceUserPassword&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  IntCmp $0 0 +1 Done Done ; If successful grant the service logon privilege to &amp;quot;MyServiceUser&amp;quot;&lt;br /&gt;
    ; Note: Every serviceuser must have the ServiceLogonPrivilege to start the service&lt;br /&gt;
    SimpleSC::GrantServiceLogonPrivilege &amp;quot;MyServiceUser&amp;quot;&lt;br /&gt;
    Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Done:&lt;br /&gt;
&lt;br /&gt;
; Sets the service failure configuration - First action: Restart the service after one minute - Second action: Reboot the computer after five minutes&lt;br /&gt;
  SimpleSC::SetServiceFailure &amp;quot;MyService&amp;quot; &amp;quot;0&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;1&amp;quot; &amp;quot;60000&amp;quot; &amp;quot;2&amp;quot; &amp;quot;300000&amp;quot; &amp;quot;0&amp;quot; &amp;quot;0&amp;quot; &lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Remove the &amp;quot;SeServiceLogonPrivilege&amp;quot; from a user&lt;br /&gt;
  SimpleSC::RemoveServiceLogonPrivilege &amp;quot;MyServiceUser&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Check if the service is paused&lt;br /&gt;
  SimpleSC::ServiceIsPaused &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns 1 (service is paused) - returns 0 (service is not paused)&lt;br /&gt;
&lt;br /&gt;
; Check if the service is running&lt;br /&gt;
  SimpleSC::ServiceIsRunning &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns 1 (service is running) - returns 0 (service is not running)&lt;br /&gt;
&lt;br /&gt;
; Check if the service is stopped&lt;br /&gt;
  SimpleSC::ServiceIsStopped &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns 1 (service is stopped) - returns 0 (service is not stopped)&lt;br /&gt;
&lt;br /&gt;
; Show the error message if a function fails &lt;br /&gt;
  SimpleSC::StopService &amp;quot;MyService&amp;quot; 1&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  IntCmp $0 0 Done +1 +1 &lt;br /&gt;
    Push $0&lt;br /&gt;
    SimpleSC::GetErrorMessage&lt;br /&gt;
    Pop $0&lt;br /&gt;
    MessageBox MB_OK|MB_ICONSTOP &amp;quot;Stopping fails - Reason: $0&amp;quot;&lt;br /&gt;
  Done:&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Changelog ==&lt;br /&gt;
* Version 1.28 (2010-09-14)&lt;br /&gt;
**SimpleSC::GetServiceFailure function added&lt;br /&gt;
**SimpleSC::SetServiceFailure function added&lt;br /&gt;
**SimpleSC::StopService WaitForFileRelease feature added (For details take a look at the documentation)&lt;br /&gt;
* Version 1.27 (2010-03-23)&lt;br /&gt;
**Documentation updated&lt;br /&gt;
* Version 1.26 (2009-05-21)&lt;br /&gt;
**Fixed wait for status bug on starting, stopping, pausing or continuing a service &lt;br /&gt;
* Version 1.25 (2009-04-23)&lt;br /&gt;
**SimpleSC::SetServiceLogon supports now non-domain username without the &amp;quot;.\&amp;quot;-prefix&lt;br /&gt;
**SimpleSC::SetServiceBinaryPath function added&lt;br /&gt;
*Version 1.24 (2009-04-13)&lt;br /&gt;
**Fixed wait for status bug if the service status changed. Now, if a service stops, starts aso. the plugin will work like the recommendations in the MSDN.&lt;br /&gt;
*Version 1.23 (2008-08-23)&lt;br /&gt;
**Removed compiler optimization to avoid a false-positive virusscan.&lt;br /&gt;
*Version 1.22 (2008-08-17)&lt;br /&gt;
**SimpleSC::GrantServiceLogonPrivilege and SimpleSC::RemoveServiceLogonPrivilege works now correct with domain names like MyDomain\MyUser.&lt;br /&gt;
**Added function SimpleSC::GetServiceLogon to get the logon username of a service.&lt;br /&gt;
*Version 1.21 (2008-02-10)&lt;br /&gt;
**SimpleSC::ExistsService results now 0 if the service exists and &amp;lt;&amp;gt; 0 if the service doensnÂ´t exists.&lt;br /&gt;
*Version 1.20 (2008-02-05)&lt;br /&gt;
**Every function now returns &amp;lt;&amp;gt; 0 if there is an error. Use SimpleSC::GetErrorMessage to get the message of a function result.&lt;br /&gt;
**Added function SimpleSC::GetErrorMessage to get the message of a function result.&lt;br /&gt;
**SimpleSC::ExistsService results now 0 if the service exists and &amp;lt;&amp;gt; 0 if the service doensnÂ´t exists.&lt;br /&gt;
**SimpleSC::RestartService supports now arguments.&lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: The signature has been changed. If you update from a previous version you must check your parameters.&lt;br /&gt;
*Version 1.10 (2008-01-29)&lt;br /&gt;
**SimpleSC::InstallService supports now more than one dependencies (delimitter is the forward slash).&lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: The signature has been changed. If you update from a previous version you must check your parameters.&lt;br /&gt;
**SimpleSC::InstallService supports now more service types e.g. to create an interactive service.&lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: The signature has been changed. If you update from a previous version you must check your parameters.&lt;br /&gt;
**SimpleSC::StartService supports now arguments. &lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: The signature has been changed. If you update from a previous version you must check your parameters.&lt;br /&gt;
*Version 1.05 (2008-01-12)&lt;br /&gt;
**The functions SimpleSC::StopService and SimpleSC::RestartService are now improved. Now all dependent services are stopping recursively too.&lt;br /&gt;
*Version 1.04 (2007-08-07)&lt;br /&gt;
**Fixed bug for possible endless loops. This concerns to the functions StartService, StopService, ContinueService and PauseService. &lt;br /&gt;
*Version 1.03 (2007-08-02)&lt;br /&gt;
**Added function SimpleSC::GetServiceBinaryPath to get the binary path of a specified service.&lt;br /&gt;
*Version 1.02 (2007-05-29)&lt;br /&gt;
**Changed wrong documentation informations about the functions SimpleSC::InstallService and SimpleSC::RemoveService.&lt;br /&gt;
*Version 1.01 (2007-05-07)&lt;br /&gt;
**Changed wrong status-results in Readme.txt. This concerns to the functions ServiceIsPaused, ServiceIsRunning and ServiceIsStopped.&lt;br /&gt;
**Changed the access privileges of the plugin. The plugin now uses the lowest privlege of each function to execute.&lt;br /&gt;
*Version 1.0 (2007-05-02)&lt;br /&gt;
**First offical version&lt;br /&gt;
&lt;br /&gt;
== Important Notes ==&lt;br /&gt;
*The function &amp;quot;SetServiceLogon&amp;quot; only works if the servicetype is &amp;quot;SERVICE_WIN32_OWN_PROCESS&amp;quot;&lt;br /&gt;
* The functions &amp;quot;GetServiceDescription&amp;quot; or &amp;quot;SetServiceDescription&amp;quot; are only available on systems higher than Windows NT. &lt;br /&gt;
* If you change the logon of an service to a new user you have to grant him the Service Logon Privilege. Otherwise the service cannot be started by the user you have assigned.&lt;br /&gt;
* The functions StartService, StopService, PauseService and ContinueService uses a timeout of 30 seconds. This means the function must be executed within 30 seconds, otherwise the functions will return an error.&lt;br /&gt;
* If you have any suggestions, comments or questions please mail me: mailto:rainer@speed-soft.de&lt;br /&gt;
&lt;br /&gt;
[[Category:Plugins]]&lt;/div&gt;</summary>
		<author><name>Speed78</name></author>
	</entry>
	<entry>
		<id>https://nsis.sourceforge.io/mediawiki/index.php?title=NSIS_Simple_Firewall_Plugin&amp;diff=19343</id>
		<title>NSIS Simple Firewall Plugin</title>
		<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/mediawiki/index.php?title=NSIS_Simple_Firewall_Plugin&amp;diff=19343"/>
		<updated>2011-02-03T17:46:37Z</updated>

		<summary type="html">&lt;p&gt;Speed78: /* Important Notes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This plugin can be used to configure the Windows firewall. This plugin contains functions to enable, check, add or remove programs or ports to the firewall exception list. It also contains functions for checking the firewall status, enable or disable the firewall and so on.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This plugin is using the MPL License or alternatively the LGPL License.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
&amp;lt;attach&amp;gt;NSIS_Simple_Firewall_Plugin_1.18.zip&amp;lt;/attach&amp;gt; The ZIP file containing a precompiled plugin DLL (to be saved in NSIS&#039; plugin directory) and the sources.&lt;br /&gt;
&lt;br /&gt;
== Donation ==&lt;br /&gt;
If you believe that I am doing a good job and you want to support me please [http://www.speed-soft.de/donation/index.php?language=en donate] any amount via PayPal.&lt;br /&gt;
&lt;br /&gt;
== Short Reference ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
SimpleFC::EnableDisableFirewall [status]&lt;br /&gt;
SimpleFC::IsFirewallEnabled  &lt;br /&gt;
 &lt;br /&gt;
SimpleFC::AllowDisallowExceptionsNotAllowed [status]&lt;br /&gt;
SimpleFC::AreExceptionsNotAllowed  &lt;br /&gt;
 &lt;br /&gt;
SimpleFC::EnableDisableNotifications [status]&lt;br /&gt;
SimpleFC::AreNotificationsEnabled  &lt;br /&gt;
 &lt;br /&gt;
SimpleFC::StartStopFirewallService [status]&lt;br /&gt;
SimpleFC::IsFirewallServiceRunning  &lt;br /&gt;
 &lt;br /&gt;
SimpleFC::AddPort [port] [name] [protocol] [scope] [ip_version] [remote_addresses] [status]&lt;br /&gt;
SimpleFC::IsPortAdded [port] [protocol]&lt;br /&gt;
SimpleFC::RemovePort [port] [protocol]&lt;br /&gt;
 &lt;br /&gt;
SimpleFC::IsPortEnabled [port] [protocol]&lt;br /&gt;
SimpleFC::EnableDisablePort [port] [protocol]&lt;br /&gt;
 &lt;br /&gt;
SimpleFC::AddApplication [name] [path] [scope] [ip_version] [remote_addresses] [status]&lt;br /&gt;
SimpleFC::IsApplicationAdded [path]&lt;br /&gt;
SimpleFC::RemoveApplication [path]&lt;br /&gt;
 &lt;br /&gt;
SimpleFC::IsApplicationEnabled [path]&lt;br /&gt;
SimpleFC::EnableDisableApplication [path]&lt;br /&gt;
&lt;br /&gt;
SimpleFC::RestoreDefaults&lt;br /&gt;
&lt;br /&gt;
SimpleFC::AllowDisallowIcmpOutboundDestinationUnreachable [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpRedirect [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpInboundEchoRequest [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpOutboundTimeExceeded [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpOutboundParameterProblem [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpOutboundSourceQuench [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpInboundRouterRequest [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpInboundTimestampRequest [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpInboundMaskRequest [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpOutboundPacketTooBig [status]&lt;br /&gt;
SimpleFC::IsIcmpTypeAllowed [ip_version] [local_address] [icmp_type]&lt;br /&gt;
&lt;br /&gt;
SimpleFC::AdvAddRule [name] [description] [protocol] [direction] &lt;br /&gt;
  [status] [profile] [action] [application] [icmp_types_and_codes] &lt;br /&gt;
  [group] [local_ports] [remote_ports] [local_address] [remote_address]&lt;br /&gt;
SimpleFC::AdvRemoveRule [name]&lt;br /&gt;
SimpleFC::AdvExistsRule [name]&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
*port - TCP/UDP port which should be opened/closed&lt;br /&gt;
*name - The name of the application/port/rule&lt;br /&gt;
*description - Description of the rule&lt;br /&gt;
*protocol - One of the following protocol&lt;br /&gt;
**1 - ICMPv4&lt;br /&gt;
**6 - TCP&lt;br /&gt;
**17 - UDP&lt;br /&gt;
**58 - ICMPv6&lt;br /&gt;
*scope - One of the following scope&lt;br /&gt;
**0 - All networks&lt;br /&gt;
**1 - Only local subnets&lt;br /&gt;
**2 - Custom scope&lt;br /&gt;
**3 - Max&lt;br /&gt;
**NOTE: If you use custom you must define remote_addresses&lt;br /&gt;
*ip_version&lt;br /&gt;
**0 - IPv4&lt;br /&gt;
**1 - IPv6&lt;br /&gt;
**2 - Any protocol&lt;br /&gt;
*icmp_type&lt;br /&gt;
**3 - Outbound Destination Unreachable (ICMPv4)&lt;br /&gt;
**4 - Outbound Source Quench (ICMPv4)&lt;br /&gt;
**5 - Redirect (ICMPv4)&lt;br /&gt;
**8 - Inbound Echo Request (ICMPv4)&lt;br /&gt;
**9 - Inbound Router Request (ICMPv4)&lt;br /&gt;
**11 - Outbound Time Exceeded (ICMPv4)&lt;br /&gt;
**12 - Outbound Parameter Problem (ICMPv4)&lt;br /&gt;
**13 - Inbound Timespamp Request (ICMPv4)&lt;br /&gt;
**17 - Inbound Mask Request (ICMPv4)&lt;br /&gt;
**1 - Outbound Destination Unreachable (ICMPv6)&lt;br /&gt;
**2 - Outbound Packet Too Big (ICMPv6)&lt;br /&gt;
**3 - Outbound Time Exceeded (ICMPv6)&lt;br /&gt;
**4 - Outbound Parameter Problem (ICMPv6)&lt;br /&gt;
**128 - Inbound Echo Request (ICMPv6)&lt;br /&gt;
**137 - Redirect (ICMPv6)&lt;br /&gt;
*direction&lt;br /&gt;
**1 - In&lt;br /&gt;
**2 - Out&lt;br /&gt;
*profile&lt;br /&gt;
**1 - Domain &lt;br /&gt;
**2 - Private&lt;br /&gt;
**4 - Public&lt;br /&gt;
**2147483647 - All profiles&lt;br /&gt;
*action&lt;br /&gt;
**0 - Block&lt;br /&gt;
**1 - Allow&lt;br /&gt;
*application - Name of the application (can be empty)&lt;br /&gt;
*icmp_types_and_codes - Specified icmp types and codes&lt;br /&gt;
*group - Put the rule in this specified group (can be empty) &lt;br /&gt;
**&#039;&#039;&#039;Note&#039;&#039;&#039;: On Vista the group must the a resource string in a exe/dll e.g. &amp;quot;@C:\Program Files\My Application\myapp.exe,-10000&amp;quot;. On all other supported operating systems it can be a string value.&lt;br /&gt;
*local_ports - Local ports (can be empty)&lt;br /&gt;
*remote_ports - Remote ports (can be empty)&lt;br /&gt;
*local_address - Local ip address (can be empty)&lt;br /&gt;
*remote_addresses - Remote addresses from which the port can listen for traffic&lt;br /&gt;
*status - Status of the port, application, rule, firewall or service for example enabled/disabled, start/stop or allow/disallow&lt;br /&gt;
**0 - Disabled, stop or disallow&lt;br /&gt;
**1 - Enabled, start, or allow&lt;br /&gt;
&lt;br /&gt;
== The Sample Script ==&lt;br /&gt;
In this script you can find the two most used functions. If you are searching for some special firewall exceptions please look at &amp;quot;The Sample Script (All Functions)&amp;quot;. &lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
; Add an application to the firewall exception list - All Networks - All IP Version - Enabled&lt;br /&gt;
  SimpleFC::AddApplication &amp;quot;My Application&amp;quot; &amp;quot;PathToApplication&amp;quot; 0 2 &amp;quot;&amp;quot; 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Remove an application from the firewall exception list&lt;br /&gt;
  SimpleFC::RemoveApplication &amp;quot;PathToApplication&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== The Sample Script (All Functions) ==&lt;br /&gt;
In this script you can find the examples of all functions provided by this plugin.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Add the port 37/TCP to the firewall exception list - All Networks - All IP Version - Enabled&lt;br /&gt;
  SimpleFC::AddPort 37 &amp;quot;My Application&amp;quot; 6 0 2 &amp;quot;&amp;quot; 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if the port 37/TCP is added to the firewall exception list&lt;br /&gt;
  SimpleFC::IsPortAdded 37 6&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Added/0=Not added&lt;br /&gt;
&lt;br /&gt;
; Remove the port 37/TCP from the firewall exception list&lt;br /&gt;
  SimpleFC::RemovePort 37 6&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if the port 37/TCP is enabled/disabled&lt;br /&gt;
  SimpleFC::IsPortEnabled 37 6&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Enabled/0=Not enabled&lt;br /&gt;
&lt;br /&gt;
; Disable the port 37/TCP&lt;br /&gt;
  SimpleFC::EnableDisablePort 37 6 0&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable the port 37/TCP&lt;br /&gt;
  SimpleFC::EnableDisablePort 37 6 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if an application is enabled/disabled&lt;br /&gt;
  SimpleFC::IsApplicationEnabled &amp;quot;PathToApplication&amp;quot; &lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Enabled/0=Not enabled&lt;br /&gt;
&lt;br /&gt;
; Disable the application&lt;br /&gt;
  SimpleFC::EnableDisableApplication &amp;quot;PathToApplication&amp;quot; 0&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable the application&lt;br /&gt;
  SimpleFC::EnableDisableApplication &amp;quot;PathToApplication&amp;quot; 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Add an application to the firewall exception list - All Networks - All IP Version - Enabled&lt;br /&gt;
  SimpleFC::AddApplication &amp;quot;My Application&amp;quot; &amp;quot;PathToApplication&amp;quot; 0 2 &amp;quot;&amp;quot; 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if the application is added to the firewall exception list&lt;br /&gt;
  SimpleFC::IsApplicationAdded &amp;quot;PathToApplication&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Added/0=Not added&lt;br /&gt;
&lt;br /&gt;
; Remove an application from the firewall exception list&lt;br /&gt;
  SimpleFC::RemoveApplication &amp;quot;PathToApplication&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Disable the windows firewall&lt;br /&gt;
  SimpleFC::EnableDisableFirewall 0&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable the windows firewall&lt;br /&gt;
  SimpleFC::EnableDisableFirewall 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if the firewall is enabled&lt;br /&gt;
  SimpleFC::IsFirewallEnabled &lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Enabled/0=Disabled&lt;br /&gt;
&lt;br /&gt;
; Enable exceptions are not allowed on the windows firewall&lt;br /&gt;
  SimpleFC::AllowDisallowExceptionsNotAllowed 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Disable exceptions are not allowed on the windows firewall&lt;br /&gt;
  SimpleFC::AllowDisallowExceptionsNotAllowed 0&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if exceptions are not allowed&lt;br /&gt;
  SimpleFC::AreExceptionsNotAllowed&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Exceptions are not allowed is &lt;br /&gt;
         ; activated/0=Exception are not allowed is deactivated&lt;br /&gt;
&lt;br /&gt;
; Enable notifications on the windows firewall&lt;br /&gt;
  SimpleFC::EnableDisableNotifications 1&lt;br /&gt;
&lt;br /&gt;
; Disable notifications on the windows firewall&lt;br /&gt;
  SimpleFC::EnableDisableNotifications 0&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if notifications are enabled/disabled&lt;br /&gt;
  SimpleFC::AreNotificationsEnabled &lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Enabled/0=Disabled&lt;br /&gt;
&lt;br /&gt;
; Starts the windows firewall service&lt;br /&gt;
  SimpleFC::StartStopFirewallService 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Stops the windows firewall service&lt;br /&gt;
  SimpleFC::StartStopFirewallService 0&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if windows firewall service is running&lt;br /&gt;
  SimpleFC::IsFirewallServiceRunning&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=IsRunning/0=Not Running&lt;br /&gt;
&lt;br /&gt;
; Sets the windows firewall to default settings&lt;br /&gt;
  SimpleFC::RestoreDefaults&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP outbound destination unreachable state&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpOutboundDestinationUnreachable 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP redirect state&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpRedirect 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP inbound echo request &lt;br /&gt;
  SimpleFC::AllowDisallowIcmpInboundEchoRequest 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP outbound time exceeded&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpOutboundTimeExceeded 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP outbound parameter problem&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpOutboundParameterProblem 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP outbound source quench&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpOutboundSourceQuench 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP inbound router request&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpInboundRouterRequest 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP inbound timestamp request&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpInboundTimestampRequest 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP inbound mask request&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpInboundMaskRequest 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP outbound packet too big&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpOutboundPacketTooBig 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if ICMPv4 echo request is allowed&lt;br /&gt;
  SimpleFC::IsIcmpTypeAllowed &amp;quot;0&amp;quot; &amp;quot;&amp;quot; &amp;quot;8&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Restricted/0=Not restricted&lt;br /&gt;
  Pop $2 ; return 1=Allowed/0=Not allowed &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Some example rules for the windows firewall with advanced security.&lt;br /&gt;
; Please note this functions are very powerful, so for a detailed &lt;br /&gt;
; description please read the windows firewall with advanced &lt;br /&gt;
; security api reference:&lt;br /&gt;
; http://msdn2.microsoft.com/en-us/library/aa365309.aspx&lt;br /&gt;
&lt;br /&gt;
; Adds an ICMPv4 rule to allow incoming echo reply messages (IcmpCodeAndType = 0:0)&lt;br /&gt;
  SimpleFC::AdvAddRule &amp;quot;Echo-Reply (ICMPv4 incoming)&amp;quot; \&lt;br /&gt;
    &amp;quot;Allows incoming Echo Replies messages.&amp;quot; &amp;quot;1&amp;quot; &amp;quot;1&amp;quot; &amp;quot;1&amp;quot; &amp;quot;7&amp;quot; &amp;quot;1&amp;quot; &amp;quot;&amp;quot; \ &lt;br /&gt;
    &amp;quot;0:0&amp;quot; &amp;quot;@PathToApplication,-10000&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Adds an ICMPv4 rule to allow incoming echo request messages (IcmpCodeAndType = 8:0)&lt;br /&gt;
  SimpleFC::AdvAddRule &amp;quot;Echo-Request (ICMPv4 incoming)&amp;quot; \&lt;br /&gt;
    &amp;quot;Allows incoming ICMP Echo messages.&amp;quot; &amp;quot;1&amp;quot; &amp;quot;1&amp;quot; &amp;quot;1&amp;quot; &amp;quot;7&amp;quot; &amp;quot;1&amp;quot; &amp;quot;&amp;quot; \&lt;br /&gt;
    &amp;quot;8:0&amp;quot; &amp;quot;@PathToApplication,-10000&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Add an application rule to allow incoming TCP access on this application&lt;br /&gt;
  SimpleFC::AdvAddRule &amp;quot;Incoming requests (TCP incoming)&amp;quot; \ &lt;br /&gt;
    &amp;quot;Allows incoming requests.&amp;quot; &amp;quot;6&amp;quot; &amp;quot;1&amp;quot; &amp;quot;1&amp;quot; &amp;quot;7&amp;quot; &amp;quot;1&amp;quot; &amp;quot;PathToApplication&amp;quot; \ &lt;br /&gt;
    &amp;quot;&amp;quot; &amp;quot;@PathToApplication,-10000&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Add an application rule to allow incoming UDP access on this application&lt;br /&gt;
  SimpleFC::AdvAddRule &amp;quot;Incoming requests (UDP incoming)&amp;quot; \&lt;br /&gt;
    &amp;quot;Allows incoming requests.&amp;quot; &amp;quot;17&amp;quot; &amp;quot;1&amp;quot; &amp;quot;1&amp;quot; &amp;quot;7&amp;quot; &amp;quot;1&amp;quot; &amp;quot;PathToApplication&amp;quot; \ &lt;br /&gt;
    &amp;quot;&amp;quot; &amp;quot;@PathToApplication,-10000&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Removes a firewall rule&lt;br /&gt;
  SimpleFC::AdvRemoveRule &amp;quot;Incoming requests (UDP incoming)&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if the firewall exists&lt;br /&gt;
  SimpleFC::AdvExistsRule &amp;quot;Incoming requests (UDP incoming)&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Exists/0=DoesnÂ´t exists&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Changelog ==&lt;br /&gt;
*Version 1.18 (2010-02-23)&lt;br /&gt;
**Documentation updated&lt;br /&gt;
*Version 1.17 (2009-09-05)&lt;br /&gt;
**Added changes from the service manager&lt;br /&gt;
**The following functions are now case insensitive:&lt;br /&gt;
***SimpleFC::IsApplicationAdded&lt;br /&gt;
***SimpleFC::IsApplicationEnabled&lt;br /&gt;
***SimpleFC::EnableDisableApplication&lt;br /&gt;
***SimpleFC::AdvExistsRule&lt;br /&gt;
*Version 1.16 (2009-04-13)&lt;br /&gt;
**Added changes from the service manager&lt;br /&gt;
*Version 1.15 (2008-08-18)&lt;br /&gt;
**Added changes from the service manager and checked removed compiler optimization to avoid a false-positive virusscan.&lt;br /&gt;
*Version 1.14 (2008-02-05)&lt;br /&gt;
** Added changes from the service manager&lt;br /&gt;
*Version 1.13 (2008-01-29)&lt;br /&gt;
** Added changes from the service manager&lt;br /&gt;
*Version 1.12 (2007-11-13)&lt;br /&gt;
** Fixed wrong documentation about SimpleFC::AdvExistsRule&lt;br /&gt;
*Version 1.11 (2007-08-07)&lt;br /&gt;
** Fixed potential endless loop bug in SimpleFC::StartStopFirewallService&lt;br /&gt;
*Version 1.10 (2007-08-02)&lt;br /&gt;
** Added default firewall functions:&lt;br /&gt;
*** SimpleFC::RestoreDefaults&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpOutboundDestinationUnreachable&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpRedirect&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpInboundEchoRequest&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpOutboundTimeExceeded&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpOutboundParameterProblem&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpOutboundSourceQuench&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpInboundRouterRequest&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpInboundTimestampRequest&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpInboundMaskRequest&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpOutboundPacketTooBig&lt;br /&gt;
*** SimpleFC::IsIcmpTypeAllowed&lt;br /&gt;
** Added functions for Windows Firewall with Advanced Security&lt;br /&gt;
*** SimpleFC::AdvAddRule&lt;br /&gt;
*** SimpleFC::AdvRemoveRule&lt;br /&gt;
*** SimpleFC::AdvExistsRule&lt;br /&gt;
*Version 1.01 (2007-07-05)&lt;br /&gt;
**Changed missing documentation about the function SimpleFC::IsFirewallEnabled&lt;br /&gt;
*Version 1.0 (2007-05-02)&lt;br /&gt;
**First offical version&lt;br /&gt;
&lt;br /&gt;
== Important Notes ==&lt;br /&gt;
&lt;br /&gt;
*This plugin is running on Windows XP SP2, Windows 2003, Windows Vista, Windows 2008 and Windows 7&lt;br /&gt;
*Before you execute some plugin commands it is recommend to check for windows firewall service is running (SimpleFC::IsFirewallServiceRunning).&lt;br /&gt;
*All functions with the prefix &amp;quot;Adv&amp;quot; are only for Windows Firewall with Advanced Security (Windows Vista and above). It is recommend to use these functions on the operating systems which supports the Windows Firewall with Advanced Security. Nethertheless, the default functions without the prefix &amp;quot;Adv&amp;quot; can be used.&lt;br /&gt;
* If you have any suggestions, comments or questions please mail me: mailto:rainer@speed-soft.de&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Plugins]]&lt;/div&gt;</summary>
		<author><name>Speed78</name></author>
	</entry>
	<entry>
		<id>https://nsis.sourceforge.io/mediawiki/index.php?title=NSIS_Simple_Firewall_Plugin&amp;diff=19342</id>
		<title>NSIS Simple Firewall Plugin</title>
		<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/mediawiki/index.php?title=NSIS_Simple_Firewall_Plugin&amp;diff=19342"/>
		<updated>2011-02-03T17:45:53Z</updated>

		<summary type="html">&lt;p&gt;Speed78: /* Important Notes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This plugin can be used to configure the Windows firewall. This plugin contains functions to enable, check, add or remove programs or ports to the firewall exception list. It also contains functions for checking the firewall status, enable or disable the firewall and so on.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This plugin is using the MPL License or alternatively the LGPL License.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
&amp;lt;attach&amp;gt;NSIS_Simple_Firewall_Plugin_1.18.zip&amp;lt;/attach&amp;gt; The ZIP file containing a precompiled plugin DLL (to be saved in NSIS&#039; plugin directory) and the sources.&lt;br /&gt;
&lt;br /&gt;
== Donation ==&lt;br /&gt;
If you believe that I am doing a good job and you want to support me please [http://www.speed-soft.de/donation/index.php?language=en donate] any amount via PayPal.&lt;br /&gt;
&lt;br /&gt;
== Short Reference ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
SimpleFC::EnableDisableFirewall [status]&lt;br /&gt;
SimpleFC::IsFirewallEnabled  &lt;br /&gt;
 &lt;br /&gt;
SimpleFC::AllowDisallowExceptionsNotAllowed [status]&lt;br /&gt;
SimpleFC::AreExceptionsNotAllowed  &lt;br /&gt;
 &lt;br /&gt;
SimpleFC::EnableDisableNotifications [status]&lt;br /&gt;
SimpleFC::AreNotificationsEnabled  &lt;br /&gt;
 &lt;br /&gt;
SimpleFC::StartStopFirewallService [status]&lt;br /&gt;
SimpleFC::IsFirewallServiceRunning  &lt;br /&gt;
 &lt;br /&gt;
SimpleFC::AddPort [port] [name] [protocol] [scope] [ip_version] [remote_addresses] [status]&lt;br /&gt;
SimpleFC::IsPortAdded [port] [protocol]&lt;br /&gt;
SimpleFC::RemovePort [port] [protocol]&lt;br /&gt;
 &lt;br /&gt;
SimpleFC::IsPortEnabled [port] [protocol]&lt;br /&gt;
SimpleFC::EnableDisablePort [port] [protocol]&lt;br /&gt;
 &lt;br /&gt;
SimpleFC::AddApplication [name] [path] [scope] [ip_version] [remote_addresses] [status]&lt;br /&gt;
SimpleFC::IsApplicationAdded [path]&lt;br /&gt;
SimpleFC::RemoveApplication [path]&lt;br /&gt;
 &lt;br /&gt;
SimpleFC::IsApplicationEnabled [path]&lt;br /&gt;
SimpleFC::EnableDisableApplication [path]&lt;br /&gt;
&lt;br /&gt;
SimpleFC::RestoreDefaults&lt;br /&gt;
&lt;br /&gt;
SimpleFC::AllowDisallowIcmpOutboundDestinationUnreachable [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpRedirect [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpInboundEchoRequest [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpOutboundTimeExceeded [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpOutboundParameterProblem [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpOutboundSourceQuench [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpInboundRouterRequest [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpInboundTimestampRequest [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpInboundMaskRequest [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpOutboundPacketTooBig [status]&lt;br /&gt;
SimpleFC::IsIcmpTypeAllowed [ip_version] [local_address] [icmp_type]&lt;br /&gt;
&lt;br /&gt;
SimpleFC::AdvAddRule [name] [description] [protocol] [direction] &lt;br /&gt;
  [status] [profile] [action] [application] [icmp_types_and_codes] &lt;br /&gt;
  [group] [local_ports] [remote_ports] [local_address] [remote_address]&lt;br /&gt;
SimpleFC::AdvRemoveRule [name]&lt;br /&gt;
SimpleFC::AdvExistsRule [name]&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
*port - TCP/UDP port which should be opened/closed&lt;br /&gt;
*name - The name of the application/port/rule&lt;br /&gt;
*description - Description of the rule&lt;br /&gt;
*protocol - One of the following protocol&lt;br /&gt;
**1 - ICMPv4&lt;br /&gt;
**6 - TCP&lt;br /&gt;
**17 - UDP&lt;br /&gt;
**58 - ICMPv6&lt;br /&gt;
*scope - One of the following scope&lt;br /&gt;
**0 - All networks&lt;br /&gt;
**1 - Only local subnets&lt;br /&gt;
**2 - Custom scope&lt;br /&gt;
**3 - Max&lt;br /&gt;
**NOTE: If you use custom you must define remote_addresses&lt;br /&gt;
*ip_version&lt;br /&gt;
**0 - IPv4&lt;br /&gt;
**1 - IPv6&lt;br /&gt;
**2 - Any protocol&lt;br /&gt;
*icmp_type&lt;br /&gt;
**3 - Outbound Destination Unreachable (ICMPv4)&lt;br /&gt;
**4 - Outbound Source Quench (ICMPv4)&lt;br /&gt;
**5 - Redirect (ICMPv4)&lt;br /&gt;
**8 - Inbound Echo Request (ICMPv4)&lt;br /&gt;
**9 - Inbound Router Request (ICMPv4)&lt;br /&gt;
**11 - Outbound Time Exceeded (ICMPv4)&lt;br /&gt;
**12 - Outbound Parameter Problem (ICMPv4)&lt;br /&gt;
**13 - Inbound Timespamp Request (ICMPv4)&lt;br /&gt;
**17 - Inbound Mask Request (ICMPv4)&lt;br /&gt;
**1 - Outbound Destination Unreachable (ICMPv6)&lt;br /&gt;
**2 - Outbound Packet Too Big (ICMPv6)&lt;br /&gt;
**3 - Outbound Time Exceeded (ICMPv6)&lt;br /&gt;
**4 - Outbound Parameter Problem (ICMPv6)&lt;br /&gt;
**128 - Inbound Echo Request (ICMPv6)&lt;br /&gt;
**137 - Redirect (ICMPv6)&lt;br /&gt;
*direction&lt;br /&gt;
**1 - In&lt;br /&gt;
**2 - Out&lt;br /&gt;
*profile&lt;br /&gt;
**1 - Domain &lt;br /&gt;
**2 - Private&lt;br /&gt;
**4 - Public&lt;br /&gt;
**2147483647 - All profiles&lt;br /&gt;
*action&lt;br /&gt;
**0 - Block&lt;br /&gt;
**1 - Allow&lt;br /&gt;
*application - Name of the application (can be empty)&lt;br /&gt;
*icmp_types_and_codes - Specified icmp types and codes&lt;br /&gt;
*group - Put the rule in this specified group (can be empty) &lt;br /&gt;
**&#039;&#039;&#039;Note&#039;&#039;&#039;: On Vista the group must the a resource string in a exe/dll e.g. &amp;quot;@C:\Program Files\My Application\myapp.exe,-10000&amp;quot;. On all other supported operating systems it can be a string value.&lt;br /&gt;
*local_ports - Local ports (can be empty)&lt;br /&gt;
*remote_ports - Remote ports (can be empty)&lt;br /&gt;
*local_address - Local ip address (can be empty)&lt;br /&gt;
*remote_addresses - Remote addresses from which the port can listen for traffic&lt;br /&gt;
*status - Status of the port, application, rule, firewall or service for example enabled/disabled, start/stop or allow/disallow&lt;br /&gt;
**0 - Disabled, stop or disallow&lt;br /&gt;
**1 - Enabled, start, or allow&lt;br /&gt;
&lt;br /&gt;
== The Sample Script ==&lt;br /&gt;
In this script you can find the two most used functions. If you are searching for some special firewall exceptions please look at &amp;quot;The Sample Script (All Functions)&amp;quot;. &lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
; Add an application to the firewall exception list - All Networks - All IP Version - Enabled&lt;br /&gt;
  SimpleFC::AddApplication &amp;quot;My Application&amp;quot; &amp;quot;PathToApplication&amp;quot; 0 2 &amp;quot;&amp;quot; 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Remove an application from the firewall exception list&lt;br /&gt;
  SimpleFC::RemoveApplication &amp;quot;PathToApplication&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== The Sample Script (All Functions) ==&lt;br /&gt;
In this script you can find the examples of all functions provided by this plugin.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Add the port 37/TCP to the firewall exception list - All Networks - All IP Version - Enabled&lt;br /&gt;
  SimpleFC::AddPort 37 &amp;quot;My Application&amp;quot; 6 0 2 &amp;quot;&amp;quot; 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if the port 37/TCP is added to the firewall exception list&lt;br /&gt;
  SimpleFC::IsPortAdded 37 6&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Added/0=Not added&lt;br /&gt;
&lt;br /&gt;
; Remove the port 37/TCP from the firewall exception list&lt;br /&gt;
  SimpleFC::RemovePort 37 6&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if the port 37/TCP is enabled/disabled&lt;br /&gt;
  SimpleFC::IsPortEnabled 37 6&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Enabled/0=Not enabled&lt;br /&gt;
&lt;br /&gt;
; Disable the port 37/TCP&lt;br /&gt;
  SimpleFC::EnableDisablePort 37 6 0&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable the port 37/TCP&lt;br /&gt;
  SimpleFC::EnableDisablePort 37 6 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if an application is enabled/disabled&lt;br /&gt;
  SimpleFC::IsApplicationEnabled &amp;quot;PathToApplication&amp;quot; &lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Enabled/0=Not enabled&lt;br /&gt;
&lt;br /&gt;
; Disable the application&lt;br /&gt;
  SimpleFC::EnableDisableApplication &amp;quot;PathToApplication&amp;quot; 0&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable the application&lt;br /&gt;
  SimpleFC::EnableDisableApplication &amp;quot;PathToApplication&amp;quot; 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Add an application to the firewall exception list - All Networks - All IP Version - Enabled&lt;br /&gt;
  SimpleFC::AddApplication &amp;quot;My Application&amp;quot; &amp;quot;PathToApplication&amp;quot; 0 2 &amp;quot;&amp;quot; 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if the application is added to the firewall exception list&lt;br /&gt;
  SimpleFC::IsApplicationAdded &amp;quot;PathToApplication&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Added/0=Not added&lt;br /&gt;
&lt;br /&gt;
; Remove an application from the firewall exception list&lt;br /&gt;
  SimpleFC::RemoveApplication &amp;quot;PathToApplication&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Disable the windows firewall&lt;br /&gt;
  SimpleFC::EnableDisableFirewall 0&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable the windows firewall&lt;br /&gt;
  SimpleFC::EnableDisableFirewall 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if the firewall is enabled&lt;br /&gt;
  SimpleFC::IsFirewallEnabled &lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Enabled/0=Disabled&lt;br /&gt;
&lt;br /&gt;
; Enable exceptions are not allowed on the windows firewall&lt;br /&gt;
  SimpleFC::AllowDisallowExceptionsNotAllowed 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Disable exceptions are not allowed on the windows firewall&lt;br /&gt;
  SimpleFC::AllowDisallowExceptionsNotAllowed 0&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if exceptions are not allowed&lt;br /&gt;
  SimpleFC::AreExceptionsNotAllowed&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Exceptions are not allowed is &lt;br /&gt;
         ; activated/0=Exception are not allowed is deactivated&lt;br /&gt;
&lt;br /&gt;
; Enable notifications on the windows firewall&lt;br /&gt;
  SimpleFC::EnableDisableNotifications 1&lt;br /&gt;
&lt;br /&gt;
; Disable notifications on the windows firewall&lt;br /&gt;
  SimpleFC::EnableDisableNotifications 0&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if notifications are enabled/disabled&lt;br /&gt;
  SimpleFC::AreNotificationsEnabled &lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Enabled/0=Disabled&lt;br /&gt;
&lt;br /&gt;
; Starts the windows firewall service&lt;br /&gt;
  SimpleFC::StartStopFirewallService 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Stops the windows firewall service&lt;br /&gt;
  SimpleFC::StartStopFirewallService 0&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if windows firewall service is running&lt;br /&gt;
  SimpleFC::IsFirewallServiceRunning&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=IsRunning/0=Not Running&lt;br /&gt;
&lt;br /&gt;
; Sets the windows firewall to default settings&lt;br /&gt;
  SimpleFC::RestoreDefaults&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP outbound destination unreachable state&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpOutboundDestinationUnreachable 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP redirect state&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpRedirect 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP inbound echo request &lt;br /&gt;
  SimpleFC::AllowDisallowIcmpInboundEchoRequest 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP outbound time exceeded&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpOutboundTimeExceeded 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP outbound parameter problem&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpOutboundParameterProblem 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP outbound source quench&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpOutboundSourceQuench 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP inbound router request&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpInboundRouterRequest 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP inbound timestamp request&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpInboundTimestampRequest 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP inbound mask request&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpInboundMaskRequest 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP outbound packet too big&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpOutboundPacketTooBig 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if ICMPv4 echo request is allowed&lt;br /&gt;
  SimpleFC::IsIcmpTypeAllowed &amp;quot;0&amp;quot; &amp;quot;&amp;quot; &amp;quot;8&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Restricted/0=Not restricted&lt;br /&gt;
  Pop $2 ; return 1=Allowed/0=Not allowed &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Some example rules for the windows firewall with advanced security.&lt;br /&gt;
; Please note this functions are very powerful, so for a detailed &lt;br /&gt;
; description please read the windows firewall with advanced &lt;br /&gt;
; security api reference:&lt;br /&gt;
; http://msdn2.microsoft.com/en-us/library/aa365309.aspx&lt;br /&gt;
&lt;br /&gt;
; Adds an ICMPv4 rule to allow incoming echo reply messages (IcmpCodeAndType = 0:0)&lt;br /&gt;
  SimpleFC::AdvAddRule &amp;quot;Echo-Reply (ICMPv4 incoming)&amp;quot; \&lt;br /&gt;
    &amp;quot;Allows incoming Echo Replies messages.&amp;quot; &amp;quot;1&amp;quot; &amp;quot;1&amp;quot; &amp;quot;1&amp;quot; &amp;quot;7&amp;quot; &amp;quot;1&amp;quot; &amp;quot;&amp;quot; \ &lt;br /&gt;
    &amp;quot;0:0&amp;quot; &amp;quot;@PathToApplication,-10000&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Adds an ICMPv4 rule to allow incoming echo request messages (IcmpCodeAndType = 8:0)&lt;br /&gt;
  SimpleFC::AdvAddRule &amp;quot;Echo-Request (ICMPv4 incoming)&amp;quot; \&lt;br /&gt;
    &amp;quot;Allows incoming ICMP Echo messages.&amp;quot; &amp;quot;1&amp;quot; &amp;quot;1&amp;quot; &amp;quot;1&amp;quot; &amp;quot;7&amp;quot; &amp;quot;1&amp;quot; &amp;quot;&amp;quot; \&lt;br /&gt;
    &amp;quot;8:0&amp;quot; &amp;quot;@PathToApplication,-10000&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Add an application rule to allow incoming TCP access on this application&lt;br /&gt;
  SimpleFC::AdvAddRule &amp;quot;Incoming requests (TCP incoming)&amp;quot; \ &lt;br /&gt;
    &amp;quot;Allows incoming requests.&amp;quot; &amp;quot;6&amp;quot; &amp;quot;1&amp;quot; &amp;quot;1&amp;quot; &amp;quot;7&amp;quot; &amp;quot;1&amp;quot; &amp;quot;PathToApplication&amp;quot; \ &lt;br /&gt;
    &amp;quot;&amp;quot; &amp;quot;@PathToApplication,-10000&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Add an application rule to allow incoming UDP access on this application&lt;br /&gt;
  SimpleFC::AdvAddRule &amp;quot;Incoming requests (UDP incoming)&amp;quot; \&lt;br /&gt;
    &amp;quot;Allows incoming requests.&amp;quot; &amp;quot;17&amp;quot; &amp;quot;1&amp;quot; &amp;quot;1&amp;quot; &amp;quot;7&amp;quot; &amp;quot;1&amp;quot; &amp;quot;PathToApplication&amp;quot; \ &lt;br /&gt;
    &amp;quot;&amp;quot; &amp;quot;@PathToApplication,-10000&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Removes a firewall rule&lt;br /&gt;
  SimpleFC::AdvRemoveRule &amp;quot;Incoming requests (UDP incoming)&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if the firewall exists&lt;br /&gt;
  SimpleFC::AdvExistsRule &amp;quot;Incoming requests (UDP incoming)&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Exists/0=DoesnÂ´t exists&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Changelog ==&lt;br /&gt;
*Version 1.18 (2010-02-23)&lt;br /&gt;
**Documentation updated&lt;br /&gt;
*Version 1.17 (2009-09-05)&lt;br /&gt;
**Added changes from the service manager&lt;br /&gt;
**The following functions are now case insensitive:&lt;br /&gt;
***SimpleFC::IsApplicationAdded&lt;br /&gt;
***SimpleFC::IsApplicationEnabled&lt;br /&gt;
***SimpleFC::EnableDisableApplication&lt;br /&gt;
***SimpleFC::AdvExistsRule&lt;br /&gt;
*Version 1.16 (2009-04-13)&lt;br /&gt;
**Added changes from the service manager&lt;br /&gt;
*Version 1.15 (2008-08-18)&lt;br /&gt;
**Added changes from the service manager and checked removed compiler optimization to avoid a false-positive virusscan.&lt;br /&gt;
*Version 1.14 (2008-02-05)&lt;br /&gt;
** Added changes from the service manager&lt;br /&gt;
*Version 1.13 (2008-01-29)&lt;br /&gt;
** Added changes from the service manager&lt;br /&gt;
*Version 1.12 (2007-11-13)&lt;br /&gt;
** Fixed wrong documentation about SimpleFC::AdvExistsRule&lt;br /&gt;
*Version 1.11 (2007-08-07)&lt;br /&gt;
** Fixed potential endless loop bug in SimpleFC::StartStopFirewallService&lt;br /&gt;
*Version 1.10 (2007-08-02)&lt;br /&gt;
** Added default firewall functions:&lt;br /&gt;
*** SimpleFC::RestoreDefaults&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpOutboundDestinationUnreachable&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpRedirect&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpInboundEchoRequest&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpOutboundTimeExceeded&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpOutboundParameterProblem&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpOutboundSourceQuench&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpInboundRouterRequest&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpInboundTimestampRequest&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpInboundMaskRequest&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpOutboundPacketTooBig&lt;br /&gt;
*** SimpleFC::IsIcmpTypeAllowed&lt;br /&gt;
** Added functions for Windows Firewall with Advanced Security&lt;br /&gt;
*** SimpleFC::AdvAddRule&lt;br /&gt;
*** SimpleFC::AdvRemoveRule&lt;br /&gt;
*** SimpleFC::AdvExistsRule&lt;br /&gt;
*Version 1.01 (2007-07-05)&lt;br /&gt;
**Changed missing documentation about the function SimpleFC::IsFirewallEnabled&lt;br /&gt;
*Version 1.0 (2007-05-02)&lt;br /&gt;
**First offical version&lt;br /&gt;
&lt;br /&gt;
== Important Notes ==&lt;br /&gt;
&lt;br /&gt;
*This plugin is running on Windows XP SP2, Windows 2003, Windows Vista, Windows 2008 and Windows 7&lt;br /&gt;
*Before you execute some plugin commands it is recommend to check for windows firewall service is running (SimpleFC::IsFirewallServiceRunning).&lt;br /&gt;
*All functions with the prefix &amp;quot;Adv&amp;quot; are only for Windows Firewall with Advanced Security (Windows Vista and above). It is recommend to use these functions on the operating systems. Nethertheless, the default functions without the prefix &amp;quot;Adv&amp;quot; can be used.&lt;br /&gt;
* If you have any suggestions, comments or questions please mail me: mailto:rainer@speed-soft.de&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Plugins]]&lt;/div&gt;</summary>
		<author><name>Speed78</name></author>
	</entry>
	<entry>
		<id>https://nsis.sourceforge.io/mediawiki/index.php?title=NSIS_Simple_Firewall_Plugin&amp;diff=19341</id>
		<title>NSIS Simple Firewall Plugin</title>
		<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/mediawiki/index.php?title=NSIS_Simple_Firewall_Plugin&amp;diff=19341"/>
		<updated>2011-02-03T17:43:04Z</updated>

		<summary type="html">&lt;p&gt;Speed78: /* Important Notes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This plugin can be used to configure the Windows firewall. This plugin contains functions to enable, check, add or remove programs or ports to the firewall exception list. It also contains functions for checking the firewall status, enable or disable the firewall and so on.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This plugin is using the MPL License or alternatively the LGPL License.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
&amp;lt;attach&amp;gt;NSIS_Simple_Firewall_Plugin_1.18.zip&amp;lt;/attach&amp;gt; The ZIP file containing a precompiled plugin DLL (to be saved in NSIS&#039; plugin directory) and the sources.&lt;br /&gt;
&lt;br /&gt;
== Donation ==&lt;br /&gt;
If you believe that I am doing a good job and you want to support me please [http://www.speed-soft.de/donation/index.php?language=en donate] any amount via PayPal.&lt;br /&gt;
&lt;br /&gt;
== Short Reference ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
SimpleFC::EnableDisableFirewall [status]&lt;br /&gt;
SimpleFC::IsFirewallEnabled  &lt;br /&gt;
 &lt;br /&gt;
SimpleFC::AllowDisallowExceptionsNotAllowed [status]&lt;br /&gt;
SimpleFC::AreExceptionsNotAllowed  &lt;br /&gt;
 &lt;br /&gt;
SimpleFC::EnableDisableNotifications [status]&lt;br /&gt;
SimpleFC::AreNotificationsEnabled  &lt;br /&gt;
 &lt;br /&gt;
SimpleFC::StartStopFirewallService [status]&lt;br /&gt;
SimpleFC::IsFirewallServiceRunning  &lt;br /&gt;
 &lt;br /&gt;
SimpleFC::AddPort [port] [name] [protocol] [scope] [ip_version] [remote_addresses] [status]&lt;br /&gt;
SimpleFC::IsPortAdded [port] [protocol]&lt;br /&gt;
SimpleFC::RemovePort [port] [protocol]&lt;br /&gt;
 &lt;br /&gt;
SimpleFC::IsPortEnabled [port] [protocol]&lt;br /&gt;
SimpleFC::EnableDisablePort [port] [protocol]&lt;br /&gt;
 &lt;br /&gt;
SimpleFC::AddApplication [name] [path] [scope] [ip_version] [remote_addresses] [status]&lt;br /&gt;
SimpleFC::IsApplicationAdded [path]&lt;br /&gt;
SimpleFC::RemoveApplication [path]&lt;br /&gt;
 &lt;br /&gt;
SimpleFC::IsApplicationEnabled [path]&lt;br /&gt;
SimpleFC::EnableDisableApplication [path]&lt;br /&gt;
&lt;br /&gt;
SimpleFC::RestoreDefaults&lt;br /&gt;
&lt;br /&gt;
SimpleFC::AllowDisallowIcmpOutboundDestinationUnreachable [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpRedirect [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpInboundEchoRequest [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpOutboundTimeExceeded [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpOutboundParameterProblem [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpOutboundSourceQuench [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpInboundRouterRequest [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpInboundTimestampRequest [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpInboundMaskRequest [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpOutboundPacketTooBig [status]&lt;br /&gt;
SimpleFC::IsIcmpTypeAllowed [ip_version] [local_address] [icmp_type]&lt;br /&gt;
&lt;br /&gt;
SimpleFC::AdvAddRule [name] [description] [protocol] [direction] &lt;br /&gt;
  [status] [profile] [action] [application] [icmp_types_and_codes] &lt;br /&gt;
  [group] [local_ports] [remote_ports] [local_address] [remote_address]&lt;br /&gt;
SimpleFC::AdvRemoveRule [name]&lt;br /&gt;
SimpleFC::AdvExistsRule [name]&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
*port - TCP/UDP port which should be opened/closed&lt;br /&gt;
*name - The name of the application/port/rule&lt;br /&gt;
*description - Description of the rule&lt;br /&gt;
*protocol - One of the following protocol&lt;br /&gt;
**1 - ICMPv4&lt;br /&gt;
**6 - TCP&lt;br /&gt;
**17 - UDP&lt;br /&gt;
**58 - ICMPv6&lt;br /&gt;
*scope - One of the following scope&lt;br /&gt;
**0 - All networks&lt;br /&gt;
**1 - Only local subnets&lt;br /&gt;
**2 - Custom scope&lt;br /&gt;
**3 - Max&lt;br /&gt;
**NOTE: If you use custom you must define remote_addresses&lt;br /&gt;
*ip_version&lt;br /&gt;
**0 - IPv4&lt;br /&gt;
**1 - IPv6&lt;br /&gt;
**2 - Any protocol&lt;br /&gt;
*icmp_type&lt;br /&gt;
**3 - Outbound Destination Unreachable (ICMPv4)&lt;br /&gt;
**4 - Outbound Source Quench (ICMPv4)&lt;br /&gt;
**5 - Redirect (ICMPv4)&lt;br /&gt;
**8 - Inbound Echo Request (ICMPv4)&lt;br /&gt;
**9 - Inbound Router Request (ICMPv4)&lt;br /&gt;
**11 - Outbound Time Exceeded (ICMPv4)&lt;br /&gt;
**12 - Outbound Parameter Problem (ICMPv4)&lt;br /&gt;
**13 - Inbound Timespamp Request (ICMPv4)&lt;br /&gt;
**17 - Inbound Mask Request (ICMPv4)&lt;br /&gt;
**1 - Outbound Destination Unreachable (ICMPv6)&lt;br /&gt;
**2 - Outbound Packet Too Big (ICMPv6)&lt;br /&gt;
**3 - Outbound Time Exceeded (ICMPv6)&lt;br /&gt;
**4 - Outbound Parameter Problem (ICMPv6)&lt;br /&gt;
**128 - Inbound Echo Request (ICMPv6)&lt;br /&gt;
**137 - Redirect (ICMPv6)&lt;br /&gt;
*direction&lt;br /&gt;
**1 - In&lt;br /&gt;
**2 - Out&lt;br /&gt;
*profile&lt;br /&gt;
**1 - Domain &lt;br /&gt;
**2 - Private&lt;br /&gt;
**4 - Public&lt;br /&gt;
**2147483647 - All profiles&lt;br /&gt;
*action&lt;br /&gt;
**0 - Block&lt;br /&gt;
**1 - Allow&lt;br /&gt;
*application - Name of the application (can be empty)&lt;br /&gt;
*icmp_types_and_codes - Specified icmp types and codes&lt;br /&gt;
*group - Put the rule in this specified group (can be empty) &lt;br /&gt;
**&#039;&#039;&#039;Note&#039;&#039;&#039;: On Vista the group must the a resource string in a exe/dll e.g. &amp;quot;@C:\Program Files\My Application\myapp.exe,-10000&amp;quot;. On all other supported operating systems it can be a string value.&lt;br /&gt;
*local_ports - Local ports (can be empty)&lt;br /&gt;
*remote_ports - Remote ports (can be empty)&lt;br /&gt;
*local_address - Local ip address (can be empty)&lt;br /&gt;
*remote_addresses - Remote addresses from which the port can listen for traffic&lt;br /&gt;
*status - Status of the port, application, rule, firewall or service for example enabled/disabled, start/stop or allow/disallow&lt;br /&gt;
**0 - Disabled, stop or disallow&lt;br /&gt;
**1 - Enabled, start, or allow&lt;br /&gt;
&lt;br /&gt;
== The Sample Script ==&lt;br /&gt;
In this script you can find the two most used functions. If you are searching for some special firewall exceptions please look at &amp;quot;The Sample Script (All Functions)&amp;quot;. &lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
; Add an application to the firewall exception list - All Networks - All IP Version - Enabled&lt;br /&gt;
  SimpleFC::AddApplication &amp;quot;My Application&amp;quot; &amp;quot;PathToApplication&amp;quot; 0 2 &amp;quot;&amp;quot; 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Remove an application from the firewall exception list&lt;br /&gt;
  SimpleFC::RemoveApplication &amp;quot;PathToApplication&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== The Sample Script (All Functions) ==&lt;br /&gt;
In this script you can find the examples of all functions provided by this plugin.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Add the port 37/TCP to the firewall exception list - All Networks - All IP Version - Enabled&lt;br /&gt;
  SimpleFC::AddPort 37 &amp;quot;My Application&amp;quot; 6 0 2 &amp;quot;&amp;quot; 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if the port 37/TCP is added to the firewall exception list&lt;br /&gt;
  SimpleFC::IsPortAdded 37 6&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Added/0=Not added&lt;br /&gt;
&lt;br /&gt;
; Remove the port 37/TCP from the firewall exception list&lt;br /&gt;
  SimpleFC::RemovePort 37 6&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if the port 37/TCP is enabled/disabled&lt;br /&gt;
  SimpleFC::IsPortEnabled 37 6&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Enabled/0=Not enabled&lt;br /&gt;
&lt;br /&gt;
; Disable the port 37/TCP&lt;br /&gt;
  SimpleFC::EnableDisablePort 37 6 0&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable the port 37/TCP&lt;br /&gt;
  SimpleFC::EnableDisablePort 37 6 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if an application is enabled/disabled&lt;br /&gt;
  SimpleFC::IsApplicationEnabled &amp;quot;PathToApplication&amp;quot; &lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Enabled/0=Not enabled&lt;br /&gt;
&lt;br /&gt;
; Disable the application&lt;br /&gt;
  SimpleFC::EnableDisableApplication &amp;quot;PathToApplication&amp;quot; 0&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable the application&lt;br /&gt;
  SimpleFC::EnableDisableApplication &amp;quot;PathToApplication&amp;quot; 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Add an application to the firewall exception list - All Networks - All IP Version - Enabled&lt;br /&gt;
  SimpleFC::AddApplication &amp;quot;My Application&amp;quot; &amp;quot;PathToApplication&amp;quot; 0 2 &amp;quot;&amp;quot; 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if the application is added to the firewall exception list&lt;br /&gt;
  SimpleFC::IsApplicationAdded &amp;quot;PathToApplication&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Added/0=Not added&lt;br /&gt;
&lt;br /&gt;
; Remove an application from the firewall exception list&lt;br /&gt;
  SimpleFC::RemoveApplication &amp;quot;PathToApplication&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Disable the windows firewall&lt;br /&gt;
  SimpleFC::EnableDisableFirewall 0&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable the windows firewall&lt;br /&gt;
  SimpleFC::EnableDisableFirewall 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if the firewall is enabled&lt;br /&gt;
  SimpleFC::IsFirewallEnabled &lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Enabled/0=Disabled&lt;br /&gt;
&lt;br /&gt;
; Enable exceptions are not allowed on the windows firewall&lt;br /&gt;
  SimpleFC::AllowDisallowExceptionsNotAllowed 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Disable exceptions are not allowed on the windows firewall&lt;br /&gt;
  SimpleFC::AllowDisallowExceptionsNotAllowed 0&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if exceptions are not allowed&lt;br /&gt;
  SimpleFC::AreExceptionsNotAllowed&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Exceptions are not allowed is &lt;br /&gt;
         ; activated/0=Exception are not allowed is deactivated&lt;br /&gt;
&lt;br /&gt;
; Enable notifications on the windows firewall&lt;br /&gt;
  SimpleFC::EnableDisableNotifications 1&lt;br /&gt;
&lt;br /&gt;
; Disable notifications on the windows firewall&lt;br /&gt;
  SimpleFC::EnableDisableNotifications 0&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if notifications are enabled/disabled&lt;br /&gt;
  SimpleFC::AreNotificationsEnabled &lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Enabled/0=Disabled&lt;br /&gt;
&lt;br /&gt;
; Starts the windows firewall service&lt;br /&gt;
  SimpleFC::StartStopFirewallService 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Stops the windows firewall service&lt;br /&gt;
  SimpleFC::StartStopFirewallService 0&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if windows firewall service is running&lt;br /&gt;
  SimpleFC::IsFirewallServiceRunning&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=IsRunning/0=Not Running&lt;br /&gt;
&lt;br /&gt;
; Sets the windows firewall to default settings&lt;br /&gt;
  SimpleFC::RestoreDefaults&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP outbound destination unreachable state&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpOutboundDestinationUnreachable 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP redirect state&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpRedirect 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP inbound echo request &lt;br /&gt;
  SimpleFC::AllowDisallowIcmpInboundEchoRequest 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP outbound time exceeded&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpOutboundTimeExceeded 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP outbound parameter problem&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpOutboundParameterProblem 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP outbound source quench&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpOutboundSourceQuench 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP inbound router request&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpInboundRouterRequest 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP inbound timestamp request&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpInboundTimestampRequest 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP inbound mask request&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpInboundMaskRequest 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP outbound packet too big&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpOutboundPacketTooBig 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if ICMPv4 echo request is allowed&lt;br /&gt;
  SimpleFC::IsIcmpTypeAllowed &amp;quot;0&amp;quot; &amp;quot;&amp;quot; &amp;quot;8&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Restricted/0=Not restricted&lt;br /&gt;
  Pop $2 ; return 1=Allowed/0=Not allowed &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Some example rules for the windows firewall with advanced security.&lt;br /&gt;
; Please note this functions are very powerful, so for a detailed &lt;br /&gt;
; description please read the windows firewall with advanced &lt;br /&gt;
; security api reference:&lt;br /&gt;
; http://msdn2.microsoft.com/en-us/library/aa365309.aspx&lt;br /&gt;
&lt;br /&gt;
; Adds an ICMPv4 rule to allow incoming echo reply messages (IcmpCodeAndType = 0:0)&lt;br /&gt;
  SimpleFC::AdvAddRule &amp;quot;Echo-Reply (ICMPv4 incoming)&amp;quot; \&lt;br /&gt;
    &amp;quot;Allows incoming Echo Replies messages.&amp;quot; &amp;quot;1&amp;quot; &amp;quot;1&amp;quot; &amp;quot;1&amp;quot; &amp;quot;7&amp;quot; &amp;quot;1&amp;quot; &amp;quot;&amp;quot; \ &lt;br /&gt;
    &amp;quot;0:0&amp;quot; &amp;quot;@PathToApplication,-10000&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Adds an ICMPv4 rule to allow incoming echo request messages (IcmpCodeAndType = 8:0)&lt;br /&gt;
  SimpleFC::AdvAddRule &amp;quot;Echo-Request (ICMPv4 incoming)&amp;quot; \&lt;br /&gt;
    &amp;quot;Allows incoming ICMP Echo messages.&amp;quot; &amp;quot;1&amp;quot; &amp;quot;1&amp;quot; &amp;quot;1&amp;quot; &amp;quot;7&amp;quot; &amp;quot;1&amp;quot; &amp;quot;&amp;quot; \&lt;br /&gt;
    &amp;quot;8:0&amp;quot; &amp;quot;@PathToApplication,-10000&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Add an application rule to allow incoming TCP access on this application&lt;br /&gt;
  SimpleFC::AdvAddRule &amp;quot;Incoming requests (TCP incoming)&amp;quot; \ &lt;br /&gt;
    &amp;quot;Allows incoming requests.&amp;quot; &amp;quot;6&amp;quot; &amp;quot;1&amp;quot; &amp;quot;1&amp;quot; &amp;quot;7&amp;quot; &amp;quot;1&amp;quot; &amp;quot;PathToApplication&amp;quot; \ &lt;br /&gt;
    &amp;quot;&amp;quot; &amp;quot;@PathToApplication,-10000&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Add an application rule to allow incoming UDP access on this application&lt;br /&gt;
  SimpleFC::AdvAddRule &amp;quot;Incoming requests (UDP incoming)&amp;quot; \&lt;br /&gt;
    &amp;quot;Allows incoming requests.&amp;quot; &amp;quot;17&amp;quot; &amp;quot;1&amp;quot; &amp;quot;1&amp;quot; &amp;quot;7&amp;quot; &amp;quot;1&amp;quot; &amp;quot;PathToApplication&amp;quot; \ &lt;br /&gt;
    &amp;quot;&amp;quot; &amp;quot;@PathToApplication,-10000&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Removes a firewall rule&lt;br /&gt;
  SimpleFC::AdvRemoveRule &amp;quot;Incoming requests (UDP incoming)&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if the firewall exists&lt;br /&gt;
  SimpleFC::AdvExistsRule &amp;quot;Incoming requests (UDP incoming)&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Exists/0=DoesnÂ´t exists&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Changelog ==&lt;br /&gt;
*Version 1.18 (2010-02-23)&lt;br /&gt;
**Documentation updated&lt;br /&gt;
*Version 1.17 (2009-09-05)&lt;br /&gt;
**Added changes from the service manager&lt;br /&gt;
**The following functions are now case insensitive:&lt;br /&gt;
***SimpleFC::IsApplicationAdded&lt;br /&gt;
***SimpleFC::IsApplicationEnabled&lt;br /&gt;
***SimpleFC::EnableDisableApplication&lt;br /&gt;
***SimpleFC::AdvExistsRule&lt;br /&gt;
*Version 1.16 (2009-04-13)&lt;br /&gt;
**Added changes from the service manager&lt;br /&gt;
*Version 1.15 (2008-08-18)&lt;br /&gt;
**Added changes from the service manager and checked removed compiler optimization to avoid a false-positive virusscan.&lt;br /&gt;
*Version 1.14 (2008-02-05)&lt;br /&gt;
** Added changes from the service manager&lt;br /&gt;
*Version 1.13 (2008-01-29)&lt;br /&gt;
** Added changes from the service manager&lt;br /&gt;
*Version 1.12 (2007-11-13)&lt;br /&gt;
** Fixed wrong documentation about SimpleFC::AdvExistsRule&lt;br /&gt;
*Version 1.11 (2007-08-07)&lt;br /&gt;
** Fixed potential endless loop bug in SimpleFC::StartStopFirewallService&lt;br /&gt;
*Version 1.10 (2007-08-02)&lt;br /&gt;
** Added default firewall functions:&lt;br /&gt;
*** SimpleFC::RestoreDefaults&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpOutboundDestinationUnreachable&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpRedirect&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpInboundEchoRequest&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpOutboundTimeExceeded&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpOutboundParameterProblem&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpOutboundSourceQuench&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpInboundRouterRequest&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpInboundTimestampRequest&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpInboundMaskRequest&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpOutboundPacketTooBig&lt;br /&gt;
*** SimpleFC::IsIcmpTypeAllowed&lt;br /&gt;
** Added functions for Windows Firewall with Advanced Security&lt;br /&gt;
*** SimpleFC::AdvAddRule&lt;br /&gt;
*** SimpleFC::AdvRemoveRule&lt;br /&gt;
*** SimpleFC::AdvExistsRule&lt;br /&gt;
*Version 1.01 (2007-07-05)&lt;br /&gt;
**Changed missing documentation about the function SimpleFC::IsFirewallEnabled&lt;br /&gt;
*Version 1.0 (2007-05-02)&lt;br /&gt;
**First offical version&lt;br /&gt;
&lt;br /&gt;
== Important Notes ==&lt;br /&gt;
&lt;br /&gt;
*This plugin is running on Windows XP SP2, Windows 2003, Windows Vista, Windows 2008 and Windows 7&lt;br /&gt;
*Before you execute some plugin commands it is recommend to check for windows firewall service is running (SimpleFC::IsFirewallServiceRunning).&lt;br /&gt;
*All functions with the prefix &amp;quot;Adv&amp;quot; are only for Windows Firewall with Advanced Security (Windows Vista and above) and it is recommend to use it on these operating systems. Nethertheless you can you the functions without the prefix &amp;quot;adv&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
* If you have any suggestions, comments or questions please mail me: mailto:rainer@speed-soft.de&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Plugins]]&lt;/div&gt;</summary>
		<author><name>Speed78</name></author>
	</entry>
	<entry>
		<id>https://nsis.sourceforge.io/mediawiki/index.php?title=NSIS_Simple_Firewall_Plugin&amp;diff=19340</id>
		<title>NSIS Simple Firewall Plugin</title>
		<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/mediawiki/index.php?title=NSIS_Simple_Firewall_Plugin&amp;diff=19340"/>
		<updated>2011-02-03T17:41:19Z</updated>

		<summary type="html">&lt;p&gt;Speed78: /* Important Notes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This plugin can be used to configure the Windows firewall. This plugin contains functions to enable, check, add or remove programs or ports to the firewall exception list. It also contains functions for checking the firewall status, enable or disable the firewall and so on.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This plugin is using the MPL License or alternatively the LGPL License.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
&amp;lt;attach&amp;gt;NSIS_Simple_Firewall_Plugin_1.18.zip&amp;lt;/attach&amp;gt; The ZIP file containing a precompiled plugin DLL (to be saved in NSIS&#039; plugin directory) and the sources.&lt;br /&gt;
&lt;br /&gt;
== Donation ==&lt;br /&gt;
If you believe that I am doing a good job and you want to support me please [http://www.speed-soft.de/donation/index.php?language=en donate] any amount via PayPal.&lt;br /&gt;
&lt;br /&gt;
== Short Reference ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
SimpleFC::EnableDisableFirewall [status]&lt;br /&gt;
SimpleFC::IsFirewallEnabled  &lt;br /&gt;
 &lt;br /&gt;
SimpleFC::AllowDisallowExceptionsNotAllowed [status]&lt;br /&gt;
SimpleFC::AreExceptionsNotAllowed  &lt;br /&gt;
 &lt;br /&gt;
SimpleFC::EnableDisableNotifications [status]&lt;br /&gt;
SimpleFC::AreNotificationsEnabled  &lt;br /&gt;
 &lt;br /&gt;
SimpleFC::StartStopFirewallService [status]&lt;br /&gt;
SimpleFC::IsFirewallServiceRunning  &lt;br /&gt;
 &lt;br /&gt;
SimpleFC::AddPort [port] [name] [protocol] [scope] [ip_version] [remote_addresses] [status]&lt;br /&gt;
SimpleFC::IsPortAdded [port] [protocol]&lt;br /&gt;
SimpleFC::RemovePort [port] [protocol]&lt;br /&gt;
 &lt;br /&gt;
SimpleFC::IsPortEnabled [port] [protocol]&lt;br /&gt;
SimpleFC::EnableDisablePort [port] [protocol]&lt;br /&gt;
 &lt;br /&gt;
SimpleFC::AddApplication [name] [path] [scope] [ip_version] [remote_addresses] [status]&lt;br /&gt;
SimpleFC::IsApplicationAdded [path]&lt;br /&gt;
SimpleFC::RemoveApplication [path]&lt;br /&gt;
 &lt;br /&gt;
SimpleFC::IsApplicationEnabled [path]&lt;br /&gt;
SimpleFC::EnableDisableApplication [path]&lt;br /&gt;
&lt;br /&gt;
SimpleFC::RestoreDefaults&lt;br /&gt;
&lt;br /&gt;
SimpleFC::AllowDisallowIcmpOutboundDestinationUnreachable [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpRedirect [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpInboundEchoRequest [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpOutboundTimeExceeded [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpOutboundParameterProblem [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpOutboundSourceQuench [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpInboundRouterRequest [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpInboundTimestampRequest [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpInboundMaskRequest [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpOutboundPacketTooBig [status]&lt;br /&gt;
SimpleFC::IsIcmpTypeAllowed [ip_version] [local_address] [icmp_type]&lt;br /&gt;
&lt;br /&gt;
SimpleFC::AdvAddRule [name] [description] [protocol] [direction] &lt;br /&gt;
  [status] [profile] [action] [application] [icmp_types_and_codes] &lt;br /&gt;
  [group] [local_ports] [remote_ports] [local_address] [remote_address]&lt;br /&gt;
SimpleFC::AdvRemoveRule [name]&lt;br /&gt;
SimpleFC::AdvExistsRule [name]&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
*port - TCP/UDP port which should be opened/closed&lt;br /&gt;
*name - The name of the application/port/rule&lt;br /&gt;
*description - Description of the rule&lt;br /&gt;
*protocol - One of the following protocol&lt;br /&gt;
**1 - ICMPv4&lt;br /&gt;
**6 - TCP&lt;br /&gt;
**17 - UDP&lt;br /&gt;
**58 - ICMPv6&lt;br /&gt;
*scope - One of the following scope&lt;br /&gt;
**0 - All networks&lt;br /&gt;
**1 - Only local subnets&lt;br /&gt;
**2 - Custom scope&lt;br /&gt;
**3 - Max&lt;br /&gt;
**NOTE: If you use custom you must define remote_addresses&lt;br /&gt;
*ip_version&lt;br /&gt;
**0 - IPv4&lt;br /&gt;
**1 - IPv6&lt;br /&gt;
**2 - Any protocol&lt;br /&gt;
*icmp_type&lt;br /&gt;
**3 - Outbound Destination Unreachable (ICMPv4)&lt;br /&gt;
**4 - Outbound Source Quench (ICMPv4)&lt;br /&gt;
**5 - Redirect (ICMPv4)&lt;br /&gt;
**8 - Inbound Echo Request (ICMPv4)&lt;br /&gt;
**9 - Inbound Router Request (ICMPv4)&lt;br /&gt;
**11 - Outbound Time Exceeded (ICMPv4)&lt;br /&gt;
**12 - Outbound Parameter Problem (ICMPv4)&lt;br /&gt;
**13 - Inbound Timespamp Request (ICMPv4)&lt;br /&gt;
**17 - Inbound Mask Request (ICMPv4)&lt;br /&gt;
**1 - Outbound Destination Unreachable (ICMPv6)&lt;br /&gt;
**2 - Outbound Packet Too Big (ICMPv6)&lt;br /&gt;
**3 - Outbound Time Exceeded (ICMPv6)&lt;br /&gt;
**4 - Outbound Parameter Problem (ICMPv6)&lt;br /&gt;
**128 - Inbound Echo Request (ICMPv6)&lt;br /&gt;
**137 - Redirect (ICMPv6)&lt;br /&gt;
*direction&lt;br /&gt;
**1 - In&lt;br /&gt;
**2 - Out&lt;br /&gt;
*profile&lt;br /&gt;
**1 - Domain &lt;br /&gt;
**2 - Private&lt;br /&gt;
**4 - Public&lt;br /&gt;
**2147483647 - All profiles&lt;br /&gt;
*action&lt;br /&gt;
**0 - Block&lt;br /&gt;
**1 - Allow&lt;br /&gt;
*application - Name of the application (can be empty)&lt;br /&gt;
*icmp_types_and_codes - Specified icmp types and codes&lt;br /&gt;
*group - Put the rule in this specified group (can be empty) &lt;br /&gt;
**&#039;&#039;&#039;Note&#039;&#039;&#039;: On Vista the group must the a resource string in a exe/dll e.g. &amp;quot;@C:\Program Files\My Application\myapp.exe,-10000&amp;quot;. On all other supported operating systems it can be a string value.&lt;br /&gt;
*local_ports - Local ports (can be empty)&lt;br /&gt;
*remote_ports - Remote ports (can be empty)&lt;br /&gt;
*local_address - Local ip address (can be empty)&lt;br /&gt;
*remote_addresses - Remote addresses from which the port can listen for traffic&lt;br /&gt;
*status - Status of the port, application, rule, firewall or service for example enabled/disabled, start/stop or allow/disallow&lt;br /&gt;
**0 - Disabled, stop or disallow&lt;br /&gt;
**1 - Enabled, start, or allow&lt;br /&gt;
&lt;br /&gt;
== The Sample Script ==&lt;br /&gt;
In this script you can find the two most used functions. If you are searching for some special firewall exceptions please look at &amp;quot;The Sample Script (All Functions)&amp;quot;. &lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
; Add an application to the firewall exception list - All Networks - All IP Version - Enabled&lt;br /&gt;
  SimpleFC::AddApplication &amp;quot;My Application&amp;quot; &amp;quot;PathToApplication&amp;quot; 0 2 &amp;quot;&amp;quot; 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Remove an application from the firewall exception list&lt;br /&gt;
  SimpleFC::RemoveApplication &amp;quot;PathToApplication&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== The Sample Script (All Functions) ==&lt;br /&gt;
In this script you can find the examples of all functions provided by this plugin.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Add the port 37/TCP to the firewall exception list - All Networks - All IP Version - Enabled&lt;br /&gt;
  SimpleFC::AddPort 37 &amp;quot;My Application&amp;quot; 6 0 2 &amp;quot;&amp;quot; 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if the port 37/TCP is added to the firewall exception list&lt;br /&gt;
  SimpleFC::IsPortAdded 37 6&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Added/0=Not added&lt;br /&gt;
&lt;br /&gt;
; Remove the port 37/TCP from the firewall exception list&lt;br /&gt;
  SimpleFC::RemovePort 37 6&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if the port 37/TCP is enabled/disabled&lt;br /&gt;
  SimpleFC::IsPortEnabled 37 6&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Enabled/0=Not enabled&lt;br /&gt;
&lt;br /&gt;
; Disable the port 37/TCP&lt;br /&gt;
  SimpleFC::EnableDisablePort 37 6 0&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable the port 37/TCP&lt;br /&gt;
  SimpleFC::EnableDisablePort 37 6 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if an application is enabled/disabled&lt;br /&gt;
  SimpleFC::IsApplicationEnabled &amp;quot;PathToApplication&amp;quot; &lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Enabled/0=Not enabled&lt;br /&gt;
&lt;br /&gt;
; Disable the application&lt;br /&gt;
  SimpleFC::EnableDisableApplication &amp;quot;PathToApplication&amp;quot; 0&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable the application&lt;br /&gt;
  SimpleFC::EnableDisableApplication &amp;quot;PathToApplication&amp;quot; 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Add an application to the firewall exception list - All Networks - All IP Version - Enabled&lt;br /&gt;
  SimpleFC::AddApplication &amp;quot;My Application&amp;quot; &amp;quot;PathToApplication&amp;quot; 0 2 &amp;quot;&amp;quot; 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if the application is added to the firewall exception list&lt;br /&gt;
  SimpleFC::IsApplicationAdded &amp;quot;PathToApplication&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Added/0=Not added&lt;br /&gt;
&lt;br /&gt;
; Remove an application from the firewall exception list&lt;br /&gt;
  SimpleFC::RemoveApplication &amp;quot;PathToApplication&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Disable the windows firewall&lt;br /&gt;
  SimpleFC::EnableDisableFirewall 0&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable the windows firewall&lt;br /&gt;
  SimpleFC::EnableDisableFirewall 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if the firewall is enabled&lt;br /&gt;
  SimpleFC::IsFirewallEnabled &lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Enabled/0=Disabled&lt;br /&gt;
&lt;br /&gt;
; Enable exceptions are not allowed on the windows firewall&lt;br /&gt;
  SimpleFC::AllowDisallowExceptionsNotAllowed 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Disable exceptions are not allowed on the windows firewall&lt;br /&gt;
  SimpleFC::AllowDisallowExceptionsNotAllowed 0&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if exceptions are not allowed&lt;br /&gt;
  SimpleFC::AreExceptionsNotAllowed&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Exceptions are not allowed is &lt;br /&gt;
         ; activated/0=Exception are not allowed is deactivated&lt;br /&gt;
&lt;br /&gt;
; Enable notifications on the windows firewall&lt;br /&gt;
  SimpleFC::EnableDisableNotifications 1&lt;br /&gt;
&lt;br /&gt;
; Disable notifications on the windows firewall&lt;br /&gt;
  SimpleFC::EnableDisableNotifications 0&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if notifications are enabled/disabled&lt;br /&gt;
  SimpleFC::AreNotificationsEnabled &lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Enabled/0=Disabled&lt;br /&gt;
&lt;br /&gt;
; Starts the windows firewall service&lt;br /&gt;
  SimpleFC::StartStopFirewallService 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Stops the windows firewall service&lt;br /&gt;
  SimpleFC::StartStopFirewallService 0&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if windows firewall service is running&lt;br /&gt;
  SimpleFC::IsFirewallServiceRunning&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=IsRunning/0=Not Running&lt;br /&gt;
&lt;br /&gt;
; Sets the windows firewall to default settings&lt;br /&gt;
  SimpleFC::RestoreDefaults&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP outbound destination unreachable state&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpOutboundDestinationUnreachable 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP redirect state&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpRedirect 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP inbound echo request &lt;br /&gt;
  SimpleFC::AllowDisallowIcmpInboundEchoRequest 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP outbound time exceeded&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpOutboundTimeExceeded 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP outbound parameter problem&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpOutboundParameterProblem 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP outbound source quench&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpOutboundSourceQuench 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP inbound router request&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpInboundRouterRequest 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP inbound timestamp request&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpInboundTimestampRequest 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP inbound mask request&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpInboundMaskRequest 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP outbound packet too big&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpOutboundPacketTooBig 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if ICMPv4 echo request is allowed&lt;br /&gt;
  SimpleFC::IsIcmpTypeAllowed &amp;quot;0&amp;quot; &amp;quot;&amp;quot; &amp;quot;8&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Restricted/0=Not restricted&lt;br /&gt;
  Pop $2 ; return 1=Allowed/0=Not allowed &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Some example rules for the windows firewall with advanced security.&lt;br /&gt;
; Please note this functions are very powerful, so for a detailed &lt;br /&gt;
; description please read the windows firewall with advanced &lt;br /&gt;
; security api reference:&lt;br /&gt;
; http://msdn2.microsoft.com/en-us/library/aa365309.aspx&lt;br /&gt;
&lt;br /&gt;
; Adds an ICMPv4 rule to allow incoming echo reply messages (IcmpCodeAndType = 0:0)&lt;br /&gt;
  SimpleFC::AdvAddRule &amp;quot;Echo-Reply (ICMPv4 incoming)&amp;quot; \&lt;br /&gt;
    &amp;quot;Allows incoming Echo Replies messages.&amp;quot; &amp;quot;1&amp;quot; &amp;quot;1&amp;quot; &amp;quot;1&amp;quot; &amp;quot;7&amp;quot; &amp;quot;1&amp;quot; &amp;quot;&amp;quot; \ &lt;br /&gt;
    &amp;quot;0:0&amp;quot; &amp;quot;@PathToApplication,-10000&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Adds an ICMPv4 rule to allow incoming echo request messages (IcmpCodeAndType = 8:0)&lt;br /&gt;
  SimpleFC::AdvAddRule &amp;quot;Echo-Request (ICMPv4 incoming)&amp;quot; \&lt;br /&gt;
    &amp;quot;Allows incoming ICMP Echo messages.&amp;quot; &amp;quot;1&amp;quot; &amp;quot;1&amp;quot; &amp;quot;1&amp;quot; &amp;quot;7&amp;quot; &amp;quot;1&amp;quot; &amp;quot;&amp;quot; \&lt;br /&gt;
    &amp;quot;8:0&amp;quot; &amp;quot;@PathToApplication,-10000&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Add an application rule to allow incoming TCP access on this application&lt;br /&gt;
  SimpleFC::AdvAddRule &amp;quot;Incoming requests (TCP incoming)&amp;quot; \ &lt;br /&gt;
    &amp;quot;Allows incoming requests.&amp;quot; &amp;quot;6&amp;quot; &amp;quot;1&amp;quot; &amp;quot;1&amp;quot; &amp;quot;7&amp;quot; &amp;quot;1&amp;quot; &amp;quot;PathToApplication&amp;quot; \ &lt;br /&gt;
    &amp;quot;&amp;quot; &amp;quot;@PathToApplication,-10000&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Add an application rule to allow incoming UDP access on this application&lt;br /&gt;
  SimpleFC::AdvAddRule &amp;quot;Incoming requests (UDP incoming)&amp;quot; \&lt;br /&gt;
    &amp;quot;Allows incoming requests.&amp;quot; &amp;quot;17&amp;quot; &amp;quot;1&amp;quot; &amp;quot;1&amp;quot; &amp;quot;7&amp;quot; &amp;quot;1&amp;quot; &amp;quot;PathToApplication&amp;quot; \ &lt;br /&gt;
    &amp;quot;&amp;quot; &amp;quot;@PathToApplication,-10000&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Removes a firewall rule&lt;br /&gt;
  SimpleFC::AdvRemoveRule &amp;quot;Incoming requests (UDP incoming)&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if the firewall exists&lt;br /&gt;
  SimpleFC::AdvExistsRule &amp;quot;Incoming requests (UDP incoming)&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Exists/0=DoesnÂ´t exists&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Changelog ==&lt;br /&gt;
*Version 1.18 (2010-02-23)&lt;br /&gt;
**Documentation updated&lt;br /&gt;
*Version 1.17 (2009-09-05)&lt;br /&gt;
**Added changes from the service manager&lt;br /&gt;
**The following functions are now case insensitive:&lt;br /&gt;
***SimpleFC::IsApplicationAdded&lt;br /&gt;
***SimpleFC::IsApplicationEnabled&lt;br /&gt;
***SimpleFC::EnableDisableApplication&lt;br /&gt;
***SimpleFC::AdvExistsRule&lt;br /&gt;
*Version 1.16 (2009-04-13)&lt;br /&gt;
**Added changes from the service manager&lt;br /&gt;
*Version 1.15 (2008-08-18)&lt;br /&gt;
**Added changes from the service manager and checked removed compiler optimization to avoid a false-positive virusscan.&lt;br /&gt;
*Version 1.14 (2008-02-05)&lt;br /&gt;
** Added changes from the service manager&lt;br /&gt;
*Version 1.13 (2008-01-29)&lt;br /&gt;
** Added changes from the service manager&lt;br /&gt;
*Version 1.12 (2007-11-13)&lt;br /&gt;
** Fixed wrong documentation about SimpleFC::AdvExistsRule&lt;br /&gt;
*Version 1.11 (2007-08-07)&lt;br /&gt;
** Fixed potential endless loop bug in SimpleFC::StartStopFirewallService&lt;br /&gt;
*Version 1.10 (2007-08-02)&lt;br /&gt;
** Added default firewall functions:&lt;br /&gt;
*** SimpleFC::RestoreDefaults&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpOutboundDestinationUnreachable&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpRedirect&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpInboundEchoRequest&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpOutboundTimeExceeded&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpOutboundParameterProblem&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpOutboundSourceQuench&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpInboundRouterRequest&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpInboundTimestampRequest&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpInboundMaskRequest&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpOutboundPacketTooBig&lt;br /&gt;
*** SimpleFC::IsIcmpTypeAllowed&lt;br /&gt;
** Added functions for Windows Firewall with Advanced Security&lt;br /&gt;
*** SimpleFC::AdvAddRule&lt;br /&gt;
*** SimpleFC::AdvRemoveRule&lt;br /&gt;
*** SimpleFC::AdvExistsRule&lt;br /&gt;
*Version 1.01 (2007-07-05)&lt;br /&gt;
**Changed missing documentation about the function SimpleFC::IsFirewallEnabled&lt;br /&gt;
*Version 1.0 (2007-05-02)&lt;br /&gt;
**First offical version&lt;br /&gt;
&lt;br /&gt;
== Important Notes ==&lt;br /&gt;
&lt;br /&gt;
*This plugin is running on Windows XP SP2, Windows 2003, Windows Vista, Windows 2008 and Windows 7&lt;br /&gt;
*Before you execute some plugin commands it is recommend to check for windows firewall service is running (SimpleFC::IsFirewallServiceRunning).&lt;br /&gt;
*All functions with the prefix &amp;quot;Adv&amp;quot; are only for Windows Firewall with Advanced Security (Windows Vista and above).&lt;br /&gt;
&lt;br /&gt;
* If you have any suggestions, comments or questions please mail me: mailto:rainer@speed-soft.de&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Plugins]]&lt;/div&gt;</summary>
		<author><name>Speed78</name></author>
	</entry>
	<entry>
		<id>https://nsis.sourceforge.io/mediawiki/index.php?title=NSIS_Simple_Firewall_Plugin&amp;diff=19339</id>
		<title>NSIS Simple Firewall Plugin</title>
		<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/mediawiki/index.php?title=NSIS_Simple_Firewall_Plugin&amp;diff=19339"/>
		<updated>2011-02-03T17:41:03Z</updated>

		<summary type="html">&lt;p&gt;Speed78: /* Important Notes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This plugin can be used to configure the Windows firewall. This plugin contains functions to enable, check, add or remove programs or ports to the firewall exception list. It also contains functions for checking the firewall status, enable or disable the firewall and so on.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This plugin is using the MPL License or alternatively the LGPL License.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
&amp;lt;attach&amp;gt;NSIS_Simple_Firewall_Plugin_1.18.zip&amp;lt;/attach&amp;gt; The ZIP file containing a precompiled plugin DLL (to be saved in NSIS&#039; plugin directory) and the sources.&lt;br /&gt;
&lt;br /&gt;
== Donation ==&lt;br /&gt;
If you believe that I am doing a good job and you want to support me please [http://www.speed-soft.de/donation/index.php?language=en donate] any amount via PayPal.&lt;br /&gt;
&lt;br /&gt;
== Short Reference ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
SimpleFC::EnableDisableFirewall [status]&lt;br /&gt;
SimpleFC::IsFirewallEnabled  &lt;br /&gt;
 &lt;br /&gt;
SimpleFC::AllowDisallowExceptionsNotAllowed [status]&lt;br /&gt;
SimpleFC::AreExceptionsNotAllowed  &lt;br /&gt;
 &lt;br /&gt;
SimpleFC::EnableDisableNotifications [status]&lt;br /&gt;
SimpleFC::AreNotificationsEnabled  &lt;br /&gt;
 &lt;br /&gt;
SimpleFC::StartStopFirewallService [status]&lt;br /&gt;
SimpleFC::IsFirewallServiceRunning  &lt;br /&gt;
 &lt;br /&gt;
SimpleFC::AddPort [port] [name] [protocol] [scope] [ip_version] [remote_addresses] [status]&lt;br /&gt;
SimpleFC::IsPortAdded [port] [protocol]&lt;br /&gt;
SimpleFC::RemovePort [port] [protocol]&lt;br /&gt;
 &lt;br /&gt;
SimpleFC::IsPortEnabled [port] [protocol]&lt;br /&gt;
SimpleFC::EnableDisablePort [port] [protocol]&lt;br /&gt;
 &lt;br /&gt;
SimpleFC::AddApplication [name] [path] [scope] [ip_version] [remote_addresses] [status]&lt;br /&gt;
SimpleFC::IsApplicationAdded [path]&lt;br /&gt;
SimpleFC::RemoveApplication [path]&lt;br /&gt;
 &lt;br /&gt;
SimpleFC::IsApplicationEnabled [path]&lt;br /&gt;
SimpleFC::EnableDisableApplication [path]&lt;br /&gt;
&lt;br /&gt;
SimpleFC::RestoreDefaults&lt;br /&gt;
&lt;br /&gt;
SimpleFC::AllowDisallowIcmpOutboundDestinationUnreachable [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpRedirect [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpInboundEchoRequest [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpOutboundTimeExceeded [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpOutboundParameterProblem [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpOutboundSourceQuench [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpInboundRouterRequest [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpInboundTimestampRequest [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpInboundMaskRequest [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpOutboundPacketTooBig [status]&lt;br /&gt;
SimpleFC::IsIcmpTypeAllowed [ip_version] [local_address] [icmp_type]&lt;br /&gt;
&lt;br /&gt;
SimpleFC::AdvAddRule [name] [description] [protocol] [direction] &lt;br /&gt;
  [status] [profile] [action] [application] [icmp_types_and_codes] &lt;br /&gt;
  [group] [local_ports] [remote_ports] [local_address] [remote_address]&lt;br /&gt;
SimpleFC::AdvRemoveRule [name]&lt;br /&gt;
SimpleFC::AdvExistsRule [name]&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
*port - TCP/UDP port which should be opened/closed&lt;br /&gt;
*name - The name of the application/port/rule&lt;br /&gt;
*description - Description of the rule&lt;br /&gt;
*protocol - One of the following protocol&lt;br /&gt;
**1 - ICMPv4&lt;br /&gt;
**6 - TCP&lt;br /&gt;
**17 - UDP&lt;br /&gt;
**58 - ICMPv6&lt;br /&gt;
*scope - One of the following scope&lt;br /&gt;
**0 - All networks&lt;br /&gt;
**1 - Only local subnets&lt;br /&gt;
**2 - Custom scope&lt;br /&gt;
**3 - Max&lt;br /&gt;
**NOTE: If you use custom you must define remote_addresses&lt;br /&gt;
*ip_version&lt;br /&gt;
**0 - IPv4&lt;br /&gt;
**1 - IPv6&lt;br /&gt;
**2 - Any protocol&lt;br /&gt;
*icmp_type&lt;br /&gt;
**3 - Outbound Destination Unreachable (ICMPv4)&lt;br /&gt;
**4 - Outbound Source Quench (ICMPv4)&lt;br /&gt;
**5 - Redirect (ICMPv4)&lt;br /&gt;
**8 - Inbound Echo Request (ICMPv4)&lt;br /&gt;
**9 - Inbound Router Request (ICMPv4)&lt;br /&gt;
**11 - Outbound Time Exceeded (ICMPv4)&lt;br /&gt;
**12 - Outbound Parameter Problem (ICMPv4)&lt;br /&gt;
**13 - Inbound Timespamp Request (ICMPv4)&lt;br /&gt;
**17 - Inbound Mask Request (ICMPv4)&lt;br /&gt;
**1 - Outbound Destination Unreachable (ICMPv6)&lt;br /&gt;
**2 - Outbound Packet Too Big (ICMPv6)&lt;br /&gt;
**3 - Outbound Time Exceeded (ICMPv6)&lt;br /&gt;
**4 - Outbound Parameter Problem (ICMPv6)&lt;br /&gt;
**128 - Inbound Echo Request (ICMPv6)&lt;br /&gt;
**137 - Redirect (ICMPv6)&lt;br /&gt;
*direction&lt;br /&gt;
**1 - In&lt;br /&gt;
**2 - Out&lt;br /&gt;
*profile&lt;br /&gt;
**1 - Domain &lt;br /&gt;
**2 - Private&lt;br /&gt;
**4 - Public&lt;br /&gt;
**2147483647 - All profiles&lt;br /&gt;
*action&lt;br /&gt;
**0 - Block&lt;br /&gt;
**1 - Allow&lt;br /&gt;
*application - Name of the application (can be empty)&lt;br /&gt;
*icmp_types_and_codes - Specified icmp types and codes&lt;br /&gt;
*group - Put the rule in this specified group (can be empty) &lt;br /&gt;
**&#039;&#039;&#039;Note&#039;&#039;&#039;: On Vista the group must the a resource string in a exe/dll e.g. &amp;quot;@C:\Program Files\My Application\myapp.exe,-10000&amp;quot;. On all other supported operating systems it can be a string value.&lt;br /&gt;
*local_ports - Local ports (can be empty)&lt;br /&gt;
*remote_ports - Remote ports (can be empty)&lt;br /&gt;
*local_address - Local ip address (can be empty)&lt;br /&gt;
*remote_addresses - Remote addresses from which the port can listen for traffic&lt;br /&gt;
*status - Status of the port, application, rule, firewall or service for example enabled/disabled, start/stop or allow/disallow&lt;br /&gt;
**0 - Disabled, stop or disallow&lt;br /&gt;
**1 - Enabled, start, or allow&lt;br /&gt;
&lt;br /&gt;
== The Sample Script ==&lt;br /&gt;
In this script you can find the two most used functions. If you are searching for some special firewall exceptions please look at &amp;quot;The Sample Script (All Functions)&amp;quot;. &lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
; Add an application to the firewall exception list - All Networks - All IP Version - Enabled&lt;br /&gt;
  SimpleFC::AddApplication &amp;quot;My Application&amp;quot; &amp;quot;PathToApplication&amp;quot; 0 2 &amp;quot;&amp;quot; 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Remove an application from the firewall exception list&lt;br /&gt;
  SimpleFC::RemoveApplication &amp;quot;PathToApplication&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== The Sample Script (All Functions) ==&lt;br /&gt;
In this script you can find the examples of all functions provided by this plugin.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Add the port 37/TCP to the firewall exception list - All Networks - All IP Version - Enabled&lt;br /&gt;
  SimpleFC::AddPort 37 &amp;quot;My Application&amp;quot; 6 0 2 &amp;quot;&amp;quot; 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if the port 37/TCP is added to the firewall exception list&lt;br /&gt;
  SimpleFC::IsPortAdded 37 6&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Added/0=Not added&lt;br /&gt;
&lt;br /&gt;
; Remove the port 37/TCP from the firewall exception list&lt;br /&gt;
  SimpleFC::RemovePort 37 6&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if the port 37/TCP is enabled/disabled&lt;br /&gt;
  SimpleFC::IsPortEnabled 37 6&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Enabled/0=Not enabled&lt;br /&gt;
&lt;br /&gt;
; Disable the port 37/TCP&lt;br /&gt;
  SimpleFC::EnableDisablePort 37 6 0&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable the port 37/TCP&lt;br /&gt;
  SimpleFC::EnableDisablePort 37 6 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if an application is enabled/disabled&lt;br /&gt;
  SimpleFC::IsApplicationEnabled &amp;quot;PathToApplication&amp;quot; &lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Enabled/0=Not enabled&lt;br /&gt;
&lt;br /&gt;
; Disable the application&lt;br /&gt;
  SimpleFC::EnableDisableApplication &amp;quot;PathToApplication&amp;quot; 0&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable the application&lt;br /&gt;
  SimpleFC::EnableDisableApplication &amp;quot;PathToApplication&amp;quot; 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Add an application to the firewall exception list - All Networks - All IP Version - Enabled&lt;br /&gt;
  SimpleFC::AddApplication &amp;quot;My Application&amp;quot; &amp;quot;PathToApplication&amp;quot; 0 2 &amp;quot;&amp;quot; 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if the application is added to the firewall exception list&lt;br /&gt;
  SimpleFC::IsApplicationAdded &amp;quot;PathToApplication&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Added/0=Not added&lt;br /&gt;
&lt;br /&gt;
; Remove an application from the firewall exception list&lt;br /&gt;
  SimpleFC::RemoveApplication &amp;quot;PathToApplication&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Disable the windows firewall&lt;br /&gt;
  SimpleFC::EnableDisableFirewall 0&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable the windows firewall&lt;br /&gt;
  SimpleFC::EnableDisableFirewall 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if the firewall is enabled&lt;br /&gt;
  SimpleFC::IsFirewallEnabled &lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Enabled/0=Disabled&lt;br /&gt;
&lt;br /&gt;
; Enable exceptions are not allowed on the windows firewall&lt;br /&gt;
  SimpleFC::AllowDisallowExceptionsNotAllowed 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Disable exceptions are not allowed on the windows firewall&lt;br /&gt;
  SimpleFC::AllowDisallowExceptionsNotAllowed 0&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if exceptions are not allowed&lt;br /&gt;
  SimpleFC::AreExceptionsNotAllowed&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Exceptions are not allowed is &lt;br /&gt;
         ; activated/0=Exception are not allowed is deactivated&lt;br /&gt;
&lt;br /&gt;
; Enable notifications on the windows firewall&lt;br /&gt;
  SimpleFC::EnableDisableNotifications 1&lt;br /&gt;
&lt;br /&gt;
; Disable notifications on the windows firewall&lt;br /&gt;
  SimpleFC::EnableDisableNotifications 0&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if notifications are enabled/disabled&lt;br /&gt;
  SimpleFC::AreNotificationsEnabled &lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Enabled/0=Disabled&lt;br /&gt;
&lt;br /&gt;
; Starts the windows firewall service&lt;br /&gt;
  SimpleFC::StartStopFirewallService 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Stops the windows firewall service&lt;br /&gt;
  SimpleFC::StartStopFirewallService 0&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if windows firewall service is running&lt;br /&gt;
  SimpleFC::IsFirewallServiceRunning&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=IsRunning/0=Not Running&lt;br /&gt;
&lt;br /&gt;
; Sets the windows firewall to default settings&lt;br /&gt;
  SimpleFC::RestoreDefaults&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP outbound destination unreachable state&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpOutboundDestinationUnreachable 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP redirect state&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpRedirect 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP inbound echo request &lt;br /&gt;
  SimpleFC::AllowDisallowIcmpInboundEchoRequest 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP outbound time exceeded&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpOutboundTimeExceeded 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP outbound parameter problem&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpOutboundParameterProblem 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP outbound source quench&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpOutboundSourceQuench 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP inbound router request&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpInboundRouterRequest 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP inbound timestamp request&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpInboundTimestampRequest 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP inbound mask request&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpInboundMaskRequest 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP outbound packet too big&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpOutboundPacketTooBig 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if ICMPv4 echo request is allowed&lt;br /&gt;
  SimpleFC::IsIcmpTypeAllowed &amp;quot;0&amp;quot; &amp;quot;&amp;quot; &amp;quot;8&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Restricted/0=Not restricted&lt;br /&gt;
  Pop $2 ; return 1=Allowed/0=Not allowed &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Some example rules for the windows firewall with advanced security.&lt;br /&gt;
; Please note this functions are very powerful, so for a detailed &lt;br /&gt;
; description please read the windows firewall with advanced &lt;br /&gt;
; security api reference:&lt;br /&gt;
; http://msdn2.microsoft.com/en-us/library/aa365309.aspx&lt;br /&gt;
&lt;br /&gt;
; Adds an ICMPv4 rule to allow incoming echo reply messages (IcmpCodeAndType = 0:0)&lt;br /&gt;
  SimpleFC::AdvAddRule &amp;quot;Echo-Reply (ICMPv4 incoming)&amp;quot; \&lt;br /&gt;
    &amp;quot;Allows incoming Echo Replies messages.&amp;quot; &amp;quot;1&amp;quot; &amp;quot;1&amp;quot; &amp;quot;1&amp;quot; &amp;quot;7&amp;quot; &amp;quot;1&amp;quot; &amp;quot;&amp;quot; \ &lt;br /&gt;
    &amp;quot;0:0&amp;quot; &amp;quot;@PathToApplication,-10000&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Adds an ICMPv4 rule to allow incoming echo request messages (IcmpCodeAndType = 8:0)&lt;br /&gt;
  SimpleFC::AdvAddRule &amp;quot;Echo-Request (ICMPv4 incoming)&amp;quot; \&lt;br /&gt;
    &amp;quot;Allows incoming ICMP Echo messages.&amp;quot; &amp;quot;1&amp;quot; &amp;quot;1&amp;quot; &amp;quot;1&amp;quot; &amp;quot;7&amp;quot; &amp;quot;1&amp;quot; &amp;quot;&amp;quot; \&lt;br /&gt;
    &amp;quot;8:0&amp;quot; &amp;quot;@PathToApplication,-10000&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Add an application rule to allow incoming TCP access on this application&lt;br /&gt;
  SimpleFC::AdvAddRule &amp;quot;Incoming requests (TCP incoming)&amp;quot; \ &lt;br /&gt;
    &amp;quot;Allows incoming requests.&amp;quot; &amp;quot;6&amp;quot; &amp;quot;1&amp;quot; &amp;quot;1&amp;quot; &amp;quot;7&amp;quot; &amp;quot;1&amp;quot; &amp;quot;PathToApplication&amp;quot; \ &lt;br /&gt;
    &amp;quot;&amp;quot; &amp;quot;@PathToApplication,-10000&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Add an application rule to allow incoming UDP access on this application&lt;br /&gt;
  SimpleFC::AdvAddRule &amp;quot;Incoming requests (UDP incoming)&amp;quot; \&lt;br /&gt;
    &amp;quot;Allows incoming requests.&amp;quot; &amp;quot;17&amp;quot; &amp;quot;1&amp;quot; &amp;quot;1&amp;quot; &amp;quot;7&amp;quot; &amp;quot;1&amp;quot; &amp;quot;PathToApplication&amp;quot; \ &lt;br /&gt;
    &amp;quot;&amp;quot; &amp;quot;@PathToApplication,-10000&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Removes a firewall rule&lt;br /&gt;
  SimpleFC::AdvRemoveRule &amp;quot;Incoming requests (UDP incoming)&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if the firewall exists&lt;br /&gt;
  SimpleFC::AdvExistsRule &amp;quot;Incoming requests (UDP incoming)&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Exists/0=DoesnÂ´t exists&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Changelog ==&lt;br /&gt;
*Version 1.18 (2010-02-23)&lt;br /&gt;
**Documentation updated&lt;br /&gt;
*Version 1.17 (2009-09-05)&lt;br /&gt;
**Added changes from the service manager&lt;br /&gt;
**The following functions are now case insensitive:&lt;br /&gt;
***SimpleFC::IsApplicationAdded&lt;br /&gt;
***SimpleFC::IsApplicationEnabled&lt;br /&gt;
***SimpleFC::EnableDisableApplication&lt;br /&gt;
***SimpleFC::AdvExistsRule&lt;br /&gt;
*Version 1.16 (2009-04-13)&lt;br /&gt;
**Added changes from the service manager&lt;br /&gt;
*Version 1.15 (2008-08-18)&lt;br /&gt;
**Added changes from the service manager and checked removed compiler optimization to avoid a false-positive virusscan.&lt;br /&gt;
*Version 1.14 (2008-02-05)&lt;br /&gt;
** Added changes from the service manager&lt;br /&gt;
*Version 1.13 (2008-01-29)&lt;br /&gt;
** Added changes from the service manager&lt;br /&gt;
*Version 1.12 (2007-11-13)&lt;br /&gt;
** Fixed wrong documentation about SimpleFC::AdvExistsRule&lt;br /&gt;
*Version 1.11 (2007-08-07)&lt;br /&gt;
** Fixed potential endless loop bug in SimpleFC::StartStopFirewallService&lt;br /&gt;
*Version 1.10 (2007-08-02)&lt;br /&gt;
** Added default firewall functions:&lt;br /&gt;
*** SimpleFC::RestoreDefaults&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpOutboundDestinationUnreachable&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpRedirect&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpInboundEchoRequest&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpOutboundTimeExceeded&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpOutboundParameterProblem&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpOutboundSourceQuench&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpInboundRouterRequest&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpInboundTimestampRequest&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpInboundMaskRequest&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpOutboundPacketTooBig&lt;br /&gt;
*** SimpleFC::IsIcmpTypeAllowed&lt;br /&gt;
** Added functions for Windows Firewall with Advanced Security&lt;br /&gt;
*** SimpleFC::AdvAddRule&lt;br /&gt;
*** SimpleFC::AdvRemoveRule&lt;br /&gt;
*** SimpleFC::AdvExistsRule&lt;br /&gt;
*Version 1.01 (2007-07-05)&lt;br /&gt;
**Changed missing documentation about the function SimpleFC::IsFirewallEnabled&lt;br /&gt;
*Version 1.0 (2007-05-02)&lt;br /&gt;
**First offical version&lt;br /&gt;
&lt;br /&gt;
== Important Notes ==&lt;br /&gt;
&lt;br /&gt;
*This plugin is running with Windows XP SP2, Windows 2003, Windows Vista, Windows 2008 and Windows 7&lt;br /&gt;
*Before you execute some plugin commands it is recommend to check for windows firewall service is running (SimpleFC::IsFirewallServiceRunning).&lt;br /&gt;
*All functions with the prefix &amp;quot;Adv&amp;quot; are only for Windows Firewall with Advanced Security (Windows Vista and above).&lt;br /&gt;
&lt;br /&gt;
* If you have any suggestions, comments or questions please mail me: mailto:rainer@speed-soft.de&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Plugins]]&lt;/div&gt;</summary>
		<author><name>Speed78</name></author>
	</entry>
	<entry>
		<id>https://nsis.sourceforge.io/mediawiki/index.php?title=NSIS_Simple_Firewall_Plugin&amp;diff=19338</id>
		<title>NSIS Simple Firewall Plugin</title>
		<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/mediawiki/index.php?title=NSIS_Simple_Firewall_Plugin&amp;diff=19338"/>
		<updated>2011-02-03T17:40:45Z</updated>

		<summary type="html">&lt;p&gt;Speed78: /* Important Notes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This plugin can be used to configure the Windows firewall. This plugin contains functions to enable, check, add or remove programs or ports to the firewall exception list. It also contains functions for checking the firewall status, enable or disable the firewall and so on.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This plugin is using the MPL License or alternatively the LGPL License.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
&amp;lt;attach&amp;gt;NSIS_Simple_Firewall_Plugin_1.18.zip&amp;lt;/attach&amp;gt; The ZIP file containing a precompiled plugin DLL (to be saved in NSIS&#039; plugin directory) and the sources.&lt;br /&gt;
&lt;br /&gt;
== Donation ==&lt;br /&gt;
If you believe that I am doing a good job and you want to support me please [http://www.speed-soft.de/donation/index.php?language=en donate] any amount via PayPal.&lt;br /&gt;
&lt;br /&gt;
== Short Reference ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
SimpleFC::EnableDisableFirewall [status]&lt;br /&gt;
SimpleFC::IsFirewallEnabled  &lt;br /&gt;
 &lt;br /&gt;
SimpleFC::AllowDisallowExceptionsNotAllowed [status]&lt;br /&gt;
SimpleFC::AreExceptionsNotAllowed  &lt;br /&gt;
 &lt;br /&gt;
SimpleFC::EnableDisableNotifications [status]&lt;br /&gt;
SimpleFC::AreNotificationsEnabled  &lt;br /&gt;
 &lt;br /&gt;
SimpleFC::StartStopFirewallService [status]&lt;br /&gt;
SimpleFC::IsFirewallServiceRunning  &lt;br /&gt;
 &lt;br /&gt;
SimpleFC::AddPort [port] [name] [protocol] [scope] [ip_version] [remote_addresses] [status]&lt;br /&gt;
SimpleFC::IsPortAdded [port] [protocol]&lt;br /&gt;
SimpleFC::RemovePort [port] [protocol]&lt;br /&gt;
 &lt;br /&gt;
SimpleFC::IsPortEnabled [port] [protocol]&lt;br /&gt;
SimpleFC::EnableDisablePort [port] [protocol]&lt;br /&gt;
 &lt;br /&gt;
SimpleFC::AddApplication [name] [path] [scope] [ip_version] [remote_addresses] [status]&lt;br /&gt;
SimpleFC::IsApplicationAdded [path]&lt;br /&gt;
SimpleFC::RemoveApplication [path]&lt;br /&gt;
 &lt;br /&gt;
SimpleFC::IsApplicationEnabled [path]&lt;br /&gt;
SimpleFC::EnableDisableApplication [path]&lt;br /&gt;
&lt;br /&gt;
SimpleFC::RestoreDefaults&lt;br /&gt;
&lt;br /&gt;
SimpleFC::AllowDisallowIcmpOutboundDestinationUnreachable [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpRedirect [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpInboundEchoRequest [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpOutboundTimeExceeded [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpOutboundParameterProblem [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpOutboundSourceQuench [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpInboundRouterRequest [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpInboundTimestampRequest [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpInboundMaskRequest [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpOutboundPacketTooBig [status]&lt;br /&gt;
SimpleFC::IsIcmpTypeAllowed [ip_version] [local_address] [icmp_type]&lt;br /&gt;
&lt;br /&gt;
SimpleFC::AdvAddRule [name] [description] [protocol] [direction] &lt;br /&gt;
  [status] [profile] [action] [application] [icmp_types_and_codes] &lt;br /&gt;
  [group] [local_ports] [remote_ports] [local_address] [remote_address]&lt;br /&gt;
SimpleFC::AdvRemoveRule [name]&lt;br /&gt;
SimpleFC::AdvExistsRule [name]&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
*port - TCP/UDP port which should be opened/closed&lt;br /&gt;
*name - The name of the application/port/rule&lt;br /&gt;
*description - Description of the rule&lt;br /&gt;
*protocol - One of the following protocol&lt;br /&gt;
**1 - ICMPv4&lt;br /&gt;
**6 - TCP&lt;br /&gt;
**17 - UDP&lt;br /&gt;
**58 - ICMPv6&lt;br /&gt;
*scope - One of the following scope&lt;br /&gt;
**0 - All networks&lt;br /&gt;
**1 - Only local subnets&lt;br /&gt;
**2 - Custom scope&lt;br /&gt;
**3 - Max&lt;br /&gt;
**NOTE: If you use custom you must define remote_addresses&lt;br /&gt;
*ip_version&lt;br /&gt;
**0 - IPv4&lt;br /&gt;
**1 - IPv6&lt;br /&gt;
**2 - Any protocol&lt;br /&gt;
*icmp_type&lt;br /&gt;
**3 - Outbound Destination Unreachable (ICMPv4)&lt;br /&gt;
**4 - Outbound Source Quench (ICMPv4)&lt;br /&gt;
**5 - Redirect (ICMPv4)&lt;br /&gt;
**8 - Inbound Echo Request (ICMPv4)&lt;br /&gt;
**9 - Inbound Router Request (ICMPv4)&lt;br /&gt;
**11 - Outbound Time Exceeded (ICMPv4)&lt;br /&gt;
**12 - Outbound Parameter Problem (ICMPv4)&lt;br /&gt;
**13 - Inbound Timespamp Request (ICMPv4)&lt;br /&gt;
**17 - Inbound Mask Request (ICMPv4)&lt;br /&gt;
**1 - Outbound Destination Unreachable (ICMPv6)&lt;br /&gt;
**2 - Outbound Packet Too Big (ICMPv6)&lt;br /&gt;
**3 - Outbound Time Exceeded (ICMPv6)&lt;br /&gt;
**4 - Outbound Parameter Problem (ICMPv6)&lt;br /&gt;
**128 - Inbound Echo Request (ICMPv6)&lt;br /&gt;
**137 - Redirect (ICMPv6)&lt;br /&gt;
*direction&lt;br /&gt;
**1 - In&lt;br /&gt;
**2 - Out&lt;br /&gt;
*profile&lt;br /&gt;
**1 - Domain &lt;br /&gt;
**2 - Private&lt;br /&gt;
**4 - Public&lt;br /&gt;
**2147483647 - All profiles&lt;br /&gt;
*action&lt;br /&gt;
**0 - Block&lt;br /&gt;
**1 - Allow&lt;br /&gt;
*application - Name of the application (can be empty)&lt;br /&gt;
*icmp_types_and_codes - Specified icmp types and codes&lt;br /&gt;
*group - Put the rule in this specified group (can be empty) &lt;br /&gt;
**&#039;&#039;&#039;Note&#039;&#039;&#039;: On Vista the group must the a resource string in a exe/dll e.g. &amp;quot;@C:\Program Files\My Application\myapp.exe,-10000&amp;quot;. On all other supported operating systems it can be a string value.&lt;br /&gt;
*local_ports - Local ports (can be empty)&lt;br /&gt;
*remote_ports - Remote ports (can be empty)&lt;br /&gt;
*local_address - Local ip address (can be empty)&lt;br /&gt;
*remote_addresses - Remote addresses from which the port can listen for traffic&lt;br /&gt;
*status - Status of the port, application, rule, firewall or service for example enabled/disabled, start/stop or allow/disallow&lt;br /&gt;
**0 - Disabled, stop or disallow&lt;br /&gt;
**1 - Enabled, start, or allow&lt;br /&gt;
&lt;br /&gt;
== The Sample Script ==&lt;br /&gt;
In this script you can find the two most used functions. If you are searching for some special firewall exceptions please look at &amp;quot;The Sample Script (All Functions)&amp;quot;. &lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
; Add an application to the firewall exception list - All Networks - All IP Version - Enabled&lt;br /&gt;
  SimpleFC::AddApplication &amp;quot;My Application&amp;quot; &amp;quot;PathToApplication&amp;quot; 0 2 &amp;quot;&amp;quot; 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Remove an application from the firewall exception list&lt;br /&gt;
  SimpleFC::RemoveApplication &amp;quot;PathToApplication&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== The Sample Script (All Functions) ==&lt;br /&gt;
In this script you can find the examples of all functions provided by this plugin.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Add the port 37/TCP to the firewall exception list - All Networks - All IP Version - Enabled&lt;br /&gt;
  SimpleFC::AddPort 37 &amp;quot;My Application&amp;quot; 6 0 2 &amp;quot;&amp;quot; 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if the port 37/TCP is added to the firewall exception list&lt;br /&gt;
  SimpleFC::IsPortAdded 37 6&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Added/0=Not added&lt;br /&gt;
&lt;br /&gt;
; Remove the port 37/TCP from the firewall exception list&lt;br /&gt;
  SimpleFC::RemovePort 37 6&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if the port 37/TCP is enabled/disabled&lt;br /&gt;
  SimpleFC::IsPortEnabled 37 6&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Enabled/0=Not enabled&lt;br /&gt;
&lt;br /&gt;
; Disable the port 37/TCP&lt;br /&gt;
  SimpleFC::EnableDisablePort 37 6 0&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable the port 37/TCP&lt;br /&gt;
  SimpleFC::EnableDisablePort 37 6 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if an application is enabled/disabled&lt;br /&gt;
  SimpleFC::IsApplicationEnabled &amp;quot;PathToApplication&amp;quot; &lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Enabled/0=Not enabled&lt;br /&gt;
&lt;br /&gt;
; Disable the application&lt;br /&gt;
  SimpleFC::EnableDisableApplication &amp;quot;PathToApplication&amp;quot; 0&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable the application&lt;br /&gt;
  SimpleFC::EnableDisableApplication &amp;quot;PathToApplication&amp;quot; 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Add an application to the firewall exception list - All Networks - All IP Version - Enabled&lt;br /&gt;
  SimpleFC::AddApplication &amp;quot;My Application&amp;quot; &amp;quot;PathToApplication&amp;quot; 0 2 &amp;quot;&amp;quot; 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if the application is added to the firewall exception list&lt;br /&gt;
  SimpleFC::IsApplicationAdded &amp;quot;PathToApplication&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Added/0=Not added&lt;br /&gt;
&lt;br /&gt;
; Remove an application from the firewall exception list&lt;br /&gt;
  SimpleFC::RemoveApplication &amp;quot;PathToApplication&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Disable the windows firewall&lt;br /&gt;
  SimpleFC::EnableDisableFirewall 0&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable the windows firewall&lt;br /&gt;
  SimpleFC::EnableDisableFirewall 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if the firewall is enabled&lt;br /&gt;
  SimpleFC::IsFirewallEnabled &lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Enabled/0=Disabled&lt;br /&gt;
&lt;br /&gt;
; Enable exceptions are not allowed on the windows firewall&lt;br /&gt;
  SimpleFC::AllowDisallowExceptionsNotAllowed 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Disable exceptions are not allowed on the windows firewall&lt;br /&gt;
  SimpleFC::AllowDisallowExceptionsNotAllowed 0&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if exceptions are not allowed&lt;br /&gt;
  SimpleFC::AreExceptionsNotAllowed&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Exceptions are not allowed is &lt;br /&gt;
         ; activated/0=Exception are not allowed is deactivated&lt;br /&gt;
&lt;br /&gt;
; Enable notifications on the windows firewall&lt;br /&gt;
  SimpleFC::EnableDisableNotifications 1&lt;br /&gt;
&lt;br /&gt;
; Disable notifications on the windows firewall&lt;br /&gt;
  SimpleFC::EnableDisableNotifications 0&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if notifications are enabled/disabled&lt;br /&gt;
  SimpleFC::AreNotificationsEnabled &lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Enabled/0=Disabled&lt;br /&gt;
&lt;br /&gt;
; Starts the windows firewall service&lt;br /&gt;
  SimpleFC::StartStopFirewallService 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Stops the windows firewall service&lt;br /&gt;
  SimpleFC::StartStopFirewallService 0&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if windows firewall service is running&lt;br /&gt;
  SimpleFC::IsFirewallServiceRunning&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=IsRunning/0=Not Running&lt;br /&gt;
&lt;br /&gt;
; Sets the windows firewall to default settings&lt;br /&gt;
  SimpleFC::RestoreDefaults&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP outbound destination unreachable state&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpOutboundDestinationUnreachable 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP redirect state&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpRedirect 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP inbound echo request &lt;br /&gt;
  SimpleFC::AllowDisallowIcmpInboundEchoRequest 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP outbound time exceeded&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpOutboundTimeExceeded 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP outbound parameter problem&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpOutboundParameterProblem 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP outbound source quench&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpOutboundSourceQuench 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP inbound router request&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpInboundRouterRequest 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP inbound timestamp request&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpInboundTimestampRequest 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP inbound mask request&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpInboundMaskRequest 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP outbound packet too big&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpOutboundPacketTooBig 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if ICMPv4 echo request is allowed&lt;br /&gt;
  SimpleFC::IsIcmpTypeAllowed &amp;quot;0&amp;quot; &amp;quot;&amp;quot; &amp;quot;8&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Restricted/0=Not restricted&lt;br /&gt;
  Pop $2 ; return 1=Allowed/0=Not allowed &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Some example rules for the windows firewall with advanced security.&lt;br /&gt;
; Please note this functions are very powerful, so for a detailed &lt;br /&gt;
; description please read the windows firewall with advanced &lt;br /&gt;
; security api reference:&lt;br /&gt;
; http://msdn2.microsoft.com/en-us/library/aa365309.aspx&lt;br /&gt;
&lt;br /&gt;
; Adds an ICMPv4 rule to allow incoming echo reply messages (IcmpCodeAndType = 0:0)&lt;br /&gt;
  SimpleFC::AdvAddRule &amp;quot;Echo-Reply (ICMPv4 incoming)&amp;quot; \&lt;br /&gt;
    &amp;quot;Allows incoming Echo Replies messages.&amp;quot; &amp;quot;1&amp;quot; &amp;quot;1&amp;quot; &amp;quot;1&amp;quot; &amp;quot;7&amp;quot; &amp;quot;1&amp;quot; &amp;quot;&amp;quot; \ &lt;br /&gt;
    &amp;quot;0:0&amp;quot; &amp;quot;@PathToApplication,-10000&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Adds an ICMPv4 rule to allow incoming echo request messages (IcmpCodeAndType = 8:0)&lt;br /&gt;
  SimpleFC::AdvAddRule &amp;quot;Echo-Request (ICMPv4 incoming)&amp;quot; \&lt;br /&gt;
    &amp;quot;Allows incoming ICMP Echo messages.&amp;quot; &amp;quot;1&amp;quot; &amp;quot;1&amp;quot; &amp;quot;1&amp;quot; &amp;quot;7&amp;quot; &amp;quot;1&amp;quot; &amp;quot;&amp;quot; \&lt;br /&gt;
    &amp;quot;8:0&amp;quot; &amp;quot;@PathToApplication,-10000&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Add an application rule to allow incoming TCP access on this application&lt;br /&gt;
  SimpleFC::AdvAddRule &amp;quot;Incoming requests (TCP incoming)&amp;quot; \ &lt;br /&gt;
    &amp;quot;Allows incoming requests.&amp;quot; &amp;quot;6&amp;quot; &amp;quot;1&amp;quot; &amp;quot;1&amp;quot; &amp;quot;7&amp;quot; &amp;quot;1&amp;quot; &amp;quot;PathToApplication&amp;quot; \ &lt;br /&gt;
    &amp;quot;&amp;quot; &amp;quot;@PathToApplication,-10000&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Add an application rule to allow incoming UDP access on this application&lt;br /&gt;
  SimpleFC::AdvAddRule &amp;quot;Incoming requests (UDP incoming)&amp;quot; \&lt;br /&gt;
    &amp;quot;Allows incoming requests.&amp;quot; &amp;quot;17&amp;quot; &amp;quot;1&amp;quot; &amp;quot;1&amp;quot; &amp;quot;7&amp;quot; &amp;quot;1&amp;quot; &amp;quot;PathToApplication&amp;quot; \ &lt;br /&gt;
    &amp;quot;&amp;quot; &amp;quot;@PathToApplication,-10000&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Removes a firewall rule&lt;br /&gt;
  SimpleFC::AdvRemoveRule &amp;quot;Incoming requests (UDP incoming)&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if the firewall exists&lt;br /&gt;
  SimpleFC::AdvExistsRule &amp;quot;Incoming requests (UDP incoming)&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Exists/0=DoesnÂ´t exists&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Changelog ==&lt;br /&gt;
*Version 1.18 (2010-02-23)&lt;br /&gt;
**Documentation updated&lt;br /&gt;
*Version 1.17 (2009-09-05)&lt;br /&gt;
**Added changes from the service manager&lt;br /&gt;
**The following functions are now case insensitive:&lt;br /&gt;
***SimpleFC::IsApplicationAdded&lt;br /&gt;
***SimpleFC::IsApplicationEnabled&lt;br /&gt;
***SimpleFC::EnableDisableApplication&lt;br /&gt;
***SimpleFC::AdvExistsRule&lt;br /&gt;
*Version 1.16 (2009-04-13)&lt;br /&gt;
**Added changes from the service manager&lt;br /&gt;
*Version 1.15 (2008-08-18)&lt;br /&gt;
**Added changes from the service manager and checked removed compiler optimization to avoid a false-positive virusscan.&lt;br /&gt;
*Version 1.14 (2008-02-05)&lt;br /&gt;
** Added changes from the service manager&lt;br /&gt;
*Version 1.13 (2008-01-29)&lt;br /&gt;
** Added changes from the service manager&lt;br /&gt;
*Version 1.12 (2007-11-13)&lt;br /&gt;
** Fixed wrong documentation about SimpleFC::AdvExistsRule&lt;br /&gt;
*Version 1.11 (2007-08-07)&lt;br /&gt;
** Fixed potential endless loop bug in SimpleFC::StartStopFirewallService&lt;br /&gt;
*Version 1.10 (2007-08-02)&lt;br /&gt;
** Added default firewall functions:&lt;br /&gt;
*** SimpleFC::RestoreDefaults&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpOutboundDestinationUnreachable&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpRedirect&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpInboundEchoRequest&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpOutboundTimeExceeded&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpOutboundParameterProblem&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpOutboundSourceQuench&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpInboundRouterRequest&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpInboundTimestampRequest&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpInboundMaskRequest&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpOutboundPacketTooBig&lt;br /&gt;
*** SimpleFC::IsIcmpTypeAllowed&lt;br /&gt;
** Added functions for Windows Firewall with Advanced Security&lt;br /&gt;
*** SimpleFC::AdvAddRule&lt;br /&gt;
*** SimpleFC::AdvRemoveRule&lt;br /&gt;
*** SimpleFC::AdvExistsRule&lt;br /&gt;
*Version 1.01 (2007-07-05)&lt;br /&gt;
**Changed missing documentation about the function SimpleFC::IsFirewallEnabled&lt;br /&gt;
*Version 1.0 (2007-05-02)&lt;br /&gt;
**First offical version&lt;br /&gt;
&lt;br /&gt;
== Important Notes ==&lt;br /&gt;
&lt;br /&gt;
*This plugin is running with Windows XP SP2, Windows 2003, Windows Vista and Windows 7&lt;br /&gt;
*Before you execute some plugin commands it is recommend to check for windows firewall service is running (SimpleFC::IsFirewallServiceRunning).&lt;br /&gt;
*All functions with the prefix &amp;quot;Adv&amp;quot; are only for Windows Firewall with Advanced Security (Windows Vista and above).&lt;br /&gt;
&lt;br /&gt;
* If you have any suggestions, comments or questions please mail me: mailto:rainer@speed-soft.de&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Plugins]]&lt;/div&gt;</summary>
		<author><name>Speed78</name></author>
	</entry>
	<entry>
		<id>https://nsis.sourceforge.io/mediawiki/index.php?title=NSIS_Simple_Firewall_Plugin&amp;diff=19337</id>
		<title>NSIS Simple Firewall Plugin</title>
		<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/mediawiki/index.php?title=NSIS_Simple_Firewall_Plugin&amp;diff=19337"/>
		<updated>2011-02-03T17:40:22Z</updated>

		<summary type="html">&lt;p&gt;Speed78: /* Important Notes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This plugin can be used to configure the Windows firewall. This plugin contains functions to enable, check, add or remove programs or ports to the firewall exception list. It also contains functions for checking the firewall status, enable or disable the firewall and so on.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This plugin is using the MPL License or alternatively the LGPL License.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
&amp;lt;attach&amp;gt;NSIS_Simple_Firewall_Plugin_1.18.zip&amp;lt;/attach&amp;gt; The ZIP file containing a precompiled plugin DLL (to be saved in NSIS&#039; plugin directory) and the sources.&lt;br /&gt;
&lt;br /&gt;
== Donation ==&lt;br /&gt;
If you believe that I am doing a good job and you want to support me please [http://www.speed-soft.de/donation/index.php?language=en donate] any amount via PayPal.&lt;br /&gt;
&lt;br /&gt;
== Short Reference ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
SimpleFC::EnableDisableFirewall [status]&lt;br /&gt;
SimpleFC::IsFirewallEnabled  &lt;br /&gt;
 &lt;br /&gt;
SimpleFC::AllowDisallowExceptionsNotAllowed [status]&lt;br /&gt;
SimpleFC::AreExceptionsNotAllowed  &lt;br /&gt;
 &lt;br /&gt;
SimpleFC::EnableDisableNotifications [status]&lt;br /&gt;
SimpleFC::AreNotificationsEnabled  &lt;br /&gt;
 &lt;br /&gt;
SimpleFC::StartStopFirewallService [status]&lt;br /&gt;
SimpleFC::IsFirewallServiceRunning  &lt;br /&gt;
 &lt;br /&gt;
SimpleFC::AddPort [port] [name] [protocol] [scope] [ip_version] [remote_addresses] [status]&lt;br /&gt;
SimpleFC::IsPortAdded [port] [protocol]&lt;br /&gt;
SimpleFC::RemovePort [port] [protocol]&lt;br /&gt;
 &lt;br /&gt;
SimpleFC::IsPortEnabled [port] [protocol]&lt;br /&gt;
SimpleFC::EnableDisablePort [port] [protocol]&lt;br /&gt;
 &lt;br /&gt;
SimpleFC::AddApplication [name] [path] [scope] [ip_version] [remote_addresses] [status]&lt;br /&gt;
SimpleFC::IsApplicationAdded [path]&lt;br /&gt;
SimpleFC::RemoveApplication [path]&lt;br /&gt;
 &lt;br /&gt;
SimpleFC::IsApplicationEnabled [path]&lt;br /&gt;
SimpleFC::EnableDisableApplication [path]&lt;br /&gt;
&lt;br /&gt;
SimpleFC::RestoreDefaults&lt;br /&gt;
&lt;br /&gt;
SimpleFC::AllowDisallowIcmpOutboundDestinationUnreachable [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpRedirect [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpInboundEchoRequest [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpOutboundTimeExceeded [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpOutboundParameterProblem [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpOutboundSourceQuench [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpInboundRouterRequest [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpInboundTimestampRequest [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpInboundMaskRequest [status]&lt;br /&gt;
SimpleFC::AllowDisallowIcmpOutboundPacketTooBig [status]&lt;br /&gt;
SimpleFC::IsIcmpTypeAllowed [ip_version] [local_address] [icmp_type]&lt;br /&gt;
&lt;br /&gt;
SimpleFC::AdvAddRule [name] [description] [protocol] [direction] &lt;br /&gt;
  [status] [profile] [action] [application] [icmp_types_and_codes] &lt;br /&gt;
  [group] [local_ports] [remote_ports] [local_address] [remote_address]&lt;br /&gt;
SimpleFC::AdvRemoveRule [name]&lt;br /&gt;
SimpleFC::AdvExistsRule [name]&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
*port - TCP/UDP port which should be opened/closed&lt;br /&gt;
*name - The name of the application/port/rule&lt;br /&gt;
*description - Description of the rule&lt;br /&gt;
*protocol - One of the following protocol&lt;br /&gt;
**1 - ICMPv4&lt;br /&gt;
**6 - TCP&lt;br /&gt;
**17 - UDP&lt;br /&gt;
**58 - ICMPv6&lt;br /&gt;
*scope - One of the following scope&lt;br /&gt;
**0 - All networks&lt;br /&gt;
**1 - Only local subnets&lt;br /&gt;
**2 - Custom scope&lt;br /&gt;
**3 - Max&lt;br /&gt;
**NOTE: If you use custom you must define remote_addresses&lt;br /&gt;
*ip_version&lt;br /&gt;
**0 - IPv4&lt;br /&gt;
**1 - IPv6&lt;br /&gt;
**2 - Any protocol&lt;br /&gt;
*icmp_type&lt;br /&gt;
**3 - Outbound Destination Unreachable (ICMPv4)&lt;br /&gt;
**4 - Outbound Source Quench (ICMPv4)&lt;br /&gt;
**5 - Redirect (ICMPv4)&lt;br /&gt;
**8 - Inbound Echo Request (ICMPv4)&lt;br /&gt;
**9 - Inbound Router Request (ICMPv4)&lt;br /&gt;
**11 - Outbound Time Exceeded (ICMPv4)&lt;br /&gt;
**12 - Outbound Parameter Problem (ICMPv4)&lt;br /&gt;
**13 - Inbound Timespamp Request (ICMPv4)&lt;br /&gt;
**17 - Inbound Mask Request (ICMPv4)&lt;br /&gt;
**1 - Outbound Destination Unreachable (ICMPv6)&lt;br /&gt;
**2 - Outbound Packet Too Big (ICMPv6)&lt;br /&gt;
**3 - Outbound Time Exceeded (ICMPv6)&lt;br /&gt;
**4 - Outbound Parameter Problem (ICMPv6)&lt;br /&gt;
**128 - Inbound Echo Request (ICMPv6)&lt;br /&gt;
**137 - Redirect (ICMPv6)&lt;br /&gt;
*direction&lt;br /&gt;
**1 - In&lt;br /&gt;
**2 - Out&lt;br /&gt;
*profile&lt;br /&gt;
**1 - Domain &lt;br /&gt;
**2 - Private&lt;br /&gt;
**4 - Public&lt;br /&gt;
**2147483647 - All profiles&lt;br /&gt;
*action&lt;br /&gt;
**0 - Block&lt;br /&gt;
**1 - Allow&lt;br /&gt;
*application - Name of the application (can be empty)&lt;br /&gt;
*icmp_types_and_codes - Specified icmp types and codes&lt;br /&gt;
*group - Put the rule in this specified group (can be empty) &lt;br /&gt;
**&#039;&#039;&#039;Note&#039;&#039;&#039;: On Vista the group must the a resource string in a exe/dll e.g. &amp;quot;@C:\Program Files\My Application\myapp.exe,-10000&amp;quot;. On all other supported operating systems it can be a string value.&lt;br /&gt;
*local_ports - Local ports (can be empty)&lt;br /&gt;
*remote_ports - Remote ports (can be empty)&lt;br /&gt;
*local_address - Local ip address (can be empty)&lt;br /&gt;
*remote_addresses - Remote addresses from which the port can listen for traffic&lt;br /&gt;
*status - Status of the port, application, rule, firewall or service for example enabled/disabled, start/stop or allow/disallow&lt;br /&gt;
**0 - Disabled, stop or disallow&lt;br /&gt;
**1 - Enabled, start, or allow&lt;br /&gt;
&lt;br /&gt;
== The Sample Script ==&lt;br /&gt;
In this script you can find the two most used functions. If you are searching for some special firewall exceptions please look at &amp;quot;The Sample Script (All Functions)&amp;quot;. &lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
; Add an application to the firewall exception list - All Networks - All IP Version - Enabled&lt;br /&gt;
  SimpleFC::AddApplication &amp;quot;My Application&amp;quot; &amp;quot;PathToApplication&amp;quot; 0 2 &amp;quot;&amp;quot; 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Remove an application from the firewall exception list&lt;br /&gt;
  SimpleFC::RemoveApplication &amp;quot;PathToApplication&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== The Sample Script (All Functions) ==&lt;br /&gt;
In this script you can find the examples of all functions provided by this plugin.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Add the port 37/TCP to the firewall exception list - All Networks - All IP Version - Enabled&lt;br /&gt;
  SimpleFC::AddPort 37 &amp;quot;My Application&amp;quot; 6 0 2 &amp;quot;&amp;quot; 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if the port 37/TCP is added to the firewall exception list&lt;br /&gt;
  SimpleFC::IsPortAdded 37 6&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Added/0=Not added&lt;br /&gt;
&lt;br /&gt;
; Remove the port 37/TCP from the firewall exception list&lt;br /&gt;
  SimpleFC::RemovePort 37 6&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if the port 37/TCP is enabled/disabled&lt;br /&gt;
  SimpleFC::IsPortEnabled 37 6&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Enabled/0=Not enabled&lt;br /&gt;
&lt;br /&gt;
; Disable the port 37/TCP&lt;br /&gt;
  SimpleFC::EnableDisablePort 37 6 0&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable the port 37/TCP&lt;br /&gt;
  SimpleFC::EnableDisablePort 37 6 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if an application is enabled/disabled&lt;br /&gt;
  SimpleFC::IsApplicationEnabled &amp;quot;PathToApplication&amp;quot; &lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Enabled/0=Not enabled&lt;br /&gt;
&lt;br /&gt;
; Disable the application&lt;br /&gt;
  SimpleFC::EnableDisableApplication &amp;quot;PathToApplication&amp;quot; 0&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable the application&lt;br /&gt;
  SimpleFC::EnableDisableApplication &amp;quot;PathToApplication&amp;quot; 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Add an application to the firewall exception list - All Networks - All IP Version - Enabled&lt;br /&gt;
  SimpleFC::AddApplication &amp;quot;My Application&amp;quot; &amp;quot;PathToApplication&amp;quot; 0 2 &amp;quot;&amp;quot; 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if the application is added to the firewall exception list&lt;br /&gt;
  SimpleFC::IsApplicationAdded &amp;quot;PathToApplication&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Added/0=Not added&lt;br /&gt;
&lt;br /&gt;
; Remove an application from the firewall exception list&lt;br /&gt;
  SimpleFC::RemoveApplication &amp;quot;PathToApplication&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Disable the windows firewall&lt;br /&gt;
  SimpleFC::EnableDisableFirewall 0&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable the windows firewall&lt;br /&gt;
  SimpleFC::EnableDisableFirewall 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if the firewall is enabled&lt;br /&gt;
  SimpleFC::IsFirewallEnabled &lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Enabled/0=Disabled&lt;br /&gt;
&lt;br /&gt;
; Enable exceptions are not allowed on the windows firewall&lt;br /&gt;
  SimpleFC::AllowDisallowExceptionsNotAllowed 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Disable exceptions are not allowed on the windows firewall&lt;br /&gt;
  SimpleFC::AllowDisallowExceptionsNotAllowed 0&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if exceptions are not allowed&lt;br /&gt;
  SimpleFC::AreExceptionsNotAllowed&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Exceptions are not allowed is &lt;br /&gt;
         ; activated/0=Exception are not allowed is deactivated&lt;br /&gt;
&lt;br /&gt;
; Enable notifications on the windows firewall&lt;br /&gt;
  SimpleFC::EnableDisableNotifications 1&lt;br /&gt;
&lt;br /&gt;
; Disable notifications on the windows firewall&lt;br /&gt;
  SimpleFC::EnableDisableNotifications 0&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if notifications are enabled/disabled&lt;br /&gt;
  SimpleFC::AreNotificationsEnabled &lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Enabled/0=Disabled&lt;br /&gt;
&lt;br /&gt;
; Starts the windows firewall service&lt;br /&gt;
  SimpleFC::StartStopFirewallService 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Stops the windows firewall service&lt;br /&gt;
  SimpleFC::StartStopFirewallService 0&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if windows firewall service is running&lt;br /&gt;
  SimpleFC::IsFirewallServiceRunning&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=IsRunning/0=Not Running&lt;br /&gt;
&lt;br /&gt;
; Sets the windows firewall to default settings&lt;br /&gt;
  SimpleFC::RestoreDefaults&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP outbound destination unreachable state&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpOutboundDestinationUnreachable 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP redirect state&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpRedirect 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP inbound echo request &lt;br /&gt;
  SimpleFC::AllowDisallowIcmpInboundEchoRequest 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP outbound time exceeded&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpOutboundTimeExceeded 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP outbound parameter problem&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpOutboundParameterProblem 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP outbound source quench&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpOutboundSourceQuench 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP inbound router request&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpInboundRouterRequest 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP inbound timestamp request&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpInboundTimestampRequest 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP inbound mask request&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpInboundMaskRequest 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Enable ICMP outbound packet too big&lt;br /&gt;
  SimpleFC::AllowDisallowIcmpOutboundPacketTooBig 1&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if ICMPv4 echo request is allowed&lt;br /&gt;
  SimpleFC::IsIcmpTypeAllowed &amp;quot;0&amp;quot; &amp;quot;&amp;quot; &amp;quot;8&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Restricted/0=Not restricted&lt;br /&gt;
  Pop $2 ; return 1=Allowed/0=Not allowed &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Some example rules for the windows firewall with advanced security.&lt;br /&gt;
; Please note this functions are very powerful, so for a detailed &lt;br /&gt;
; description please read the windows firewall with advanced &lt;br /&gt;
; security api reference:&lt;br /&gt;
; http://msdn2.microsoft.com/en-us/library/aa365309.aspx&lt;br /&gt;
&lt;br /&gt;
; Adds an ICMPv4 rule to allow incoming echo reply messages (IcmpCodeAndType = 0:0)&lt;br /&gt;
  SimpleFC::AdvAddRule &amp;quot;Echo-Reply (ICMPv4 incoming)&amp;quot; \&lt;br /&gt;
    &amp;quot;Allows incoming Echo Replies messages.&amp;quot; &amp;quot;1&amp;quot; &amp;quot;1&amp;quot; &amp;quot;1&amp;quot; &amp;quot;7&amp;quot; &amp;quot;1&amp;quot; &amp;quot;&amp;quot; \ &lt;br /&gt;
    &amp;quot;0:0&amp;quot; &amp;quot;@PathToApplication,-10000&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Adds an ICMPv4 rule to allow incoming echo request messages (IcmpCodeAndType = 8:0)&lt;br /&gt;
  SimpleFC::AdvAddRule &amp;quot;Echo-Request (ICMPv4 incoming)&amp;quot; \&lt;br /&gt;
    &amp;quot;Allows incoming ICMP Echo messages.&amp;quot; &amp;quot;1&amp;quot; &amp;quot;1&amp;quot; &amp;quot;1&amp;quot; &amp;quot;7&amp;quot; &amp;quot;1&amp;quot; &amp;quot;&amp;quot; \&lt;br /&gt;
    &amp;quot;8:0&amp;quot; &amp;quot;@PathToApplication,-10000&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Add an application rule to allow incoming TCP access on this application&lt;br /&gt;
  SimpleFC::AdvAddRule &amp;quot;Incoming requests (TCP incoming)&amp;quot; \ &lt;br /&gt;
    &amp;quot;Allows incoming requests.&amp;quot; &amp;quot;6&amp;quot; &amp;quot;1&amp;quot; &amp;quot;1&amp;quot; &amp;quot;7&amp;quot; &amp;quot;1&amp;quot; &amp;quot;PathToApplication&amp;quot; \ &lt;br /&gt;
    &amp;quot;&amp;quot; &amp;quot;@PathToApplication,-10000&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Add an application rule to allow incoming UDP access on this application&lt;br /&gt;
  SimpleFC::AdvAddRule &amp;quot;Incoming requests (UDP incoming)&amp;quot; \&lt;br /&gt;
    &amp;quot;Allows incoming requests.&amp;quot; &amp;quot;17&amp;quot; &amp;quot;1&amp;quot; &amp;quot;1&amp;quot; &amp;quot;7&amp;quot; &amp;quot;1&amp;quot; &amp;quot;PathToApplication&amp;quot; \ &lt;br /&gt;
    &amp;quot;&amp;quot; &amp;quot;@PathToApplication,-10000&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Removes a firewall rule&lt;br /&gt;
  SimpleFC::AdvRemoveRule &amp;quot;Incoming requests (UDP incoming)&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
&lt;br /&gt;
; Check if the firewall exists&lt;br /&gt;
  SimpleFC::AdvExistsRule &amp;quot;Incoming requests (UDP incoming)&amp;quot;&lt;br /&gt;
  Pop $0 ; return error(1)/success(0)&lt;br /&gt;
  Pop $1 ; return 1=Exists/0=DoesnÂ´t exists&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Changelog ==&lt;br /&gt;
*Version 1.18 (2010-02-23)&lt;br /&gt;
**Documentation updated&lt;br /&gt;
*Version 1.17 (2009-09-05)&lt;br /&gt;
**Added changes from the service manager&lt;br /&gt;
**The following functions are now case insensitive:&lt;br /&gt;
***SimpleFC::IsApplicationAdded&lt;br /&gt;
***SimpleFC::IsApplicationEnabled&lt;br /&gt;
***SimpleFC::EnableDisableApplication&lt;br /&gt;
***SimpleFC::AdvExistsRule&lt;br /&gt;
*Version 1.16 (2009-04-13)&lt;br /&gt;
**Added changes from the service manager&lt;br /&gt;
*Version 1.15 (2008-08-18)&lt;br /&gt;
**Added changes from the service manager and checked removed compiler optimization to avoid a false-positive virusscan.&lt;br /&gt;
*Version 1.14 (2008-02-05)&lt;br /&gt;
** Added changes from the service manager&lt;br /&gt;
*Version 1.13 (2008-01-29)&lt;br /&gt;
** Added changes from the service manager&lt;br /&gt;
*Version 1.12 (2007-11-13)&lt;br /&gt;
** Fixed wrong documentation about SimpleFC::AdvExistsRule&lt;br /&gt;
*Version 1.11 (2007-08-07)&lt;br /&gt;
** Fixed potential endless loop bug in SimpleFC::StartStopFirewallService&lt;br /&gt;
*Version 1.10 (2007-08-02)&lt;br /&gt;
** Added default firewall functions:&lt;br /&gt;
*** SimpleFC::RestoreDefaults&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpOutboundDestinationUnreachable&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpRedirect&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpInboundEchoRequest&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpOutboundTimeExceeded&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpOutboundParameterProblem&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpOutboundSourceQuench&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpInboundRouterRequest&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpInboundTimestampRequest&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpInboundMaskRequest&lt;br /&gt;
*** SimpleFC::AllowDisallowIcmpOutboundPacketTooBig&lt;br /&gt;
*** SimpleFC::IsIcmpTypeAllowed&lt;br /&gt;
** Added functions for Windows Firewall with Advanced Security&lt;br /&gt;
*** SimpleFC::AdvAddRule&lt;br /&gt;
*** SimpleFC::AdvRemoveRule&lt;br /&gt;
*** SimpleFC::AdvExistsRule&lt;br /&gt;
*Version 1.01 (2007-07-05)&lt;br /&gt;
**Changed missing documentation about the function SimpleFC::IsFirewallEnabled&lt;br /&gt;
*Version 1.0 (2007-05-02)&lt;br /&gt;
**First offical version&lt;br /&gt;
&lt;br /&gt;
== Important Notes ==&lt;br /&gt;
&lt;br /&gt;
*This plugin is running with Windows XP SP2, Windows 2003, Windows Vista and Windows 7&lt;br /&gt;
*Before you execute some plugin commands it is recommend to check for windows firewall service is running (SimpleFC::IsFirewallServiceRunning).&lt;br /&gt;
*All functions with the prefix &amp;quot;Adv&amp;quot; are only for Windows Firewall with Advanced Security (Windows Vista).&lt;br /&gt;
&lt;br /&gt;
* If you have any suggestions, comments or questions please mail me: mailto:rainer@speed-soft.de&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Plugins]]&lt;/div&gt;</summary>
		<author><name>Speed78</name></author>
	</entry>
	<entry>
		<id>https://nsis.sourceforge.io/mediawiki/index.php?title=NSIS_Simple_Service_Plugin&amp;diff=18913</id>
		<title>NSIS Simple Service Plugin</title>
		<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/mediawiki/index.php?title=NSIS_Simple_Service_Plugin&amp;diff=18913"/>
		<updated>2010-09-14T11:29:15Z</updated>

		<summary type="html">&lt;p&gt;Speed78: /* Changelog */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This plugin contains basic service functions like start, stop the service or checking the service status. It also contains advanced service functions for example setting the service description, changed the logon account, granting or removing the service logon privilege.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This plugin is using the MPL License or alternatively the LGPL License.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
&amp;lt;attach&amp;gt;NSIS_Simple_Service_Plugin_1.28.zip&amp;lt;/attach&amp;gt; The ZIP file containing a precompiled plugin DLL (to be saved in NSIS&#039; plugin directory) and the sources. If you update from a previous version it is strongly &#039;&#039;&#039;recommend&#039;&#039;&#039; to take look at the changelog.&lt;br /&gt;
&lt;br /&gt;
== Donation ==&lt;br /&gt;
If you believe that I am doing a good job and you want to support me please [http://www.speed-soft.de/donation/index.php?language=en donate] any amount via PayPal.&lt;br /&gt;
&lt;br /&gt;
== Short Reference ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
SimpleSC::InstallService [name_of_service] [display_name] [service_type] [start_type] &lt;br /&gt;
  [binary_path] [dependencies] [account] [password]&lt;br /&gt;
SimpleSC::RemoveService [name_of_service]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::StartService [name_of_service] [arguments]&lt;br /&gt;
SimpleSC::StopService [name_of_service] [wait_for_file_release]&lt;br /&gt;
SimpleSC::PauseService [name_of_service] &lt;br /&gt;
SimpleSC::ContinueService [name_of_service]&lt;br /&gt;
SimpleSC::RestartService [name_of_service] [arguments]&lt;br /&gt;
SimpleSC::ExistsService [name_of_service]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::GetServiceDisplayName [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceName [display_name]&lt;br /&gt;
SimpleSC::GetServiceStatus [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceDescription [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceStartType [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceBinaryPath [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceLogon [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceFailure [name_of_service]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::SetServiceDescription [name_of_service] [service_description]&lt;br /&gt;
SimpleSC::SetServiceStartType [name_of_service] [start_type]&lt;br /&gt;
SimpleSC::SetServiceBinaryPath [name_of_service] [binary_path]&lt;br /&gt;
SimpleSC::SetServiceLogon [name_of_service] [account] [password]&lt;br /&gt;
SimpleSC::SetServiceFailure [name_of_service] [reset_period] [reboot_message] [command] &lt;br /&gt;
  [action_type_1] [action_delay_1] [action_type_2] [action_delay_2] [action_type_3] &lt;br /&gt;
  [action_delay_3] &lt;br /&gt;
&lt;br /&gt;
SimpleSC::GrantServiceLogonPrivilege [account]&lt;br /&gt;
SimpleSC::RemoveServiceLogonPrivilege [account]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::ServiceIsPaused [name_of_service]&lt;br /&gt;
SimpleSC::ServiceIsRunning [name_of_service]&lt;br /&gt;
SimpleSC::ServiceIsStopped [name_of_service]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::GetErrorMessage [error_code]&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
*name_of_service - The name of the service used for Start/Stop commands and all further commands &lt;br /&gt;
*display_name - The name as shown in the service control manager applet in system control &lt;br /&gt;
*service_type - One of the following codes &lt;br /&gt;
**1 - SERVICE_KERNEL_DRIVER - Driver service.&lt;br /&gt;
**2 - SERVICE_FILE_SYSTEM_DRIVER - File system driver service.&lt;br /&gt;
**16 - SERVICE_WIN32_OWN_PROCESS - Service that runs in its own process. (Should be used in most cases)&lt;br /&gt;
**32 - SERVICE_WIN32_SHARE_PROCESS - Service that shares a process with one or more other services. &lt;br /&gt;
**256 - SERVICE_INTERACTIVE_PROCESS - The service can interact with the desktop. &lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: If you specify either SERVICE_WIN32_OWN_PROCESS or SERVICE_WIN32_SHARE_PROCESS,          and the service is running in the context of the LocalSystem account,          you can also specify this value. Example: SERVICE_WIN32_OWN_PROCESS or SERVICE_INTERACTIVE_PROCESS - (16 or 256) = 272&lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: Services cannot directly interact with a user as of Windows Vista.             Therefore, this technique should not be used in new code. See for more information: http://msdn2.microsoft.com/en-us/library/ms683502(VS.85).aspx          &lt;br /&gt;
&lt;br /&gt;
*start_type - one of the following codes &lt;br /&gt;
**0 - SERVICE_BOOT_START - Driver boot stage start &lt;br /&gt;
**1 - SERVICE_SYSTEM_START - Driver scm stage start &lt;br /&gt;
**2 - SERVICE_AUTO_START - Service auto start (Should be used in most cases)&lt;br /&gt;
**3 - SERVICE_DEMAND_START - Driver/service manual start &lt;br /&gt;
**4 - SERVICE_DISABLED - Driver/service disabled&lt;br /&gt;
*service_status - one of the following codes&lt;br /&gt;
**1 - SERVICE_STOPPED&lt;br /&gt;
**2 - SERVICE_START_PENDING&lt;br /&gt;
**3 - SERVICE_STOP_PENDING&lt;br /&gt;
**4 - SERVICE_RUNNING&lt;br /&gt;
**5 - SERVICE_CONTINUE_PENDING&lt;br /&gt;
**6 - SERVICE_PAUSE_PENDING&lt;br /&gt;
**7 - SERVICE_PAUSED&lt;br /&gt;
*binary_path - The path to the binary including all necessary parameters &lt;br /&gt;
*dependencies - Needed services, controls which services have to be started before this one; use the forward slash &amp;quot;/&amp;quot; to add more more than one service&lt;br /&gt;
*account - The username/account which should be used &lt;br /&gt;
*password - Password of the aforementioned account to be able to logon as a service &lt;br /&gt;
**&#039;&#039;&#039;Note&#039;&#039;&#039;: If you do not specify account/password, the local system account will be used to run the service&lt;br /&gt;
*arguments - Arguments passed to the service main function. &lt;br /&gt;
**&#039;&#039;&#039;Note&#039;&#039;&#039;: Driver services do not receive these arguments.&lt;br /&gt;
*reset_period - The time after which to reset the failure count to zero if there are no failures, in seconds. Specify 0 (INFINITE) to indicate that this value should never be reset&lt;br /&gt;
*reboot_message - The message to be broadcast to server users before rebooting&lt;br /&gt;
*command - The command line of the process to execute in response to the SC_ACTION_RUN_COMMAND service controller action. This process runs under the same account as the service&lt;br /&gt;
*action_type_x - one of the following codes for the action to be performed&lt;br /&gt;
**0 - SC_ACTION_NONE - No action&lt;br /&gt;
**1 - SC_ACTION_RESTART - Restart the service&lt;br /&gt;
**2 - SC_ACTION_REBOOT - Reboot the computer (Note: The service user must have the SE_SHUTDOWN_NAME privilege)&lt;br /&gt;
**3 - SC_ACTION_RUN_COMMAND - Run a command&lt;br /&gt;
*action_delay_x - The time to wait before performing the specified action, in milliseconds&lt;br /&gt;
*error_code - Error code of a function&lt;br /&gt;
*service_description - The description as shown in the service control manager applet in system control&lt;br /&gt;
*wait_for_file_release - Wait for file release after the service is stopped. This is useful if the binary file will be overwritten after stopping the service.&lt;br /&gt;
**0 - NO_WAIT - No wait for file release&lt;br /&gt;
**1 - WAIT - Wait for file release &lt;br /&gt;
**&#039;&#039;&#039;Note&#039;&#039;&#039;: If SERVICE_WIN32_OWN_PROCESS is used this option should be set to WAIT.	If SERVICE_WIN32_SHARE_PROCESS is used this option should only be set to WAIT if the last service in the process is stopped.&lt;br /&gt;
&lt;br /&gt;
== The Sample Script ==&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
; Install a service - ServiceType own process - StartType automatic - NoDependencies -  Logon as System Account&lt;br /&gt;
  SimpleSC::InstallService &amp;quot;MyService&amp;quot; &amp;quot;My Service Display Name&amp;quot; &amp;quot;16&amp;quot; &amp;quot;2&amp;quot; &amp;quot;C:\MyPath\MyService.exe&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Install a service - ServiceType interact with desktop - StartType automatic - Dependencies on &amp;quot;Windows Time Service&amp;quot; (w32time) and &amp;quot;WWW Publishing Service&amp;quot; (w3svc) - Logon as System Account&lt;br /&gt;
  SimpleSC::InstallService &amp;quot;MyService&amp;quot; &amp;quot;My Service Display Name&amp;quot; &amp;quot;272&amp;quot; &amp;quot;2&amp;quot; &amp;quot;C:\MyPath\MyService.exe&amp;quot; &amp;quot;w32time/w3svc&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Remove a service&lt;br /&gt;
  SimpleSC::RemoveService &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Start a service&lt;br /&gt;
  SimpleSC::StartService &amp;quot;MyService&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Start a service with two arguments &amp;quot;/param1=true&amp;quot; &amp;quot;/param2=1&amp;quot;&lt;br /&gt;
  SimpleSC::StartService &amp;quot;MyService&amp;quot; &amp;quot;/param1=true /param2=1&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
 &lt;br /&gt;
; Start a service with two arguments &amp;quot;-p param1&amp;quot; &amp;quot;-param2&amp;quot;&lt;br /&gt;
  SimpleSC::StartService &amp;quot;MyService&amp;quot; &#039;&amp;quot;-p param1&amp;quot; -param2&#039;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Stop a service and waits for file release&lt;br /&gt;
  SimpleSC::StopService &amp;quot;MyService&amp;quot; 1&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Stops two services and waits for file release after the last service is stopped&lt;br /&gt;
  SimpleSC::StopService &amp;quot;MyService1&amp;quot; 0&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  SimpleSC::StopService &amp;quot;MyService2&amp;quot; 1&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Pause a service&lt;br /&gt;
  SimpleSC::PauseService &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Continue a service&lt;br /&gt;
  SimpleSC::ContinueService &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Restart a service&lt;br /&gt;
  SimpleSC::RestartService &amp;quot;MyService&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Restart a service with two arguments &amp;quot;/param1=true&amp;quot; &amp;quot;/param2=1&amp;quot;&lt;br /&gt;
  SimpleSC::RestartService &amp;quot;MyService&amp;quot; &amp;quot;/param1=true /param2=1&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Start a service with two arguments &amp;quot;-p param1&amp;quot; &amp;quot;-param2&amp;quot;&lt;br /&gt;
  SimpleSC::RestartService &amp;quot;MyService&amp;quot; &#039;&amp;quot;-p param1&amp;quot; -param2&#039;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Check if the service exists&lt;br /&gt;
  SimpleSC::ExistsService &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode if the service doesnÂ´t exists (&amp;lt;&amp;gt;0)/service exists (0)&lt;br /&gt;
&lt;br /&gt;
; Get the displayname of a service&lt;br /&gt;
  SimpleSC::GetServiceDisplayName &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the displayname of the service&lt;br /&gt;
&lt;br /&gt;
; Get the servicename of a service by the displayname&lt;br /&gt;
  SimpleSC::GetServiceName &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the servicename of the service&lt;br /&gt;
&lt;br /&gt;
; Get the current status of a service&lt;br /&gt;
  SimpleSC::GetServiceStatus &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; return the status of the service (See &amp;quot;service_status&amp;quot; in the parameters)&lt;br /&gt;
&lt;br /&gt;
; Get the description of a service&lt;br /&gt;
  SimpleSC::GetServiceDescription &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the description of the service&lt;br /&gt;
 &lt;br /&gt;
; Get the start type of the service&lt;br /&gt;
  SimpleSC::GetServiceStartType &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the start type of the service (see &amp;quot;start_type&amp;quot; in the parameters)&lt;br /&gt;
&lt;br /&gt;
; Get the binary path of a service&lt;br /&gt;
  SimpleSC::GetServiceBinaryPath &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the binary path of the service&lt;br /&gt;
&lt;br /&gt;
; Get the logon user of the service&lt;br /&gt;
  SimpleSC::GetServiceLogon &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the logon username of the service  &lt;br /&gt;
&lt;br /&gt;
; Get the failure configuration of the service&lt;br /&gt;
  SimpleSC::GetServiceFailure &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the reset period &lt;br /&gt;
  Pop $2 ; returns the reboot message&lt;br /&gt;
  Pop $3 ; returns the command&lt;br /&gt;
  Pop $4 ; returns the first action (See &amp;quot;action_type_x&amp;quot; in the parameters)&lt;br /&gt;
  Pop $5 ; returns the first action delay &lt;br /&gt;
  Pop $6 ; returns the second action (See &amp;quot;action_type_x&amp;quot; in the parameters)&lt;br /&gt;
  Pop $7 ; returns the second action delay &lt;br /&gt;
  Pop $8 ; returns the third action (See &amp;quot;action_type_x&amp;quot; in the parameters)&lt;br /&gt;
  Pop $9 ; returns the third action delay &lt;br /&gt;
&lt;br /&gt;
; Set the description of a service (Not supported on Windows NT 4.0)&lt;br /&gt;
  SimpleSC::SetServiceDescription &amp;quot;MyService&amp;quot; &amp;quot;Sample Description&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Set the starttype to automatic of a service&lt;br /&gt;
  SimpleSC::SetServiceStartType &amp;quot;MyService&amp;quot; &amp;quot;2&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Sets the service binary path&lt;br /&gt;
  SimpleSC::SetServiceBinaryPath &amp;quot;MyService&amp;quot; &amp;quot;C:\MySoftware\MyService.exe&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Sets the service logon to a user and grant the user the &amp;quot;SeServiceLogonPrivilege&amp;quot;&lt;br /&gt;
  SimpleSC::SetServiceLogon &amp;quot;MyService&amp;quot; &amp;quot;MyServiceUser&amp;quot; &amp;quot;MyServiceUserPassword&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  IntCmp $0 0 +1 Done Done ; If successful grant the service logon privilege to &amp;quot;MyServiceUser&amp;quot;&lt;br /&gt;
    ; Note: Every serviceuser must have the ServiceLogonPrivilege to start the service&lt;br /&gt;
    SimpleSC::GrantServiceLogonPrivilege &amp;quot;MyServiceUser&amp;quot;&lt;br /&gt;
    Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Done:&lt;br /&gt;
&lt;br /&gt;
; Sets the service failure configuration - First action: Restart the service after one minute - Second action: Reboot the computer after five minutes&lt;br /&gt;
  SimpleSC::SetServiceFailure &amp;quot;MyService&amp;quot; &amp;quot;0&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;1&amp;quot; &amp;quot;60000&amp;quot; &amp;quot;2&amp;quot; &amp;quot;300000&amp;quot; &amp;quot;0&amp;quot; &amp;quot;0&amp;quot; &lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Remove the &amp;quot;SeServiceLogonPrivilege&amp;quot; from a user&lt;br /&gt;
  SimpleSC::RemoveServiceLogonPrivilege &amp;quot;MyServiceUser&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Check if the service is paused&lt;br /&gt;
  SimpleSC::ServiceIsPaused &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns 1 (service is paused) - returns 0 (service is not paused)&lt;br /&gt;
&lt;br /&gt;
; Check if the service is running&lt;br /&gt;
  SimpleSC::ServiceIsRunning &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns 1 (service is running) - returns 0 (service is not running)&lt;br /&gt;
&lt;br /&gt;
; Check if the service is stopped&lt;br /&gt;
  SimpleSC::ServiceIsStopped &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns 1 (service is stopped) - returns 0 (service is not stopped)&lt;br /&gt;
&lt;br /&gt;
; Show the error message if a function fails &lt;br /&gt;
  SimpleSC::StopService &amp;quot;MyService&amp;quot; 1&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  IntCmp $0 0 Done +1 +1 &lt;br /&gt;
    Push $0&lt;br /&gt;
    SimpleSC::GetErrorMessage&lt;br /&gt;
    Pop $0&lt;br /&gt;
    MessageBox MB_OK|MB_ICONSTOP &amp;quot;Stopping fails - Reason: $0&amp;quot;&lt;br /&gt;
  Done:&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Changelog ==&lt;br /&gt;
* Version 1.28 (2010-09-14)&lt;br /&gt;
**SimpleSC::GetServiceFailure function added&lt;br /&gt;
**SimpleSC::SetServiceFailure function added&lt;br /&gt;
**SimpleSC::StopService WaitForFileRelease feature added (For details take a look at the documentation)&lt;br /&gt;
* Version 1.27 (2010-03-23)&lt;br /&gt;
**Documentation updated&lt;br /&gt;
* Version 1.26 (2009-05-21)&lt;br /&gt;
**Fixed wait for status bug on starting, stopping, pausing or continuing a service &lt;br /&gt;
* Version 1.25 (2009-04-23)&lt;br /&gt;
**SimpleSC::SetServiceLogon supports now non-domain username without the &amp;quot;.\&amp;quot;-prefix&lt;br /&gt;
**SimpleSC::SetServiceBinaryPath function added&lt;br /&gt;
*Version 1.24 (2009-04-13)&lt;br /&gt;
**Fixed wait for status bug if the service status changed. Now, if a service stops, starts aso. the plugin will work like the recommendations in the MSDN.&lt;br /&gt;
*Version 1.23 (2008-08-23)&lt;br /&gt;
**Removed compiler optimization to avoid a false-positive virusscan.&lt;br /&gt;
*Version 1.22 (2008-08-17)&lt;br /&gt;
**SimpleSC::GrantServiceLogonPrivilege and SimpleSC::RemoveServiceLogonPrivilege works now correct with domain names like MyDomain\MyUser.&lt;br /&gt;
**Added function SimpleSC::GetServiceLogon to get the logon username of a service.&lt;br /&gt;
*Version 1.21 (2008-02-10)&lt;br /&gt;
**SimpleSC::ExistsService results now 0 if the service exists and &amp;lt;&amp;gt; 0 if the service doensnÂ´t exists.&lt;br /&gt;
*Version 1.20 (2008-02-05)&lt;br /&gt;
**Every function now returns &amp;lt;&amp;gt; 0 if there is an error. Use SimpleSC::GetErrorMessage to get the message of a function result.&lt;br /&gt;
**Added function SimpleSC::GetErrorMessage to get the message of a function result.&lt;br /&gt;
**SimpleSC::ExistsService results now 0 if the service exists and &amp;lt;&amp;gt; 0 if the service doensnÂ´t exists.&lt;br /&gt;
**SimpleSC::RestartService supports now arguments.&lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: The signature has been changed. If you update from a previous version you must check your parameters.&lt;br /&gt;
*Version 1.10 (2008-01-29)&lt;br /&gt;
**SimpleSC::InstallService supports now more than one dependencies (delimitter is the forward slash).&lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: The signature has been changed. If you update from a previous version you must check your parameters.&lt;br /&gt;
**SimpleSC::InstallService supports now more service types e.g. to create an interactive service.&lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: The signature has been changed. If you update from a previous version you must check your parameters.&lt;br /&gt;
**SimpleSC::StartService supports now arguments. &lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: The signature has been changed. If you update from a previous version you must check your parameters.&lt;br /&gt;
*Version 1.05 (2008-01-12)&lt;br /&gt;
**The functions SimpleSC::StopService and SimpleSC::RestartService are now improved. Now all dependent services are stopping recursively too.&lt;br /&gt;
*Version 1.04 (2007-08-07)&lt;br /&gt;
**Fixed bug for possible endless loops. This concerns to the functions StartService, StopService, ContinueService and PauseService. &lt;br /&gt;
*Version 1.03 (2007-08-02)&lt;br /&gt;
**Added function SimpleSC::GetServiceBinaryPath to get the binary path of a specified service.&lt;br /&gt;
*Version 1.02 (2007-05-29)&lt;br /&gt;
**Changed wrong documentation informations about the functions SimpleSC::InstallService and SimpleSC::RemoveService.&lt;br /&gt;
*Version 1.01 (2007-05-07)&lt;br /&gt;
**Changed wrong status-results in Readme.txt. This concerns to the functions ServiceIsPaused, ServiceIsRunning and ServiceIsStopped.&lt;br /&gt;
**Changed the access privileges of the plugin. The plugin now uses the lowest privlege of each function to execute.&lt;br /&gt;
*Version 1.0 (2007-05-02)&lt;br /&gt;
**First offical version&lt;br /&gt;
&lt;br /&gt;
== Important Notes ==&lt;br /&gt;
*The function &amp;quot;SetServiceLogon&amp;quot; only works if the servicetype is &amp;quot;SERVICE_WIN32_OWN_PROCESS&amp;quot;&lt;br /&gt;
* The functions &amp;quot;GetServiceDescription&amp;quot; or &amp;quot;SetServiceDescription&amp;quot; are only available on systems higher than Windows NT. &lt;br /&gt;
* If you change the logon of an service to a new user you have to grant him the Service Logon Privilege. Otherwise the service cannot be started by the user you have assigned.&lt;br /&gt;
* The functions StartService, StopService, PauseService and ContinueService uses a timeout of 30 seconds. This means the function must be executed within 30 seconds, otherwise the functions will return an error.&lt;br /&gt;
* If you have any suggestions, comments or questions please mail me: mailto:rainer@speed-soft.de&lt;br /&gt;
&lt;br /&gt;
[[Category:Plugins]]&lt;/div&gt;</summary>
		<author><name>Speed78</name></author>
	</entry>
	<entry>
		<id>https://nsis.sourceforge.io/mediawiki/index.php?title=NSIS_Simple_Service_Plugin&amp;diff=18912</id>
		<title>NSIS Simple Service Plugin</title>
		<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/mediawiki/index.php?title=NSIS_Simple_Service_Plugin&amp;diff=18912"/>
		<updated>2010-09-14T11:22:50Z</updated>

		<summary type="html">&lt;p&gt;Speed78: /* Changelog */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This plugin contains basic service functions like start, stop the service or checking the service status. It also contains advanced service functions for example setting the service description, changed the logon account, granting or removing the service logon privilege.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This plugin is using the MPL License or alternatively the LGPL License.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
&amp;lt;attach&amp;gt;NSIS_Simple_Service_Plugin_1.28.zip&amp;lt;/attach&amp;gt; The ZIP file containing a precompiled plugin DLL (to be saved in NSIS&#039; plugin directory) and the sources. If you update from a previous version it is strongly &#039;&#039;&#039;recommend&#039;&#039;&#039; to take look at the changelog.&lt;br /&gt;
&lt;br /&gt;
== Donation ==&lt;br /&gt;
If you believe that I am doing a good job and you want to support me please [http://www.speed-soft.de/donation/index.php?language=en donate] any amount via PayPal.&lt;br /&gt;
&lt;br /&gt;
== Short Reference ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
SimpleSC::InstallService [name_of_service] [display_name] [service_type] [start_type] &lt;br /&gt;
  [binary_path] [dependencies] [account] [password]&lt;br /&gt;
SimpleSC::RemoveService [name_of_service]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::StartService [name_of_service] [arguments]&lt;br /&gt;
SimpleSC::StopService [name_of_service] [wait_for_file_release]&lt;br /&gt;
SimpleSC::PauseService [name_of_service] &lt;br /&gt;
SimpleSC::ContinueService [name_of_service]&lt;br /&gt;
SimpleSC::RestartService [name_of_service] [arguments]&lt;br /&gt;
SimpleSC::ExistsService [name_of_service]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::GetServiceDisplayName [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceName [display_name]&lt;br /&gt;
SimpleSC::GetServiceStatus [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceDescription [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceStartType [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceBinaryPath [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceLogon [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceFailure [name_of_service]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::SetServiceDescription [name_of_service] [service_description]&lt;br /&gt;
SimpleSC::SetServiceStartType [name_of_service] [start_type]&lt;br /&gt;
SimpleSC::SetServiceBinaryPath [name_of_service] [binary_path]&lt;br /&gt;
SimpleSC::SetServiceLogon [name_of_service] [account] [password]&lt;br /&gt;
SimpleSC::SetServiceFailure [name_of_service] [reset_period] [reboot_message] [command] &lt;br /&gt;
  [action_type_1] [action_delay_1] [action_type_2] [action_delay_2] [action_type_3] &lt;br /&gt;
  [action_delay_3] &lt;br /&gt;
&lt;br /&gt;
SimpleSC::GrantServiceLogonPrivilege [account]&lt;br /&gt;
SimpleSC::RemoveServiceLogonPrivilege [account]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::ServiceIsPaused [name_of_service]&lt;br /&gt;
SimpleSC::ServiceIsRunning [name_of_service]&lt;br /&gt;
SimpleSC::ServiceIsStopped [name_of_service]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::GetErrorMessage [error_code]&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
*name_of_service - The name of the service used for Start/Stop commands and all further commands &lt;br /&gt;
*display_name - The name as shown in the service control manager applet in system control &lt;br /&gt;
*service_type - One of the following codes &lt;br /&gt;
**1 - SERVICE_KERNEL_DRIVER - Driver service.&lt;br /&gt;
**2 - SERVICE_FILE_SYSTEM_DRIVER - File system driver service.&lt;br /&gt;
**16 - SERVICE_WIN32_OWN_PROCESS - Service that runs in its own process. (Should be used in most cases)&lt;br /&gt;
**32 - SERVICE_WIN32_SHARE_PROCESS - Service that shares a process with one or more other services. &lt;br /&gt;
**256 - SERVICE_INTERACTIVE_PROCESS - The service can interact with the desktop. &lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: If you specify either SERVICE_WIN32_OWN_PROCESS or SERVICE_WIN32_SHARE_PROCESS,          and the service is running in the context of the LocalSystem account,          you can also specify this value. Example: SERVICE_WIN32_OWN_PROCESS or SERVICE_INTERACTIVE_PROCESS - (16 or 256) = 272&lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: Services cannot directly interact with a user as of Windows Vista.             Therefore, this technique should not be used in new code. See for more information: http://msdn2.microsoft.com/en-us/library/ms683502(VS.85).aspx          &lt;br /&gt;
&lt;br /&gt;
*start_type - one of the following codes &lt;br /&gt;
**0 - SERVICE_BOOT_START - Driver boot stage start &lt;br /&gt;
**1 - SERVICE_SYSTEM_START - Driver scm stage start &lt;br /&gt;
**2 - SERVICE_AUTO_START - Service auto start (Should be used in most cases)&lt;br /&gt;
**3 - SERVICE_DEMAND_START - Driver/service manual start &lt;br /&gt;
**4 - SERVICE_DISABLED - Driver/service disabled&lt;br /&gt;
*service_status - one of the following codes&lt;br /&gt;
**1 - SERVICE_STOPPED&lt;br /&gt;
**2 - SERVICE_START_PENDING&lt;br /&gt;
**3 - SERVICE_STOP_PENDING&lt;br /&gt;
**4 - SERVICE_RUNNING&lt;br /&gt;
**5 - SERVICE_CONTINUE_PENDING&lt;br /&gt;
**6 - SERVICE_PAUSE_PENDING&lt;br /&gt;
**7 - SERVICE_PAUSED&lt;br /&gt;
*binary_path - The path to the binary including all necessary parameters &lt;br /&gt;
*dependencies - Needed services, controls which services have to be started before this one; use the forward slash &amp;quot;/&amp;quot; to add more more than one service&lt;br /&gt;
*account - The username/account which should be used &lt;br /&gt;
*password - Password of the aforementioned account to be able to logon as a service &lt;br /&gt;
**&#039;&#039;&#039;Note&#039;&#039;&#039;: If you do not specify account/password, the local system account will be used to run the service&lt;br /&gt;
*arguments - Arguments passed to the service main function. &lt;br /&gt;
**&#039;&#039;&#039;Note&#039;&#039;&#039;: Driver services do not receive these arguments.&lt;br /&gt;
*reset_period - The time after which to reset the failure count to zero if there are no failures, in seconds. Specify 0 (INFINITE) to indicate that this value should never be reset&lt;br /&gt;
*reboot_message - The message to be broadcast to server users before rebooting&lt;br /&gt;
*command - The command line of the process to execute in response to the SC_ACTION_RUN_COMMAND service controller action. This process runs under the same account as the service&lt;br /&gt;
*action_type_x - one of the following codes for the action to be performed&lt;br /&gt;
**0 - SC_ACTION_NONE - No action&lt;br /&gt;
**1 - SC_ACTION_RESTART - Restart the service&lt;br /&gt;
**2 - SC_ACTION_REBOOT - Reboot the computer (Note: The service user must have the SE_SHUTDOWN_NAME privilege)&lt;br /&gt;
**3 - SC_ACTION_RUN_COMMAND - Run a command&lt;br /&gt;
*action_delay_x - The time to wait before performing the specified action, in milliseconds&lt;br /&gt;
*error_code - Error code of a function&lt;br /&gt;
*service_description - The description as shown in the service control manager applet in system control&lt;br /&gt;
*wait_for_file_release - Wait for file release after the service is stopped. This is useful if the binary file will be overwritten after stopping the service.&lt;br /&gt;
**0 - NO_WAIT - No wait for file release&lt;br /&gt;
**1 - WAIT - Wait for file release &lt;br /&gt;
**&#039;&#039;&#039;Note&#039;&#039;&#039;: If SERVICE_WIN32_OWN_PROCESS is used this option should be set to WAIT.	If SERVICE_WIN32_SHARE_PROCESS is used this option should only be set to WAIT if the last service in the process is stopped.&lt;br /&gt;
&lt;br /&gt;
== The Sample Script ==&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
; Install a service - ServiceType own process - StartType automatic - NoDependencies -  Logon as System Account&lt;br /&gt;
  SimpleSC::InstallService &amp;quot;MyService&amp;quot; &amp;quot;My Service Display Name&amp;quot; &amp;quot;16&amp;quot; &amp;quot;2&amp;quot; &amp;quot;C:\MyPath\MyService.exe&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Install a service - ServiceType interact with desktop - StartType automatic - Dependencies on &amp;quot;Windows Time Service&amp;quot; (w32time) and &amp;quot;WWW Publishing Service&amp;quot; (w3svc) - Logon as System Account&lt;br /&gt;
  SimpleSC::InstallService &amp;quot;MyService&amp;quot; &amp;quot;My Service Display Name&amp;quot; &amp;quot;272&amp;quot; &amp;quot;2&amp;quot; &amp;quot;C:\MyPath\MyService.exe&amp;quot; &amp;quot;w32time/w3svc&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Remove a service&lt;br /&gt;
  SimpleSC::RemoveService &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Start a service&lt;br /&gt;
  SimpleSC::StartService &amp;quot;MyService&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Start a service with two arguments &amp;quot;/param1=true&amp;quot; &amp;quot;/param2=1&amp;quot;&lt;br /&gt;
  SimpleSC::StartService &amp;quot;MyService&amp;quot; &amp;quot;/param1=true /param2=1&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
 &lt;br /&gt;
; Start a service with two arguments &amp;quot;-p param1&amp;quot; &amp;quot;-param2&amp;quot;&lt;br /&gt;
  SimpleSC::StartService &amp;quot;MyService&amp;quot; &#039;&amp;quot;-p param1&amp;quot; -param2&#039;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Stop a service and waits for file release&lt;br /&gt;
  SimpleSC::StopService &amp;quot;MyService&amp;quot; 1&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Stops two services and waits for file release after the last service is stopped&lt;br /&gt;
  SimpleSC::StopService &amp;quot;MyService1&amp;quot; 0&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  SimpleSC::StopService &amp;quot;MyService2&amp;quot; 1&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Pause a service&lt;br /&gt;
  SimpleSC::PauseService &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Continue a service&lt;br /&gt;
  SimpleSC::ContinueService &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Restart a service&lt;br /&gt;
  SimpleSC::RestartService &amp;quot;MyService&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Restart a service with two arguments &amp;quot;/param1=true&amp;quot; &amp;quot;/param2=1&amp;quot;&lt;br /&gt;
  SimpleSC::RestartService &amp;quot;MyService&amp;quot; &amp;quot;/param1=true /param2=1&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Start a service with two arguments &amp;quot;-p param1&amp;quot; &amp;quot;-param2&amp;quot;&lt;br /&gt;
  SimpleSC::RestartService &amp;quot;MyService&amp;quot; &#039;&amp;quot;-p param1&amp;quot; -param2&#039;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Check if the service exists&lt;br /&gt;
  SimpleSC::ExistsService &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode if the service doesnÂ´t exists (&amp;lt;&amp;gt;0)/service exists (0)&lt;br /&gt;
&lt;br /&gt;
; Get the displayname of a service&lt;br /&gt;
  SimpleSC::GetServiceDisplayName &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the displayname of the service&lt;br /&gt;
&lt;br /&gt;
; Get the servicename of a service by the displayname&lt;br /&gt;
  SimpleSC::GetServiceName &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the servicename of the service&lt;br /&gt;
&lt;br /&gt;
; Get the current status of a service&lt;br /&gt;
  SimpleSC::GetServiceStatus &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; return the status of the service (See &amp;quot;service_status&amp;quot; in the parameters)&lt;br /&gt;
&lt;br /&gt;
; Get the description of a service&lt;br /&gt;
  SimpleSC::GetServiceDescription &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the description of the service&lt;br /&gt;
 &lt;br /&gt;
; Get the start type of the service&lt;br /&gt;
  SimpleSC::GetServiceStartType &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the start type of the service (see &amp;quot;start_type&amp;quot; in the parameters)&lt;br /&gt;
&lt;br /&gt;
; Get the binary path of a service&lt;br /&gt;
  SimpleSC::GetServiceBinaryPath &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the binary path of the service&lt;br /&gt;
&lt;br /&gt;
; Get the logon user of the service&lt;br /&gt;
  SimpleSC::GetServiceLogon &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the logon username of the service  &lt;br /&gt;
&lt;br /&gt;
; Get the failure configuration of the service&lt;br /&gt;
  SimpleSC::GetServiceFailure &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the reset period &lt;br /&gt;
  Pop $2 ; returns the reboot message&lt;br /&gt;
  Pop $3 ; returns the command&lt;br /&gt;
  Pop $4 ; returns the first action (See &amp;quot;action_type_x&amp;quot; in the parameters)&lt;br /&gt;
  Pop $5 ; returns the first action delay &lt;br /&gt;
  Pop $6 ; returns the second action (See &amp;quot;action_type_x&amp;quot; in the parameters)&lt;br /&gt;
  Pop $7 ; returns the second action delay &lt;br /&gt;
  Pop $8 ; returns the third action (See &amp;quot;action_type_x&amp;quot; in the parameters)&lt;br /&gt;
  Pop $9 ; returns the third action delay &lt;br /&gt;
&lt;br /&gt;
; Set the description of a service (Not supported on Windows NT 4.0)&lt;br /&gt;
  SimpleSC::SetServiceDescription &amp;quot;MyService&amp;quot; &amp;quot;Sample Description&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Set the starttype to automatic of a service&lt;br /&gt;
  SimpleSC::SetServiceStartType &amp;quot;MyService&amp;quot; &amp;quot;2&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Sets the service binary path&lt;br /&gt;
  SimpleSC::SetServiceBinaryPath &amp;quot;MyService&amp;quot; &amp;quot;C:\MySoftware\MyService.exe&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Sets the service logon to a user and grant the user the &amp;quot;SeServiceLogonPrivilege&amp;quot;&lt;br /&gt;
  SimpleSC::SetServiceLogon &amp;quot;MyService&amp;quot; &amp;quot;MyServiceUser&amp;quot; &amp;quot;MyServiceUserPassword&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  IntCmp $0 0 +1 Done Done ; If successful grant the service logon privilege to &amp;quot;MyServiceUser&amp;quot;&lt;br /&gt;
    ; Note: Every serviceuser must have the ServiceLogonPrivilege to start the service&lt;br /&gt;
    SimpleSC::GrantServiceLogonPrivilege &amp;quot;MyServiceUser&amp;quot;&lt;br /&gt;
    Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Done:&lt;br /&gt;
&lt;br /&gt;
; Sets the service failure configuration - First action: Restart the service after one minute - Second action: Reboot the computer after five minutes&lt;br /&gt;
  SimpleSC::SetServiceFailure &amp;quot;MyService&amp;quot; &amp;quot;0&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;1&amp;quot; &amp;quot;60000&amp;quot; &amp;quot;2&amp;quot; &amp;quot;300000&amp;quot; &amp;quot;0&amp;quot; &amp;quot;0&amp;quot; &lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Remove the &amp;quot;SeServiceLogonPrivilege&amp;quot; from a user&lt;br /&gt;
  SimpleSC::RemoveServiceLogonPrivilege &amp;quot;MyServiceUser&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Check if the service is paused&lt;br /&gt;
  SimpleSC::ServiceIsPaused &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns 1 (service is paused) - returns 0 (service is not paused)&lt;br /&gt;
&lt;br /&gt;
; Check if the service is running&lt;br /&gt;
  SimpleSC::ServiceIsRunning &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns 1 (service is running) - returns 0 (service is not running)&lt;br /&gt;
&lt;br /&gt;
; Check if the service is stopped&lt;br /&gt;
  SimpleSC::ServiceIsStopped &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns 1 (service is stopped) - returns 0 (service is not stopped)&lt;br /&gt;
&lt;br /&gt;
; Show the error message if a function fails &lt;br /&gt;
  SimpleSC::StopService &amp;quot;MyService&amp;quot; 1&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  IntCmp $0 0 Done +1 +1 &lt;br /&gt;
    Push $0&lt;br /&gt;
    SimpleSC::GetErrorMessage&lt;br /&gt;
    Pop $0&lt;br /&gt;
    MessageBox MB_OK|MB_ICONSTOP &amp;quot;Stopping fails - Reason: $0&amp;quot;&lt;br /&gt;
  Done:&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Changelog ==&lt;br /&gt;
* Version 1.28 (2010-09-14)&lt;br /&gt;
**SimpleSC::GetServiceFailure function added&lt;br /&gt;
**SimpleSC::SetServiceFailure function added&lt;br /&gt;
**SimpleSC::StopService WaitForFileRelease feature added (For details look at the documentation)&lt;br /&gt;
* Version 1.27 (2010-03-23)&lt;br /&gt;
**Documentation updated&lt;br /&gt;
* Version 1.26 (2009-05-21)&lt;br /&gt;
**Fixed wait for status bug on starting, stopping, pausing or continuing a service &lt;br /&gt;
* Version 1.25 (2009-04-23)&lt;br /&gt;
**SimpleSC::SetServiceLogon supports now non-domain username without the &amp;quot;.\&amp;quot;-prefix&lt;br /&gt;
**SimpleSC::SetServiceBinaryPath function added&lt;br /&gt;
*Version 1.24 (2009-04-13)&lt;br /&gt;
**Fixed wait for status bug if the service status changed. Now, if a service stops, starts aso. the plugin will work like the recommendations in the MSDN.&lt;br /&gt;
*Version 1.23 (2008-08-23)&lt;br /&gt;
**Removed compiler optimization to avoid a false-positive virusscan.&lt;br /&gt;
*Version 1.22 (2008-08-17)&lt;br /&gt;
**SimpleSC::GrantServiceLogonPrivilege and SimpleSC::RemoveServiceLogonPrivilege works now correct with domain names like MyDomain\MyUser.&lt;br /&gt;
**Added function SimpleSC::GetServiceLogon to get the logon username of a service.&lt;br /&gt;
*Version 1.21 (2008-02-10)&lt;br /&gt;
**SimpleSC::ExistsService results now 0 if the service exists and &amp;lt;&amp;gt; 0 if the service doensnÂ´t exists.&lt;br /&gt;
*Version 1.20 (2008-02-05)&lt;br /&gt;
**Every function now returns &amp;lt;&amp;gt; 0 if there is an error. Use SimpleSC::GetErrorMessage to get the message of a function result.&lt;br /&gt;
**Added function SimpleSC::GetErrorMessage to get the message of a function result.&lt;br /&gt;
**SimpleSC::ExistsService results now 0 if the service exists and &amp;lt;&amp;gt; 0 if the service doensnÂ´t exists.&lt;br /&gt;
**SimpleSC::RestartService supports now arguments.&lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: The signature has been changed. If you update from a previous version you must check your parameters.&lt;br /&gt;
*Version 1.10 (2008-01-29)&lt;br /&gt;
**SimpleSC::InstallService supports now more than one dependencies (delimitter is the forward slash).&lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: The signature has been changed. If you update from a previous version you must check your parameters.&lt;br /&gt;
**SimpleSC::InstallService supports now more service types e.g. to create an interactive service.&lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: The signature has been changed. If you update from a previous version you must check your parameters.&lt;br /&gt;
**SimpleSC::StartService supports now arguments. &lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: The signature has been changed. If you update from a previous version you must check your parameters.&lt;br /&gt;
*Version 1.05 (2008-01-12)&lt;br /&gt;
**The functions SimpleSC::StopService and SimpleSC::RestartService are now improved. Now all dependent services are stopping recursively too.&lt;br /&gt;
*Version 1.04 (2007-08-07)&lt;br /&gt;
**Fixed bug for possible endless loops. This concerns to the functions StartService, StopService, ContinueService and PauseService. &lt;br /&gt;
*Version 1.03 (2007-08-02)&lt;br /&gt;
**Added function SimpleSC::GetServiceBinaryPath to get the binary path of a specified service.&lt;br /&gt;
*Version 1.02 (2007-05-29)&lt;br /&gt;
**Changed wrong documentation informations about the functions SimpleSC::InstallService and SimpleSC::RemoveService.&lt;br /&gt;
*Version 1.01 (2007-05-07)&lt;br /&gt;
**Changed wrong status-results in Readme.txt. This concerns to the functions ServiceIsPaused, ServiceIsRunning and ServiceIsStopped.&lt;br /&gt;
**Changed the access privileges of the plugin. The plugin now uses the lowest privlege of each function to execute.&lt;br /&gt;
*Version 1.0 (2007-05-02)&lt;br /&gt;
**First offical version&lt;br /&gt;
&lt;br /&gt;
== Important Notes ==&lt;br /&gt;
*The function &amp;quot;SetServiceLogon&amp;quot; only works if the servicetype is &amp;quot;SERVICE_WIN32_OWN_PROCESS&amp;quot;&lt;br /&gt;
* The functions &amp;quot;GetServiceDescription&amp;quot; or &amp;quot;SetServiceDescription&amp;quot; are only available on systems higher than Windows NT. &lt;br /&gt;
* If you change the logon of an service to a new user you have to grant him the Service Logon Privilege. Otherwise the service cannot be started by the user you have assigned.&lt;br /&gt;
* The functions StartService, StopService, PauseService and ContinueService uses a timeout of 30 seconds. This means the function must be executed within 30 seconds, otherwise the functions will return an error.&lt;br /&gt;
* If you have any suggestions, comments or questions please mail me: mailto:rainer@speed-soft.de&lt;br /&gt;
&lt;br /&gt;
[[Category:Plugins]]&lt;/div&gt;</summary>
		<author><name>Speed78</name></author>
	</entry>
	<entry>
		<id>https://nsis.sourceforge.io/mediawiki/index.php?title=NSIS_Simple_Service_Plugin&amp;diff=18911</id>
		<title>NSIS Simple Service Plugin</title>
		<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/mediawiki/index.php?title=NSIS_Simple_Service_Plugin&amp;diff=18911"/>
		<updated>2010-09-14T11:22:25Z</updated>

		<summary type="html">&lt;p&gt;Speed78: /* Links */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This plugin contains basic service functions like start, stop the service or checking the service status. It also contains advanced service functions for example setting the service description, changed the logon account, granting or removing the service logon privilege.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This plugin is using the MPL License or alternatively the LGPL License.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
&amp;lt;attach&amp;gt;NSIS_Simple_Service_Plugin_1.28.zip&amp;lt;/attach&amp;gt; The ZIP file containing a precompiled plugin DLL (to be saved in NSIS&#039; plugin directory) and the sources. If you update from a previous version it is strongly &#039;&#039;&#039;recommend&#039;&#039;&#039; to take look at the changelog.&lt;br /&gt;
&lt;br /&gt;
== Donation ==&lt;br /&gt;
If you believe that I am doing a good job and you want to support me please [http://www.speed-soft.de/donation/index.php?language=en donate] any amount via PayPal.&lt;br /&gt;
&lt;br /&gt;
== Short Reference ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
SimpleSC::InstallService [name_of_service] [display_name] [service_type] [start_type] &lt;br /&gt;
  [binary_path] [dependencies] [account] [password]&lt;br /&gt;
SimpleSC::RemoveService [name_of_service]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::StartService [name_of_service] [arguments]&lt;br /&gt;
SimpleSC::StopService [name_of_service] [wait_for_file_release]&lt;br /&gt;
SimpleSC::PauseService [name_of_service] &lt;br /&gt;
SimpleSC::ContinueService [name_of_service]&lt;br /&gt;
SimpleSC::RestartService [name_of_service] [arguments]&lt;br /&gt;
SimpleSC::ExistsService [name_of_service]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::GetServiceDisplayName [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceName [display_name]&lt;br /&gt;
SimpleSC::GetServiceStatus [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceDescription [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceStartType [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceBinaryPath [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceLogon [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceFailure [name_of_service]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::SetServiceDescription [name_of_service] [service_description]&lt;br /&gt;
SimpleSC::SetServiceStartType [name_of_service] [start_type]&lt;br /&gt;
SimpleSC::SetServiceBinaryPath [name_of_service] [binary_path]&lt;br /&gt;
SimpleSC::SetServiceLogon [name_of_service] [account] [password]&lt;br /&gt;
SimpleSC::SetServiceFailure [name_of_service] [reset_period] [reboot_message] [command] &lt;br /&gt;
  [action_type_1] [action_delay_1] [action_type_2] [action_delay_2] [action_type_3] &lt;br /&gt;
  [action_delay_3] &lt;br /&gt;
&lt;br /&gt;
SimpleSC::GrantServiceLogonPrivilege [account]&lt;br /&gt;
SimpleSC::RemoveServiceLogonPrivilege [account]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::ServiceIsPaused [name_of_service]&lt;br /&gt;
SimpleSC::ServiceIsRunning [name_of_service]&lt;br /&gt;
SimpleSC::ServiceIsStopped [name_of_service]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::GetErrorMessage [error_code]&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
*name_of_service - The name of the service used for Start/Stop commands and all further commands &lt;br /&gt;
*display_name - The name as shown in the service control manager applet in system control &lt;br /&gt;
*service_type - One of the following codes &lt;br /&gt;
**1 - SERVICE_KERNEL_DRIVER - Driver service.&lt;br /&gt;
**2 - SERVICE_FILE_SYSTEM_DRIVER - File system driver service.&lt;br /&gt;
**16 - SERVICE_WIN32_OWN_PROCESS - Service that runs in its own process. (Should be used in most cases)&lt;br /&gt;
**32 - SERVICE_WIN32_SHARE_PROCESS - Service that shares a process with one or more other services. &lt;br /&gt;
**256 - SERVICE_INTERACTIVE_PROCESS - The service can interact with the desktop. &lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: If you specify either SERVICE_WIN32_OWN_PROCESS or SERVICE_WIN32_SHARE_PROCESS,          and the service is running in the context of the LocalSystem account,          you can also specify this value. Example: SERVICE_WIN32_OWN_PROCESS or SERVICE_INTERACTIVE_PROCESS - (16 or 256) = 272&lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: Services cannot directly interact with a user as of Windows Vista.             Therefore, this technique should not be used in new code. See for more information: http://msdn2.microsoft.com/en-us/library/ms683502(VS.85).aspx          &lt;br /&gt;
&lt;br /&gt;
*start_type - one of the following codes &lt;br /&gt;
**0 - SERVICE_BOOT_START - Driver boot stage start &lt;br /&gt;
**1 - SERVICE_SYSTEM_START - Driver scm stage start &lt;br /&gt;
**2 - SERVICE_AUTO_START - Service auto start (Should be used in most cases)&lt;br /&gt;
**3 - SERVICE_DEMAND_START - Driver/service manual start &lt;br /&gt;
**4 - SERVICE_DISABLED - Driver/service disabled&lt;br /&gt;
*service_status - one of the following codes&lt;br /&gt;
**1 - SERVICE_STOPPED&lt;br /&gt;
**2 - SERVICE_START_PENDING&lt;br /&gt;
**3 - SERVICE_STOP_PENDING&lt;br /&gt;
**4 - SERVICE_RUNNING&lt;br /&gt;
**5 - SERVICE_CONTINUE_PENDING&lt;br /&gt;
**6 - SERVICE_PAUSE_PENDING&lt;br /&gt;
**7 - SERVICE_PAUSED&lt;br /&gt;
*binary_path - The path to the binary including all necessary parameters &lt;br /&gt;
*dependencies - Needed services, controls which services have to be started before this one; use the forward slash &amp;quot;/&amp;quot; to add more more than one service&lt;br /&gt;
*account - The username/account which should be used &lt;br /&gt;
*password - Password of the aforementioned account to be able to logon as a service &lt;br /&gt;
**&#039;&#039;&#039;Note&#039;&#039;&#039;: If you do not specify account/password, the local system account will be used to run the service&lt;br /&gt;
*arguments - Arguments passed to the service main function. &lt;br /&gt;
**&#039;&#039;&#039;Note&#039;&#039;&#039;: Driver services do not receive these arguments.&lt;br /&gt;
*reset_period - The time after which to reset the failure count to zero if there are no failures, in seconds. Specify 0 (INFINITE) to indicate that this value should never be reset&lt;br /&gt;
*reboot_message - The message to be broadcast to server users before rebooting&lt;br /&gt;
*command - The command line of the process to execute in response to the SC_ACTION_RUN_COMMAND service controller action. This process runs under the same account as the service&lt;br /&gt;
*action_type_x - one of the following codes for the action to be performed&lt;br /&gt;
**0 - SC_ACTION_NONE - No action&lt;br /&gt;
**1 - SC_ACTION_RESTART - Restart the service&lt;br /&gt;
**2 - SC_ACTION_REBOOT - Reboot the computer (Note: The service user must have the SE_SHUTDOWN_NAME privilege)&lt;br /&gt;
**3 - SC_ACTION_RUN_COMMAND - Run a command&lt;br /&gt;
*action_delay_x - The time to wait before performing the specified action, in milliseconds&lt;br /&gt;
*error_code - Error code of a function&lt;br /&gt;
*service_description - The description as shown in the service control manager applet in system control&lt;br /&gt;
*wait_for_file_release - Wait for file release after the service is stopped. This is useful if the binary file will be overwritten after stopping the service.&lt;br /&gt;
**0 - NO_WAIT - No wait for file release&lt;br /&gt;
**1 - WAIT - Wait for file release &lt;br /&gt;
**&#039;&#039;&#039;Note&#039;&#039;&#039;: If SERVICE_WIN32_OWN_PROCESS is used this option should be set to WAIT.	If SERVICE_WIN32_SHARE_PROCESS is used this option should only be set to WAIT if the last service in the process is stopped.&lt;br /&gt;
&lt;br /&gt;
== The Sample Script ==&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
; Install a service - ServiceType own process - StartType automatic - NoDependencies -  Logon as System Account&lt;br /&gt;
  SimpleSC::InstallService &amp;quot;MyService&amp;quot; &amp;quot;My Service Display Name&amp;quot; &amp;quot;16&amp;quot; &amp;quot;2&amp;quot; &amp;quot;C:\MyPath\MyService.exe&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Install a service - ServiceType interact with desktop - StartType automatic - Dependencies on &amp;quot;Windows Time Service&amp;quot; (w32time) and &amp;quot;WWW Publishing Service&amp;quot; (w3svc) - Logon as System Account&lt;br /&gt;
  SimpleSC::InstallService &amp;quot;MyService&amp;quot; &amp;quot;My Service Display Name&amp;quot; &amp;quot;272&amp;quot; &amp;quot;2&amp;quot; &amp;quot;C:\MyPath\MyService.exe&amp;quot; &amp;quot;w32time/w3svc&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Remove a service&lt;br /&gt;
  SimpleSC::RemoveService &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Start a service&lt;br /&gt;
  SimpleSC::StartService &amp;quot;MyService&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Start a service with two arguments &amp;quot;/param1=true&amp;quot; &amp;quot;/param2=1&amp;quot;&lt;br /&gt;
  SimpleSC::StartService &amp;quot;MyService&amp;quot; &amp;quot;/param1=true /param2=1&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
 &lt;br /&gt;
; Start a service with two arguments &amp;quot;-p param1&amp;quot; &amp;quot;-param2&amp;quot;&lt;br /&gt;
  SimpleSC::StartService &amp;quot;MyService&amp;quot; &#039;&amp;quot;-p param1&amp;quot; -param2&#039;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Stop a service and waits for file release&lt;br /&gt;
  SimpleSC::StopService &amp;quot;MyService&amp;quot; 1&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Stops two services and waits for file release after the last service is stopped&lt;br /&gt;
  SimpleSC::StopService &amp;quot;MyService1&amp;quot; 0&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  SimpleSC::StopService &amp;quot;MyService2&amp;quot; 1&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Pause a service&lt;br /&gt;
  SimpleSC::PauseService &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Continue a service&lt;br /&gt;
  SimpleSC::ContinueService &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Restart a service&lt;br /&gt;
  SimpleSC::RestartService &amp;quot;MyService&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Restart a service with two arguments &amp;quot;/param1=true&amp;quot; &amp;quot;/param2=1&amp;quot;&lt;br /&gt;
  SimpleSC::RestartService &amp;quot;MyService&amp;quot; &amp;quot;/param1=true /param2=1&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Start a service with two arguments &amp;quot;-p param1&amp;quot; &amp;quot;-param2&amp;quot;&lt;br /&gt;
  SimpleSC::RestartService &amp;quot;MyService&amp;quot; &#039;&amp;quot;-p param1&amp;quot; -param2&#039;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Check if the service exists&lt;br /&gt;
  SimpleSC::ExistsService &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode if the service doesnÂ´t exists (&amp;lt;&amp;gt;0)/service exists (0)&lt;br /&gt;
&lt;br /&gt;
; Get the displayname of a service&lt;br /&gt;
  SimpleSC::GetServiceDisplayName &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the displayname of the service&lt;br /&gt;
&lt;br /&gt;
; Get the servicename of a service by the displayname&lt;br /&gt;
  SimpleSC::GetServiceName &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the servicename of the service&lt;br /&gt;
&lt;br /&gt;
; Get the current status of a service&lt;br /&gt;
  SimpleSC::GetServiceStatus &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; return the status of the service (See &amp;quot;service_status&amp;quot; in the parameters)&lt;br /&gt;
&lt;br /&gt;
; Get the description of a service&lt;br /&gt;
  SimpleSC::GetServiceDescription &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the description of the service&lt;br /&gt;
 &lt;br /&gt;
; Get the start type of the service&lt;br /&gt;
  SimpleSC::GetServiceStartType &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the start type of the service (see &amp;quot;start_type&amp;quot; in the parameters)&lt;br /&gt;
&lt;br /&gt;
; Get the binary path of a service&lt;br /&gt;
  SimpleSC::GetServiceBinaryPath &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the binary path of the service&lt;br /&gt;
&lt;br /&gt;
; Get the logon user of the service&lt;br /&gt;
  SimpleSC::GetServiceLogon &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the logon username of the service  &lt;br /&gt;
&lt;br /&gt;
; Get the failure configuration of the service&lt;br /&gt;
  SimpleSC::GetServiceFailure &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the reset period &lt;br /&gt;
  Pop $2 ; returns the reboot message&lt;br /&gt;
  Pop $3 ; returns the command&lt;br /&gt;
  Pop $4 ; returns the first action (See &amp;quot;action_type_x&amp;quot; in the parameters)&lt;br /&gt;
  Pop $5 ; returns the first action delay &lt;br /&gt;
  Pop $6 ; returns the second action (See &amp;quot;action_type_x&amp;quot; in the parameters)&lt;br /&gt;
  Pop $7 ; returns the second action delay &lt;br /&gt;
  Pop $8 ; returns the third action (See &amp;quot;action_type_x&amp;quot; in the parameters)&lt;br /&gt;
  Pop $9 ; returns the third action delay &lt;br /&gt;
&lt;br /&gt;
; Set the description of a service (Not supported on Windows NT 4.0)&lt;br /&gt;
  SimpleSC::SetServiceDescription &amp;quot;MyService&amp;quot; &amp;quot;Sample Description&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Set the starttype to automatic of a service&lt;br /&gt;
  SimpleSC::SetServiceStartType &amp;quot;MyService&amp;quot; &amp;quot;2&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Sets the service binary path&lt;br /&gt;
  SimpleSC::SetServiceBinaryPath &amp;quot;MyService&amp;quot; &amp;quot;C:\MySoftware\MyService.exe&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Sets the service logon to a user and grant the user the &amp;quot;SeServiceLogonPrivilege&amp;quot;&lt;br /&gt;
  SimpleSC::SetServiceLogon &amp;quot;MyService&amp;quot; &amp;quot;MyServiceUser&amp;quot; &amp;quot;MyServiceUserPassword&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  IntCmp $0 0 +1 Done Done ; If successful grant the service logon privilege to &amp;quot;MyServiceUser&amp;quot;&lt;br /&gt;
    ; Note: Every serviceuser must have the ServiceLogonPrivilege to start the service&lt;br /&gt;
    SimpleSC::GrantServiceLogonPrivilege &amp;quot;MyServiceUser&amp;quot;&lt;br /&gt;
    Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Done:&lt;br /&gt;
&lt;br /&gt;
; Sets the service failure configuration - First action: Restart the service after one minute - Second action: Reboot the computer after five minutes&lt;br /&gt;
  SimpleSC::SetServiceFailure &amp;quot;MyService&amp;quot; &amp;quot;0&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;1&amp;quot; &amp;quot;60000&amp;quot; &amp;quot;2&amp;quot; &amp;quot;300000&amp;quot; &amp;quot;0&amp;quot; &amp;quot;0&amp;quot; &lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Remove the &amp;quot;SeServiceLogonPrivilege&amp;quot; from a user&lt;br /&gt;
  SimpleSC::RemoveServiceLogonPrivilege &amp;quot;MyServiceUser&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Check if the service is paused&lt;br /&gt;
  SimpleSC::ServiceIsPaused &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns 1 (service is paused) - returns 0 (service is not paused)&lt;br /&gt;
&lt;br /&gt;
; Check if the service is running&lt;br /&gt;
  SimpleSC::ServiceIsRunning &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns 1 (service is running) - returns 0 (service is not running)&lt;br /&gt;
&lt;br /&gt;
; Check if the service is stopped&lt;br /&gt;
  SimpleSC::ServiceIsStopped &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns 1 (service is stopped) - returns 0 (service is not stopped)&lt;br /&gt;
&lt;br /&gt;
; Show the error message if a function fails &lt;br /&gt;
  SimpleSC::StopService &amp;quot;MyService&amp;quot; 1&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  IntCmp $0 0 Done +1 +1 &lt;br /&gt;
    Push $0&lt;br /&gt;
    SimpleSC::GetErrorMessage&lt;br /&gt;
    Pop $0&lt;br /&gt;
    MessageBox MB_OK|MB_ICONSTOP &amp;quot;Stopping fails - Reason: $0&amp;quot;&lt;br /&gt;
  Done:&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Changelog ==&lt;br /&gt;
* Version 1.28 (2010-09-14)&lt;br /&gt;
**SimpleSC::GetServiceFailure function added&lt;br /&gt;
**SimpleSC::SetServiceFailure function added&lt;br /&gt;
**SimpleSC::StopService WaitForFileRelease feature added&lt;br /&gt;
* Version 1.27 (2010-03-23)&lt;br /&gt;
**Documentation updated&lt;br /&gt;
* Version 1.26 (2009-05-21)&lt;br /&gt;
**Fixed wait for status bug on starting, stopping, pausing or continuing a service &lt;br /&gt;
* Version 1.25 (2009-04-23)&lt;br /&gt;
**SimpleSC::SetServiceLogon supports now non-domain username without the &amp;quot;.\&amp;quot;-prefix&lt;br /&gt;
**SimpleSC::SetServiceBinaryPath function added&lt;br /&gt;
*Version 1.24 (2009-04-13)&lt;br /&gt;
**Fixed wait for status bug if the service status changed. Now, if a service stops, starts aso. the plugin will work like the recommendations in the MSDN.&lt;br /&gt;
*Version 1.23 (2008-08-23)&lt;br /&gt;
**Removed compiler optimization to avoid a false-positive virusscan.&lt;br /&gt;
*Version 1.22 (2008-08-17)&lt;br /&gt;
**SimpleSC::GrantServiceLogonPrivilege and SimpleSC::RemoveServiceLogonPrivilege works now correct with domain names like MyDomain\MyUser.&lt;br /&gt;
**Added function SimpleSC::GetServiceLogon to get the logon username of a service.&lt;br /&gt;
*Version 1.21 (2008-02-10)&lt;br /&gt;
**SimpleSC::ExistsService results now 0 if the service exists and &amp;lt;&amp;gt; 0 if the service doensnÂ´t exists.&lt;br /&gt;
*Version 1.20 (2008-02-05)&lt;br /&gt;
**Every function now returns &amp;lt;&amp;gt; 0 if there is an error. Use SimpleSC::GetErrorMessage to get the message of a function result.&lt;br /&gt;
**Added function SimpleSC::GetErrorMessage to get the message of a function result.&lt;br /&gt;
**SimpleSC::ExistsService results now 0 if the service exists and &amp;lt;&amp;gt; 0 if the service doensnÂ´t exists.&lt;br /&gt;
**SimpleSC::RestartService supports now arguments.&lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: The signature has been changed. If you update from a previous version you must check your parameters.&lt;br /&gt;
*Version 1.10 (2008-01-29)&lt;br /&gt;
**SimpleSC::InstallService supports now more than one dependencies (delimitter is the forward slash).&lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: The signature has been changed. If you update from a previous version you must check your parameters.&lt;br /&gt;
**SimpleSC::InstallService supports now more service types e.g. to create an interactive service.&lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: The signature has been changed. If you update from a previous version you must check your parameters.&lt;br /&gt;
**SimpleSC::StartService supports now arguments. &lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: The signature has been changed. If you update from a previous version you must check your parameters.&lt;br /&gt;
*Version 1.05 (2008-01-12)&lt;br /&gt;
**The functions SimpleSC::StopService and SimpleSC::RestartService are now improved. Now all dependent services are stopping recursively too.&lt;br /&gt;
*Version 1.04 (2007-08-07)&lt;br /&gt;
**Fixed bug for possible endless loops. This concerns to the functions StartService, StopService, ContinueService and PauseService. &lt;br /&gt;
*Version 1.03 (2007-08-02)&lt;br /&gt;
**Added function SimpleSC::GetServiceBinaryPath to get the binary path of a specified service.&lt;br /&gt;
*Version 1.02 (2007-05-29)&lt;br /&gt;
**Changed wrong documentation informations about the functions SimpleSC::InstallService and SimpleSC::RemoveService.&lt;br /&gt;
*Version 1.01 (2007-05-07)&lt;br /&gt;
**Changed wrong status-results in Readme.txt. This concerns to the functions ServiceIsPaused, ServiceIsRunning and ServiceIsStopped.&lt;br /&gt;
**Changed the access privileges of the plugin. The plugin now uses the lowest privlege of each function to execute.&lt;br /&gt;
*Version 1.0 (2007-05-02)&lt;br /&gt;
**First offical version&lt;br /&gt;
&lt;br /&gt;
== Important Notes ==&lt;br /&gt;
*The function &amp;quot;SetServiceLogon&amp;quot; only works if the servicetype is &amp;quot;SERVICE_WIN32_OWN_PROCESS&amp;quot;&lt;br /&gt;
* The functions &amp;quot;GetServiceDescription&amp;quot; or &amp;quot;SetServiceDescription&amp;quot; are only available on systems higher than Windows NT. &lt;br /&gt;
* If you change the logon of an service to a new user you have to grant him the Service Logon Privilege. Otherwise the service cannot be started by the user you have assigned.&lt;br /&gt;
* The functions StartService, StopService, PauseService and ContinueService uses a timeout of 30 seconds. This means the function must be executed within 30 seconds, otherwise the functions will return an error.&lt;br /&gt;
* If you have any suggestions, comments or questions please mail me: mailto:rainer@speed-soft.de&lt;br /&gt;
&lt;br /&gt;
[[Category:Plugins]]&lt;/div&gt;</summary>
		<author><name>Speed78</name></author>
	</entry>
	<entry>
		<id>https://nsis.sourceforge.io/mediawiki/index.php?title=NSIS_Simple_Service_Plugin&amp;diff=18910</id>
		<title>NSIS Simple Service Plugin</title>
		<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/mediawiki/index.php?title=NSIS_Simple_Service_Plugin&amp;diff=18910"/>
		<updated>2010-09-14T11:21:45Z</updated>

		<summary type="html">&lt;p&gt;Speed78: /* The Sample Script */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This plugin contains basic service functions like start, stop the service or checking the service status. It also contains advanced service functions for example setting the service description, changed the logon account, granting or removing the service logon privilege.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This plugin is using the MPL License or alternatively the LGPL License.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
&amp;lt;attach&amp;gt;NSIS_Simple_Service_Plugin_1.27.zip&amp;lt;/attach&amp;gt; The ZIP file containing a precompiled plugin DLL (to be saved in NSIS&#039; plugin directory) and the sources. If you update from a previous version it is strongly &#039;&#039;&#039;recommend&#039;&#039;&#039; to take look at the changelog.&lt;br /&gt;
&lt;br /&gt;
== Donation ==&lt;br /&gt;
If you believe that I am doing a good job and you want to support me please [http://www.speed-soft.de/donation/index.php?language=en donate] any amount via PayPal.&lt;br /&gt;
&lt;br /&gt;
== Short Reference ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
SimpleSC::InstallService [name_of_service] [display_name] [service_type] [start_type] &lt;br /&gt;
  [binary_path] [dependencies] [account] [password]&lt;br /&gt;
SimpleSC::RemoveService [name_of_service]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::StartService [name_of_service] [arguments]&lt;br /&gt;
SimpleSC::StopService [name_of_service] [wait_for_file_release]&lt;br /&gt;
SimpleSC::PauseService [name_of_service] &lt;br /&gt;
SimpleSC::ContinueService [name_of_service]&lt;br /&gt;
SimpleSC::RestartService [name_of_service] [arguments]&lt;br /&gt;
SimpleSC::ExistsService [name_of_service]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::GetServiceDisplayName [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceName [display_name]&lt;br /&gt;
SimpleSC::GetServiceStatus [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceDescription [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceStartType [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceBinaryPath [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceLogon [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceFailure [name_of_service]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::SetServiceDescription [name_of_service] [service_description]&lt;br /&gt;
SimpleSC::SetServiceStartType [name_of_service] [start_type]&lt;br /&gt;
SimpleSC::SetServiceBinaryPath [name_of_service] [binary_path]&lt;br /&gt;
SimpleSC::SetServiceLogon [name_of_service] [account] [password]&lt;br /&gt;
SimpleSC::SetServiceFailure [name_of_service] [reset_period] [reboot_message] [command] &lt;br /&gt;
  [action_type_1] [action_delay_1] [action_type_2] [action_delay_2] [action_type_3] &lt;br /&gt;
  [action_delay_3] &lt;br /&gt;
&lt;br /&gt;
SimpleSC::GrantServiceLogonPrivilege [account]&lt;br /&gt;
SimpleSC::RemoveServiceLogonPrivilege [account]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::ServiceIsPaused [name_of_service]&lt;br /&gt;
SimpleSC::ServiceIsRunning [name_of_service]&lt;br /&gt;
SimpleSC::ServiceIsStopped [name_of_service]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::GetErrorMessage [error_code]&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
*name_of_service - The name of the service used for Start/Stop commands and all further commands &lt;br /&gt;
*display_name - The name as shown in the service control manager applet in system control &lt;br /&gt;
*service_type - One of the following codes &lt;br /&gt;
**1 - SERVICE_KERNEL_DRIVER - Driver service.&lt;br /&gt;
**2 - SERVICE_FILE_SYSTEM_DRIVER - File system driver service.&lt;br /&gt;
**16 - SERVICE_WIN32_OWN_PROCESS - Service that runs in its own process. (Should be used in most cases)&lt;br /&gt;
**32 - SERVICE_WIN32_SHARE_PROCESS - Service that shares a process with one or more other services. &lt;br /&gt;
**256 - SERVICE_INTERACTIVE_PROCESS - The service can interact with the desktop. &lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: If you specify either SERVICE_WIN32_OWN_PROCESS or SERVICE_WIN32_SHARE_PROCESS,          and the service is running in the context of the LocalSystem account,          you can also specify this value. Example: SERVICE_WIN32_OWN_PROCESS or SERVICE_INTERACTIVE_PROCESS - (16 or 256) = 272&lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: Services cannot directly interact with a user as of Windows Vista.             Therefore, this technique should not be used in new code. See for more information: http://msdn2.microsoft.com/en-us/library/ms683502(VS.85).aspx          &lt;br /&gt;
&lt;br /&gt;
*start_type - one of the following codes &lt;br /&gt;
**0 - SERVICE_BOOT_START - Driver boot stage start &lt;br /&gt;
**1 - SERVICE_SYSTEM_START - Driver scm stage start &lt;br /&gt;
**2 - SERVICE_AUTO_START - Service auto start (Should be used in most cases)&lt;br /&gt;
**3 - SERVICE_DEMAND_START - Driver/service manual start &lt;br /&gt;
**4 - SERVICE_DISABLED - Driver/service disabled&lt;br /&gt;
*service_status - one of the following codes&lt;br /&gt;
**1 - SERVICE_STOPPED&lt;br /&gt;
**2 - SERVICE_START_PENDING&lt;br /&gt;
**3 - SERVICE_STOP_PENDING&lt;br /&gt;
**4 - SERVICE_RUNNING&lt;br /&gt;
**5 - SERVICE_CONTINUE_PENDING&lt;br /&gt;
**6 - SERVICE_PAUSE_PENDING&lt;br /&gt;
**7 - SERVICE_PAUSED&lt;br /&gt;
*binary_path - The path to the binary including all necessary parameters &lt;br /&gt;
*dependencies - Needed services, controls which services have to be started before this one; use the forward slash &amp;quot;/&amp;quot; to add more more than one service&lt;br /&gt;
*account - The username/account which should be used &lt;br /&gt;
*password - Password of the aforementioned account to be able to logon as a service &lt;br /&gt;
**&#039;&#039;&#039;Note&#039;&#039;&#039;: If you do not specify account/password, the local system account will be used to run the service&lt;br /&gt;
*arguments - Arguments passed to the service main function. &lt;br /&gt;
**&#039;&#039;&#039;Note&#039;&#039;&#039;: Driver services do not receive these arguments.&lt;br /&gt;
*reset_period - The time after which to reset the failure count to zero if there are no failures, in seconds. Specify 0 (INFINITE) to indicate that this value should never be reset&lt;br /&gt;
*reboot_message - The message to be broadcast to server users before rebooting&lt;br /&gt;
*command - The command line of the process to execute in response to the SC_ACTION_RUN_COMMAND service controller action. This process runs under the same account as the service&lt;br /&gt;
*action_type_x - one of the following codes for the action to be performed&lt;br /&gt;
**0 - SC_ACTION_NONE - No action&lt;br /&gt;
**1 - SC_ACTION_RESTART - Restart the service&lt;br /&gt;
**2 - SC_ACTION_REBOOT - Reboot the computer (Note: The service user must have the SE_SHUTDOWN_NAME privilege)&lt;br /&gt;
**3 - SC_ACTION_RUN_COMMAND - Run a command&lt;br /&gt;
*action_delay_x - The time to wait before performing the specified action, in milliseconds&lt;br /&gt;
*error_code - Error code of a function&lt;br /&gt;
*service_description - The description as shown in the service control manager applet in system control&lt;br /&gt;
*wait_for_file_release - Wait for file release after the service is stopped. This is useful if the binary file will be overwritten after stopping the service.&lt;br /&gt;
**0 - NO_WAIT - No wait for file release&lt;br /&gt;
**1 - WAIT - Wait for file release &lt;br /&gt;
**&#039;&#039;&#039;Note&#039;&#039;&#039;: If SERVICE_WIN32_OWN_PROCESS is used this option should be set to WAIT.	If SERVICE_WIN32_SHARE_PROCESS is used this option should only be set to WAIT if the last service in the process is stopped.&lt;br /&gt;
&lt;br /&gt;
== The Sample Script ==&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
; Install a service - ServiceType own process - StartType automatic - NoDependencies -  Logon as System Account&lt;br /&gt;
  SimpleSC::InstallService &amp;quot;MyService&amp;quot; &amp;quot;My Service Display Name&amp;quot; &amp;quot;16&amp;quot; &amp;quot;2&amp;quot; &amp;quot;C:\MyPath\MyService.exe&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Install a service - ServiceType interact with desktop - StartType automatic - Dependencies on &amp;quot;Windows Time Service&amp;quot; (w32time) and &amp;quot;WWW Publishing Service&amp;quot; (w3svc) - Logon as System Account&lt;br /&gt;
  SimpleSC::InstallService &amp;quot;MyService&amp;quot; &amp;quot;My Service Display Name&amp;quot; &amp;quot;272&amp;quot; &amp;quot;2&amp;quot; &amp;quot;C:\MyPath\MyService.exe&amp;quot; &amp;quot;w32time/w3svc&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Remove a service&lt;br /&gt;
  SimpleSC::RemoveService &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Start a service&lt;br /&gt;
  SimpleSC::StartService &amp;quot;MyService&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Start a service with two arguments &amp;quot;/param1=true&amp;quot; &amp;quot;/param2=1&amp;quot;&lt;br /&gt;
  SimpleSC::StartService &amp;quot;MyService&amp;quot; &amp;quot;/param1=true /param2=1&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
 &lt;br /&gt;
; Start a service with two arguments &amp;quot;-p param1&amp;quot; &amp;quot;-param2&amp;quot;&lt;br /&gt;
  SimpleSC::StartService &amp;quot;MyService&amp;quot; &#039;&amp;quot;-p param1&amp;quot; -param2&#039;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Stop a service and waits for file release&lt;br /&gt;
  SimpleSC::StopService &amp;quot;MyService&amp;quot; 1&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Stops two services and waits for file release after the last service is stopped&lt;br /&gt;
  SimpleSC::StopService &amp;quot;MyService1&amp;quot; 0&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  SimpleSC::StopService &amp;quot;MyService2&amp;quot; 1&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Pause a service&lt;br /&gt;
  SimpleSC::PauseService &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Continue a service&lt;br /&gt;
  SimpleSC::ContinueService &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Restart a service&lt;br /&gt;
  SimpleSC::RestartService &amp;quot;MyService&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Restart a service with two arguments &amp;quot;/param1=true&amp;quot; &amp;quot;/param2=1&amp;quot;&lt;br /&gt;
  SimpleSC::RestartService &amp;quot;MyService&amp;quot; &amp;quot;/param1=true /param2=1&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Start a service with two arguments &amp;quot;-p param1&amp;quot; &amp;quot;-param2&amp;quot;&lt;br /&gt;
  SimpleSC::RestartService &amp;quot;MyService&amp;quot; &#039;&amp;quot;-p param1&amp;quot; -param2&#039;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Check if the service exists&lt;br /&gt;
  SimpleSC::ExistsService &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode if the service doesnÂ´t exists (&amp;lt;&amp;gt;0)/service exists (0)&lt;br /&gt;
&lt;br /&gt;
; Get the displayname of a service&lt;br /&gt;
  SimpleSC::GetServiceDisplayName &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the displayname of the service&lt;br /&gt;
&lt;br /&gt;
; Get the servicename of a service by the displayname&lt;br /&gt;
  SimpleSC::GetServiceName &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the servicename of the service&lt;br /&gt;
&lt;br /&gt;
; Get the current status of a service&lt;br /&gt;
  SimpleSC::GetServiceStatus &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; return the status of the service (See &amp;quot;service_status&amp;quot; in the parameters)&lt;br /&gt;
&lt;br /&gt;
; Get the description of a service&lt;br /&gt;
  SimpleSC::GetServiceDescription &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the description of the service&lt;br /&gt;
 &lt;br /&gt;
; Get the start type of the service&lt;br /&gt;
  SimpleSC::GetServiceStartType &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the start type of the service (see &amp;quot;start_type&amp;quot; in the parameters)&lt;br /&gt;
&lt;br /&gt;
; Get the binary path of a service&lt;br /&gt;
  SimpleSC::GetServiceBinaryPath &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the binary path of the service&lt;br /&gt;
&lt;br /&gt;
; Get the logon user of the service&lt;br /&gt;
  SimpleSC::GetServiceLogon &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the logon username of the service  &lt;br /&gt;
&lt;br /&gt;
; Get the failure configuration of the service&lt;br /&gt;
  SimpleSC::GetServiceFailure &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the reset period &lt;br /&gt;
  Pop $2 ; returns the reboot message&lt;br /&gt;
  Pop $3 ; returns the command&lt;br /&gt;
  Pop $4 ; returns the first action (See &amp;quot;action_type_x&amp;quot; in the parameters)&lt;br /&gt;
  Pop $5 ; returns the first action delay &lt;br /&gt;
  Pop $6 ; returns the second action (See &amp;quot;action_type_x&amp;quot; in the parameters)&lt;br /&gt;
  Pop $7 ; returns the second action delay &lt;br /&gt;
  Pop $8 ; returns the third action (See &amp;quot;action_type_x&amp;quot; in the parameters)&lt;br /&gt;
  Pop $9 ; returns the third action delay &lt;br /&gt;
&lt;br /&gt;
; Set the description of a service (Not supported on Windows NT 4.0)&lt;br /&gt;
  SimpleSC::SetServiceDescription &amp;quot;MyService&amp;quot; &amp;quot;Sample Description&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Set the starttype to automatic of a service&lt;br /&gt;
  SimpleSC::SetServiceStartType &amp;quot;MyService&amp;quot; &amp;quot;2&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Sets the service binary path&lt;br /&gt;
  SimpleSC::SetServiceBinaryPath &amp;quot;MyService&amp;quot; &amp;quot;C:\MySoftware\MyService.exe&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Sets the service logon to a user and grant the user the &amp;quot;SeServiceLogonPrivilege&amp;quot;&lt;br /&gt;
  SimpleSC::SetServiceLogon &amp;quot;MyService&amp;quot; &amp;quot;MyServiceUser&amp;quot; &amp;quot;MyServiceUserPassword&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  IntCmp $0 0 +1 Done Done ; If successful grant the service logon privilege to &amp;quot;MyServiceUser&amp;quot;&lt;br /&gt;
    ; Note: Every serviceuser must have the ServiceLogonPrivilege to start the service&lt;br /&gt;
    SimpleSC::GrantServiceLogonPrivilege &amp;quot;MyServiceUser&amp;quot;&lt;br /&gt;
    Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Done:&lt;br /&gt;
&lt;br /&gt;
; Sets the service failure configuration - First action: Restart the service after one minute - Second action: Reboot the computer after five minutes&lt;br /&gt;
  SimpleSC::SetServiceFailure &amp;quot;MyService&amp;quot; &amp;quot;0&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;1&amp;quot; &amp;quot;60000&amp;quot; &amp;quot;2&amp;quot; &amp;quot;300000&amp;quot; &amp;quot;0&amp;quot; &amp;quot;0&amp;quot; &lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Remove the &amp;quot;SeServiceLogonPrivilege&amp;quot; from a user&lt;br /&gt;
  SimpleSC::RemoveServiceLogonPrivilege &amp;quot;MyServiceUser&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Check if the service is paused&lt;br /&gt;
  SimpleSC::ServiceIsPaused &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns 1 (service is paused) - returns 0 (service is not paused)&lt;br /&gt;
&lt;br /&gt;
; Check if the service is running&lt;br /&gt;
  SimpleSC::ServiceIsRunning &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns 1 (service is running) - returns 0 (service is not running)&lt;br /&gt;
&lt;br /&gt;
; Check if the service is stopped&lt;br /&gt;
  SimpleSC::ServiceIsStopped &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns 1 (service is stopped) - returns 0 (service is not stopped)&lt;br /&gt;
&lt;br /&gt;
; Show the error message if a function fails &lt;br /&gt;
  SimpleSC::StopService &amp;quot;MyService&amp;quot; 1&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  IntCmp $0 0 Done +1 +1 &lt;br /&gt;
    Push $0&lt;br /&gt;
    SimpleSC::GetErrorMessage&lt;br /&gt;
    Pop $0&lt;br /&gt;
    MessageBox MB_OK|MB_ICONSTOP &amp;quot;Stopping fails - Reason: $0&amp;quot;&lt;br /&gt;
  Done:&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Changelog ==&lt;br /&gt;
* Version 1.28 (2010-09-14)&lt;br /&gt;
**SimpleSC::GetServiceFailure function added&lt;br /&gt;
**SimpleSC::SetServiceFailure function added&lt;br /&gt;
**SimpleSC::StopService WaitForFileRelease feature added&lt;br /&gt;
* Version 1.27 (2010-03-23)&lt;br /&gt;
**Documentation updated&lt;br /&gt;
* Version 1.26 (2009-05-21)&lt;br /&gt;
**Fixed wait for status bug on starting, stopping, pausing or continuing a service &lt;br /&gt;
* Version 1.25 (2009-04-23)&lt;br /&gt;
**SimpleSC::SetServiceLogon supports now non-domain username without the &amp;quot;.\&amp;quot;-prefix&lt;br /&gt;
**SimpleSC::SetServiceBinaryPath function added&lt;br /&gt;
*Version 1.24 (2009-04-13)&lt;br /&gt;
**Fixed wait for status bug if the service status changed. Now, if a service stops, starts aso. the plugin will work like the recommendations in the MSDN.&lt;br /&gt;
*Version 1.23 (2008-08-23)&lt;br /&gt;
**Removed compiler optimization to avoid a false-positive virusscan.&lt;br /&gt;
*Version 1.22 (2008-08-17)&lt;br /&gt;
**SimpleSC::GrantServiceLogonPrivilege and SimpleSC::RemoveServiceLogonPrivilege works now correct with domain names like MyDomain\MyUser.&lt;br /&gt;
**Added function SimpleSC::GetServiceLogon to get the logon username of a service.&lt;br /&gt;
*Version 1.21 (2008-02-10)&lt;br /&gt;
**SimpleSC::ExistsService results now 0 if the service exists and &amp;lt;&amp;gt; 0 if the service doensnÂ´t exists.&lt;br /&gt;
*Version 1.20 (2008-02-05)&lt;br /&gt;
**Every function now returns &amp;lt;&amp;gt; 0 if there is an error. Use SimpleSC::GetErrorMessage to get the message of a function result.&lt;br /&gt;
**Added function SimpleSC::GetErrorMessage to get the message of a function result.&lt;br /&gt;
**SimpleSC::ExistsService results now 0 if the service exists and &amp;lt;&amp;gt; 0 if the service doensnÂ´t exists.&lt;br /&gt;
**SimpleSC::RestartService supports now arguments.&lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: The signature has been changed. If you update from a previous version you must check your parameters.&lt;br /&gt;
*Version 1.10 (2008-01-29)&lt;br /&gt;
**SimpleSC::InstallService supports now more than one dependencies (delimitter is the forward slash).&lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: The signature has been changed. If you update from a previous version you must check your parameters.&lt;br /&gt;
**SimpleSC::InstallService supports now more service types e.g. to create an interactive service.&lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: The signature has been changed. If you update from a previous version you must check your parameters.&lt;br /&gt;
**SimpleSC::StartService supports now arguments. &lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: The signature has been changed. If you update from a previous version you must check your parameters.&lt;br /&gt;
*Version 1.05 (2008-01-12)&lt;br /&gt;
**The functions SimpleSC::StopService and SimpleSC::RestartService are now improved. Now all dependent services are stopping recursively too.&lt;br /&gt;
*Version 1.04 (2007-08-07)&lt;br /&gt;
**Fixed bug for possible endless loops. This concerns to the functions StartService, StopService, ContinueService and PauseService. &lt;br /&gt;
*Version 1.03 (2007-08-02)&lt;br /&gt;
**Added function SimpleSC::GetServiceBinaryPath to get the binary path of a specified service.&lt;br /&gt;
*Version 1.02 (2007-05-29)&lt;br /&gt;
**Changed wrong documentation informations about the functions SimpleSC::InstallService and SimpleSC::RemoveService.&lt;br /&gt;
*Version 1.01 (2007-05-07)&lt;br /&gt;
**Changed wrong status-results in Readme.txt. This concerns to the functions ServiceIsPaused, ServiceIsRunning and ServiceIsStopped.&lt;br /&gt;
**Changed the access privileges of the plugin. The plugin now uses the lowest privlege of each function to execute.&lt;br /&gt;
*Version 1.0 (2007-05-02)&lt;br /&gt;
**First offical version&lt;br /&gt;
&lt;br /&gt;
== Important Notes ==&lt;br /&gt;
*The function &amp;quot;SetServiceLogon&amp;quot; only works if the servicetype is &amp;quot;SERVICE_WIN32_OWN_PROCESS&amp;quot;&lt;br /&gt;
* The functions &amp;quot;GetServiceDescription&amp;quot; or &amp;quot;SetServiceDescription&amp;quot; are only available on systems higher than Windows NT. &lt;br /&gt;
* If you change the logon of an service to a new user you have to grant him the Service Logon Privilege. Otherwise the service cannot be started by the user you have assigned.&lt;br /&gt;
* The functions StartService, StopService, PauseService and ContinueService uses a timeout of 30 seconds. This means the function must be executed within 30 seconds, otherwise the functions will return an error.&lt;br /&gt;
* If you have any suggestions, comments or questions please mail me: mailto:rainer@speed-soft.de&lt;br /&gt;
&lt;br /&gt;
[[Category:Plugins]]&lt;/div&gt;</summary>
		<author><name>Speed78</name></author>
	</entry>
	<entry>
		<id>https://nsis.sourceforge.io/mediawiki/index.php?title=NSIS_Simple_Service_Plugin&amp;diff=18909</id>
		<title>NSIS Simple Service Plugin</title>
		<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/mediawiki/index.php?title=NSIS_Simple_Service_Plugin&amp;diff=18909"/>
		<updated>2010-09-14T11:19:47Z</updated>

		<summary type="html">&lt;p&gt;Speed78: /* The Sample Script */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This plugin contains basic service functions like start, stop the service or checking the service status. It also contains advanced service functions for example setting the service description, changed the logon account, granting or removing the service logon privilege.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This plugin is using the MPL License or alternatively the LGPL License.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
&amp;lt;attach&amp;gt;NSIS_Simple_Service_Plugin_1.27.zip&amp;lt;/attach&amp;gt; The ZIP file containing a precompiled plugin DLL (to be saved in NSIS&#039; plugin directory) and the sources. If you update from a previous version it is strongly &#039;&#039;&#039;recommend&#039;&#039;&#039; to take look at the changelog.&lt;br /&gt;
&lt;br /&gt;
== Donation ==&lt;br /&gt;
If you believe that I am doing a good job and you want to support me please [http://www.speed-soft.de/donation/index.php?language=en donate] any amount via PayPal.&lt;br /&gt;
&lt;br /&gt;
== Short Reference ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
SimpleSC::InstallService [name_of_service] [display_name] [service_type] [start_type] &lt;br /&gt;
  [binary_path] [dependencies] [account] [password]&lt;br /&gt;
SimpleSC::RemoveService [name_of_service]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::StartService [name_of_service] [arguments]&lt;br /&gt;
SimpleSC::StopService [name_of_service] [wait_for_file_release]&lt;br /&gt;
SimpleSC::PauseService [name_of_service] &lt;br /&gt;
SimpleSC::ContinueService [name_of_service]&lt;br /&gt;
SimpleSC::RestartService [name_of_service] [arguments]&lt;br /&gt;
SimpleSC::ExistsService [name_of_service]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::GetServiceDisplayName [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceName [display_name]&lt;br /&gt;
SimpleSC::GetServiceStatus [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceDescription [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceStartType [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceBinaryPath [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceLogon [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceFailure [name_of_service]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::SetServiceDescription [name_of_service] [service_description]&lt;br /&gt;
SimpleSC::SetServiceStartType [name_of_service] [start_type]&lt;br /&gt;
SimpleSC::SetServiceBinaryPath [name_of_service] [binary_path]&lt;br /&gt;
SimpleSC::SetServiceLogon [name_of_service] [account] [password]&lt;br /&gt;
SimpleSC::SetServiceFailure [name_of_service] [reset_period] [reboot_message] [command] &lt;br /&gt;
  [action_type_1] [action_delay_1] [action_type_2] [action_delay_2] [action_type_3] &lt;br /&gt;
  [action_delay_3] &lt;br /&gt;
&lt;br /&gt;
SimpleSC::GrantServiceLogonPrivilege [account]&lt;br /&gt;
SimpleSC::RemoveServiceLogonPrivilege [account]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::ServiceIsPaused [name_of_service]&lt;br /&gt;
SimpleSC::ServiceIsRunning [name_of_service]&lt;br /&gt;
SimpleSC::ServiceIsStopped [name_of_service]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::GetErrorMessage [error_code]&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
*name_of_service - The name of the service used for Start/Stop commands and all further commands &lt;br /&gt;
*display_name - The name as shown in the service control manager applet in system control &lt;br /&gt;
*service_type - One of the following codes &lt;br /&gt;
**1 - SERVICE_KERNEL_DRIVER - Driver service.&lt;br /&gt;
**2 - SERVICE_FILE_SYSTEM_DRIVER - File system driver service.&lt;br /&gt;
**16 - SERVICE_WIN32_OWN_PROCESS - Service that runs in its own process. (Should be used in most cases)&lt;br /&gt;
**32 - SERVICE_WIN32_SHARE_PROCESS - Service that shares a process with one or more other services. &lt;br /&gt;
**256 - SERVICE_INTERACTIVE_PROCESS - The service can interact with the desktop. &lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: If you specify either SERVICE_WIN32_OWN_PROCESS or SERVICE_WIN32_SHARE_PROCESS,          and the service is running in the context of the LocalSystem account,          you can also specify this value. Example: SERVICE_WIN32_OWN_PROCESS or SERVICE_INTERACTIVE_PROCESS - (16 or 256) = 272&lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: Services cannot directly interact with a user as of Windows Vista.             Therefore, this technique should not be used in new code. See for more information: http://msdn2.microsoft.com/en-us/library/ms683502(VS.85).aspx          &lt;br /&gt;
&lt;br /&gt;
*start_type - one of the following codes &lt;br /&gt;
**0 - SERVICE_BOOT_START - Driver boot stage start &lt;br /&gt;
**1 - SERVICE_SYSTEM_START - Driver scm stage start &lt;br /&gt;
**2 - SERVICE_AUTO_START - Service auto start (Should be used in most cases)&lt;br /&gt;
**3 - SERVICE_DEMAND_START - Driver/service manual start &lt;br /&gt;
**4 - SERVICE_DISABLED - Driver/service disabled&lt;br /&gt;
*service_status - one of the following codes&lt;br /&gt;
**1 - SERVICE_STOPPED&lt;br /&gt;
**2 - SERVICE_START_PENDING&lt;br /&gt;
**3 - SERVICE_STOP_PENDING&lt;br /&gt;
**4 - SERVICE_RUNNING&lt;br /&gt;
**5 - SERVICE_CONTINUE_PENDING&lt;br /&gt;
**6 - SERVICE_PAUSE_PENDING&lt;br /&gt;
**7 - SERVICE_PAUSED&lt;br /&gt;
*binary_path - The path to the binary including all necessary parameters &lt;br /&gt;
*dependencies - Needed services, controls which services have to be started before this one; use the forward slash &amp;quot;/&amp;quot; to add more more than one service&lt;br /&gt;
*account - The username/account which should be used &lt;br /&gt;
*password - Password of the aforementioned account to be able to logon as a service &lt;br /&gt;
**&#039;&#039;&#039;Note&#039;&#039;&#039;: If you do not specify account/password, the local system account will be used to run the service&lt;br /&gt;
*arguments - Arguments passed to the service main function. &lt;br /&gt;
**&#039;&#039;&#039;Note&#039;&#039;&#039;: Driver services do not receive these arguments.&lt;br /&gt;
*reset_period - The time after which to reset the failure count to zero if there are no failures, in seconds. Specify 0 (INFINITE) to indicate that this value should never be reset&lt;br /&gt;
*reboot_message - The message to be broadcast to server users before rebooting&lt;br /&gt;
*command - The command line of the process to execute in response to the SC_ACTION_RUN_COMMAND service controller action. This process runs under the same account as the service&lt;br /&gt;
*action_type_x - one of the following codes for the action to be performed&lt;br /&gt;
**0 - SC_ACTION_NONE - No action&lt;br /&gt;
**1 - SC_ACTION_RESTART - Restart the service&lt;br /&gt;
**2 - SC_ACTION_REBOOT - Reboot the computer (Note: The service user must have the SE_SHUTDOWN_NAME privilege)&lt;br /&gt;
**3 - SC_ACTION_RUN_COMMAND - Run a command&lt;br /&gt;
*action_delay_x - The time to wait before performing the specified action, in milliseconds&lt;br /&gt;
*error_code - Error code of a function&lt;br /&gt;
*service_description - The description as shown in the service control manager applet in system control&lt;br /&gt;
*wait_for_file_release - Wait for file release after the service is stopped. This is useful if the binary file will be overwritten after stopping the service.&lt;br /&gt;
**0 - NO_WAIT - No wait for file release&lt;br /&gt;
**1 - WAIT - Wait for file release &lt;br /&gt;
**&#039;&#039;&#039;Note&#039;&#039;&#039;: If SERVICE_WIN32_OWN_PROCESS is used this option should be set to WAIT.	If SERVICE_WIN32_SHARE_PROCESS is used this option should only be set to WAIT if the last service in the process is stopped.&lt;br /&gt;
&lt;br /&gt;
== The Sample Script ==&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
; Install a service - ServiceType own process - StartType automatic - NoDependencies - &lt;br /&gt;
; Logon as System Account&lt;br /&gt;
  SimpleSC::InstallService &amp;quot;MyService&amp;quot; &amp;quot;My Service Display Name&amp;quot; &amp;quot;16&amp;quot; &amp;quot;2&amp;quot; &amp;quot;C:\MyPath\MyService.exe&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Install a service - ServiceType interact with desktop - StartType automatic - &lt;br /&gt;
; Dependencies on &amp;quot;Windows Time Service&amp;quot; (w32time) and &amp;quot;WWW Publishing Service&amp;quot; &lt;br /&gt;
; (w3svc) - Logon as System Account&lt;br /&gt;
  SimpleSC::InstallService &amp;quot;MyService&amp;quot; &amp;quot;My Service Display Name&amp;quot; &amp;quot;272&amp;quot; &amp;quot;2&amp;quot; &amp;quot;C:\MyPath\MyService.exe&amp;quot; &amp;quot;w32time/w3svc&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Remove a service&lt;br /&gt;
  SimpleSC::RemoveService &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Start a service&lt;br /&gt;
  SimpleSC::StartService &amp;quot;MyService&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Start a service with two arguments &amp;quot;/param1=true&amp;quot; &amp;quot;/param2=1&amp;quot;&lt;br /&gt;
  SimpleSC::StartService &amp;quot;MyService&amp;quot; &amp;quot;/param1=true /param2=1&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
 &lt;br /&gt;
; Start a service with two arguments &amp;quot;-p param1&amp;quot; &amp;quot;-param2&amp;quot;&lt;br /&gt;
  SimpleSC::StartService &amp;quot;MyService&amp;quot; &#039;&amp;quot;-p param1&amp;quot; -param2&#039;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Stop a service and waits for file release&lt;br /&gt;
  SimpleSC::StopService &amp;quot;MyService&amp;quot; 1&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Stops two services and waits for file release after the last service is stopped&lt;br /&gt;
  SimpleSC::StopService &amp;quot;MyService1&amp;quot; 0&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  SimpleSC::StopService &amp;quot;MyService2&amp;quot; 1&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Pause a service&lt;br /&gt;
  SimpleSC::PauseService &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Continue a service&lt;br /&gt;
  SimpleSC::ContinueService &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Restart a service&lt;br /&gt;
  SimpleSC::RestartService &amp;quot;MyService&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Restart a service with two arguments &amp;quot;/param1=true&amp;quot; &amp;quot;/param2=1&amp;quot;&lt;br /&gt;
  SimpleSC::RestartService &amp;quot;MyService&amp;quot; &amp;quot;/param1=true /param2=1&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Start a service with two arguments &amp;quot;-p param1&amp;quot; &amp;quot;-param2&amp;quot;&lt;br /&gt;
  SimpleSC::RestartService &amp;quot;MyService&amp;quot; &#039;&amp;quot;-p param1&amp;quot; -param2&#039;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Check if the service exists&lt;br /&gt;
  SimpleSC::ExistsService &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode if the service doesnÂ´t exists (&amp;lt;&amp;gt;0)/service exists (0)&lt;br /&gt;
&lt;br /&gt;
; Get the displayname of a service&lt;br /&gt;
  SimpleSC::GetServiceDisplayName &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the displayname of the service&lt;br /&gt;
&lt;br /&gt;
; Get the servicename of a service by the displayname&lt;br /&gt;
  SimpleSC::GetServiceName &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the servicename of the service&lt;br /&gt;
&lt;br /&gt;
; Get the current status of a service&lt;br /&gt;
  SimpleSC::GetServiceStatus &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; return the status of the service (See &amp;quot;service_status&amp;quot; in the parameters)&lt;br /&gt;
&lt;br /&gt;
; Get the description of a service&lt;br /&gt;
  SimpleSC::GetServiceDescription &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the description of the service&lt;br /&gt;
 &lt;br /&gt;
; Get the start type of the service&lt;br /&gt;
  SimpleSC::GetServiceStartType &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the start type of the service (see &amp;quot;start_type&amp;quot; in the parameters)&lt;br /&gt;
&lt;br /&gt;
; Get the binary path of a service&lt;br /&gt;
  SimpleSC::GetServiceBinaryPath &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the binary path of the service&lt;br /&gt;
&lt;br /&gt;
; Get the logon user of the service&lt;br /&gt;
  SimpleSC::GetServiceLogon &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the logon username of the service  &lt;br /&gt;
&lt;br /&gt;
; Get the failure configuration of the service&lt;br /&gt;
  SimpleSC::GetServiceFailure &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the reset period &lt;br /&gt;
  Pop $2 ; returns the reboot message&lt;br /&gt;
  Pop $3 ; returns the command&lt;br /&gt;
  Pop $4 ; returns the first action (See &amp;quot;action_type_x&amp;quot; in the parameters)&lt;br /&gt;
  Pop $5 ; returns the first action delay &lt;br /&gt;
  Pop $6 ; returns the second action (See &amp;quot;action_type_x&amp;quot; in the parameters)&lt;br /&gt;
  Pop $7 ; returns the second action delay &lt;br /&gt;
  Pop $8 ; returns the third action (See &amp;quot;action_type_x&amp;quot; in the parameters)&lt;br /&gt;
  Pop $9 ; returns the third action delay &lt;br /&gt;
&lt;br /&gt;
; Set the description of a service (Not supported on Windows NT 4.0)&lt;br /&gt;
  SimpleSC::SetServiceDescription &amp;quot;MyService&amp;quot; &amp;quot;Sample Description&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Set the starttype to automatic of a service&lt;br /&gt;
  SimpleSC::SetServiceStartType &amp;quot;MyService&amp;quot; &amp;quot;2&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Sets the service binary path&lt;br /&gt;
  SimpleSC::SetServiceBinaryPath &amp;quot;MyService&amp;quot; &amp;quot;C:\MySoftware\MyService.exe&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Sets the service logon to a user and grant the user the &amp;quot;SeServiceLogonPrivilege&amp;quot;&lt;br /&gt;
  SimpleSC::SetServiceLogon &amp;quot;MyService&amp;quot; &amp;quot;MyServiceUser&amp;quot; &amp;quot;MyServiceUserPassword&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  IntCmp $0 0 +1 Done Done ; If successful grant the service logon privilege to &amp;quot;MyServiceUser&amp;quot;&lt;br /&gt;
    ; Note: Every serviceuser must have the ServiceLogonPrivilege to start the service&lt;br /&gt;
    SimpleSC::GrantServiceLogonPrivilege &amp;quot;MyServiceUser&amp;quot;&lt;br /&gt;
    Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Done:&lt;br /&gt;
&lt;br /&gt;
; Sets the service failure configuration - First action: Restart the service after one minute - Second action: Reboot the computer after five minutes&lt;br /&gt;
  SimpleSC::SetServiceFailure &amp;quot;MyService&amp;quot; &amp;quot;0&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;1&amp;quot; &amp;quot;60000&amp;quot; &amp;quot;2&amp;quot; &amp;quot;300000&amp;quot; &amp;quot;0&amp;quot; &amp;quot;0&amp;quot; &lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Remove the &amp;quot;SeServiceLogonPrivilege&amp;quot; from a user&lt;br /&gt;
  SimpleSC::RemoveServiceLogonPrivilege &amp;quot;MyServiceUser&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Check if the service is paused&lt;br /&gt;
  SimpleSC::ServiceIsPaused &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns 1 (service is paused) - returns 0 (service is not paused)&lt;br /&gt;
&lt;br /&gt;
; Check if the service is running&lt;br /&gt;
  SimpleSC::ServiceIsRunning &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns 1 (service is running) - returns 0 (service is not running)&lt;br /&gt;
&lt;br /&gt;
; Check if the service is stopped&lt;br /&gt;
  SimpleSC::ServiceIsStopped &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns 1 (service is stopped) - returns 0 (service is not stopped)&lt;br /&gt;
&lt;br /&gt;
; Show the error message if a function fails &lt;br /&gt;
  SimpleSC::StopService &amp;quot;MyService&amp;quot; 1&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  IntCmp $0 0 Done +1 +1 &lt;br /&gt;
    Push $0&lt;br /&gt;
    SimpleSC::GetErrorMessage&lt;br /&gt;
    Pop $0&lt;br /&gt;
    MessageBox MB_OK|MB_ICONSTOP &amp;quot;Stopping fails - Reason: $0&amp;quot;&lt;br /&gt;
  Done:&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Changelog ==&lt;br /&gt;
* Version 1.28 (2010-09-14)&lt;br /&gt;
**SimpleSC::GetServiceFailure function added&lt;br /&gt;
**SimpleSC::SetServiceFailure function added&lt;br /&gt;
**SimpleSC::StopService WaitForFileRelease feature added&lt;br /&gt;
* Version 1.27 (2010-03-23)&lt;br /&gt;
**Documentation updated&lt;br /&gt;
* Version 1.26 (2009-05-21)&lt;br /&gt;
**Fixed wait for status bug on starting, stopping, pausing or continuing a service &lt;br /&gt;
* Version 1.25 (2009-04-23)&lt;br /&gt;
**SimpleSC::SetServiceLogon supports now non-domain username without the &amp;quot;.\&amp;quot;-prefix&lt;br /&gt;
**SimpleSC::SetServiceBinaryPath function added&lt;br /&gt;
*Version 1.24 (2009-04-13)&lt;br /&gt;
**Fixed wait for status bug if the service status changed. Now, if a service stops, starts aso. the plugin will work like the recommendations in the MSDN.&lt;br /&gt;
*Version 1.23 (2008-08-23)&lt;br /&gt;
**Removed compiler optimization to avoid a false-positive virusscan.&lt;br /&gt;
*Version 1.22 (2008-08-17)&lt;br /&gt;
**SimpleSC::GrantServiceLogonPrivilege and SimpleSC::RemoveServiceLogonPrivilege works now correct with domain names like MyDomain\MyUser.&lt;br /&gt;
**Added function SimpleSC::GetServiceLogon to get the logon username of a service.&lt;br /&gt;
*Version 1.21 (2008-02-10)&lt;br /&gt;
**SimpleSC::ExistsService results now 0 if the service exists and &amp;lt;&amp;gt; 0 if the service doensnÂ´t exists.&lt;br /&gt;
*Version 1.20 (2008-02-05)&lt;br /&gt;
**Every function now returns &amp;lt;&amp;gt; 0 if there is an error. Use SimpleSC::GetErrorMessage to get the message of a function result.&lt;br /&gt;
**Added function SimpleSC::GetErrorMessage to get the message of a function result.&lt;br /&gt;
**SimpleSC::ExistsService results now 0 if the service exists and &amp;lt;&amp;gt; 0 if the service doensnÂ´t exists.&lt;br /&gt;
**SimpleSC::RestartService supports now arguments.&lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: The signature has been changed. If you update from a previous version you must check your parameters.&lt;br /&gt;
*Version 1.10 (2008-01-29)&lt;br /&gt;
**SimpleSC::InstallService supports now more than one dependencies (delimitter is the forward slash).&lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: The signature has been changed. If you update from a previous version you must check your parameters.&lt;br /&gt;
**SimpleSC::InstallService supports now more service types e.g. to create an interactive service.&lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: The signature has been changed. If you update from a previous version you must check your parameters.&lt;br /&gt;
**SimpleSC::StartService supports now arguments. &lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: The signature has been changed. If you update from a previous version you must check your parameters.&lt;br /&gt;
*Version 1.05 (2008-01-12)&lt;br /&gt;
**The functions SimpleSC::StopService and SimpleSC::RestartService are now improved. Now all dependent services are stopping recursively too.&lt;br /&gt;
*Version 1.04 (2007-08-07)&lt;br /&gt;
**Fixed bug for possible endless loops. This concerns to the functions StartService, StopService, ContinueService and PauseService. &lt;br /&gt;
*Version 1.03 (2007-08-02)&lt;br /&gt;
**Added function SimpleSC::GetServiceBinaryPath to get the binary path of a specified service.&lt;br /&gt;
*Version 1.02 (2007-05-29)&lt;br /&gt;
**Changed wrong documentation informations about the functions SimpleSC::InstallService and SimpleSC::RemoveService.&lt;br /&gt;
*Version 1.01 (2007-05-07)&lt;br /&gt;
**Changed wrong status-results in Readme.txt. This concerns to the functions ServiceIsPaused, ServiceIsRunning and ServiceIsStopped.&lt;br /&gt;
**Changed the access privileges of the plugin. The plugin now uses the lowest privlege of each function to execute.&lt;br /&gt;
*Version 1.0 (2007-05-02)&lt;br /&gt;
**First offical version&lt;br /&gt;
&lt;br /&gt;
== Important Notes ==&lt;br /&gt;
*The function &amp;quot;SetServiceLogon&amp;quot; only works if the servicetype is &amp;quot;SERVICE_WIN32_OWN_PROCESS&amp;quot;&lt;br /&gt;
* The functions &amp;quot;GetServiceDescription&amp;quot; or &amp;quot;SetServiceDescription&amp;quot; are only available on systems higher than Windows NT. &lt;br /&gt;
* If you change the logon of an service to a new user you have to grant him the Service Logon Privilege. Otherwise the service cannot be started by the user you have assigned.&lt;br /&gt;
* The functions StartService, StopService, PauseService and ContinueService uses a timeout of 30 seconds. This means the function must be executed within 30 seconds, otherwise the functions will return an error.&lt;br /&gt;
* If you have any suggestions, comments or questions please mail me: mailto:rainer@speed-soft.de&lt;br /&gt;
&lt;br /&gt;
[[Category:Plugins]]&lt;/div&gt;</summary>
		<author><name>Speed78</name></author>
	</entry>
	<entry>
		<id>https://nsis.sourceforge.io/mediawiki/index.php?title=NSIS_Simple_Service_Plugin&amp;diff=18908</id>
		<title>NSIS Simple Service Plugin</title>
		<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/mediawiki/index.php?title=NSIS_Simple_Service_Plugin&amp;diff=18908"/>
		<updated>2010-09-14T11:18:42Z</updated>

		<summary type="html">&lt;p&gt;Speed78: /* The Sample Script */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This plugin contains basic service functions like start, stop the service or checking the service status. It also contains advanced service functions for example setting the service description, changed the logon account, granting or removing the service logon privilege.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This plugin is using the MPL License or alternatively the LGPL License.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
&amp;lt;attach&amp;gt;NSIS_Simple_Service_Plugin_1.27.zip&amp;lt;/attach&amp;gt; The ZIP file containing a precompiled plugin DLL (to be saved in NSIS&#039; plugin directory) and the sources. If you update from a previous version it is strongly &#039;&#039;&#039;recommend&#039;&#039;&#039; to take look at the changelog.&lt;br /&gt;
&lt;br /&gt;
== Donation ==&lt;br /&gt;
If you believe that I am doing a good job and you want to support me please [http://www.speed-soft.de/donation/index.php?language=en donate] any amount via PayPal.&lt;br /&gt;
&lt;br /&gt;
== Short Reference ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
SimpleSC::InstallService [name_of_service] [display_name] [service_type] [start_type] &lt;br /&gt;
  [binary_path] [dependencies] [account] [password]&lt;br /&gt;
SimpleSC::RemoveService [name_of_service]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::StartService [name_of_service] [arguments]&lt;br /&gt;
SimpleSC::StopService [name_of_service] [wait_for_file_release]&lt;br /&gt;
SimpleSC::PauseService [name_of_service] &lt;br /&gt;
SimpleSC::ContinueService [name_of_service]&lt;br /&gt;
SimpleSC::RestartService [name_of_service] [arguments]&lt;br /&gt;
SimpleSC::ExistsService [name_of_service]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::GetServiceDisplayName [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceName [display_name]&lt;br /&gt;
SimpleSC::GetServiceStatus [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceDescription [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceStartType [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceBinaryPath [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceLogon [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceFailure [name_of_service]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::SetServiceDescription [name_of_service] [service_description]&lt;br /&gt;
SimpleSC::SetServiceStartType [name_of_service] [start_type]&lt;br /&gt;
SimpleSC::SetServiceBinaryPath [name_of_service] [binary_path]&lt;br /&gt;
SimpleSC::SetServiceLogon [name_of_service] [account] [password]&lt;br /&gt;
SimpleSC::SetServiceFailure [name_of_service] [reset_period] [reboot_message] [command] &lt;br /&gt;
  [action_type_1] [action_delay_1] [action_type_2] [action_delay_2] [action_type_3] &lt;br /&gt;
  [action_delay_3] &lt;br /&gt;
&lt;br /&gt;
SimpleSC::GrantServiceLogonPrivilege [account]&lt;br /&gt;
SimpleSC::RemoveServiceLogonPrivilege [account]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::ServiceIsPaused [name_of_service]&lt;br /&gt;
SimpleSC::ServiceIsRunning [name_of_service]&lt;br /&gt;
SimpleSC::ServiceIsStopped [name_of_service]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::GetErrorMessage [error_code]&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
*name_of_service - The name of the service used for Start/Stop commands and all further commands &lt;br /&gt;
*display_name - The name as shown in the service control manager applet in system control &lt;br /&gt;
*service_type - One of the following codes &lt;br /&gt;
**1 - SERVICE_KERNEL_DRIVER - Driver service.&lt;br /&gt;
**2 - SERVICE_FILE_SYSTEM_DRIVER - File system driver service.&lt;br /&gt;
**16 - SERVICE_WIN32_OWN_PROCESS - Service that runs in its own process. (Should be used in most cases)&lt;br /&gt;
**32 - SERVICE_WIN32_SHARE_PROCESS - Service that shares a process with one or more other services. &lt;br /&gt;
**256 - SERVICE_INTERACTIVE_PROCESS - The service can interact with the desktop. &lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: If you specify either SERVICE_WIN32_OWN_PROCESS or SERVICE_WIN32_SHARE_PROCESS,          and the service is running in the context of the LocalSystem account,          you can also specify this value. Example: SERVICE_WIN32_OWN_PROCESS or SERVICE_INTERACTIVE_PROCESS - (16 or 256) = 272&lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: Services cannot directly interact with a user as of Windows Vista.             Therefore, this technique should not be used in new code. See for more information: http://msdn2.microsoft.com/en-us/library/ms683502(VS.85).aspx          &lt;br /&gt;
&lt;br /&gt;
*start_type - one of the following codes &lt;br /&gt;
**0 - SERVICE_BOOT_START - Driver boot stage start &lt;br /&gt;
**1 - SERVICE_SYSTEM_START - Driver scm stage start &lt;br /&gt;
**2 - SERVICE_AUTO_START - Service auto start (Should be used in most cases)&lt;br /&gt;
**3 - SERVICE_DEMAND_START - Driver/service manual start &lt;br /&gt;
**4 - SERVICE_DISABLED - Driver/service disabled&lt;br /&gt;
*service_status - one of the following codes&lt;br /&gt;
**1 - SERVICE_STOPPED&lt;br /&gt;
**2 - SERVICE_START_PENDING&lt;br /&gt;
**3 - SERVICE_STOP_PENDING&lt;br /&gt;
**4 - SERVICE_RUNNING&lt;br /&gt;
**5 - SERVICE_CONTINUE_PENDING&lt;br /&gt;
**6 - SERVICE_PAUSE_PENDING&lt;br /&gt;
**7 - SERVICE_PAUSED&lt;br /&gt;
*binary_path - The path to the binary including all necessary parameters &lt;br /&gt;
*dependencies - Needed services, controls which services have to be started before this one; use the forward slash &amp;quot;/&amp;quot; to add more more than one service&lt;br /&gt;
*account - The username/account which should be used &lt;br /&gt;
*password - Password of the aforementioned account to be able to logon as a service &lt;br /&gt;
**&#039;&#039;&#039;Note&#039;&#039;&#039;: If you do not specify account/password, the local system account will be used to run the service&lt;br /&gt;
*arguments - Arguments passed to the service main function. &lt;br /&gt;
**&#039;&#039;&#039;Note&#039;&#039;&#039;: Driver services do not receive these arguments.&lt;br /&gt;
*reset_period - The time after which to reset the failure count to zero if there are no failures, in seconds. Specify 0 (INFINITE) to indicate that this value should never be reset&lt;br /&gt;
*reboot_message - The message to be broadcast to server users before rebooting&lt;br /&gt;
*command - The command line of the process to execute in response to the SC_ACTION_RUN_COMMAND service controller action. This process runs under the same account as the service&lt;br /&gt;
*action_type_x - one of the following codes for the action to be performed&lt;br /&gt;
**0 - SC_ACTION_NONE - No action&lt;br /&gt;
**1 - SC_ACTION_RESTART - Restart the service&lt;br /&gt;
**2 - SC_ACTION_REBOOT - Reboot the computer (Note: The service user must have the SE_SHUTDOWN_NAME privilege)&lt;br /&gt;
**3 - SC_ACTION_RUN_COMMAND - Run a command&lt;br /&gt;
*action_delay_x - The time to wait before performing the specified action, in milliseconds&lt;br /&gt;
*error_code - Error code of a function&lt;br /&gt;
*service_description - The description as shown in the service control manager applet in system control&lt;br /&gt;
*wait_for_file_release - Wait for file release after the service is stopped. This is useful if the binary file will be overwritten after stopping the service.&lt;br /&gt;
**0 - NO_WAIT - No wait for file release&lt;br /&gt;
**1 - WAIT - Wait for file release &lt;br /&gt;
**&#039;&#039;&#039;Note&#039;&#039;&#039;: If SERVICE_WIN32_OWN_PROCESS is used this option should be set to WAIT.	If SERVICE_WIN32_SHARE_PROCESS is used this option should only be set to WAIT if the last service in the process is stopped.&lt;br /&gt;
&lt;br /&gt;
== The Sample Script ==&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
; Install a service - ServiceType own process - StartType automatic - NoDependencies - Logon as System Account&lt;br /&gt;
  SimpleSC::InstallService &amp;quot;MyService&amp;quot; &amp;quot;My Service Display Name&amp;quot; &amp;quot;16&amp;quot; &amp;quot;2&amp;quot; &amp;quot;C:\MyPath\MyService.exe&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Install a service - ServiceType interact with desktop - StartType automatic - Dependencies on &amp;quot;Windows Time Service&amp;quot; (w32time) and &amp;quot;WWW Publishing Service&amp;quot; (w3svc) - Logon as System Account&lt;br /&gt;
  SimpleSC::InstallService &amp;quot;MyService&amp;quot; &amp;quot;My Service Display Name&amp;quot; &amp;quot;272&amp;quot; &amp;quot;2&amp;quot; &amp;quot;C:\MyPath\MyService.exe&amp;quot; &amp;quot;w32time/w3svc&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Remove a service&lt;br /&gt;
  SimpleSC::RemoveService &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Start a service&lt;br /&gt;
  SimpleSC::StartService &amp;quot;MyService&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Start a service with two arguments &amp;quot;/param1=true&amp;quot; &amp;quot;/param2=1&amp;quot;&lt;br /&gt;
  SimpleSC::StartService &amp;quot;MyService&amp;quot; &amp;quot;/param1=true /param2=1&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
 &lt;br /&gt;
; Start a service with two arguments &amp;quot;-p param1&amp;quot; &amp;quot;-param2&amp;quot;&lt;br /&gt;
  SimpleSC::StartService &amp;quot;MyService&amp;quot; &#039;&amp;quot;-p param1&amp;quot; -param2&#039;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Stop a service and waits for file release&lt;br /&gt;
  SimpleSC::StopService &amp;quot;MyService&amp;quot; 1&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Stops two services and waits for file release after the last service is stopped&lt;br /&gt;
  SimpleSC::StopService &amp;quot;MyService1&amp;quot; 0&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  SimpleSC::StopService &amp;quot;MyService2&amp;quot; 1&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Pause a service&lt;br /&gt;
  SimpleSC::PauseService &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Continue a service&lt;br /&gt;
  SimpleSC::ContinueService &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Restart a service&lt;br /&gt;
  SimpleSC::RestartService &amp;quot;MyService&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Restart a service with two arguments &amp;quot;/param1=true&amp;quot; &amp;quot;/param2=1&amp;quot;&lt;br /&gt;
  SimpleSC::RestartService &amp;quot;MyService&amp;quot; &amp;quot;/param1=true /param2=1&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Start a service with two arguments &amp;quot;-p param1&amp;quot; &amp;quot;-param2&amp;quot;&lt;br /&gt;
  SimpleSC::RestartService &amp;quot;MyService&amp;quot; &#039;&amp;quot;-p param1&amp;quot; -param2&#039;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Check if the service exists&lt;br /&gt;
  SimpleSC::ExistsService &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode if the service doesnÂ´t exists (&amp;lt;&amp;gt;0)/service exists (0)&lt;br /&gt;
&lt;br /&gt;
; Get the displayname of a service&lt;br /&gt;
  SimpleSC::GetServiceDisplayName &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the displayname of the service&lt;br /&gt;
&lt;br /&gt;
; Get the servicename of a service by the displayname&lt;br /&gt;
  SimpleSC::GetServiceName &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the servicename of the service&lt;br /&gt;
&lt;br /&gt;
; Get the current status of a service&lt;br /&gt;
  SimpleSC::GetServiceStatus &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; return the status of the service (See &amp;quot;service_status&amp;quot; in the parameters)&lt;br /&gt;
&lt;br /&gt;
; Get the description of a service&lt;br /&gt;
  SimpleSC::GetServiceDescription &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the description of the service&lt;br /&gt;
 &lt;br /&gt;
; Get the start type of the service&lt;br /&gt;
  SimpleSC::GetServiceStartType &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the start type of the service (see &amp;quot;start_type&amp;quot; in the parameters)&lt;br /&gt;
&lt;br /&gt;
; Get the binary path of a service&lt;br /&gt;
  SimpleSC::GetServiceBinaryPath &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the binary path of the service&lt;br /&gt;
&lt;br /&gt;
; Get the logon user of the service&lt;br /&gt;
  SimpleSC::GetServiceLogon &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the logon username of the service  &lt;br /&gt;
&lt;br /&gt;
; Get the failure configuration of the service&lt;br /&gt;
  SimpleSC::GetServiceFailure &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the reset period &lt;br /&gt;
  Pop $2 ; returns the reboot message&lt;br /&gt;
  Pop $3 ; returns the command&lt;br /&gt;
  Pop $4 ; returns the first action (See &amp;quot;action_type_x&amp;quot; in the parameters)&lt;br /&gt;
  Pop $5 ; returns the first action delay &lt;br /&gt;
  Pop $6 ; returns the second action (See &amp;quot;action_type_x&amp;quot; in the parameters)&lt;br /&gt;
  Pop $7 ; returns the second action delay &lt;br /&gt;
  Pop $8 ; returns the third action (See &amp;quot;action_type_x&amp;quot; in the parameters)&lt;br /&gt;
  Pop $9 ; returns the third action delay &lt;br /&gt;
&lt;br /&gt;
; Set the description of a service (Not supported on Windows NT 4.0)&lt;br /&gt;
  SimpleSC::SetServiceDescription &amp;quot;MyService&amp;quot; &amp;quot;Sample Description&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Set the starttype to automatic of a service&lt;br /&gt;
  SimpleSC::SetServiceStartType &amp;quot;MyService&amp;quot; &amp;quot;2&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Sets the service binary path&lt;br /&gt;
  SimpleSC::SetServiceBinaryPath &amp;quot;MyService&amp;quot; &amp;quot;C:\MySoftware\MyService.exe&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Sets the service logon to a user and grant the user the &amp;quot;SeServiceLogonPrivilege&amp;quot;&lt;br /&gt;
  SimpleSC::SetServiceLogon &amp;quot;MyService&amp;quot; &amp;quot;MyServiceUser&amp;quot; &amp;quot;MyServiceUserPassword&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  IntCmp $0 0 +1 Done Done ; If successful grant the service logon privilege to &amp;quot;MyServiceUser&amp;quot;&lt;br /&gt;
    ; Note: Every serviceuser must have the ServiceLogonPrivilege to start the service&lt;br /&gt;
    SimpleSC::GrantServiceLogonPrivilege &amp;quot;MyServiceUser&amp;quot;&lt;br /&gt;
    Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Done:&lt;br /&gt;
&lt;br /&gt;
; Sets the service failure configuration - First action: Restart the service after one minute - Second action: Reboot the computer after five minutes&lt;br /&gt;
  SimpleSC::SetServiceFailure &amp;quot;MyService&amp;quot; &amp;quot;0&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;1&amp;quot; &amp;quot;60000&amp;quot; &amp;quot;2&amp;quot; &amp;quot;300000&amp;quot; &amp;quot;0&amp;quot; &amp;quot;0&amp;quot; &lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Remove the &amp;quot;SeServiceLogonPrivilege&amp;quot; from a user&lt;br /&gt;
  SimpleSC::RemoveServiceLogonPrivilege &amp;quot;MyServiceUser&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Check if the service is paused&lt;br /&gt;
  SimpleSC::ServiceIsPaused &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns 1 (service is paused) - returns 0 (service is not paused)&lt;br /&gt;
&lt;br /&gt;
; Check if the service is running&lt;br /&gt;
  SimpleSC::ServiceIsRunning &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns 1 (service is running) - returns 0 (service is not running)&lt;br /&gt;
&lt;br /&gt;
; Check if the service is stopped&lt;br /&gt;
  SimpleSC::ServiceIsStopped &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns 1 (service is stopped) - returns 0 (service is not stopped)&lt;br /&gt;
&lt;br /&gt;
; Show the error message if a function fails &lt;br /&gt;
  SimpleSC::StopService &amp;quot;MyService&amp;quot; 1&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  IntCmp $0 0 Done +1 +1 &lt;br /&gt;
    Push $0&lt;br /&gt;
    SimpleSC::GetErrorMessage&lt;br /&gt;
    Pop $0&lt;br /&gt;
    MessageBox MB_OK|MB_ICONSTOP &amp;quot;Stopping fails - Reason: $0&amp;quot;&lt;br /&gt;
  Done:&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Changelog ==&lt;br /&gt;
* Version 1.28 (2010-09-14)&lt;br /&gt;
**SimpleSC::GetServiceFailure function added&lt;br /&gt;
**SimpleSC::SetServiceFailure function added&lt;br /&gt;
**SimpleSC::StopService WaitForFileRelease feature added&lt;br /&gt;
* Version 1.27 (2010-03-23)&lt;br /&gt;
**Documentation updated&lt;br /&gt;
* Version 1.26 (2009-05-21)&lt;br /&gt;
**Fixed wait for status bug on starting, stopping, pausing or continuing a service &lt;br /&gt;
* Version 1.25 (2009-04-23)&lt;br /&gt;
**SimpleSC::SetServiceLogon supports now non-domain username without the &amp;quot;.\&amp;quot;-prefix&lt;br /&gt;
**SimpleSC::SetServiceBinaryPath function added&lt;br /&gt;
*Version 1.24 (2009-04-13)&lt;br /&gt;
**Fixed wait for status bug if the service status changed. Now, if a service stops, starts aso. the plugin will work like the recommendations in the MSDN.&lt;br /&gt;
*Version 1.23 (2008-08-23)&lt;br /&gt;
**Removed compiler optimization to avoid a false-positive virusscan.&lt;br /&gt;
*Version 1.22 (2008-08-17)&lt;br /&gt;
**SimpleSC::GrantServiceLogonPrivilege and SimpleSC::RemoveServiceLogonPrivilege works now correct with domain names like MyDomain\MyUser.&lt;br /&gt;
**Added function SimpleSC::GetServiceLogon to get the logon username of a service.&lt;br /&gt;
*Version 1.21 (2008-02-10)&lt;br /&gt;
**SimpleSC::ExistsService results now 0 if the service exists and &amp;lt;&amp;gt; 0 if the service doensnÂ´t exists.&lt;br /&gt;
*Version 1.20 (2008-02-05)&lt;br /&gt;
**Every function now returns &amp;lt;&amp;gt; 0 if there is an error. Use SimpleSC::GetErrorMessage to get the message of a function result.&lt;br /&gt;
**Added function SimpleSC::GetErrorMessage to get the message of a function result.&lt;br /&gt;
**SimpleSC::ExistsService results now 0 if the service exists and &amp;lt;&amp;gt; 0 if the service doensnÂ´t exists.&lt;br /&gt;
**SimpleSC::RestartService supports now arguments.&lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: The signature has been changed. If you update from a previous version you must check your parameters.&lt;br /&gt;
*Version 1.10 (2008-01-29)&lt;br /&gt;
**SimpleSC::InstallService supports now more than one dependencies (delimitter is the forward slash).&lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: The signature has been changed. If you update from a previous version you must check your parameters.&lt;br /&gt;
**SimpleSC::InstallService supports now more service types e.g. to create an interactive service.&lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: The signature has been changed. If you update from a previous version you must check your parameters.&lt;br /&gt;
**SimpleSC::StartService supports now arguments. &lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: The signature has been changed. If you update from a previous version you must check your parameters.&lt;br /&gt;
*Version 1.05 (2008-01-12)&lt;br /&gt;
**The functions SimpleSC::StopService and SimpleSC::RestartService are now improved. Now all dependent services are stopping recursively too.&lt;br /&gt;
*Version 1.04 (2007-08-07)&lt;br /&gt;
**Fixed bug for possible endless loops. This concerns to the functions StartService, StopService, ContinueService and PauseService. &lt;br /&gt;
*Version 1.03 (2007-08-02)&lt;br /&gt;
**Added function SimpleSC::GetServiceBinaryPath to get the binary path of a specified service.&lt;br /&gt;
*Version 1.02 (2007-05-29)&lt;br /&gt;
**Changed wrong documentation informations about the functions SimpleSC::InstallService and SimpleSC::RemoveService.&lt;br /&gt;
*Version 1.01 (2007-05-07)&lt;br /&gt;
**Changed wrong status-results in Readme.txt. This concerns to the functions ServiceIsPaused, ServiceIsRunning and ServiceIsStopped.&lt;br /&gt;
**Changed the access privileges of the plugin. The plugin now uses the lowest privlege of each function to execute.&lt;br /&gt;
*Version 1.0 (2007-05-02)&lt;br /&gt;
**First offical version&lt;br /&gt;
&lt;br /&gt;
== Important Notes ==&lt;br /&gt;
*The function &amp;quot;SetServiceLogon&amp;quot; only works if the servicetype is &amp;quot;SERVICE_WIN32_OWN_PROCESS&amp;quot;&lt;br /&gt;
* The functions &amp;quot;GetServiceDescription&amp;quot; or &amp;quot;SetServiceDescription&amp;quot; are only available on systems higher than Windows NT. &lt;br /&gt;
* If you change the logon of an service to a new user you have to grant him the Service Logon Privilege. Otherwise the service cannot be started by the user you have assigned.&lt;br /&gt;
* The functions StartService, StopService, PauseService and ContinueService uses a timeout of 30 seconds. This means the function must be executed within 30 seconds, otherwise the functions will return an error.&lt;br /&gt;
* If you have any suggestions, comments or questions please mail me: mailto:rainer@speed-soft.de&lt;br /&gt;
&lt;br /&gt;
[[Category:Plugins]]&lt;/div&gt;</summary>
		<author><name>Speed78</name></author>
	</entry>
	<entry>
		<id>https://nsis.sourceforge.io/mediawiki/index.php?title=NSIS_Simple_Service_Plugin&amp;diff=18907</id>
		<title>NSIS Simple Service Plugin</title>
		<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/mediawiki/index.php?title=NSIS_Simple_Service_Plugin&amp;diff=18907"/>
		<updated>2010-09-14T11:17:09Z</updated>

		<summary type="html">&lt;p&gt;Speed78: /* Short Reference */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This plugin contains basic service functions like start, stop the service or checking the service status. It also contains advanced service functions for example setting the service description, changed the logon account, granting or removing the service logon privilege.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This plugin is using the MPL License or alternatively the LGPL License.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
&amp;lt;attach&amp;gt;NSIS_Simple_Service_Plugin_1.27.zip&amp;lt;/attach&amp;gt; The ZIP file containing a precompiled plugin DLL (to be saved in NSIS&#039; plugin directory) and the sources. If you update from a previous version it is strongly &#039;&#039;&#039;recommend&#039;&#039;&#039; to take look at the changelog.&lt;br /&gt;
&lt;br /&gt;
== Donation ==&lt;br /&gt;
If you believe that I am doing a good job and you want to support me please [http://www.speed-soft.de/donation/index.php?language=en donate] any amount via PayPal.&lt;br /&gt;
&lt;br /&gt;
== Short Reference ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
SimpleSC::InstallService [name_of_service] [display_name] [service_type] [start_type] &lt;br /&gt;
  [binary_path] [dependencies] [account] [password]&lt;br /&gt;
SimpleSC::RemoveService [name_of_service]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::StartService [name_of_service] [arguments]&lt;br /&gt;
SimpleSC::StopService [name_of_service] [wait_for_file_release]&lt;br /&gt;
SimpleSC::PauseService [name_of_service] &lt;br /&gt;
SimpleSC::ContinueService [name_of_service]&lt;br /&gt;
SimpleSC::RestartService [name_of_service] [arguments]&lt;br /&gt;
SimpleSC::ExistsService [name_of_service]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::GetServiceDisplayName [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceName [display_name]&lt;br /&gt;
SimpleSC::GetServiceStatus [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceDescription [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceStartType [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceBinaryPath [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceLogon [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceFailure [name_of_service]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::SetServiceDescription [name_of_service] [service_description]&lt;br /&gt;
SimpleSC::SetServiceStartType [name_of_service] [start_type]&lt;br /&gt;
SimpleSC::SetServiceBinaryPath [name_of_service] [binary_path]&lt;br /&gt;
SimpleSC::SetServiceLogon [name_of_service] [account] [password]&lt;br /&gt;
SimpleSC::SetServiceFailure [name_of_service] [reset_period] [reboot_message] [command] &lt;br /&gt;
  [action_type_1] [action_delay_1] [action_type_2] [action_delay_2] [action_type_3] &lt;br /&gt;
  [action_delay_3] &lt;br /&gt;
&lt;br /&gt;
SimpleSC::GrantServiceLogonPrivilege [account]&lt;br /&gt;
SimpleSC::RemoveServiceLogonPrivilege [account]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::ServiceIsPaused [name_of_service]&lt;br /&gt;
SimpleSC::ServiceIsRunning [name_of_service]&lt;br /&gt;
SimpleSC::ServiceIsStopped [name_of_service]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::GetErrorMessage [error_code]&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
*name_of_service - The name of the service used for Start/Stop commands and all further commands &lt;br /&gt;
*display_name - The name as shown in the service control manager applet in system control &lt;br /&gt;
*service_type - One of the following codes &lt;br /&gt;
**1 - SERVICE_KERNEL_DRIVER - Driver service.&lt;br /&gt;
**2 - SERVICE_FILE_SYSTEM_DRIVER - File system driver service.&lt;br /&gt;
**16 - SERVICE_WIN32_OWN_PROCESS - Service that runs in its own process. (Should be used in most cases)&lt;br /&gt;
**32 - SERVICE_WIN32_SHARE_PROCESS - Service that shares a process with one or more other services. &lt;br /&gt;
**256 - SERVICE_INTERACTIVE_PROCESS - The service can interact with the desktop. &lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: If you specify either SERVICE_WIN32_OWN_PROCESS or SERVICE_WIN32_SHARE_PROCESS,          and the service is running in the context of the LocalSystem account,          you can also specify this value. Example: SERVICE_WIN32_OWN_PROCESS or SERVICE_INTERACTIVE_PROCESS - (16 or 256) = 272&lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: Services cannot directly interact with a user as of Windows Vista.             Therefore, this technique should not be used in new code. See for more information: http://msdn2.microsoft.com/en-us/library/ms683502(VS.85).aspx          &lt;br /&gt;
&lt;br /&gt;
*start_type - one of the following codes &lt;br /&gt;
**0 - SERVICE_BOOT_START - Driver boot stage start &lt;br /&gt;
**1 - SERVICE_SYSTEM_START - Driver scm stage start &lt;br /&gt;
**2 - SERVICE_AUTO_START - Service auto start (Should be used in most cases)&lt;br /&gt;
**3 - SERVICE_DEMAND_START - Driver/service manual start &lt;br /&gt;
**4 - SERVICE_DISABLED - Driver/service disabled&lt;br /&gt;
*service_status - one of the following codes&lt;br /&gt;
**1 - SERVICE_STOPPED&lt;br /&gt;
**2 - SERVICE_START_PENDING&lt;br /&gt;
**3 - SERVICE_STOP_PENDING&lt;br /&gt;
**4 - SERVICE_RUNNING&lt;br /&gt;
**5 - SERVICE_CONTINUE_PENDING&lt;br /&gt;
**6 - SERVICE_PAUSE_PENDING&lt;br /&gt;
**7 - SERVICE_PAUSED&lt;br /&gt;
*binary_path - The path to the binary including all necessary parameters &lt;br /&gt;
*dependencies - Needed services, controls which services have to be started before this one; use the forward slash &amp;quot;/&amp;quot; to add more more than one service&lt;br /&gt;
*account - The username/account which should be used &lt;br /&gt;
*password - Password of the aforementioned account to be able to logon as a service &lt;br /&gt;
**&#039;&#039;&#039;Note&#039;&#039;&#039;: If you do not specify account/password, the local system account will be used to run the service&lt;br /&gt;
*arguments - Arguments passed to the service main function. &lt;br /&gt;
**&#039;&#039;&#039;Note&#039;&#039;&#039;: Driver services do not receive these arguments.&lt;br /&gt;
*reset_period - The time after which to reset the failure count to zero if there are no failures, in seconds. Specify 0 (INFINITE) to indicate that this value should never be reset&lt;br /&gt;
*reboot_message - The message to be broadcast to server users before rebooting&lt;br /&gt;
*command - The command line of the process to execute in response to the SC_ACTION_RUN_COMMAND service controller action. This process runs under the same account as the service&lt;br /&gt;
*action_type_x - one of the following codes for the action to be performed&lt;br /&gt;
**0 - SC_ACTION_NONE - No action&lt;br /&gt;
**1 - SC_ACTION_RESTART - Restart the service&lt;br /&gt;
**2 - SC_ACTION_REBOOT - Reboot the computer (Note: The service user must have the SE_SHUTDOWN_NAME privilege)&lt;br /&gt;
**3 - SC_ACTION_RUN_COMMAND - Run a command&lt;br /&gt;
*action_delay_x - The time to wait before performing the specified action, in milliseconds&lt;br /&gt;
*error_code - Error code of a function&lt;br /&gt;
*service_description - The description as shown in the service control manager applet in system control&lt;br /&gt;
*wait_for_file_release - Wait for file release after the service is stopped. This is useful if the binary file will be overwritten after stopping the service.&lt;br /&gt;
**0 - NO_WAIT - No wait for file release&lt;br /&gt;
**1 - WAIT - Wait for file release &lt;br /&gt;
**&#039;&#039;&#039;Note&#039;&#039;&#039;: If SERVICE_WIN32_OWN_PROCESS is used this option should be set to WAIT.	If SERVICE_WIN32_SHARE_PROCESS is used this option should only be set to WAIT if the last service in the process is stopped.&lt;br /&gt;
&lt;br /&gt;
== The Sample Script ==&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
; Install a service - ServiceType own process - StartType automatic - NoDependencies - Logon as &lt;br /&gt;
; System Account&lt;br /&gt;
  SimpleSC::InstallService &amp;quot;MyService&amp;quot; &amp;quot;My Service Display Name&amp;quot; &amp;quot;16&amp;quot; &amp;quot;2&amp;quot; &lt;br /&gt;
    &amp;quot;C:\MyPath\MyService.exe&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Install a service - ServiceType interact with desktop - StartType automatic - Dependencies on &lt;br /&gt;
; &amp;quot;Windows Time Service&amp;quot; (w32time) and &amp;quot;WWW Publishing Service&amp;quot; (w3svc) - Logon as System Account&lt;br /&gt;
  SimpleSC::InstallService &amp;quot;MyService&amp;quot; &amp;quot;My Service Display Name&amp;quot; &amp;quot;272&amp;quot; &amp;quot;2&amp;quot; &lt;br /&gt;
    &amp;quot;C:\MyPath\MyService.exe&amp;quot; &amp;quot;w32time/w3svc&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Remove a service&lt;br /&gt;
  SimpleSC::RemoveService &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Start a service&lt;br /&gt;
  SimpleSC::StartService &amp;quot;MyService&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Start a service with two arguments &amp;quot;/param1=true&amp;quot; &amp;quot;/param2=1&amp;quot;&lt;br /&gt;
  SimpleSC::StartService &amp;quot;MyService&amp;quot; &amp;quot;/param1=true /param2=1&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
 &lt;br /&gt;
; Start a service with two arguments &amp;quot;-p param1&amp;quot; &amp;quot;-param2&amp;quot;&lt;br /&gt;
  SimpleSC::StartService &amp;quot;MyService&amp;quot; &#039;&amp;quot;-p param1&amp;quot; -param2&#039;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Stop a service&lt;br /&gt;
  SimpleSC::StopService &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Pause a service&lt;br /&gt;
  SimpleSC::PauseService &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Continue a service&lt;br /&gt;
  SimpleSC::ContinueService &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Restart a service&lt;br /&gt;
  SimpleSC::RestartService &amp;quot;MyService&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Restart a service with two arguments &amp;quot;/param1=true&amp;quot; &amp;quot;/param2=1&amp;quot;&lt;br /&gt;
  SimpleSC::RestartService &amp;quot;MyService&amp;quot; &amp;quot;/param1=true /param2=1&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Start a service with two arguments &amp;quot;-p param1&amp;quot; &amp;quot;-param2&amp;quot;&lt;br /&gt;
  SimpleSC::RestartService &amp;quot;MyService&amp;quot; &#039;&amp;quot;-p param1&amp;quot; -param2&#039;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Check if the service exists&lt;br /&gt;
  SimpleSC::ExistsService &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode if the service doesnÂ´t exists (&amp;lt;&amp;gt;0)/service exists (0)&lt;br /&gt;
&lt;br /&gt;
; Get the displayname of a service&lt;br /&gt;
  SimpleSC::GetServiceDisplayName &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the displayname of the service&lt;br /&gt;
&lt;br /&gt;
; Get the servicename of a service by the displayname&lt;br /&gt;
  SimpleSC::GetServiceName &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the servicename of the service&lt;br /&gt;
&lt;br /&gt;
; Get the current status of a service&lt;br /&gt;
  SimpleSC::GetServiceStatus &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the status of the service&lt;br /&gt;
  ; Valid values are:&lt;br /&gt;
  ; 1 - SERVICE_STOPPED&lt;br /&gt;
  ; 2 - SERVICE_START_PENDING&lt;br /&gt;
  ; 3 - SERVICE_STOP_PENDING&lt;br /&gt;
  ; 4 - SERVICE_RUNNING&lt;br /&gt;
  ; 5 - SERVICE_CONTINUE_PENDING&lt;br /&gt;
  ; 6 - SERVICE_PAUSE_PENDING&lt;br /&gt;
  ; 7 - SERVICE_PAUSED&lt;br /&gt;
&lt;br /&gt;
; Get the description of a service&lt;br /&gt;
  SimpleSC::GetServiceDescription &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the description of the service&lt;br /&gt;
&lt;br /&gt;
; Get the start type of the service&lt;br /&gt;
  SimpleSC::GetServiceStartType &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the start type of the service&lt;br /&gt;
  ; Valid values are:&lt;br /&gt;
  ; 0 - SERVICE_BOOT_START&lt;br /&gt;
  ; 1 - SERVICE_SYSTEM_START&lt;br /&gt;
  ; 2 - SERVICE_AUTO_START&lt;br /&gt;
  ; 3 - SERVICE_DEMAND_START &lt;br /&gt;
  ; 4 - SERVICE_DISABLED&lt;br /&gt;
&lt;br /&gt;
; Get the binary path of a service&lt;br /&gt;
  SimpleSC::GetServiceBinaryPath &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the binary path of the service&lt;br /&gt;
&lt;br /&gt;
; Get the service logon user of the service&lt;br /&gt;
  SimpleSC::GetServiceLogon &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the logon username of the service&lt;br /&gt;
&lt;br /&gt;
; Set the description of a service (Not supported on Windows NT 4.0)&lt;br /&gt;
  SimpleSC::SetServiceDescription &amp;quot;MyService&amp;quot; &amp;quot;Sample Description&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Set the starttype to automatic of a service&lt;br /&gt;
  SimpleSC::SetServiceStartType &amp;quot;MyService&amp;quot; &amp;quot;2&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Sets the service logon to a user and grant the user the &amp;quot;SeServiceLogonPrivilege&amp;quot;&lt;br /&gt;
  SimpleSC::SetServiceLogon &amp;quot;MyService&amp;quot; &amp;quot;MyServiceUser&amp;quot; &amp;quot;MyServiceUserPassword&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  IntCmp $0 0 +1 Done Done ; If successful grant the service logon privilege to &amp;quot;MyServiceUser&amp;quot;&lt;br /&gt;
    ; Note: Every serviceuser must have the ServiceLogonPrivilege to start the service&lt;br /&gt;
    SimpleSC::GrantServiceLogonPrivilege &amp;quot;MyServiceUser&amp;quot;&lt;br /&gt;
    Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Done:&lt;br /&gt;
&lt;br /&gt;
; Sets the service binary path&lt;br /&gt;
  SimpleSC::SetServiceBinaryPath &amp;quot;MyService&amp;quot; &amp;quot;C:\MySoftware\MyService.exe&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Remove the &amp;quot;SeServiceLogonPrivilege&amp;quot; from a user&lt;br /&gt;
  SimpleSC::RemoveServiceLogonPrivilege &amp;quot;MyServiceUser&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Check if the service is paused&lt;br /&gt;
  SimpleSC::ServiceIsPaused &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns 1 (service is paused) - returns 0 (service is not paused)&lt;br /&gt;
&lt;br /&gt;
; Check if the service is running&lt;br /&gt;
  SimpleSC::ServiceIsRunning &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns 1 (service is running) - returns 0 (service is not running)&lt;br /&gt;
&lt;br /&gt;
; Check if the service is stopped&lt;br /&gt;
  SimpleSC::ServiceIsStopped &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns 1 (service is stopped) - returns 0 (service is not stopped)&lt;br /&gt;
&lt;br /&gt;
; Show the error message if a function fails &lt;br /&gt;
  SimpleSC::StopService &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  IntCmp $0 0 Done +1 +1 &lt;br /&gt;
    Push $0&lt;br /&gt;
    SimpleSC::GetErrorMessage&lt;br /&gt;
    Pop $0&lt;br /&gt;
    MessageBox MB_OK|MB_ICONSTOP &amp;quot;Stopping fails - Reason: $0&amp;quot;&lt;br /&gt;
  Done:&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Changelog ==&lt;br /&gt;
* Version 1.28 (2010-09-14)&lt;br /&gt;
**SimpleSC::GetServiceFailure function added&lt;br /&gt;
**SimpleSC::SetServiceFailure function added&lt;br /&gt;
**SimpleSC::StopService WaitForFileRelease feature added&lt;br /&gt;
* Version 1.27 (2010-03-23)&lt;br /&gt;
**Documentation updated&lt;br /&gt;
* Version 1.26 (2009-05-21)&lt;br /&gt;
**Fixed wait for status bug on starting, stopping, pausing or continuing a service &lt;br /&gt;
* Version 1.25 (2009-04-23)&lt;br /&gt;
**SimpleSC::SetServiceLogon supports now non-domain username without the &amp;quot;.\&amp;quot;-prefix&lt;br /&gt;
**SimpleSC::SetServiceBinaryPath function added&lt;br /&gt;
*Version 1.24 (2009-04-13)&lt;br /&gt;
**Fixed wait for status bug if the service status changed. Now, if a service stops, starts aso. the plugin will work like the recommendations in the MSDN.&lt;br /&gt;
*Version 1.23 (2008-08-23)&lt;br /&gt;
**Removed compiler optimization to avoid a false-positive virusscan.&lt;br /&gt;
*Version 1.22 (2008-08-17)&lt;br /&gt;
**SimpleSC::GrantServiceLogonPrivilege and SimpleSC::RemoveServiceLogonPrivilege works now correct with domain names like MyDomain\MyUser.&lt;br /&gt;
**Added function SimpleSC::GetServiceLogon to get the logon username of a service.&lt;br /&gt;
*Version 1.21 (2008-02-10)&lt;br /&gt;
**SimpleSC::ExistsService results now 0 if the service exists and &amp;lt;&amp;gt; 0 if the service doensnÂ´t exists.&lt;br /&gt;
*Version 1.20 (2008-02-05)&lt;br /&gt;
**Every function now returns &amp;lt;&amp;gt; 0 if there is an error. Use SimpleSC::GetErrorMessage to get the message of a function result.&lt;br /&gt;
**Added function SimpleSC::GetErrorMessage to get the message of a function result.&lt;br /&gt;
**SimpleSC::ExistsService results now 0 if the service exists and &amp;lt;&amp;gt; 0 if the service doensnÂ´t exists.&lt;br /&gt;
**SimpleSC::RestartService supports now arguments.&lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: The signature has been changed. If you update from a previous version you must check your parameters.&lt;br /&gt;
*Version 1.10 (2008-01-29)&lt;br /&gt;
**SimpleSC::InstallService supports now more than one dependencies (delimitter is the forward slash).&lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: The signature has been changed. If you update from a previous version you must check your parameters.&lt;br /&gt;
**SimpleSC::InstallService supports now more service types e.g. to create an interactive service.&lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: The signature has been changed. If you update from a previous version you must check your parameters.&lt;br /&gt;
**SimpleSC::StartService supports now arguments. &lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: The signature has been changed. If you update from a previous version you must check your parameters.&lt;br /&gt;
*Version 1.05 (2008-01-12)&lt;br /&gt;
**The functions SimpleSC::StopService and SimpleSC::RestartService are now improved. Now all dependent services are stopping recursively too.&lt;br /&gt;
*Version 1.04 (2007-08-07)&lt;br /&gt;
**Fixed bug for possible endless loops. This concerns to the functions StartService, StopService, ContinueService and PauseService. &lt;br /&gt;
*Version 1.03 (2007-08-02)&lt;br /&gt;
**Added function SimpleSC::GetServiceBinaryPath to get the binary path of a specified service.&lt;br /&gt;
*Version 1.02 (2007-05-29)&lt;br /&gt;
**Changed wrong documentation informations about the functions SimpleSC::InstallService and SimpleSC::RemoveService.&lt;br /&gt;
*Version 1.01 (2007-05-07)&lt;br /&gt;
**Changed wrong status-results in Readme.txt. This concerns to the functions ServiceIsPaused, ServiceIsRunning and ServiceIsStopped.&lt;br /&gt;
**Changed the access privileges of the plugin. The plugin now uses the lowest privlege of each function to execute.&lt;br /&gt;
*Version 1.0 (2007-05-02)&lt;br /&gt;
**First offical version&lt;br /&gt;
&lt;br /&gt;
== Important Notes ==&lt;br /&gt;
*The function &amp;quot;SetServiceLogon&amp;quot; only works if the servicetype is &amp;quot;SERVICE_WIN32_OWN_PROCESS&amp;quot;&lt;br /&gt;
* The functions &amp;quot;GetServiceDescription&amp;quot; or &amp;quot;SetServiceDescription&amp;quot; are only available on systems higher than Windows NT. &lt;br /&gt;
* If you change the logon of an service to a new user you have to grant him the Service Logon Privilege. Otherwise the service cannot be started by the user you have assigned.&lt;br /&gt;
* The functions StartService, StopService, PauseService and ContinueService uses a timeout of 30 seconds. This means the function must be executed within 30 seconds, otherwise the functions will return an error.&lt;br /&gt;
* If you have any suggestions, comments or questions please mail me: mailto:rainer@speed-soft.de&lt;br /&gt;
&lt;br /&gt;
[[Category:Plugins]]&lt;/div&gt;</summary>
		<author><name>Speed78</name></author>
	</entry>
	<entry>
		<id>https://nsis.sourceforge.io/mediawiki/index.php?title=NSIS_Simple_Service_Plugin&amp;diff=18906</id>
		<title>NSIS Simple Service Plugin</title>
		<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/mediawiki/index.php?title=NSIS_Simple_Service_Plugin&amp;diff=18906"/>
		<updated>2010-09-14T11:16:43Z</updated>

		<summary type="html">&lt;p&gt;Speed78: /* Short Reference */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This plugin contains basic service functions like start, stop the service or checking the service status. It also contains advanced service functions for example setting the service description, changed the logon account, granting or removing the service logon privilege.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This plugin is using the MPL License or alternatively the LGPL License.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
&amp;lt;attach&amp;gt;NSIS_Simple_Service_Plugin_1.27.zip&amp;lt;/attach&amp;gt; The ZIP file containing a precompiled plugin DLL (to be saved in NSIS&#039; plugin directory) and the sources. If you update from a previous version it is strongly &#039;&#039;&#039;recommend&#039;&#039;&#039; to take look at the changelog.&lt;br /&gt;
&lt;br /&gt;
== Donation ==&lt;br /&gt;
If you believe that I am doing a good job and you want to support me please [http://www.speed-soft.de/donation/index.php?language=en donate] any amount via PayPal.&lt;br /&gt;
&lt;br /&gt;
== Short Reference ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
SimpleSC::InstallService [name_of_service] [display_name] [service_type] [start_type] &lt;br /&gt;
  [binary_path] [dependencies] [account] [password]&lt;br /&gt;
SimpleSC::RemoveService [name_of_service]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::StartService [name_of_service] [arguments]&lt;br /&gt;
SimpleSC::StopService [name_of_service] [wait_for_file_release]&lt;br /&gt;
SimpleSC::PauseService [name_of_service] &lt;br /&gt;
SimpleSC::ContinueService [name_of_service]&lt;br /&gt;
SimpleSC::RestartService [name_of_service] [arguments]&lt;br /&gt;
SimpleSC::ExistsService [name_of_service]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::GetServiceDisplayName [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceName [display_name]&lt;br /&gt;
SimpleSC::GetServiceStatus [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceDescription [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceStartType [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceBinaryPath [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceLogon [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceFailure [name_of_service]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::SetServiceDescription [name_of_service] [service_description]&lt;br /&gt;
SimpleSC::SetServiceStartType [name_of_service] [start_type]&lt;br /&gt;
SimpleSC::SetServiceBinaryPath [name_of_service] [binary_path]&lt;br /&gt;
SimpleSC::SetServiceLogon [name_of_service] [account] [password]&lt;br /&gt;
SimpleSC::SetServiceFailure [name_of_service] [reset_period] [reboot_message] [command] &lt;br /&gt;
  [action_type_1] [action_delay_1] [action_type_2] [action_delay_2] [action_type_3] &lt;br /&gt;
  [action_delay_3] &lt;br /&gt;
&lt;br /&gt;
SimpleSC::GrantServiceLogonPrivilege [account]&lt;br /&gt;
SimpleSC::RemoveServiceLogonPrivilege [account]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::ServiceIsPaused [name_of_service]&lt;br /&gt;
SimpleSC::ServiceIsRunning [name_of_service]&lt;br /&gt;
SimpleSC::ServiceIsStopped [name_of_service]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::GetErrorMessage [error_code]&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
*name_of_service - The name of the service used for Start/Stop commands and all further commands &lt;br /&gt;
*display_name - The name as shown in the service control manager applet in system control &lt;br /&gt;
*service_type - One of the following codes &lt;br /&gt;
**1 - SERVICE_KERNEL_DRIVER - Driver service.&lt;br /&gt;
**2 - SERVICE_FILE_SYSTEM_DRIVER - File system driver service.&lt;br /&gt;
**16 - SERVICE_WIN32_OWN_PROCESS - Service that runs in its own process. (Should be used in most cases)&lt;br /&gt;
**32 - SERVICE_WIN32_SHARE_PROCESS - Service that shares a process with one or more other services. &lt;br /&gt;
**256 - SERVICE_INTERACTIVE_PROCESS - The service can interact with the desktop. &lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: If you specify either SERVICE_WIN32_OWN_PROCESS or SERVICE_WIN32_SHARE_PROCESS,          and the service is running in the context of the LocalSystem account,          you can also specify this value. Example: SERVICE_WIN32_OWN_PROCESS or SERVICE_INTERACTIVE_PROCESS - (16 or 256) = 272&lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: Services cannot directly interact with a user as of Windows Vista.             Therefore, this technique should not be used in new code. See for more information: http://msdn2.microsoft.com/en-us/library/ms683502(VS.85).aspx          &lt;br /&gt;
&lt;br /&gt;
*start_type - one of the following codes &lt;br /&gt;
**0 - SERVICE_BOOT_START - Driver boot stage start &lt;br /&gt;
**1 - SERVICE_SYSTEM_START - Driver scm stage start &lt;br /&gt;
**2 - SERVICE_AUTO_START - Service auto start (Should be used in most cases)&lt;br /&gt;
**3 - SERVICE_DEMAND_START - Driver/service manual start &lt;br /&gt;
**4 - SERVICE_DISABLED - Driver/service disabled&lt;br /&gt;
*service_status - one of the following codes&lt;br /&gt;
**1 - SERVICE_STOPPED&lt;br /&gt;
**2 - SERVICE_START_PENDING&lt;br /&gt;
**3 - SERVICE_STOP_PENDING&lt;br /&gt;
**4 - SERVICE_RUNNING&lt;br /&gt;
**5 - SERVICE_CONTINUE_PENDING&lt;br /&gt;
**6 - SERVICE_PAUSE_PENDING&lt;br /&gt;
**7 - SERVICE_PAUSED&lt;br /&gt;
*binary_path - The path to the binary including all necessary parameters &lt;br /&gt;
*dependencies - Needed services, controls which services have to be started before this one; use the forward slash &amp;quot;/&amp;quot; to add more more than one service&lt;br /&gt;
*account - The username/account which should be used &lt;br /&gt;
*password - Password of the aforementioned account to be able to logon as a service &lt;br /&gt;
**&#039;&#039;&#039;Note&#039;&#039;&#039;: If you do not specify account/password, the local system account will be used to run the service&lt;br /&gt;
*arguments - Arguments passed to the service main function. &lt;br /&gt;
**&#039;&#039;&#039;Note&#039;&#039;&#039;: Driver services do not receive these arguments.&lt;br /&gt;
*reset_period - The time after which to reset the failure count to zero if there are no failures, in seconds. Specify 0 (INFINITE) to indicate that this value should never be reset&lt;br /&gt;
*reboot_message - The message to be broadcast to server users before rebooting&lt;br /&gt;
*command - The command line of the process to execute in response to the SC_ACTION_RUN_COMMAND service controller action. This process runs under the same account as the service&lt;br /&gt;
*action_type_x - one of the following codes for the action to be performed&lt;br /&gt;
**0 - SC_ACTION_NONE - No action&lt;br /&gt;
**1 - SC_ACTION_RESTART - Restart the service&lt;br /&gt;
**2 - SC_ACTION_REBOOT - Reboot the computer (Note: The service user must have the SE_SHUTDOWN_NAME privilege)&lt;br /&gt;
**3 - SC_ACTION_RUN_COMMAND - Run a command&lt;br /&gt;
*action_delay_x - The time to wait before performing the specified action, in milliseconds&lt;br /&gt;
*error_code - Error code of a function&lt;br /&gt;
*service_description - The description as shown in the service control manager applet in system control&lt;br /&gt;
*wait_for_file_release - Wait for file release after the service is stopped. This is useful if the binary file will be overwritten after stopping the service.&lt;br /&gt;
**0 - NO_WAIT - No wait for file release&lt;br /&gt;
**1 - WAIT - Wait for file release &lt;br /&gt;
**Note: If SERVICE_WIN32_OWN_PROCESS is used this option should be set to WAIT.	If SERVICE_WIN32_SHARE_PROCESS is used this option should only be set to WAIT if the last service in the process is stopped.&lt;br /&gt;
&lt;br /&gt;
== The Sample Script ==&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
; Install a service - ServiceType own process - StartType automatic - NoDependencies - Logon as &lt;br /&gt;
; System Account&lt;br /&gt;
  SimpleSC::InstallService &amp;quot;MyService&amp;quot; &amp;quot;My Service Display Name&amp;quot; &amp;quot;16&amp;quot; &amp;quot;2&amp;quot; &lt;br /&gt;
    &amp;quot;C:\MyPath\MyService.exe&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Install a service - ServiceType interact with desktop - StartType automatic - Dependencies on &lt;br /&gt;
; &amp;quot;Windows Time Service&amp;quot; (w32time) and &amp;quot;WWW Publishing Service&amp;quot; (w3svc) - Logon as System Account&lt;br /&gt;
  SimpleSC::InstallService &amp;quot;MyService&amp;quot; &amp;quot;My Service Display Name&amp;quot; &amp;quot;272&amp;quot; &amp;quot;2&amp;quot; &lt;br /&gt;
    &amp;quot;C:\MyPath\MyService.exe&amp;quot; &amp;quot;w32time/w3svc&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Remove a service&lt;br /&gt;
  SimpleSC::RemoveService &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Start a service&lt;br /&gt;
  SimpleSC::StartService &amp;quot;MyService&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Start a service with two arguments &amp;quot;/param1=true&amp;quot; &amp;quot;/param2=1&amp;quot;&lt;br /&gt;
  SimpleSC::StartService &amp;quot;MyService&amp;quot; &amp;quot;/param1=true /param2=1&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
 &lt;br /&gt;
; Start a service with two arguments &amp;quot;-p param1&amp;quot; &amp;quot;-param2&amp;quot;&lt;br /&gt;
  SimpleSC::StartService &amp;quot;MyService&amp;quot; &#039;&amp;quot;-p param1&amp;quot; -param2&#039;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Stop a service&lt;br /&gt;
  SimpleSC::StopService &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Pause a service&lt;br /&gt;
  SimpleSC::PauseService &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Continue a service&lt;br /&gt;
  SimpleSC::ContinueService &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Restart a service&lt;br /&gt;
  SimpleSC::RestartService &amp;quot;MyService&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Restart a service with two arguments &amp;quot;/param1=true&amp;quot; &amp;quot;/param2=1&amp;quot;&lt;br /&gt;
  SimpleSC::RestartService &amp;quot;MyService&amp;quot; &amp;quot;/param1=true /param2=1&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Start a service with two arguments &amp;quot;-p param1&amp;quot; &amp;quot;-param2&amp;quot;&lt;br /&gt;
  SimpleSC::RestartService &amp;quot;MyService&amp;quot; &#039;&amp;quot;-p param1&amp;quot; -param2&#039;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Check if the service exists&lt;br /&gt;
  SimpleSC::ExistsService &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode if the service doesnÂ´t exists (&amp;lt;&amp;gt;0)/service exists (0)&lt;br /&gt;
&lt;br /&gt;
; Get the displayname of a service&lt;br /&gt;
  SimpleSC::GetServiceDisplayName &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the displayname of the service&lt;br /&gt;
&lt;br /&gt;
; Get the servicename of a service by the displayname&lt;br /&gt;
  SimpleSC::GetServiceName &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the servicename of the service&lt;br /&gt;
&lt;br /&gt;
; Get the current status of a service&lt;br /&gt;
  SimpleSC::GetServiceStatus &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the status of the service&lt;br /&gt;
  ; Valid values are:&lt;br /&gt;
  ; 1 - SERVICE_STOPPED&lt;br /&gt;
  ; 2 - SERVICE_START_PENDING&lt;br /&gt;
  ; 3 - SERVICE_STOP_PENDING&lt;br /&gt;
  ; 4 - SERVICE_RUNNING&lt;br /&gt;
  ; 5 - SERVICE_CONTINUE_PENDING&lt;br /&gt;
  ; 6 - SERVICE_PAUSE_PENDING&lt;br /&gt;
  ; 7 - SERVICE_PAUSED&lt;br /&gt;
&lt;br /&gt;
; Get the description of a service&lt;br /&gt;
  SimpleSC::GetServiceDescription &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the description of the service&lt;br /&gt;
&lt;br /&gt;
; Get the start type of the service&lt;br /&gt;
  SimpleSC::GetServiceStartType &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the start type of the service&lt;br /&gt;
  ; Valid values are:&lt;br /&gt;
  ; 0 - SERVICE_BOOT_START&lt;br /&gt;
  ; 1 - SERVICE_SYSTEM_START&lt;br /&gt;
  ; 2 - SERVICE_AUTO_START&lt;br /&gt;
  ; 3 - SERVICE_DEMAND_START &lt;br /&gt;
  ; 4 - SERVICE_DISABLED&lt;br /&gt;
&lt;br /&gt;
; Get the binary path of a service&lt;br /&gt;
  SimpleSC::GetServiceBinaryPath &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the binary path of the service&lt;br /&gt;
&lt;br /&gt;
; Get the service logon user of the service&lt;br /&gt;
  SimpleSC::GetServiceLogon &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the logon username of the service&lt;br /&gt;
&lt;br /&gt;
; Set the description of a service (Not supported on Windows NT 4.0)&lt;br /&gt;
  SimpleSC::SetServiceDescription &amp;quot;MyService&amp;quot; &amp;quot;Sample Description&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Set the starttype to automatic of a service&lt;br /&gt;
  SimpleSC::SetServiceStartType &amp;quot;MyService&amp;quot; &amp;quot;2&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Sets the service logon to a user and grant the user the &amp;quot;SeServiceLogonPrivilege&amp;quot;&lt;br /&gt;
  SimpleSC::SetServiceLogon &amp;quot;MyService&amp;quot; &amp;quot;MyServiceUser&amp;quot; &amp;quot;MyServiceUserPassword&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  IntCmp $0 0 +1 Done Done ; If successful grant the service logon privilege to &amp;quot;MyServiceUser&amp;quot;&lt;br /&gt;
    ; Note: Every serviceuser must have the ServiceLogonPrivilege to start the service&lt;br /&gt;
    SimpleSC::GrantServiceLogonPrivilege &amp;quot;MyServiceUser&amp;quot;&lt;br /&gt;
    Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Done:&lt;br /&gt;
&lt;br /&gt;
; Sets the service binary path&lt;br /&gt;
  SimpleSC::SetServiceBinaryPath &amp;quot;MyService&amp;quot; &amp;quot;C:\MySoftware\MyService.exe&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Remove the &amp;quot;SeServiceLogonPrivilege&amp;quot; from a user&lt;br /&gt;
  SimpleSC::RemoveServiceLogonPrivilege &amp;quot;MyServiceUser&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Check if the service is paused&lt;br /&gt;
  SimpleSC::ServiceIsPaused &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns 1 (service is paused) - returns 0 (service is not paused)&lt;br /&gt;
&lt;br /&gt;
; Check if the service is running&lt;br /&gt;
  SimpleSC::ServiceIsRunning &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns 1 (service is running) - returns 0 (service is not running)&lt;br /&gt;
&lt;br /&gt;
; Check if the service is stopped&lt;br /&gt;
  SimpleSC::ServiceIsStopped &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns 1 (service is stopped) - returns 0 (service is not stopped)&lt;br /&gt;
&lt;br /&gt;
; Show the error message if a function fails &lt;br /&gt;
  SimpleSC::StopService &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  IntCmp $0 0 Done +1 +1 &lt;br /&gt;
    Push $0&lt;br /&gt;
    SimpleSC::GetErrorMessage&lt;br /&gt;
    Pop $0&lt;br /&gt;
    MessageBox MB_OK|MB_ICONSTOP &amp;quot;Stopping fails - Reason: $0&amp;quot;&lt;br /&gt;
  Done:&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Changelog ==&lt;br /&gt;
* Version 1.28 (2010-09-14)&lt;br /&gt;
**SimpleSC::GetServiceFailure function added&lt;br /&gt;
**SimpleSC::SetServiceFailure function added&lt;br /&gt;
**SimpleSC::StopService WaitForFileRelease feature added&lt;br /&gt;
* Version 1.27 (2010-03-23)&lt;br /&gt;
**Documentation updated&lt;br /&gt;
* Version 1.26 (2009-05-21)&lt;br /&gt;
**Fixed wait for status bug on starting, stopping, pausing or continuing a service &lt;br /&gt;
* Version 1.25 (2009-04-23)&lt;br /&gt;
**SimpleSC::SetServiceLogon supports now non-domain username without the &amp;quot;.\&amp;quot;-prefix&lt;br /&gt;
**SimpleSC::SetServiceBinaryPath function added&lt;br /&gt;
*Version 1.24 (2009-04-13)&lt;br /&gt;
**Fixed wait for status bug if the service status changed. Now, if a service stops, starts aso. the plugin will work like the recommendations in the MSDN.&lt;br /&gt;
*Version 1.23 (2008-08-23)&lt;br /&gt;
**Removed compiler optimization to avoid a false-positive virusscan.&lt;br /&gt;
*Version 1.22 (2008-08-17)&lt;br /&gt;
**SimpleSC::GrantServiceLogonPrivilege and SimpleSC::RemoveServiceLogonPrivilege works now correct with domain names like MyDomain\MyUser.&lt;br /&gt;
**Added function SimpleSC::GetServiceLogon to get the logon username of a service.&lt;br /&gt;
*Version 1.21 (2008-02-10)&lt;br /&gt;
**SimpleSC::ExistsService results now 0 if the service exists and &amp;lt;&amp;gt; 0 if the service doensnÂ´t exists.&lt;br /&gt;
*Version 1.20 (2008-02-05)&lt;br /&gt;
**Every function now returns &amp;lt;&amp;gt; 0 if there is an error. Use SimpleSC::GetErrorMessage to get the message of a function result.&lt;br /&gt;
**Added function SimpleSC::GetErrorMessage to get the message of a function result.&lt;br /&gt;
**SimpleSC::ExistsService results now 0 if the service exists and &amp;lt;&amp;gt; 0 if the service doensnÂ´t exists.&lt;br /&gt;
**SimpleSC::RestartService supports now arguments.&lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: The signature has been changed. If you update from a previous version you must check your parameters.&lt;br /&gt;
*Version 1.10 (2008-01-29)&lt;br /&gt;
**SimpleSC::InstallService supports now more than one dependencies (delimitter is the forward slash).&lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: The signature has been changed. If you update from a previous version you must check your parameters.&lt;br /&gt;
**SimpleSC::InstallService supports now more service types e.g. to create an interactive service.&lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: The signature has been changed. If you update from a previous version you must check your parameters.&lt;br /&gt;
**SimpleSC::StartService supports now arguments. &lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: The signature has been changed. If you update from a previous version you must check your parameters.&lt;br /&gt;
*Version 1.05 (2008-01-12)&lt;br /&gt;
**The functions SimpleSC::StopService and SimpleSC::RestartService are now improved. Now all dependent services are stopping recursively too.&lt;br /&gt;
*Version 1.04 (2007-08-07)&lt;br /&gt;
**Fixed bug for possible endless loops. This concerns to the functions StartService, StopService, ContinueService and PauseService. &lt;br /&gt;
*Version 1.03 (2007-08-02)&lt;br /&gt;
**Added function SimpleSC::GetServiceBinaryPath to get the binary path of a specified service.&lt;br /&gt;
*Version 1.02 (2007-05-29)&lt;br /&gt;
**Changed wrong documentation informations about the functions SimpleSC::InstallService and SimpleSC::RemoveService.&lt;br /&gt;
*Version 1.01 (2007-05-07)&lt;br /&gt;
**Changed wrong status-results in Readme.txt. This concerns to the functions ServiceIsPaused, ServiceIsRunning and ServiceIsStopped.&lt;br /&gt;
**Changed the access privileges of the plugin. The plugin now uses the lowest privlege of each function to execute.&lt;br /&gt;
*Version 1.0 (2007-05-02)&lt;br /&gt;
**First offical version&lt;br /&gt;
&lt;br /&gt;
== Important Notes ==&lt;br /&gt;
*The function &amp;quot;SetServiceLogon&amp;quot; only works if the servicetype is &amp;quot;SERVICE_WIN32_OWN_PROCESS&amp;quot;&lt;br /&gt;
* The functions &amp;quot;GetServiceDescription&amp;quot; or &amp;quot;SetServiceDescription&amp;quot; are only available on systems higher than Windows NT. &lt;br /&gt;
* If you change the logon of an service to a new user you have to grant him the Service Logon Privilege. Otherwise the service cannot be started by the user you have assigned.&lt;br /&gt;
* The functions StartService, StopService, PauseService and ContinueService uses a timeout of 30 seconds. This means the function must be executed within 30 seconds, otherwise the functions will return an error.&lt;br /&gt;
* If you have any suggestions, comments or questions please mail me: mailto:rainer@speed-soft.de&lt;br /&gt;
&lt;br /&gt;
[[Category:Plugins]]&lt;/div&gt;</summary>
		<author><name>Speed78</name></author>
	</entry>
	<entry>
		<id>https://nsis.sourceforge.io/mediawiki/index.php?title=NSIS_Simple_Service_Plugin&amp;diff=18905</id>
		<title>NSIS Simple Service Plugin</title>
		<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/mediawiki/index.php?title=NSIS_Simple_Service_Plugin&amp;diff=18905"/>
		<updated>2010-09-14T11:15:48Z</updated>

		<summary type="html">&lt;p&gt;Speed78: /* Short Reference */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This plugin contains basic service functions like start, stop the service or checking the service status. It also contains advanced service functions for example setting the service description, changed the logon account, granting or removing the service logon privilege.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This plugin is using the MPL License or alternatively the LGPL License.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
&amp;lt;attach&amp;gt;NSIS_Simple_Service_Plugin_1.27.zip&amp;lt;/attach&amp;gt; The ZIP file containing a precompiled plugin DLL (to be saved in NSIS&#039; plugin directory) and the sources. If you update from a previous version it is strongly &#039;&#039;&#039;recommend&#039;&#039;&#039; to take look at the changelog.&lt;br /&gt;
&lt;br /&gt;
== Donation ==&lt;br /&gt;
If you believe that I am doing a good job and you want to support me please [http://www.speed-soft.de/donation/index.php?language=en donate] any amount via PayPal.&lt;br /&gt;
&lt;br /&gt;
== Short Reference ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
SimpleSC::InstallService [name_of_service] [display_name] [service_type] &lt;br /&gt;
[start_type] [binary_path] [dependencies] [account] [password]&lt;br /&gt;
SimpleSC::RemoveService [name_of_service]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::StartService [name_of_service] [arguments]&lt;br /&gt;
SimpleSC::StopService [name_of_service] [wait_for_file_release]&lt;br /&gt;
SimpleSC::PauseService [name_of_service] &lt;br /&gt;
SimpleSC::ContinueService [name_of_service]&lt;br /&gt;
SimpleSC::RestartService [name_of_service] [arguments]&lt;br /&gt;
SimpleSC::ExistsService [name_of_service]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::GetServiceDisplayName [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceName [display_name]&lt;br /&gt;
SimpleSC::GetServiceStatus [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceDescription [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceStartType [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceBinaryPath [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceLogon [name_of_service]&lt;br /&gt;
SimpleSC::GetServiceFailure [name_of_service]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::SetServiceDescription [name_of_service] [service_description]&lt;br /&gt;
SimpleSC::SetServiceStartType [name_of_service] [start_type]&lt;br /&gt;
SimpleSC::SetServiceBinaryPath [name_of_service] [binary_path]&lt;br /&gt;
SimpleSC::SetServiceLogon [name_of_service] [account] [password]&lt;br /&gt;
SimpleSC::SetServiceFailure [name_of_service] [reset_period] [reboot_message] &lt;br /&gt;
[command] [action_type_1] [action_delay_1] [action_type_2] [action_delay_2] &lt;br /&gt;
[action_type_3] [action_delay_3] &lt;br /&gt;
&lt;br /&gt;
SimpleSC::GrantServiceLogonPrivilege [account]&lt;br /&gt;
SimpleSC::RemoveServiceLogonPrivilege [account]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::ServiceIsPaused [name_of_service]&lt;br /&gt;
SimpleSC::ServiceIsRunning [name_of_service]&lt;br /&gt;
SimpleSC::ServiceIsStopped [name_of_service]&lt;br /&gt;
&lt;br /&gt;
SimpleSC::GetErrorMessage [error_code]&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
*name_of_service - The name of the service used for Start/Stop commands and all further commands &lt;br /&gt;
*display_name - The name as shown in the service control manager applet in system control &lt;br /&gt;
*service_type - One of the following codes &lt;br /&gt;
**1 - SERVICE_KERNEL_DRIVER - Driver service.&lt;br /&gt;
**2 - SERVICE_FILE_SYSTEM_DRIVER - File system driver service.&lt;br /&gt;
**16 - SERVICE_WIN32_OWN_PROCESS - Service that runs in its own process. (Should be used in most cases)&lt;br /&gt;
**32 - SERVICE_WIN32_SHARE_PROCESS - Service that shares a process with one or more other services. &lt;br /&gt;
**256 - SERVICE_INTERACTIVE_PROCESS - The service can interact with the desktop. &lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: If you specify either SERVICE_WIN32_OWN_PROCESS or SERVICE_WIN32_SHARE_PROCESS,          and the service is running in the context of the LocalSystem account,          you can also specify this value. Example: SERVICE_WIN32_OWN_PROCESS or SERVICE_INTERACTIVE_PROCESS - (16 or 256) = 272&lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: Services cannot directly interact with a user as of Windows Vista.             Therefore, this technique should not be used in new code. See for more information: http://msdn2.microsoft.com/en-us/library/ms683502(VS.85).aspx          &lt;br /&gt;
&lt;br /&gt;
*start_type - one of the following codes &lt;br /&gt;
**0 - SERVICE_BOOT_START - Driver boot stage start &lt;br /&gt;
**1 - SERVICE_SYSTEM_START - Driver scm stage start &lt;br /&gt;
**2 - SERVICE_AUTO_START - Service auto start (Should be used in most cases)&lt;br /&gt;
**3 - SERVICE_DEMAND_START - Driver/service manual start &lt;br /&gt;
**4 - SERVICE_DISABLED - Driver/service disabled&lt;br /&gt;
*service_status - one of the following codes&lt;br /&gt;
**1 - SERVICE_STOPPED&lt;br /&gt;
**2 - SERVICE_START_PENDING&lt;br /&gt;
**3 - SERVICE_STOP_PENDING&lt;br /&gt;
**4 - SERVICE_RUNNING&lt;br /&gt;
**5 - SERVICE_CONTINUE_PENDING&lt;br /&gt;
**6 - SERVICE_PAUSE_PENDING&lt;br /&gt;
**7 - SERVICE_PAUSED&lt;br /&gt;
*binary_path - The path to the binary including all necessary parameters &lt;br /&gt;
*dependencies - Needed services, controls which services have to be started before this one; use the forward slash &amp;quot;/&amp;quot; to add more more than one service&lt;br /&gt;
*account - The username/account which should be used &lt;br /&gt;
*password - Password of the aforementioned account to be able to logon as a service &lt;br /&gt;
**&#039;&#039;&#039;Note&#039;&#039;&#039;: If you do not specify account/password, the local system account will be used to run the service&lt;br /&gt;
*arguments - Arguments passed to the service main function. &lt;br /&gt;
**&#039;&#039;&#039;Note&#039;&#039;&#039;: Driver services do not receive these arguments.&lt;br /&gt;
*reset_period - The time after which to reset the failure count to zero if there are no failures, in seconds. Specify 0 (INFINITE) to indicate that this value should never be reset&lt;br /&gt;
*reboot_message - The message to be broadcast to server users before rebooting&lt;br /&gt;
*command - The command line of the process to execute in response to the SC_ACTION_RUN_COMMAND service controller action. This process runs under the same account as the service&lt;br /&gt;
*action_type_x - one of the following codes for the action to be performed&lt;br /&gt;
**0 - SC_ACTION_NONE - No action&lt;br /&gt;
**1 - SC_ACTION_RESTART - Restart the service&lt;br /&gt;
**2 - SC_ACTION_REBOOT - Reboot the computer (Note: The service user must have the SE_SHUTDOWN_NAME privilege)&lt;br /&gt;
**3 - SC_ACTION_RUN_COMMAND - Run a command&lt;br /&gt;
*action_delay_x - The time to wait before performing the specified action, in milliseconds&lt;br /&gt;
*error_code - Error code of a function&lt;br /&gt;
*service_description - The description as shown in the service control manager applet in system control&lt;br /&gt;
*wait_for_file_release - Wait for file release after the service is stopped. This is useful if the binary file will be overwritten after stopping the service.&lt;br /&gt;
**0 - NO_WAIT - No wait for file release&lt;br /&gt;
**1 - WAIT - Wait for file release &lt;br /&gt;
**Note: If SERVICE_WIN32_OWN_PROCESS is used this option should be set to WAIT.	If SERVICE_WIN32_SHARE_PROCESS is used this option should only be set to WAIT if the last service in the process is stopped.&lt;br /&gt;
&lt;br /&gt;
== The Sample Script ==&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
; Install a service - ServiceType own process - StartType automatic - NoDependencies - Logon as &lt;br /&gt;
; System Account&lt;br /&gt;
  SimpleSC::InstallService &amp;quot;MyService&amp;quot; &amp;quot;My Service Display Name&amp;quot; &amp;quot;16&amp;quot; &amp;quot;2&amp;quot; &lt;br /&gt;
    &amp;quot;C:\MyPath\MyService.exe&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Install a service - ServiceType interact with desktop - StartType automatic - Dependencies on &lt;br /&gt;
; &amp;quot;Windows Time Service&amp;quot; (w32time) and &amp;quot;WWW Publishing Service&amp;quot; (w3svc) - Logon as System Account&lt;br /&gt;
  SimpleSC::InstallService &amp;quot;MyService&amp;quot; &amp;quot;My Service Display Name&amp;quot; &amp;quot;272&amp;quot; &amp;quot;2&amp;quot; &lt;br /&gt;
    &amp;quot;C:\MyPath\MyService.exe&amp;quot; &amp;quot;w32time/w3svc&amp;quot; &amp;quot;&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Remove a service&lt;br /&gt;
  SimpleSC::RemoveService &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Start a service&lt;br /&gt;
  SimpleSC::StartService &amp;quot;MyService&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Start a service with two arguments &amp;quot;/param1=true&amp;quot; &amp;quot;/param2=1&amp;quot;&lt;br /&gt;
  SimpleSC::StartService &amp;quot;MyService&amp;quot; &amp;quot;/param1=true /param2=1&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
 &lt;br /&gt;
; Start a service with two arguments &amp;quot;-p param1&amp;quot; &amp;quot;-param2&amp;quot;&lt;br /&gt;
  SimpleSC::StartService &amp;quot;MyService&amp;quot; &#039;&amp;quot;-p param1&amp;quot; -param2&#039;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Stop a service&lt;br /&gt;
  SimpleSC::StopService &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Pause a service&lt;br /&gt;
  SimpleSC::PauseService &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Continue a service&lt;br /&gt;
  SimpleSC::ContinueService &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Restart a service&lt;br /&gt;
  SimpleSC::RestartService &amp;quot;MyService&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Restart a service with two arguments &amp;quot;/param1=true&amp;quot; &amp;quot;/param2=1&amp;quot;&lt;br /&gt;
  SimpleSC::RestartService &amp;quot;MyService&amp;quot; &amp;quot;/param1=true /param2=1&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Start a service with two arguments &amp;quot;-p param1&amp;quot; &amp;quot;-param2&amp;quot;&lt;br /&gt;
  SimpleSC::RestartService &amp;quot;MyService&amp;quot; &#039;&amp;quot;-p param1&amp;quot; -param2&#039;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Check if the service exists&lt;br /&gt;
  SimpleSC::ExistsService &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode if the service doesnÂ´t exists (&amp;lt;&amp;gt;0)/service exists (0)&lt;br /&gt;
&lt;br /&gt;
; Get the displayname of a service&lt;br /&gt;
  SimpleSC::GetServiceDisplayName &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the displayname of the service&lt;br /&gt;
&lt;br /&gt;
; Get the servicename of a service by the displayname&lt;br /&gt;
  SimpleSC::GetServiceName &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the servicename of the service&lt;br /&gt;
&lt;br /&gt;
; Get the current status of a service&lt;br /&gt;
  SimpleSC::GetServiceStatus &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the status of the service&lt;br /&gt;
  ; Valid values are:&lt;br /&gt;
  ; 1 - SERVICE_STOPPED&lt;br /&gt;
  ; 2 - SERVICE_START_PENDING&lt;br /&gt;
  ; 3 - SERVICE_STOP_PENDING&lt;br /&gt;
  ; 4 - SERVICE_RUNNING&lt;br /&gt;
  ; 5 - SERVICE_CONTINUE_PENDING&lt;br /&gt;
  ; 6 - SERVICE_PAUSE_PENDING&lt;br /&gt;
  ; 7 - SERVICE_PAUSED&lt;br /&gt;
&lt;br /&gt;
; Get the description of a service&lt;br /&gt;
  SimpleSC::GetServiceDescription &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the description of the service&lt;br /&gt;
&lt;br /&gt;
; Get the start type of the service&lt;br /&gt;
  SimpleSC::GetServiceStartType &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the start type of the service&lt;br /&gt;
  ; Valid values are:&lt;br /&gt;
  ; 0 - SERVICE_BOOT_START&lt;br /&gt;
  ; 1 - SERVICE_SYSTEM_START&lt;br /&gt;
  ; 2 - SERVICE_AUTO_START&lt;br /&gt;
  ; 3 - SERVICE_DEMAND_START &lt;br /&gt;
  ; 4 - SERVICE_DISABLED&lt;br /&gt;
&lt;br /&gt;
; Get the binary path of a service&lt;br /&gt;
  SimpleSC::GetServiceBinaryPath &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the binary path of the service&lt;br /&gt;
&lt;br /&gt;
; Get the service logon user of the service&lt;br /&gt;
  SimpleSC::GetServiceLogon &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns the logon username of the service&lt;br /&gt;
&lt;br /&gt;
; Set the description of a service (Not supported on Windows NT 4.0)&lt;br /&gt;
  SimpleSC::SetServiceDescription &amp;quot;MyService&amp;quot; &amp;quot;Sample Description&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Set the starttype to automatic of a service&lt;br /&gt;
  SimpleSC::SetServiceStartType &amp;quot;MyService&amp;quot; &amp;quot;2&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Sets the service logon to a user and grant the user the &amp;quot;SeServiceLogonPrivilege&amp;quot;&lt;br /&gt;
  SimpleSC::SetServiceLogon &amp;quot;MyService&amp;quot; &amp;quot;MyServiceUser&amp;quot; &amp;quot;MyServiceUserPassword&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  IntCmp $0 0 +1 Done Done ; If successful grant the service logon privilege to &amp;quot;MyServiceUser&amp;quot;&lt;br /&gt;
    ; Note: Every serviceuser must have the ServiceLogonPrivilege to start the service&lt;br /&gt;
    SimpleSC::GrantServiceLogonPrivilege &amp;quot;MyServiceUser&amp;quot;&lt;br /&gt;
    Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Done:&lt;br /&gt;
&lt;br /&gt;
; Sets the service binary path&lt;br /&gt;
  SimpleSC::SetServiceBinaryPath &amp;quot;MyService&amp;quot; &amp;quot;C:\MySoftware\MyService.exe&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Remove the &amp;quot;SeServiceLogonPrivilege&amp;quot; from a user&lt;br /&gt;
  SimpleSC::RemoveServiceLogonPrivilege &amp;quot;MyServiceUser&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
&lt;br /&gt;
; Check if the service is paused&lt;br /&gt;
  SimpleSC::ServiceIsPaused &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns 1 (service is paused) - returns 0 (service is not paused)&lt;br /&gt;
&lt;br /&gt;
; Check if the service is running&lt;br /&gt;
  SimpleSC::ServiceIsRunning &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns 1 (service is running) - returns 0 (service is not running)&lt;br /&gt;
&lt;br /&gt;
; Check if the service is stopped&lt;br /&gt;
  SimpleSC::ServiceIsStopped &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  Pop $1 ; returns 1 (service is stopped) - returns 0 (service is not stopped)&lt;br /&gt;
&lt;br /&gt;
; Show the error message if a function fails &lt;br /&gt;
  SimpleSC::StopService &amp;quot;MyService&amp;quot;&lt;br /&gt;
  Pop $0 ; returns an errorcode (&amp;lt;&amp;gt;0) otherwise success (0)&lt;br /&gt;
  IntCmp $0 0 Done +1 +1 &lt;br /&gt;
    Push $0&lt;br /&gt;
    SimpleSC::GetErrorMessage&lt;br /&gt;
    Pop $0&lt;br /&gt;
    MessageBox MB_OK|MB_ICONSTOP &amp;quot;Stopping fails - Reason: $0&amp;quot;&lt;br /&gt;
  Done:&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Changelog ==&lt;br /&gt;
* Version 1.28 (2010-09-14)&lt;br /&gt;
**SimpleSC::GetServiceFailure function added&lt;br /&gt;
**SimpleSC::SetServiceFailure function added&lt;br /&gt;
**SimpleSC::StopService WaitForFileRelease feature added&lt;br /&gt;
* Version 1.27 (2010-03-23)&lt;br /&gt;
**Documentation updated&lt;br /&gt;
* Version 1.26 (2009-05-21)&lt;br /&gt;
**Fixed wait for status bug on starting, stopping, pausing or continuing a service &lt;br /&gt;
* Version 1.25 (2009-04-23)&lt;br /&gt;
**SimpleSC::SetServiceLogon supports now non-domain username without the &amp;quot;.\&amp;quot;-prefix&lt;br /&gt;
**SimpleSC::SetServiceBinaryPath function added&lt;br /&gt;
*Version 1.24 (2009-04-13)&lt;br /&gt;
**Fixed wait for status bug if the service status changed. Now, if a service stops, starts aso. the plugin will work like the recommendations in the MSDN.&lt;br /&gt;
*Version 1.23 (2008-08-23)&lt;br /&gt;
**Removed compiler optimization to avoid a false-positive virusscan.&lt;br /&gt;
*Version 1.22 (2008-08-17)&lt;br /&gt;
**SimpleSC::GrantServiceLogonPrivilege and SimpleSC::RemoveServiceLogonPrivilege works now correct with domain names like MyDomain\MyUser.&lt;br /&gt;
**Added function SimpleSC::GetServiceLogon to get the logon username of a service.&lt;br /&gt;
*Version 1.21 (2008-02-10)&lt;br /&gt;
**SimpleSC::ExistsService results now 0 if the service exists and &amp;lt;&amp;gt; 0 if the service doensnÂ´t exists.&lt;br /&gt;
*Version 1.20 (2008-02-05)&lt;br /&gt;
**Every function now returns &amp;lt;&amp;gt; 0 if there is an error. Use SimpleSC::GetErrorMessage to get the message of a function result.&lt;br /&gt;
**Added function SimpleSC::GetErrorMessage to get the message of a function result.&lt;br /&gt;
**SimpleSC::ExistsService results now 0 if the service exists and &amp;lt;&amp;gt; 0 if the service doensnÂ´t exists.&lt;br /&gt;
**SimpleSC::RestartService supports now arguments.&lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: The signature has been changed. If you update from a previous version you must check your parameters.&lt;br /&gt;
*Version 1.10 (2008-01-29)&lt;br /&gt;
**SimpleSC::InstallService supports now more than one dependencies (delimitter is the forward slash).&lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: The signature has been changed. If you update from a previous version you must check your parameters.&lt;br /&gt;
**SimpleSC::InstallService supports now more service types e.g. to create an interactive service.&lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: The signature has been changed. If you update from a previous version you must check your parameters.&lt;br /&gt;
**SimpleSC::StartService supports now arguments. &lt;br /&gt;
***&#039;&#039;&#039;Note&#039;&#039;&#039;: The signature has been changed. If you update from a previous version you must check your parameters.&lt;br /&gt;
*Version 1.05 (2008-01-12)&lt;br /&gt;
**The functions SimpleSC::StopService and SimpleSC::RestartService are now improved. Now all dependent services are stopping recursively too.&lt;br /&gt;
*Version 1.04 (2007-08-07)&lt;br /&gt;
**Fixed bug for possible endless loops. This concerns to the functions StartService, StopService, ContinueService and PauseService. &lt;br /&gt;
*Version 1.03 (2007-08-02)&lt;br /&gt;
**Added function SimpleSC::GetServiceBinaryPath to get the binary path of a specified service.&lt;br /&gt;
*Version 1.02 (2007-05-29)&lt;br /&gt;
**Changed wrong documentation informations about the functions SimpleSC::InstallService and SimpleSC::RemoveService.&lt;br /&gt;
*Version 1.01 (2007-05-07)&lt;br /&gt;
**Changed wrong status-results in Readme.txt. This concerns to the functions ServiceIsPaused, ServiceIsRunning and ServiceIsStopped.&lt;br /&gt;
**Changed the access privileges of the plugin. The plugin now uses the lowest privlege of each function to execute.&lt;br /&gt;
*Version 1.0 (2007-05-02)&lt;br /&gt;
**First offical version&lt;br /&gt;
&lt;br /&gt;
== Important Notes ==&lt;br /&gt;
*The function &amp;quot;SetServiceLogon&amp;quot; only works if the servicetype is &amp;quot;SERVICE_WIN32_OWN_PROCESS&amp;quot;&lt;br /&gt;
* The functions &amp;quot;GetServiceDescription&amp;quot; or &amp;quot;SetServiceDescription&amp;quot; are only available on systems higher than Windows NT. &lt;br /&gt;
* If you change the logon of an service to a new user you have to grant him the Service Logon Privilege. Otherwise the service cannot be started by the user you have assigned.&lt;br /&gt;
* The functions StartService, StopService, PauseService and ContinueService uses a timeout of 30 seconds. This means the function must be executed within 30 seconds, otherwise the functions will return an error.&lt;br /&gt;
* If you have any suggestions, comments or questions please mail me: mailto:rainer@speed-soft.de&lt;br /&gt;
&lt;br /&gt;
[[Category:Plugins]]&lt;/div&gt;</summary>
		<author><name>Speed78</name></author>
	</entry>
</feed>