diff --git a/LD-SysInfo/App.xaml.cs b/LD-SysInfo/App.xaml.cs index af3dd9e..6610653 100644 --- a/LD-SysInfo/App.xaml.cs +++ b/LD-SysInfo/App.xaml.cs @@ -16,18 +16,47 @@ public partial class App : Application [STAThread] private static void Main(string[] args) { - MainAsync(args).GetAwaiter().GetResult(); + // Show splash screen with fade-in effect + var splash = new SplashScreen("Assets/splash.png"); + splash.Show(false, true); // autoClose=false, topMost=true + + // Allow 1 second for fade-in to complete + System.Threading.Thread.Sleep(1000); + + MainAsync(args, splash).GetAwaiter().GetResult(); } - private static async Task MainAsync(string[] args) + private static async Task MainAsync(string[] args, SplashScreen splash) { using IHost host = CreateHostBuilder(args).Build(); await host.StartAsync().ConfigureAwait(true); App app = new(); app.InitializeComponent(); - app.MainWindow = host.Services.GetRequiredService(); - app.MainWindow.Visibility = Visibility.Visible; + + var mainWindow = host.Services.GetRequiredService(); + app.MainWindow = mainWindow; + + // Keep MainWindow hidden until system info loads + mainWindow.Visibility = Visibility.Hidden; + + // When system info finishes loading, show MainWindow and close splash + mainWindow.SystemInfoLoaded += (s, e) => + { + // Use dispatcher to handle UI thread timing + mainWindow.Dispatcher.BeginInvoke(async () => + { + // Wait 1 second before starting fade-out + await Task.Delay(1000); + + // Show the main window + mainWindow.Visibility = Visibility.Visible; + + // Close splash with fade-out effect (1 second) + splash.Close(TimeSpan.FromMilliseconds(1000)); + }); + }; + app.Run(); await host.StopAsync().ConfigureAwait(true); diff --git a/LD-SysInfo/Assets/splash.png b/LD-SysInfo/Assets/splash.png new file mode 100644 index 0000000..7ae201c Binary files /dev/null and b/LD-SysInfo/Assets/splash.png differ diff --git a/LD-SysInfo/LD_SysInfo.csproj b/LD-SysInfo/LD_SysInfo.csproj index 07e97a5..4c1098c 100644 --- a/LD-SysInfo/LD_SysInfo.csproj +++ b/LD-SysInfo/LD_SysInfo.csproj @@ -51,11 +51,15 @@ + Always + + Always + diff --git a/LD-SysInfo/MainWindow.xaml.cs b/LD-SysInfo/MainWindow.xaml.cs index 859dd41..137b2cd 100644 --- a/LD-SysInfo/MainWindow.xaml.cs +++ b/LD-SysInfo/MainWindow.xaml.cs @@ -51,6 +51,9 @@ namespace LD_SysInfo private static readonly string ConfigPath = Path.Combine(AppContext.BaseDirectory, "config.json"); + // Event to signal when system info loading is complete + public event EventHandler? SystemInfoLoaded; + public MainWindow() { @@ -78,7 +81,10 @@ namespace LD_SysInfo VersionTextBlock.Text = "v0.0.0"; } LoadConfig(); - DisplaySystemInfo(); + + // Load system info asynchronously to avoid blocking UI + Task.Run(async () => await DisplaySystemInfoAsync()); + AutoLogin(); // 🔍 Perform initial connectivity check @@ -270,6 +276,22 @@ namespace LD_SysInfo } } + private async Task DisplaySystemInfoAsync() + { + // Run system info collection on background thread + var sysInfo = await Task.Run(() => SystemInfo.GetSystemInfo()); + + // Update UI on UI thread + await Dispatcher.InvokeAsync(() => + { + _cachedSystemInfo = sysInfo; + UpdateSysInfoUI(_cachedSystemInfo); + + // Notify that system info has loaded + SystemInfoLoaded?.Invoke(this, EventArgs.Empty); + }); + } + private void DisplaySystemInfo() { _cachedSystemInfo = SystemInfo.GetSystemInfo(); diff --git a/LD_SysInfo_Installer/Assets/LDShortcut.ico b/LD_SysInfo_Installer/Assets/LDShortcut.ico deleted file mode 100644 index a156f00..0000000 Binary files a/LD_SysInfo_Installer/Assets/LDShortcut.ico and /dev/null differ diff --git a/LD_SysInfo_Installer/Assets/trayicon.ico b/LD_SysInfo_Installer/Assets/trayicon.ico deleted file mode 100644 index 0761cff..0000000 Binary files a/LD_SysInfo_Installer/Assets/trayicon.ico and /dev/null differ diff --git a/LD_SysInfo_Installer/Assets/windowsdesktop-runtime-8.0.13-win-x64.exe b/LD_SysInfo_Installer/Assets/windowsdesktop-runtime-8.0.13-win-x64.exe deleted file mode 100644 index 31f478e..0000000 Binary files a/LD_SysInfo_Installer/Assets/windowsdesktop-runtime-8.0.13-win-x64.exe and /dev/null differ diff --git a/LD_SysInfo_Installer/LD-SysInfo.exe b/LD_SysInfo_Installer/LD-SysInfo.exe deleted file mode 100644 index 44c838f..0000000 Binary files a/LD_SysInfo_Installer/LD-SysInfo.exe and /dev/null differ diff --git a/LD_SysInfo_Installer/LD_SysInfo_Installer.wixproj b/LD_SysInfo_Installer/LD_SysInfo_Installer.wixproj deleted file mode 100644 index 152dfe0..0000000 --- a/LD_SysInfo_Installer/LD_SysInfo_Installer.wixproj +++ /dev/null @@ -1,35 +0,0 @@ - - - x64 - - - false - true - - - - - - - - - - - Always - - - - - LD-SysInfo - {604bf69a-6bff-4637-88b5-78936c7eb68f} - True - True - Binaries;Content;Satellites - INSTALLFOLDER - - - - - - - \ No newline at end of file diff --git a/LD_SysInfo_Installer/Product.wxs b/LD_SysInfo_Installer/Product.wxs deleted file mode 100644 index 670fa70..0000000 --- a/LD_SysInfo_Installer/Product.wxs +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/OversightInstaller/HarvestedFiles.wxs b/OversightInstaller/HarvestedFiles.wxs index a300173..332cbba 100644 --- a/OversightInstaller/HarvestedFiles.wxs +++ b/OversightInstaller/HarvestedFiles.wxs @@ -1,6 +1,8 @@ + + @@ -25,6 +27,12 @@ + + + + @@ -37,6 +45,7 @@ + \ No newline at end of file diff --git a/OversightInstaller/OversightInstaller.wixproj b/OversightInstaller/OversightInstaller.wixproj index 33511dd..ffa14e0 100644 --- a/OversightInstaller/OversightInstaller.wixproj +++ b/OversightInstaller/OversightInstaller.wixproj @@ -50,6 +50,7 @@ + diff --git a/OversightInstaller/Package.wxs b/OversightInstaller/Package.wxs index e5e0001..6d82a1a 100644 --- a/OversightInstaller/Package.wxs +++ b/OversightInstaller/Package.wxs @@ -89,6 +89,7 @@ +