From ec3a826e01896dcd4ed1d4f9bcac20bc004979ce Mon Sep 17 00:00:00 2001 From: CJKmkp <2564608840@qq.com> Date: Sat, 14 Feb 2026 15:59:10 +0800 Subject: [PATCH] add:OOBE --- Ink Canvas/App.xaml.cs | 5 + Ink Canvas/MainWindow.xaml.cs | 37 ++ Ink Canvas/Resources/Settings.cs | 2 + Ink Canvas/Windows/OobeWindow.xaml | 530 +++++++++++++++++++++++ Ink Canvas/Windows/OobeWindow.xaml.cs | 589 ++++++++++++++++++++++++++ 5 files changed, 1163 insertions(+) create mode 100644 Ink Canvas/Windows/OobeWindow.xaml create mode 100644 Ink Canvas/Windows/OobeWindow.xaml.cs diff --git a/Ink Canvas/App.xaml.cs b/Ink Canvas/App.xaml.cs index f74024af..f72d072f 100644 --- a/Ink Canvas/App.xaml.cs +++ b/Ink Canvas/App.xaml.cs @@ -44,6 +44,8 @@ namespace Ink_Canvas public static bool IsAppExitByUser; // 新增:标记是否启用了UIA置顶功能 public static bool IsUIAccessTopMostEnabled; + // 新增:标记是否正在显示 OOBE(首次启动向导),看门狗在此期间不判定为卡死/假死 + public static bool IsOobeShowing; // 新增:退出信号文件路径 private static string watchdogExitSignalFile = Path.Combine(Path.GetTempPath(), "icc_watchdog_exit_" + Process.GetCurrentProcess().Id + ".flag"); // 新增:崩溃日志文件路径 @@ -1158,6 +1160,9 @@ namespace Ink_Canvas watchdogTimer = new Timer(_ => { + if (IsOobeShowing) + return; + if (!isStartupComplete && appStartupStartTime != DateTime.MinValue) { DateTime startTime = _isSplashScreenShown && splashScreenStartTime != DateTime.MinValue diff --git a/Ink Canvas/MainWindow.xaml.cs b/Ink Canvas/MainWindow.xaml.cs index 3c2c12da..5dfb8757 100644 --- a/Ink Canvas/MainWindow.xaml.cs +++ b/Ink Canvas/MainWindow.xaml.cs @@ -931,6 +931,8 @@ namespace Ink_Canvas AutoBackupManager.Initialize(Settings); CheckUpdateChannelAndTelemetryConsistency(); + ShowOobeIfNeeded(); + // 初始化Dlass上传队列(恢复上次的上传队列) DlassNoteUploader.InitializeQueue(); @@ -1228,6 +1230,41 @@ namespace Ink_Canvas AddTouchSupportToSliders(); } + private void ShowOobeIfNeeded() + { + try + { + if (Settings?.Startup == null) return; + if (Settings.Startup.HasShownOobe) return; + + var oobeWindow = new OobeWindow(Settings) + { + Owner = this, + WindowStartupLocation = WindowStartupLocation.CenterOwner + }; + try + { + App.IsOobeShowing = true; + oobeWindow.ShowDialog(); + } + finally + { + App.IsOobeShowing = false; + } + + Settings.Startup.HasShownOobe = true; + SaveSettingsToFile(); + } + catch (Exception ex) + { + LogHelper.WriteLogToFile($"显示首次启动体验(OOBE)时出错: {ex}", LogHelper.LogType.Error); + } + finally + { + App.IsOobeShowing = false; + } + } + private void SystemEventsOnDisplaySettingsChanged(object sender, EventArgs e) { if (!Settings.Advanced.IsEnableResolutionChangeDetection) return; diff --git a/Ink Canvas/Resources/Settings.cs b/Ink Canvas/Resources/Settings.cs index 8aa4ba0b..10d6e341 100644 --- a/Ink Canvas/Resources/Settings.cs +++ b/Ink Canvas/Resources/Settings.cs @@ -203,6 +203,8 @@ namespace Ink_Canvas public TelemetryUploadLevel TelemetryUploadLevel { get; set; } = TelemetryUploadLevel.None; [JsonProperty("hasAcceptedTelemetryPrivacy")] public bool HasAcceptedTelemetryPrivacy { get; set; } = false; + [JsonProperty("hasShownOobe")] + public bool HasShownOobe { get; set; } = false; } public class Appearance diff --git a/Ink Canvas/Windows/OobeWindow.xaml b/Ink Canvas/Windows/OobeWindow.xaml new file mode 100644 index 00000000..963d4fd0 --- /dev/null +++ b/Ink Canvas/Windows/OobeWindow.xaml @@ -0,0 +1,530 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 隐私说明:本软件不会收集课堂内容、学生个人信息或可识别您的原始墨迹内容,详情可查看安装目录中的 privacy.txt。 + + + + 启动与更新选项(对应 设置 → 启动) + + + + + + + + + + + 画笔光标、压感、墨迹显示等可在 设置 → 画板和墨迹 中修改。 + + + + + + + + + + + + 双指缩放、平移、旋转及手掌擦等可在 设置 → 手势操作 中修改。 + + + + + + + + + + + + + 手绘图形识别为标准形状等可在 设置 → 墨迹纠正 中修改。 + + + + + + + + + + 主题、启动动画、托盘图标等均可在 设置 → 外观 中修改。 + + + + + + + + + + + + + + + + + + + + + + + + + + 具体快捷键可在 设置 → 快捷键设置 中配置。 + + + + + + + + + + 发生未处理异常时的行为可在 设置 → 崩溃处理 中修改。 + + + + + + + + + + + + + 以下选项均可在 设置 → PPT 中修改,用于与 PowerPoint/WPS 放映联动。 + + + + + + + + + + + + + + + + + 进入/退出特定软件时自动收纳、墨迹自动保存、悬浮窗拦截等可在 设置 → 自动化行为 中修改。 + + + + + + + + + + + + + 点名窗口样式与行为可在 设置 → 随机点名 中修改。 + + + + + + + + + + 日志、特殊屏幕、窗口模式等可在 设置 → 高级选项 中修改。 + + + + + + + + + + 清屏截图、按日期保存等可在 设置 → 截图和屏幕捕捉 中修改。 + + + + + + + + + + + + + + + + + + + 此向导仅在首次启动时出现;之后可在 设置 中按侧边栏分区修改对应选项。 + + +