Compare commits

..

15 Commits

Author SHA1 Message Date
zsyg
70534c06db 修改版本号 2025-07-28 13:02:03 +08:00
zsyg
9e11e66e03 添加应用卡片图标 2025-07-27 11:26:01 +08:00
zsyg
4b8283574a 添加应用卡片 2025-07-27 11:23:50 +08:00
zsyg
de48557786 Update README.md 2025-07-27 08:24:46 +08:00
zsyg
aa739e8d9e Update README.md 2025-07-27 08:23:35 +08:00
zsyg
924684918c Update README.md 2025-07-27 08:22:23 +08:00
zsyg
76bb4d1b50 完善下载机制 2025-07-27 08:16:32 +08:00
zsyg
94fafdb3ed 2025-07-26 16:07:43 +08:00
zsyg
b09175550e 添加luanti软件图标 2025-07-26 08:22:29 +08:00
zsyg
c3b5e3fe66 修改版本号 2025-07-26 08:21:30 +08:00
zsyg
1cad6573e2 添加应用卡片 2025-07-26 08:20:50 +08:00
zsyg
d01b7a4b5a 修改版本号 2025-07-24 08:09:15 +08:00
zsyg
7d393aa817 添加更多应用卡片 2025-07-24 08:08:43 +08:00
zsyg
f28ec55eaf 修改协议漏洞
zsyg改zs-yg
2025-07-23 19:14:15 +08:00
zsyg
cbf4a2bc2d 修改版本号 2025-07-23 08:20:30 +08:00
10 changed files with 555 additions and 514 deletions

View File

@@ -51,7 +51,7 @@ namespace AppStore
// 初始化并添加应用信息 // 初始化并添加应用信息
infoLabel = new Label(); infoLabel = new Label();
infoLabel.Text = "kortapp-z\n版本: 1.3.4\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.Font = new Font("Microsoft YaHei", 12);
infoLabel.AutoSize = false; infoLabel.AutoSize = false;
infoLabel.Width = 300; infoLabel.Width = 300;
@@ -125,7 +125,7 @@ namespace AppStore
} }
} }
// 保留原AboutForm作为容器(可选) // 保留原AboutForm作为容器
public class AboutForm : Form public class AboutForm : Form
{ {
public AboutForm() public AboutForm()

View File

@@ -1,4 +1,5 @@
using System; using System;
using System.Diagnostics;
using System.Drawing; using System.Drawing;
using System.Windows.Forms; using System.Windows.Forms;
@@ -14,6 +15,7 @@ namespace AppStore
public string FileName { get; set; } = string.Empty; public string FileName { get; set; } = string.Empty;
public int Progress { get; set; } public int Progress { get; set; }
public string Status { get; set; } = string.Empty; public string Status { get; set; } = string.Empty;
public Process? DownloadProcess { get; set; }
public DownloadItem() public DownloadItem()
{ {
@@ -123,9 +125,26 @@ namespace AppStore
try try
{ {
// 1. 先取消下载
DownloadManager.Instance.CancelDownload(this); DownloadManager.Instance.CancelDownload(this);
// 2. 更新状态为已取消
Status = "已取消"; Status = "已取消";
UpdateDisplay(); 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) catch (Exception ex)
{ {

View File

@@ -24,7 +24,6 @@ namespace AppStore
private static DownloadManager instance = null!; private static DownloadManager instance = null!;
public static DownloadManager Instance => instance ??= new DownloadManager(); public static DownloadManager Instance => instance ??= new DownloadManager();
private Process? currentProcess;
public List<DownloadItem> DownloadItems { get; } = new List<DownloadItem>(); public List<DownloadItem> DownloadItems { get; } = new List<DownloadItem>();
public event Action<DownloadItem> DownloadAdded = delegate { }; public event Action<DownloadItem> DownloadAdded = delegate { };
@@ -78,6 +77,8 @@ namespace AppStore
Status = "准备下载" Status = "准备下载"
}; };
// 创建进程并关联到下载项
downloadItem.DownloadProcess = new Process();
DownloadItems.Add(downloadItem); DownloadItems.Add(downloadItem);
DownloadAdded?.Invoke(downloadItem); DownloadAdded?.Invoke(downloadItem);
@@ -137,9 +138,7 @@ namespace AppStore
var arguments = $"--out=\"{originalFileName}\" --dir=\"{downloadsDir}\" --split=16 --max-connection-per-server=16 {url}"; 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, FileName = aria2cPath,
Arguments = arguments, Arguments = arguments,
@@ -148,7 +147,6 @@ namespace AppStore
CreateNoWindow = true, CreateNoWindow = true,
RedirectStandardOutput = true, RedirectStandardOutput = true,
RedirectStandardError = true RedirectStandardError = true
}
}; };
// 获取目标文件路径 // 获取目标文件路径
@@ -170,7 +168,7 @@ namespace AppStore
} }
}; };
currentProcess.OutputDataReceived += (sender, e) => downloadItem.DownloadProcess.OutputDataReceived += (sender, e) =>
{ {
if (!string.IsNullOrEmpty(e.Data)) 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)) 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; if (process == null) return;
var result = GetProcessResult(process); var result = GetProcessResult(process);
@@ -292,10 +290,8 @@ namespace AppStore
} }
finally finally
{ {
if (process != null) // 清理资源
{ downloadItem.DownloadProcess = null;
currentProcess = null;
}
} }
// 强制更新显示 // 强制更新显示
@@ -304,13 +300,13 @@ namespace AppStore
if (!currentProcess.Start()) if (!downloadItem.DownloadProcess.Start())
{ {
throw new Exception("进程启动失败"); throw new Exception("进程启动失败");
} }
currentProcess.BeginOutputReadLine(); downloadItem.DownloadProcess.BeginOutputReadLine();
currentProcess.BeginErrorReadLine(); downloadItem.DownloadProcess.BeginErrorReadLine();
progressTimer.Start(); progressTimer.Start();
} }
catch (Exception ex) catch (Exception ex)
@@ -333,7 +329,7 @@ namespace AppStore
{ {
try try
{ {
var process = currentProcess; var process = item.DownloadProcess;
if (process?.StartInfo == null || process.HasExited) if (process?.StartInfo == null || process.HasExited)
{ {
item.Status = "已取消"; item.Status = "已取消";
@@ -343,7 +339,7 @@ namespace AppStore
process.Kill(); process.Kill();
process.Dispose(); process.Dispose();
currentProcess = null; item.DownloadProcess = null;
item.Status = "已取消"; item.Status = "已取消";
DownloadProgressChanged?.Invoke(item); DownloadProgressChanged?.Invoke(item);

View File

@@ -1,6 +1,6 @@
MIT License MIT License
Copyright (c) 2025 zsyg Copyright (c) 2025 zs-yg
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -1129,6 +1129,12 @@ namespace AppStore
"img/png/godot.png", "img/png/godot.png",
"Godot - 免费开源的由社区驱动的游戏引擎")); "Godot - 免费开源的由社区驱动的游戏引擎"));
flowPanel.Controls.Add(CreateAppCard(
"luanti游戏引擎",
"https://www.ghproxy.cn/https://github.com/luanti-org/luanti/releases/download/5.12.0/luanti-5.12.0-win64.zip",
"img/png/Luanti.png",
"Luanti - Luanti(以前称为 Minetest)是一个开源体素游戏创建平台,具有简单的模组和游戏创建功能"));
flowPanel.Controls.Add(CreateAppCard( flowPanel.Controls.Add(CreateAppCard(
"7-Zip", "7-Zip",
"https://objects.githubusercontent.com/github-production-release-asset-2e65be/466446150/1645817e-3677-4207-93ff-e62de7e147be?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=releaseassetproduction%2F20250613%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20250613T035936Z&X-Amz-Expires=300&X-Amz-Signature=5e02d5fc34f45bd8308029c9fc78052007e9475ce0e32775619921cb8f3b83ea&X-Amz-SignedHeaders=host&response-content-disposition=attachment%3B%20filename%3D7z2409-x64.exe&response-content-type=application%2Foctet-stream", "https://objects.githubusercontent.com/github-production-release-asset-2e65be/466446150/1645817e-3677-4207-93ff-e62de7e147be?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=releaseassetproduction%2F20250613%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20250613T035936Z&X-Amz-Expires=300&X-Amz-Signature=5e02d5fc34f45bd8308029c9fc78052007e9475ce0e32775619921cb8f3b83ea&X-Amz-SignedHeaders=host&response-content-disposition=attachment%3B%20filename%3D7z2409-x64.exe&response-content-type=application%2Foctet-stream",
@@ -1544,12 +1550,30 @@ namespace AppStore
"img/ico/Sumatra PDF.ico", "img/ico/Sumatra PDF.ico",
"Sumatra PDF - 轻量级的PDF阅读器")); "Sumatra PDF - 轻量级的PDF阅读器"));
flowPanel.Controls.Add(CreateAppCard(
"LiveRecorder",
"https://ghproxy.net/https://github.com/auqhjjqdo/LiveRecorder/releases/download/v2.35/LiveRecorder_Windows_v2.35.zip",
"",
"LiveRecorder - 基于Streamlink的全自动直播录制工具"));
flowPanel.Controls.Add(CreateAppCard( flowPanel.Controls.Add(CreateAppCard(
"Freeplane", "Freeplane",
"https://ghproxy.net/https://github.com/zs-yg/package/releases/download/v0.5/Freeplane-Setup-1.12.11.exe.7z", "https://ghproxy.net/https://github.com/zs-yg/package/releases/download/v0.5/Freeplane-Setup-1.12.11.exe.7z",
"img/png/Freeplane.png", "img/png/Freeplane.png",
"Freeplane - 思维导图软件,帮助组织思路")); "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( flowPanel.Controls.Add(CreateAppCard(
"Motrix", "Motrix",
"https://dl.motrix.app/release/Motrix-Setup-1.8.19.exe", "https://dl.motrix.app/release/Motrix-Setup-1.8.19.exe",

View File

@@ -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/Luanti.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

BIN
img/png/keycloak.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

View File

@@ -2,7 +2,7 @@
; 有关创建 Inno Setup 脚本文件的详细信息,请参阅帮助文档! ; 有关创建 Inno Setup 脚本文件的详细信息,请参阅帮助文档!
#define MyAppName "kortapp-z" #define MyAppName "kortapp-z"
#define MyAppVersion "1.3.4" #define MyAppVersion "1.3.7"
#define MyAppPublisher "zsyg" #define MyAppPublisher "zsyg"
#define MyAppURL "https://github.com/zs-yg/kortapp-z" #define MyAppURL "https://github.com/zs-yg/kortapp-z"
#define MyAppExeName "kortapp-z.exe" #define MyAppExeName "kortapp-z.exe"

View File

@@ -2,7 +2,7 @@
; 有关创建 Inno Setup 脚本文件的详细信息,请参阅帮助文档! ; 有关创建 Inno Setup 脚本文件的详细信息,请参阅帮助文档!
#define MyAppName "kortapp-z" #define MyAppName "kortapp-z"
#define MyAppVersion "1.3.4" #define MyAppVersion "1.3.7"
#define MyAppPublisher "zsyg" #define MyAppPublisher "zsyg"
#define MyAppURL "https://github.com/zs-yg/kortapp-z" #define MyAppURL "https://github.com/zs-yg/kortapp-z"
#define MyAppExeName "kortapp-z.exe" #define MyAppExeName "kortapp-z.exe"