From e7b9d3851cdf433045dfbecf2004c87e2d4d2ada Mon Sep 17 00:00:00 2001 From: Administrator Date: Thu, 18 Dec 2025 11:41:46 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20=E6=9B=B4=E6=96=B0=E6=96=87=E6=A1=A3?= =?UTF-8?q?=E4=B8=AD=E7=9A=84=20.NET=20Framework=20=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E4=B8=BA=204.6.2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 更新 README.md 中的技术栈、系统要求和编译输出路径 - 更新 BUILD_INSTALLER.md 中的兼容性说明和下载链接 - 更新轻量级订单发货客户端方案.md 中的所有版本引用 - 更新 build_installer.bat 自动编译和复制流程 - 修复 App.config 中的 supportedRuntime 版本 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- BUILD_INSTALLER.md | 74 +++++++++++++++++++++++++ PackagingMallShipper/App.config | 2 +- README.md | 10 ++-- build_installer.bat | 26 +++++++-- 轻量级订单发货客户端方案.md | 16 +++--- 5 files changed, 110 insertions(+), 18 deletions(-) create mode 100644 BUILD_INSTALLER.md diff --git a/BUILD_INSTALLER.md b/BUILD_INSTALLER.md new file mode 100644 index 0000000..c26e04c --- /dev/null +++ b/BUILD_INSTALLER.md @@ -0,0 +1,74 @@ +# 构建安装包说明 + +## Windows 7 兼容性 + +本应用程序使用 .NET Framework 4.6.2,支持以下系统: +- Windows 7 SP1(原生支持 .NET Framework 4.6.2) +- Windows 8.1(自带 .NET Framework 4.6.2+) +- Windows 10(自带 .NET Framework 4.6.2+) +- Windows 11(自带 .NET Framework 4.6.2+) + +## 方式一:使用 Inno Setup 创建安装程序(推荐) + +### 步骤 1:安装 Inno Setup + +1. 下载 Inno Setup 6:https://jrsoftware.org/isdl.php +2. 安装时选择包含 **中文简体语言包** + +### 步骤 2:编译安装程序 + +**方法 A - 命令行编译:** +```cmd +"C:\Program Files (x86)\Inno Setup 6\ISCC.exe" setup.iss +``` + +**方法 B - 图形界面:** +1. 双击打开 `setup.iss` 文件 +2. 按 `Ctrl+F9` 或点击菜单 `Build > Compile` + +### 步骤 3:获取安装包 + +编译完成后,安装包位于: +``` +installer\PackagingMallShipper_Setup_v1.0.0.exe +``` + +## 方式二:手动分发(无需安装程序) + +将 `publish` 文件夹的内容复制给用户: +``` +publish/ +├── PackagingMallShipper.exe (主程序) +├── PackagingMallShipper.exe.config (配置文件) +├── x64/ +│ └── SQLite.Interop.dll (64位SQLite库) +└── x86/ + └── SQLite.Interop.dll (32位SQLite库) +``` + +用户需要 .NET Framework 4.6.2+ 运行时(Windows 7 SP1 原生支持)。 + +## .NET Framework 4.6.2 下载地址 + +如果目标系统没有安装 .NET Framework 4.6.2,可从以下地址下载: + +**离线安装包(推荐):** +https://dotnet.microsoft.com/download/dotnet-framework/net462 + +**在线安装包:** +https://dotnet.microsoft.com/download/dotnet-framework/thank-you/net462-web-installer + +## Windows 7 注意事项 + +Windows 7 SP1 用户: +1. 确保已安装 Windows 7 Service Pack 1 +2. .NET Framework 4.6.2 通常已通过 Windows Update 安装 +3. 如未安装,可下载离线安装包(约 60MB) + +## 文件说明 + +| 文件 | 说明 | +|------|------| +| `setup.iss` | Inno Setup 安装脚本 | +| `publish/` | 编译好的程序文件 | +| `installer/` | 生成的安装包输出目录 | diff --git a/PackagingMallShipper/App.config b/PackagingMallShipper/App.config index 6cb018a..7ddabb6 100644 --- a/PackagingMallShipper/App.config +++ b/PackagingMallShipper/App.config @@ -1,7 +1,7 @@ - + diff --git a/README.md b/README.md index 49c3161..701f035 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ | 组件 | 技术 | 版本 | |-----|------|------| -| 桌面框架 | WPF | .NET Framework 4.8 | +| 桌面框架 | WPF | .NET Framework 4.6.2 | | 架构模式 | MVVM | CommunityToolkit.Mvvm 8.2 | | 本地数据库 | SQLite | System.Data.SQLite 1.0.118 | | Excel处理 | ClosedXML | 0.102.2 | @@ -26,13 +26,13 @@ ## 系统要求 - **操作系统**: Windows 7 SP1 或更高版本 -- **运行时**: .NET Framework 4.8(Win7已内置,无需额外安装) +- **运行时**: .NET Framework 4.6.2(Win7 SP1 原生支持) - **磁盘空间**: ~10MB ## 开发环境 - Visual Studio 2019+ 或 .NET SDK 8.0+ -- .NET Framework 4.8 开发工具 +- .NET Framework 4.6.2+ 开发工具 ## 编译步骤 @@ -43,7 +43,7 @@ dotnet build PackagingMallShipper.sln -c Release # 输出文件位于 -bin/Release/net48/PackagingMallShipper.exe +bin/Release/net462/PackagingMallShipper.exe ``` ### 方式二:Visual Studio @@ -52,7 +52,7 @@ bin/Release/net48/PackagingMallShipper.exe 2. 还原 NuGet 包 3. 选择 `Release` 配置 4. 生成解决方案 -5. 输出文件位于 `bin/Release/net48/` 目录 +5. 输出文件位于 `bin/Release/net462/` 目录 ## 配置说明 diff --git a/build_installer.bat b/build_installer.bat index d88ba92..d2e68d7 100644 --- a/build_installer.bat +++ b/build_installer.bat @@ -26,17 +26,35 @@ if "%ISCC%"=="" ( echo [Info] Found Inno Setup: %ISCC% echo. +echo [Step 1] Building Release version... +dotnet build -c Release +if %ERRORLEVEL% NEQ 0 ( + echo [Error] Build failed! + pause + exit /b 1 +) +echo. + +echo [Step 2] Copying files to publish folder... +if not exist "publish" mkdir publish +if not exist "publish\x64" mkdir publish\x64 +if not exist "publish\x86" mkdir publish\x86 + +copy /Y "PackagingMallShipper\bin\Release\net462\PackagingMallShipper.exe" "publish\" >nul +copy /Y "PackagingMallShipper\bin\Release\net462\PackagingMallShipper.exe.config" "publish\" >nul +copy /Y "PackagingMallShipper\bin\Release\net462\x64\SQLite.Interop.dll" "publish\x64\" >nul +copy /Y "PackagingMallShipper\bin\Release\net462\x86\SQLite.Interop.dll" "publish\x86\" >nul + if not exist "publish\PackagingMallShipper.exe" ( echo [Error] publish\PackagingMallShipper.exe not found echo. - echo Please build Release version first: - echo dotnet build -c Release - echo. pause exit /b 1 ) +echo [Info] Files copied to publish folder +echo. -echo [Info] Compiling installer... +echo [Step 3] Compiling installer... echo. "%ISCC%" setup.iss diff --git a/轻量级订单发货客户端方案.md b/轻量级订单发货客户端方案.md index 4933a6d..628bf31 100644 --- a/轻量级订单发货客户端方案.md +++ b/轻量级订单发货客户端方案.md @@ -44,7 +44,7 @@ | 层级 | 选型 | 版本 | 理由 | |-----|------|------|------| -| **桌面框架** | WPF | .NET Framework 4.8 | Win7原生支持、性能极佳、微软官方维护 | +| **桌面框架** | WPF | .NET Framework 4.6.2 | Win7原生支持、性能极佳、微软官方维护 | | **开发语言** | C# | 7.3 | 强类型、性能优秀、生态成熟 | | **UI风格** | Modern WPF | MaterialDesign/MahApps | 现代Windows风格 | | **架构模式** | MVVM | CommunityToolkit.Mvvm | 解耦视图与逻辑 | @@ -53,10 +53,10 @@ | **HTTP客户端** | HttpClient | 内置 | 原生支持、异步友好 | | **JSON处理** | Newtonsoft.Json | 13.x | 功能强大、兼容性好 | -### 2.2 为什么选择 WPF + .NET Framework 4.8? +### 2.2 为什么选择 WPF + .NET Framework 4.6.2? ``` -✅ Win7原生支持 - Windows 7 SP1 已内置 .NET Framework 4.8,无需安装运行时 +✅ Win7原生支持 - Windows 7 SP1 已内置 .NET Framework 4.6.2,无需安装运行时 ✅ 性能极佳 - 原生编译,启动时间 <1秒 ✅ 内存占用低 - ~50MB(vs Electron ~200MB) ✅ 包体极小 - ~5MB(vs Electron ~150MB) @@ -106,7 +106,7 @@ ``` ┌─────────────────────────────────────────────────────────────┐ -│ 桌面客户端 (WPF + .NET Framework 4.8) │ +│ 桌面客户端 (WPF + .NET Framework 4.6.2) │ ├─────────────────────────────────────────────────────────────┤ │ 视图层 (Views/XAML) │ │ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │ @@ -138,7 +138,7 @@ ```csharp // ViewModel -> View 数据绑定示例 -// 使用 CommunityToolkit.Mvvm (兼容 .NET Framework 4.8) +// 使用 CommunityToolkit.Mvvm (兼容 .NET Framework 4.6.2) using CommunityToolkit.Mvvm.ComponentModel; using CommunityToolkit.Mvvm.Input; using System.Collections.ObjectModel; @@ -1477,7 +1477,7 @@ public class ShipOrderRequest WinExe PackagingMallShipper PackagingMallShipper - v4.8 + v4.6.2 7.3 true true @@ -1560,7 +1560,7 @@ public class ShipOrderRequest | 风险 | 概率 | 影响 | 对策 | |-----|:----:|:----:|------| | API工厂接口变更 | 低 | 高 | 封装API层,便于统一修改 | -| Win7特殊兼容问题 | 低 | 低 | .NET Framework 4.8 原生支持,风险极低 | +| Win7特殊兼容问题 | 低 | 低 | .NET Framework 4.6.2 原生支持,风险极低 | | SQLite性能瓶颈 | 低 | 中 | 添加索引,分页查询,异步操作 | | 离线发货冲突 | 中 | 中 | 发货前先同步,提示用户确认 | | VS2019 在 Win7 卡顿 | 中 | 低 | 关闭不必要的扩展,使用轻量配置 | @@ -1639,7 +1639,7 @@ public class ExpressCompany 运行环境要求: - Windows 7 SP1 或更高版本 -- .NET Framework 4.8(Win7 已内置,无需单独安装) +- .NET Framework 4.6.2(Win7 已内置,无需单独安装) 文件清单: ├── PackagingMallShipper.exe # 主程序