private void btnCreateLik_Click(object sender, RoutedEventArgs e) { var re = LikUtil.FastCreate(); if (re) { Alert.Show("设置桌面快捷方式成功", AlertTheme.Success); } else { var btn = new UserButton("更新", () => { var re2 = LikUtil.FastCreate(true); if (re2) { Alert.Show("更新桌面快捷方式成功", AlertTheme.Success); } else { Alert.Show("更新桌面快捷方式失败", AlertTheme.Error); } }); btn.LoadAlertTheme(AlertTheme.Warning); Alert.Show("", "桌面快捷方式已存在,是否强制更新快捷方式", AlertTheme.Warning, btn, new AlertConfig() { OnlyOneWindowAllowed = true }); } }
/// <summary> /// 程序启动 /// </summary> /// <param name="e"></param> protected override void OnStartup(StartupEventArgs e) { Core.CoreEngine.Current.Logger.Info("程序启动"); using (var orderUtil = AppStartUtil.CreateOrderCenter()) { //命令模式修改设置 foreach (string arg in e.Args) { Core.CoreEngine.Current.Logger.Info($"程序启动参数:{arg}"); orderUtil.Run(arg); } } #if !DEBUG RunOrExit(); var isFirstRun = Core.CoreEngine.Current.AppSetting.GetAppFirstStart(); if (isFirstRun) { Core.CoreEngine.Current.Logger.Info($"程序安装或升级后第一次启动"); var re = LikUtil.FastCreate(true); } #endif }