dragon-iso/src/Dragon-ISO.App/OnboardingWindow.xaml.cs
Zac Gaetano edb7975039
Some checks failed
CI / build-and-test (push) Failing after 29s
Release / build-msi (push) Failing after 21s
rebrand: rename all TeamsISO source paths to Dragon-ISO
- Rename solution files: TeamsISO.sln/slnf -> Dragon-ISO.sln/slnf
- Rename all src/TeamsISO.* directories and project files
  to src/Dragon-ISO.* equivalents
- Update .gitignore to exclude build/test output logs
- Update ci.yml, CHANGELOG.md, build-and-test.ps1, docs references

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-31 11:18:27 -04:00

57 lines
2 KiB
C#

using System.IO;
using System.Windows;
namespace DragonISO.App;
/// <summary>
/// First-launch welcome dialog. Walks the user through the once-per-machine
/// setup that's not derivable from the UI alone (NDI runtime install, Teams
/// admin permission, transcoder topology) and points them at where logs and
/// presets live for later self-service.
///
/// Suppression is governed by a marker file at
/// <c>%LOCALAPPDATA%\Dragon-ISO\onboarding.flag</c>. The presence of the file —
/// regardless of contents — means "don't show again." The user can restore
/// the dialog by deleting that file.
/// </summary>
public partial class OnboardingWindow : Window
{
private static string FlagPath =>
Path.Combine(
Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData),
"Dragon-ISO", "onboarding.flag");
public OnboardingWindow() => InitializeComponent();
/// <summary>
/// Returns true on first launch (and on launches where the user previously
/// unchecked "Don't show this again" so the marker file was never created).
/// </summary>
public static bool ShouldShow()
{
try { return !File.Exists(FlagPath); }
catch { return false; } // permission errors → assume already shown
}
private void OnDismiss(object sender, RoutedEventArgs e)
{
if (SuppressBox.IsChecked == true)
{
try
{
var dir = Path.GetDirectoryName(FlagPath);
if (!string.IsNullOrEmpty(dir)) Directory.CreateDirectory(dir);
File.WriteAllText(FlagPath,
"Onboarding dialog dismissed at " + DateTimeOffset.UtcNow.ToString("o") + ". " +
"Delete this file to see the welcome dialog again on next launch.");
}
catch
{
// Disk full / permission denied — show the dialog again next launch
// rather than fail noisily.
}
}
DialogResult = true;
Close();
}
}