You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix launch command not working due to working directory
Fix restarted process unable to hook streams due to old streams still being open
Fix restart delay comparing in the wrong direction
Fix InvalidOperationException after closing process
Add options for launch command and launch arguments
Change config processor to be tolerant of any file format, as long as value is on the line after the directive name
Add logging output for bot stop and restart detection
Add logging output for exceptions (Except config or log file exceptions)
this.EventLog.WriteEntry("Failed to end process"+Environment.NewLine+e.GetType().FullName+": "+e.Message+Environment.NewLine+e.StackTrace,EventLogEntryType.Error);
251
+
stringmsg="Failed to end process"+Environment.NewLine+e.GetType().FullName+": "+e.Message+Environment.NewLine+e.StackTrace;
this.EventLog.WriteEntry("Failed to kill process"+Environment.NewLine+e.GetType().FullName+": "+e.Message+Environment.NewLine+e.StackTrace,EventLogEntryType.Error);
268
+
stringmsg="Failed to kill process"+Environment.NewLine+e.GetType().FullName+": "+e.Message+Environment.NewLine+e.StackTrace;
Runs phantomBot as a service on Windows using .Net 4.7.2
3
+
4
+
This requires .NET Framework 4.7.2, setup.exe should automatically install this for you.
5
+
6
+
NOTE: You need BOTH setup.exe and PhantomBotServiceSetup.msi to perform the install. If you install .NET Framework 4.7.2 manually (or already have it), then you should be okay with just PhantomBotServiceSetup.msi
7
+
8
+
To use the service:
9
+
10
+
Install PhantomBotService wherever you like using setup.exe, it may be easiest to set the install location to the same folder as PhantomBot. NOTE: If setup.exe successfully installs .NET Framework 4.7.2, it will automatically run PhantomBotServiceSetup.msi for you
11
+
In the folder where you installed PhantomBotService, edit PhantomBotService.config in a text editor, such as Notepad or Notepad++, and ensure that the path on Line 2 is set to the same folder as your PhantomBot.jar file. Optionally enable logging.
12
+
Start the service from Microsoft Management Console. The easiest way to get there is to right-click the Start button, click Computer Management and then go to Computer Management > Services and Applications > Services on the left pane
13
+
14
+
The logging feature will save a log file in the same folder as PhantomBot.jar containing the output of the bot console. The file name will be unique each time the server starts the bot
15
+
16
+
The service will attempt to restart the bot if you try to use any method to stop it other than stopping the service through Microsoft Management Console or shutting down the computer
17
+
18
+
If the service encounters an Exception at the service level while attempting to start the bot, such as File Access Errors, it will be logged in Windows Event Viewer on the Microsoft Management Console. Right-click the Start button, click Computer Management and then go to Computer Management > System Tools > Event Viewer > Windows Logs > Application on the left pane. Look for entries with a Source of PhantomBotService
19
+
20
+
If setup.exe fails to install .NET Framework 4.7.2, follow these steps
21
+
22
+
Download the offline installer for .NET Framework 4.7.2 from https://support.microsoft.com/en-us/help/4054530/microsoft-net-framework-4-7-2-offline-installer-for-windows
23
+
Install .NET Framework 4.7.2 from the offline installer
24
+
Run PhantomBotServiceSetup.msi to install the service
25
+
26
+
Available options in PhantomBotService.config:
27
+
28
+
\[Bot Install Directory] - _(Required)_ The line under this directive must be the full path to the bot installation directory (where PhantomBot.jar is located)
29
+
\[Logging Enabled] - _(Optional, Defaults to false)_ The line under this directive can be changed to read ***true*** to enable a log of the bot console output to be created in the bot installation directory
30
+
\[Launch Command] - _(Optional, Defaults to the java included with the bot)_ The line under this directive can be used to override the command used to launch the bot
31
+
\[Launch Arguments] - _(Optional, Defaults to the arguments used by launch.bat)_ The line under this directive can be used to override the command line arguments provided to the launch command
0 commit comments