Auto-Start Server Changes

- added username/password settings to use for the Auto-Start server on Boot task.
- updated support zip with new settings.
This commit is contained in:
Brett Hewitson 2022-08-08 21:43:03 +10:00
parent 5532050c04
commit efbdc77be6
17 changed files with 143 additions and 8 deletions

View file

@ -758,6 +758,8 @@
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="20"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" MinWidth="150"/>
@ -801,6 +803,12 @@
<Label Grid.Row="10" Grid.Column="2" Margin="0" Content="{DynamicResource GlobalSettings_TaskPriority_AutoStartLabel}" VerticalAlignment="Center"/>
<ComboBox Name="TaskPriorityAutoStartComboBox" Grid.Row="10" Grid.Column="3" Margin="1" ItemsSource="{Binding ElementName=GlobalSettings, Path=TaskPriorities}" SelectedValue="{Binding Config.AutoStart_TaskPriority}" ToolTip="{DynamicResource GlobalSettings_TaskPriority_Tooltip}" SelectedValuePath="ValueMember" DisplayMemberPath="DisplayMember" PreviewMouseWheel="ComboBox_PreviewMouseWheel"/>
<Label Grid.Row="12" Grid.Column="0" Content="{DynamicResource GlobalSettings_TaskSchedulerUsernameLabel}" VerticalAlignment="Center"/>
<TextBox Grid.Row="12" Grid.Column="1" Margin="1" Text="{Binding Config.TaskSchedulerUsername}" IsReadOnlyCaretVisible="True" VerticalContentAlignment="Center" ToolTip="{DynamicResource GlobalSettings_TaskSchedulerUsernameTooltip}"/>
<Label Grid.Row="12" Grid.Column="2" Content="{DynamicResource GlobalSettings_TaskSchedulerPasswordLabel}" VerticalAlignment="Center"/>
<TextBox Grid.Row="12" Grid.Column="3" Margin="1" Name="HideTaskSchedulerPasswordTextBox" Text="{DynamicResource ServerSettings_HidePasswordText}" IsEnabled="{Binding Config.Email_UseDetaultCredentials, Converter={StaticResource InvertBooleanConverter}}" ToolTip="{DynamicResource ServerSettings_HidePasswordTooltip}" GotFocus="HiddenField_GotFocus" Style="{StaticResource HiddenTextBoxStyle}"/>
<TextBox Grid.Row="12" Grid.Column="3" Margin="1" Name="TaskSchedulerPasswordTextBox" Text="{Binding Config.TaskSchedulerPassword}" IsReadOnlyCaretVisible="True" VerticalContentAlignment="Center" ToolTip="{DynamicResource GlobalSettings_TaskSchedulerPasswordTooltip}" LostFocus="HiddenField_LostFocus" Visibility="Collapsed"/>
</Grid>
</GroupBox>
</Grid>

View file

@ -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)
{

View file

@ -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);