Feature Added: -Start command line option

This commit is contained in:
BubbaGumpShrump 2024-12-16 19:00:45 -05:00
parent a541c5822b
commit 9a4f224b92
6 changed files with 19 additions and 7 deletions

View file

@ -10,5 +10,4 @@ namespace AutoTrackR2
public partial class App : Application
{
}
}

View file

@ -59,8 +59,9 @@ namespace AutoTrackR2
}
}
private void StartButton_Click(object sender, RoutedEventArgs e)
public void StartButton_Click(object sender, RoutedEventArgs e)
{
UpdateButtonState(true);
string scriptPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "KillTrackR_MainScript.ps1");
TailFileAsync(scriptPath);
}

View file

@ -1,4 +1,4 @@
$TrackRver = "2.0r"
$TrackRver = "2.03"
# Path to the config file
$appName = "AutoTrackR2"

View file

@ -49,6 +49,18 @@ namespace AutoTrackR2
InitializeConfigPage();
UpdateTabVisuals();
Loaded += MainWindow_Loaded; // Handle Loaded event
}
private void MainWindow_Loaded(object sender, RoutedEventArgs e)
{
// Check command-line arguments after the window is loaded
var args = Environment.GetCommandLineArgs();
if (args.Contains("-start", StringComparer.OrdinalIgnoreCase))
{
homePage.StartButton_Click(null, null);
}
}
private void CloseWindow(object sender, RoutedEventArgs e)

View file

@ -9,7 +9,7 @@ namespace AutoTrackR2
{
public partial class UpdatePage : UserControl
{
private string currentVersion = "v2.0-release";
private string currentVersion = "v2.03-release";
private string latestVersion;
public UpdatePage()