diff --git a/AboutForm.cs b/AboutForm.cs index c7674f3..cd6f1d8 100644 --- a/AboutForm.cs +++ b/AboutForm.cs @@ -57,7 +57,7 @@ namespace AppStore // 初始化并添加应用信息 infoLabel = new Label(); - infoLabel.Text = "kortapp-z\n版本: 1.1.4\n作者: zs-yg\n一个简单、开源的应用商店\nkortapp-z是完全免费\n基于.NET8和C/C++的软件"; + infoLabel.Text = "kortapp-z\n版本: 1.1.5\n作者: zs-yg\n一个简单、开源的应用商店\nkortapp-z是完全免费\n基于.NET8和C/C++的软件"; infoLabel.Font = new Font("Microsoft YaHei", 12); infoLabel.AutoSize = false; infoLabel.Width = 300; diff --git a/MainForm.cs b/MainForm.cs index 0d97587..31c5500 100644 --- a/MainForm.cs +++ b/MainForm.cs @@ -464,44 +464,6 @@ namespace AppStore }; flowPanel.Controls.Add(systemInfoCard); - // 视频压缩工具卡片 - var videoCompressorCard = new ToolCard(); - videoCompressorCard.ToolName = "视频压缩工具"; - - try - { - string iconPath = Path.Combine(Application.StartupPath, "img", "resource", "png", "video_compressor.png"); - if (File.Exists(iconPath)) - { - videoCompressorCard.ToolIcon = Image.FromFile(iconPath); - } - else - { - videoCompressorCard.ToolIcon = SystemIcons.Shield.ToBitmap(); - } - } - catch - { - videoCompressorCard.ToolIcon = SystemIcons.Shield.ToBitmap(); - } - - videoCompressorCard.UpdateDisplay(); - videoCompressorCard.ToolCardClicked += (s, e) => { - try { - string toolPath = Path.Combine(Application.StartupPath, "resource", "video_compressor.exe"); - if (File.Exists(toolPath)) { - Process.Start(toolPath); - } else { - MessageBox.Show("视频压缩工具未找到,请确保已正确安装", "错误", - MessageBoxButtons.OK, MessageBoxIcon.Error); - } - } catch (Exception ex) { - MessageBox.Show($"启动视频压缩工具失败: {ex.Message}", "错误", - MessageBoxButtons.OK, MessageBoxIcon.Error); - } - }; - flowPanel.Controls.Add(videoCompressorCard); - // 计算器工具卡片 var calculatorCard = new CalculatorToolCard(); try diff --git a/SettingsForm.cs b/SettingsForm.cs index e3d269f..15cbe23 100644 --- a/SettingsForm.cs +++ b/SettingsForm.cs @@ -209,7 +209,7 @@ namespace AppStore { string jsonString = File.ReadAllText(jsonPath); var jsonData = JsonSerializer.Deserialize(jsonString); - string customPath = jsonData.GetProperty("DownloadPath").GetString(); + string customPath = jsonData.GetProperty("DownloadPath").GetString() ?? ""; // 如果自定义路径有效则显示,否则显示默认路径 txtBox.Text = !string.IsNullOrWhiteSpace(customPath) ? customPath : defaultPath; diff --git a/img/resource/png/video_compressor.png b/img/resource/png/video_compressor.png deleted file mode 100644 index ebcf0d2..0000000 Binary files a/img/resource/png/video_compressor.png and /dev/null differ diff --git a/inno/innosetup_x64.iss b/inno/innosetup_x64.iss index 1cfcbb7..85ce61c 100644 --- a/inno/innosetup_x64.iss +++ b/inno/innosetup_x64.iss @@ -2,7 +2,7 @@ ; 有关创建 Inno Setup 脚本文件的详细信息,请参阅帮助文档! #define MyAppName "kortapp-z" -#define MyAppVersion "1.1.4" +#define MyAppVersion "1.1.5" #define MyAppPublisher "zsyg" #define MyAppURL "https://github.com/zs-yg/kortapp-z" #define MyAppExeName "kortapp-z.exe" diff --git a/inno/innosetup_x86.iss b/inno/innosetup_x86.iss index 188944d..30eef02 100644 --- a/inno/innosetup_x86.iss +++ b/inno/innosetup_x86.iss @@ -2,7 +2,7 @@ ; 有关创建 Inno Setup 脚本文件的详细信息,请参阅帮助文档! #define MyAppName "kortapp-z" -#define MyAppVersion "1.1.4" +#define MyAppVersion "1.1.5" #define MyAppPublisher "zsyg" #define MyAppURL "https://github.com/zs-yg/kortapp-z" #define MyAppExeName "kortapp-z.exe" diff --git a/resource/video_compressor.exe b/resource/video_compressor.exe deleted file mode 100644 index 6eca6d6..0000000 Binary files a/resource/video_compressor.exe and /dev/null differ diff --git a/tools/Self_starting_management/SelfStartingManagerForm.cs b/tools/Self_starting_management/SelfStartingManagerForm.cs index 9b265ca..e52ab5c 100644 --- a/tools/Self_starting_management/SelfStartingManagerForm.cs +++ b/tools/Self_starting_management/SelfStartingManagerForm.cs @@ -131,29 +131,39 @@ namespace AppStore { foreach (var item in items) { - Image iconImage = null; + Image? iconImage = null; try { if (!string.IsNullOrEmpty(item.Value) && System.IO.File.Exists(item.Value)) { using (Icon icon = Icon.ExtractAssociatedIcon(item.Value)) { - iconImage = icon.ToBitmap(); + iconImage = icon?.ToBitmap() ?? SystemIcons.Application.ToBitmap(); } } else { // 使用默认图标 - iconImage = SystemIcons.Application.ToBitmap(); + iconImage = SystemIcons.Application?.ToBitmap() ?? SystemIcons.WinLogo.ToBitmap(); } } catch (Exception ex) { Logger.LogWarning($"无法加载程序图标: {item.Value}", ex); - iconImage = SystemIcons.Warning.ToBitmap(); + // 确保在任何情况下都有有效的图标 + iconImage = SystemIcons.Warning?.ToBitmap() + ?? SystemIcons.Error?.ToBitmap() + ?? SystemIcons.Application?.ToBitmap() + ?? SystemIcons.WinLogo?.ToBitmap() + ?? SystemIcons.Shield?.ToBitmap() + ?? new Bitmap(16, 16); + if (iconImage == null) + { + iconImage = new Bitmap(16, 16); + } } - dataGridView.Rows.Add(iconImage, item.Key, item.Value); + dataGridView.Rows.Add(iconImage!, item.Key, item.Value); } } }