diff --git a/src/ARKServerManager/App.config b/src/ARKServerManager/App.config
index 173f4c09..6ad5213c 100644
--- a/src/ARKServerManager/App.config
+++ b/src/ARKServerManager/App.config
@@ -900,6 +900,12 @@
Online Player Count:
+
+
+
+
+
+
diff --git a/src/ARKServerManager/Config.Designer.cs b/src/ARKServerManager/Config.Designer.cs
index e2136a7b..eccdf644 100644
--- a/src/ARKServerManager/Config.Designer.cs
+++ b/src/ARKServerManager/Config.Designer.cs
@@ -3189,5 +3189,29 @@ namespace ServerManagerTool {
return ((int)(this["ServicePointManager_SecurityProtocol"]));
}
}
+
+ [global::System.Configuration.UserScopedSettingAttribute()]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Configuration.DefaultSettingValueAttribute("")]
+ public string TaskSchedulerUsername {
+ get {
+ return ((string)(this["TaskSchedulerUsername"]));
+ }
+ set {
+ this["TaskSchedulerUsername"] = value;
+ }
+ }
+
+ [global::System.Configuration.UserScopedSettingAttribute()]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Configuration.DefaultSettingValueAttribute("")]
+ public string TaskSchedulerPassword {
+ get {
+ return ((string)(this["TaskSchedulerPassword"]));
+ }
+ set {
+ this["TaskSchedulerPassword"] = value;
+ }
+ }
}
}
diff --git a/src/ARKServerManager/Config.settings b/src/ARKServerManager/Config.settings
index 3245b804..86a6242e 100644
--- a/src/ARKServerManager/Config.settings
+++ b/src/ARKServerManager/Config.settings
@@ -872,5 +872,11 @@
3072
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/ARKServerManager/Globalization/en-US/en-US.xaml b/src/ARKServerManager/Globalization/en-US/en-US.xaml
index d3e53e66..a42d71c6 100644
--- a/src/ARKServerManager/Globalization/en-US/en-US.xaml
+++ b/src/ARKServerManager/Globalization/en-US/en-US.xaml
@@ -802,6 +802,11 @@
Auto Shutdown/Restart Task Priority:
Auto Start Task Priority:
+ Task Scheduler Username:
+ This username will be used for the Auto-Start server on Boot task.
+ Task Scheduler Password:
+ This password will be used for the Auto-Start server on Boot task.
+
Confirm Settings Reset Action
Click 'Yes' to confirm you want to perform the settings reset.
Failed to Reset Settings
diff --git a/src/ARKServerManager/Lib/ServerProfile.cs b/src/ARKServerManager/Lib/ServerProfile.cs
index 8a516165..ead64e39 100644
--- a/src/ARKServerManager/Lib/ServerProfile.cs
+++ b/src/ARKServerManager/Lib/ServerProfile.cs
@@ -4611,7 +4611,7 @@ namespace ServerManagerTool.Lib
var taskKey = GetProfileKey();
- if (!TaskSchedulerUtils.ScheduleAutoStart(taskKey, null, this.EnableAutoStart, GetLauncherFile(), ProfileName, this.AutoStartOnLogin, Config.Default.AutoStart_TaskPriority))
+ if (!TaskSchedulerUtils.ScheduleAutoStart(taskKey, null, this.EnableAutoStart, GetLauncherFile(), ProfileName, this.AutoStartOnLogin, Config.Default.TaskSchedulerUsername, Config.Default.TaskSchedulerPassword, Config.Default.AutoStart_TaskPriority))
{
return false;
}
diff --git a/src/ARKServerManager/UserControls/GlobalSettingsControl.xaml b/src/ARKServerManager/UserControls/GlobalSettingsControl.xaml
index e16be6ef..ff550d39 100644
--- a/src/ARKServerManager/UserControls/GlobalSettingsControl.xaml
+++ b/src/ARKServerManager/UserControls/GlobalSettingsControl.xaml
@@ -813,6 +813,8 @@
+
+
@@ -856,6 +858,12 @@
+
+
+
+
+
+
diff --git a/src/ARKServerManager/UserControls/GlobalSettingsControl.xaml.cs b/src/ARKServerManager/UserControls/GlobalSettingsControl.xaml.cs
index bbab1442..a7139d23 100644
--- a/src/ARKServerManager/UserControls/GlobalSettingsControl.xaml.cs
+++ b/src/ARKServerManager/UserControls/GlobalSettingsControl.xaml.cs
@@ -434,6 +434,8 @@ namespace ServerManagerTool
textBox = EmailPasswordTextBox;
if (Equals(hideTextBox, HideDiscordBotTokenTextBox))
textBox = DiscordBotTokenTextBox;
+ if (Equals(hideTextBox, HideTaskSchedulerPasswordTextBox))
+ textBox = TaskSchedulerPasswordTextBox;
if (textBox != null)
{
@@ -459,6 +461,8 @@ namespace ServerManagerTool
hideTextBox = HideEmailPasswordTextBox;
if (textBox == DiscordBotTokenTextBox)
hideTextBox = HideDiscordBotTokenTextBox;
+ if (textBox == TaskSchedulerPasswordTextBox)
+ hideTextBox = HideTaskSchedulerPasswordTextBox;
if (hideTextBox != null)
{
diff --git a/src/ARKServerManager/UserControls/ServerSettingsControl.xaml.cs b/src/ARKServerManager/UserControls/ServerSettingsControl.xaml.cs
index 10ad2657..bed6c44a 100644
--- a/src/ARKServerManager/UserControls/ServerSettingsControl.xaml.cs
+++ b/src/ARKServerManager/UserControls/ServerSettingsControl.xaml.cs
@@ -972,6 +972,14 @@ namespace ServerManagerTool
comment.AppendLine($"ServerShutdown_WorldSaveDelay: {Config.Default.ServerShutdown_WorldSaveDelay}");
comment.AppendLine($"RCON_MessageCommand: {Config.Default.RCON_MessageCommand}");
+ comment.AppendLine($"AutoBackup_TaskPriority: {Config.Default.AutoBackup_TaskPriority}");
+ comment.AppendLine($"AutoUpdate_TaskPriority: {Config.Default.AutoUpdate_TaskPriority}");
+ comment.AppendLine($"AutoShutdown_TaskPriority: {Config.Default.AutoShutdown_TaskPriority}");
+ comment.AppendLine($"AutoStart_TaskPriority: {Config.Default.AutoStart_TaskPriority}");
+
+ comment.AppendLine($"TaskSchedulerUsername: {Config.Default.TaskSchedulerUsername}");
+ comment.AppendLine($"HasTaskSchedulerPassword: {!string.IsNullOrWhiteSpace(Config.Default.TaskSchedulerPassword)}");
+
var zipFile = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), this.Settings.ProfileID + ".zip");
if (File.Exists(zipFile)) File.Delete(zipFile);
diff --git a/src/ConanServerManager/App.config b/src/ConanServerManager/App.config
index da2c6d77..3450f4d8 100644
--- a/src/ConanServerManager/App.config
+++ b/src/ConanServerManager/App.config
@@ -705,6 +705,12 @@
Online Player Count:
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/ConanServerManager/Config.Designer.cs b/src/ConanServerManager/Config.Designer.cs
index 255f3bfc..666ef6d1 100644
--- a/src/ConanServerManager/Config.Designer.cs
+++ b/src/ConanServerManager/Config.Designer.cs
@@ -2462,5 +2462,29 @@ namespace ServerManagerTool {
return ((string)(this["AppPatchNotesUrl_Testlive"]));
}
}
+
+ [global::System.Configuration.UserScopedSettingAttribute()]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Configuration.DefaultSettingValueAttribute("")]
+ public string TaskSchedulerUsername {
+ get {
+ return ((string)(this["TaskSchedulerUsername"]));
+ }
+ set {
+ this["TaskSchedulerUsername"] = value;
+ }
+ }
+
+ [global::System.Configuration.UserScopedSettingAttribute()]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Configuration.DefaultSettingValueAttribute("")]
+ public string TaskSchedulerPassword {
+ get {
+ return ((string)(this["TaskSchedulerPassword"]));
+ }
+ set {
+ this["TaskSchedulerPassword"] = value;
+ }
+ }
}
}
diff --git a/src/ConanServerManager/Config.settings b/src/ConanServerManager/Config.settings
index 3bbc978f..60f9c547 100644
--- a/src/ConanServerManager/Config.settings
+++ b/src/ConanServerManager/Config.settings
@@ -677,5 +677,11 @@
https://forums.funcom.com/c/conan-exiles/exiles-pc/testlive
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/ConanServerManager/Globalization/en-US/en-US.xaml b/src/ConanServerManager/Globalization/en-US/en-US.xaml
index 27499ef0..0c868667 100644
--- a/src/ConanServerManager/Globalization/en-US/en-US.xaml
+++ b/src/ConanServerManager/Globalization/en-US/en-US.xaml
@@ -957,6 +957,11 @@
Auto Shutdown/Restart Task Priority:
Auto Start Task Priority:
+ Task Scheduler Username:
+ This username will be used for the Auto-Start server on Boot task.
+ Task Scheduler Password:
+ This password will be used for the Auto-Start server on Boot task.
+
Confirm Settings Reset Action
Click 'Yes' to confirm you want to perform the settings reset.
Failed to Reset Settings
diff --git a/src/ConanServerManager/Lib/ServerProfile.cs b/src/ConanServerManager/Lib/ServerProfile.cs
index cafd1ed3..b8bd7cfd 100644
--- a/src/ConanServerManager/Lib/ServerProfile.cs
+++ b/src/ConanServerManager/Lib/ServerProfile.cs
@@ -1248,7 +1248,7 @@ namespace ServerManagerTool.Lib
var taskKey = GetProfileKey();
- if (!TaskSchedulerUtils.ScheduleAutoStart(taskKey, null, this.EnableAutoStart, GetLauncherFile(), ProfileName, this.AutoStartOnLogin, Config.Default.AutoStart_TaskPriority))
+ if (!TaskSchedulerUtils.ScheduleAutoStart(taskKey, null, this.EnableAutoStart, GetLauncherFile(), ProfileName, this.AutoStartOnLogin, Config.Default.TaskSchedulerUsername, Config.Default.TaskSchedulerPassword, Config.Default.AutoStart_TaskPriority))
{
return false;
}
diff --git a/src/ConanServerManager/UserControls/GlobalSettingsControl.xaml b/src/ConanServerManager/UserControls/GlobalSettingsControl.xaml
index 2b49acbc..777741e3 100644
--- a/src/ConanServerManager/UserControls/GlobalSettingsControl.xaml
+++ b/src/ConanServerManager/UserControls/GlobalSettingsControl.xaml
@@ -758,6 +758,8 @@
+
+
@@ -801,6 +803,12 @@
+
+
+
+
+
+
diff --git a/src/ConanServerManager/UserControls/GlobalSettingsControl.xaml.cs b/src/ConanServerManager/UserControls/GlobalSettingsControl.xaml.cs
index 9e83704f..7c98d2a7 100644
--- a/src/ConanServerManager/UserControls/GlobalSettingsControl.xaml.cs
+++ b/src/ConanServerManager/UserControls/GlobalSettingsControl.xaml.cs
@@ -435,6 +435,8 @@ namespace ServerManagerTool
textBox = EmailPasswordTextBox;
if (Equals(hideTextBox, HideDiscordBotTokenTextBox))
textBox = DiscordBotTokenTextBox;
+ if (Equals(hideTextBox, HideTaskSchedulerPasswordTextBox))
+ textBox = TaskSchedulerPasswordTextBox;
if (textBox != null)
{
@@ -460,6 +462,8 @@ namespace ServerManagerTool
hideTextBox = HideEmailPasswordTextBox;
if (textBox == DiscordBotTokenTextBox)
hideTextBox = HideDiscordBotTokenTextBox;
+ if (textBox == TaskSchedulerPasswordTextBox)
+ hideTextBox = HideTaskSchedulerPasswordTextBox;
if (hideTextBox != null)
{
diff --git a/src/ConanServerManager/UserControls/ServerSettingsControl.xaml.cs b/src/ConanServerManager/UserControls/ServerSettingsControl.xaml.cs
index 855ebaca..3a857fbb 100644
--- a/src/ConanServerManager/UserControls/ServerSettingsControl.xaml.cs
+++ b/src/ConanServerManager/UserControls/ServerSettingsControl.xaml.cs
@@ -651,6 +651,8 @@ namespace ServerManagerTool
comment.AppendLine($"Profiles Directory: {Config.Default.ConfigPath}");
comment.AppendLine($"Server Directory: {this.Settings.InstallDirectory}");
+ comment.AppendLine($"Testlive Server: {this.Settings.UseTestlive}");
+
comment.AppendLine($"IsAdministrator: {SecurityUtils.IsAdministrator()}");
comment.AppendLine($"RunAsAdministratorPrompt: {Config.Default.RunAsAdministratorPrompt}");
comment.AppendLine($"CheckIfServerManagerRunningOnStartup: {Config.Default.CheckIfServerManagerRunningOnStartup}");
@@ -744,6 +746,14 @@ namespace ServerManagerTool
comment.AppendLine($"ServerShutdown_WorldSaveDelay: {Config.Default.ServerShutdown_WorldSaveDelay}");
comment.AppendLine($"RCON_MessageCommand: {Config.Default.RCON_MessageCommand}");
+ comment.AppendLine($"AutoBackup_TaskPriority: {Config.Default.AutoBackup_TaskPriority}");
+ comment.AppendLine($"AutoUpdate_TaskPriority: {Config.Default.AutoUpdate_TaskPriority}");
+ comment.AppendLine($"AutoShutdown_TaskPriority: {Config.Default.AutoShutdown_TaskPriority}");
+ comment.AppendLine($"AutoStart_TaskPriority: {Config.Default.AutoStart_TaskPriority}");
+
+ comment.AppendLine($"TaskSchedulerUsername: {Config.Default.TaskSchedulerUsername}");
+ comment.AppendLine($"HasTaskSchedulerPassword: {!string.IsNullOrWhiteSpace(Config.Default.TaskSchedulerPassword)}");
+
var zipFile = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), this.Settings.ProfileID + ".zip");
if (File.Exists(zipFile)) File.Delete(zipFile);
diff --git a/src/ServerManager.Common/Utils/TaskSchedulerUtils.cs b/src/ServerManager.Common/Utils/TaskSchedulerUtils.cs
index 5942c1e0..a3523a19 100644
--- a/src/ServerManager.Common/Utils/TaskSchedulerUtils.cs
+++ b/src/ServerManager.Common/Utils/TaskSchedulerUtils.cs
@@ -430,7 +430,7 @@ namespace ServerManagerTool.Common.Utils
return false;
}
- public static bool ScheduleAutoStart(string taskKey, string taskSuffix, bool enableAutoStart, string command, string profileName, bool onLogin, ProcessPriorityClass priority)
+ public static bool ScheduleAutoStart(string taskKey, string taskSuffix, bool enableAutoStart, string command, string profileName, bool onLogin, string username, string password, ProcessPriorityClass priority)
{
var taskName = GetScheduledTaskName(TaskType.AutoStart, taskKey, taskSuffix);
var taskFolder = TaskService.Instance.RootFolder.SubFolders.Exists(TaskFolder) ? TaskService.Instance.RootFolder.SubFolders[TaskFolder] : null;
@@ -457,7 +457,8 @@ namespace ServerManagerTool.Common.Utils
Task task = null;
TaskDefinition taskDefinition = null;
TaskLogonType taskLogonType;
- string userId;
+ string taskUsername = !string.IsNullOrWhiteSpace(username) ? username : null;
+ string taskPassword = !string.IsNullOrWhiteSpace(username) && !string.IsNullOrWhiteSpace(password) ? password : null;
try
{
@@ -488,10 +489,12 @@ namespace ServerManagerTool.Common.Utils
if (onLogin)
{
+ taskUsername = null;
+ taskPassword = null;
+
taskLogonType = TaskLogonType.InteractiveToken;
taskDefinition.Principal.LogonType = taskLogonType;
taskDefinition.Principal.UserId = null;
- userId = null;
var oldtriggers = taskDefinition.Triggers.OfType();
foreach (var trigger in oldtriggers)
@@ -522,10 +525,18 @@ namespace ServerManagerTool.Common.Utils
}
else
{
- taskLogonType = TaskLogonType.ServiceAccount;
+ if (!string.IsNullOrWhiteSpace(taskUsername))
+ {
+ taskLogonType = TaskLogonType.Password;
+ }
+ else
+ {
+ taskUsername = "SYSTEM";
+ taskPassword = null;
+ taskLogonType = TaskLogonType.ServiceAccount;
+ }
taskDefinition.Principal.LogonType = taskLogonType;
taskDefinition.Principal.UserId = null;
- userId = "SYSTEM";
var oldtriggers = taskDefinition.Triggers.OfType();
foreach (var trigger in oldtriggers)
@@ -564,7 +575,7 @@ namespace ServerManagerTool.Common.Utils
try
{
- task = taskFolder.RegisterTaskDefinition(taskName, taskDefinition, TaskCreation.CreateOrUpdate, userId, null, taskLogonType);
+ task = taskFolder.RegisterTaskDefinition(taskName, taskDefinition, TaskCreation.CreateOrUpdate, taskUsername, taskPassword, taskLogonType);
return task != null;
}
catch (Exception ex)