mirror of
https://github.com/zs-yg/kortapp-z.git
synced 2025-12-06 16:10:42 +08:00
Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
70534c06db | ||
|
|
9e11e66e03 | ||
|
|
4b8283574a | ||
|
|
de48557786 | ||
|
|
aa739e8d9e | ||
|
|
924684918c | ||
|
|
76bb4d1b50 | ||
|
|
94fafdb3ed |
@@ -51,7 +51,7 @@ namespace AppStore
|
||||
|
||||
// 初始化并添加应用信息
|
||||
infoLabel = new Label();
|
||||
infoLabel.Text = "kortapp-z\n版本: 1.3.6\n作者: zs-yg\n一个简单、开源的应用商店\nkortapp-z是完全免费\n基于.NET8和C/C++的软件";
|
||||
infoLabel.Text = "kortapp-z\n版本: 1.3.7\n作者: zs-yg\n一个简单、开源的应用商店\nkortapp-z是完全免费\n基于.NET8和C/C++的软件";
|
||||
infoLabel.Font = new Font("Microsoft YaHei", 12);
|
||||
infoLabel.AutoSize = false;
|
||||
infoLabel.Width = 300;
|
||||
@@ -125,7 +125,7 @@ namespace AppStore
|
||||
}
|
||||
}
|
||||
|
||||
// 保留原AboutForm作为容器(可选)
|
||||
// 保留原AboutForm作为容器
|
||||
public class AboutForm : Form
|
||||
{
|
||||
public AboutForm()
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Drawing;
|
||||
using System.Windows.Forms;
|
||||
|
||||
@@ -14,6 +15,7 @@ namespace AppStore
|
||||
public string FileName { get; set; } = string.Empty;
|
||||
public int Progress { get; set; }
|
||||
public string Status { get; set; } = string.Empty;
|
||||
public Process? DownloadProcess { get; set; }
|
||||
|
||||
public DownloadItem()
|
||||
{
|
||||
@@ -123,9 +125,26 @@ namespace AppStore
|
||||
|
||||
try
|
||||
{
|
||||
// 1. 先取消下载
|
||||
DownloadManager.Instance.CancelDownload(this);
|
||||
|
||||
// 2. 更新状态为已取消
|
||||
Status = "已取消";
|
||||
UpdateDisplay();
|
||||
|
||||
// 3. 延迟100ms后移除控件,确保UI更新完成
|
||||
var timer = new System.Windows.Forms.Timer { Interval = 100 };
|
||||
timer.Tick += (s, args) =>
|
||||
{
|
||||
timer.Stop();
|
||||
timer.Dispose();
|
||||
if (this.Parent != null)
|
||||
{
|
||||
this.Parent.Controls.Remove(this);
|
||||
this.Dispose();
|
||||
}
|
||||
};
|
||||
timer.Start();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
@@ -24,7 +24,6 @@ namespace AppStore
|
||||
private static DownloadManager instance = null!;
|
||||
public static DownloadManager Instance => instance ??= new DownloadManager();
|
||||
|
||||
private Process? currentProcess;
|
||||
public List<DownloadItem> DownloadItems { get; } = new List<DownloadItem>();
|
||||
|
||||
public event Action<DownloadItem> DownloadAdded = delegate { };
|
||||
@@ -78,6 +77,8 @@ namespace AppStore
|
||||
Status = "准备下载"
|
||||
};
|
||||
|
||||
// 创建进程并关联到下载项
|
||||
downloadItem.DownloadProcess = new Process();
|
||||
DownloadItems.Add(downloadItem);
|
||||
DownloadAdded?.Invoke(downloadItem);
|
||||
|
||||
@@ -137,18 +138,15 @@ namespace AppStore
|
||||
var arguments = $"--out=\"{originalFileName}\" --dir=\"{downloadsDir}\" --split=16 --max-connection-per-server=16 {url}";
|
||||
|
||||
|
||||
currentProcess = new Process
|
||||
downloadItem.DownloadProcess.StartInfo = new ProcessStartInfo
|
||||
{
|
||||
StartInfo = new ProcessStartInfo
|
||||
{
|
||||
FileName = aria2cPath,
|
||||
Arguments = arguments,
|
||||
WorkingDirectory = AppDomain.CurrentDomain.BaseDirectory,
|
||||
UseShellExecute = false,
|
||||
CreateNoWindow = true,
|
||||
RedirectStandardOutput = true,
|
||||
RedirectStandardError = true
|
||||
}
|
||||
FileName = aria2cPath,
|
||||
Arguments = arguments,
|
||||
WorkingDirectory = AppDomain.CurrentDomain.BaseDirectory,
|
||||
UseShellExecute = false,
|
||||
CreateNoWindow = true,
|
||||
RedirectStandardOutput = true,
|
||||
RedirectStandardError = true
|
||||
};
|
||||
|
||||
// 获取目标文件路径
|
||||
@@ -170,7 +168,7 @@ namespace AppStore
|
||||
}
|
||||
};
|
||||
|
||||
currentProcess.OutputDataReceived += (sender, e) =>
|
||||
downloadItem.DownloadProcess.OutputDataReceived += (sender, e) =>
|
||||
{
|
||||
if (!string.IsNullOrEmpty(e.Data))
|
||||
{
|
||||
@@ -211,7 +209,7 @@ namespace AppStore
|
||||
}
|
||||
};
|
||||
|
||||
currentProcess.ErrorDataReceived += (sender, e) =>
|
||||
downloadItem.DownloadProcess.ErrorDataReceived += (sender, e) =>
|
||||
{
|
||||
if (!string.IsNullOrEmpty(e.Data))
|
||||
{
|
||||
@@ -221,9 +219,9 @@ namespace AppStore
|
||||
}
|
||||
};
|
||||
|
||||
currentProcess.Exited += (sender, e) =>
|
||||
downloadItem.DownloadProcess.Exited += (sender, e) =>
|
||||
{
|
||||
var process = currentProcess;
|
||||
var process = downloadItem.DownloadProcess;
|
||||
if (process == null) return;
|
||||
|
||||
var result = GetProcessResult(process);
|
||||
@@ -292,10 +290,8 @@ namespace AppStore
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (process != null)
|
||||
{
|
||||
currentProcess = null;
|
||||
}
|
||||
// 清理资源
|
||||
downloadItem.DownloadProcess = null;
|
||||
}
|
||||
|
||||
// 强制更新显示
|
||||
@@ -304,13 +300,13 @@ namespace AppStore
|
||||
|
||||
|
||||
|
||||
if (!currentProcess.Start())
|
||||
if (!downloadItem.DownloadProcess.Start())
|
||||
{
|
||||
throw new Exception("进程启动失败");
|
||||
}
|
||||
|
||||
currentProcess.BeginOutputReadLine();
|
||||
currentProcess.BeginErrorReadLine();
|
||||
downloadItem.DownloadProcess.BeginOutputReadLine();
|
||||
downloadItem.DownloadProcess.BeginErrorReadLine();
|
||||
progressTimer.Start();
|
||||
}
|
||||
catch (Exception ex)
|
||||
@@ -333,7 +329,7 @@ namespace AppStore
|
||||
{
|
||||
try
|
||||
{
|
||||
var process = currentProcess;
|
||||
var process = item.DownloadProcess;
|
||||
if (process?.StartInfo == null || process.HasExited)
|
||||
{
|
||||
item.Status = "已取消";
|
||||
@@ -343,7 +339,7 @@ namespace AppStore
|
||||
|
||||
process.Kill();
|
||||
process.Dispose();
|
||||
currentProcess = null;
|
||||
item.DownloadProcess = null;
|
||||
|
||||
item.Status = "已取消";
|
||||
DownloadProgressChanged?.Invoke(item);
|
||||
|
||||
12
MainForm.cs
12
MainForm.cs
@@ -1562,6 +1562,18 @@ namespace AppStore
|
||||
"img/png/Freeplane.png",
|
||||
"Freeplane - 思维导图软件,帮助组织思路"));
|
||||
|
||||
flowPanel.Controls.Add(CreateAppCard(
|
||||
"Win11Debloat",
|
||||
"https://ghproxy.net/https://github.com/Raphire/Win11Debloat/releases/download/2025.06.12/Get.ps1",
|
||||
"img/png/powershell.png",
|
||||
"Win11Debloat - 这是一个简单易用的PowerShell脚本,可用于删除预装应用程序、禁用遥测以及执行各种其他更改,以自定义、整理和改善您的Windows体验。Win11Debloat适用于Windows 10和Windows 11。"));
|
||||
|
||||
flowPanel.Controls.Add(CreateAppCard(
|
||||
"keycloak",
|
||||
"https://ghproxy.net/https://github.com/keycloak/keycloak/releases/download/26.3.2/keycloak-26.3.2.zip",
|
||||
"img/png/keycloak.png",
|
||||
"keycloak - 现代应用程序和服务的开源身份和访问管理"));
|
||||
|
||||
flowPanel.Controls.Add(CreateAppCard(
|
||||
"Motrix",
|
||||
"https://dl.motrix.app/release/Motrix-Setup-1.8.19.exe",
|
||||
|
||||
@@ -83,7 +83,9 @@ Copyright (c) 2025 zsyg
|
||||
|
||||
## 其他网站
|
||||
|
||||
gitee镜像仓库:https://gitee.com/chr_super/kortapp-z (目前已经停止维护)
|
||||
gitee镜像仓库:https://gitee.com/chr_super/kortapp-z (目前已经停止维护,仅镜像代码)
|
||||
|
||||
sourceforge镜像仓库:https://sourceforge.net/projects/kortapp-z/ (提供releases镜像)
|
||||
|
||||
## 维护
|
||||
|
||||
|
||||
BIN
img/png/keycloak.png
Normal file
BIN
img/png/keycloak.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.6 KiB |
@@ -2,7 +2,7 @@
|
||||
; 有关创建 Inno Setup 脚本文件的详细信息,请参阅帮助文档!
|
||||
|
||||
#define MyAppName "kortapp-z"
|
||||
#define MyAppVersion "1.3.6"
|
||||
#define MyAppVersion "1.3.7"
|
||||
#define MyAppPublisher "zsyg"
|
||||
#define MyAppURL "https://github.com/zs-yg/kortapp-z"
|
||||
#define MyAppExeName "kortapp-z.exe"
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
; 有关创建 Inno Setup 脚本文件的详细信息,请参阅帮助文档!
|
||||
|
||||
#define MyAppName "kortapp-z"
|
||||
#define MyAppVersion "1.3.6"
|
||||
#define MyAppVersion "1.3.7"
|
||||
#define MyAppPublisher "zsyg"
|
||||
#define MyAppURL "https://github.com/zs-yg/kortapp-z"
|
||||
#define MyAppExeName "kortapp-z.exe"
|
||||
|
||||
Reference in New Issue
Block a user