chore: 降级到 .NET Framework 4.6.2 以支持 Windows 7

- 将 TargetFramework 从 net48 改为 net462
- 更新 setup.iss 中的 .NET 版本检测为 4.6.2
- 修改安装程序提示信息和下载链接

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Administrator
2025-12-18 10:04:36 +08:00
parent a1208eeaca
commit 9b11baba63
2 changed files with 11 additions and 11 deletions

View File

@@ -2,7 +2,7 @@
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net48</TargetFramework>
<TargetFramework>net462</TargetFramework>
<RootNamespace>PackagingMallShipper</RootNamespace>
<AssemblyName>PackagingMallShipper</AssemblyName>
<UseWPF>true</UseWPF>

View File

@@ -45,8 +45,8 @@ Source: "publish\PackagingMallShipper.exe.config"; DestDir: "{app}"; Flags: igno
; SQLite 本地库
Source: "publish\x64\SQLite.Interop.dll"; DestDir: "{app}\x64"; Flags: ignoreversion
Source: "publish\x86\SQLite.Interop.dll"; DestDir: "{app}\x86"; Flags: ignoreversion
; .NET Framework 4.8 离线安装包(可选,取消注释以包含)
; Source: "redist\ndp48-x86-x64-allos-enu.exe"; DestDir: "{tmp}"; Flags: deleteafterinstall; Check: not IsDotNetInstalled
; .NET Framework 4.6.2 离线安装包(可选,取消注释以包含)
; Source: "redist\NDP462-KB3151800-x86-x64-AllOS-ENU.exe"; DestDir: "{tmp}"; Flags: deleteafterinstall; Check: not IsDotNetInstalled
[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
@@ -58,16 +58,16 @@ Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: de
Filename: "{app}\{#MyAppExeName}"; Description: "运行 {#MyAppName}"; Flags: nowait postinstall skipifsilent
[Code]
// 检查 .NET Framework 4.8 是否已安装
// 检查 .NET Framework 4.6.2 是否已安装
function IsDotNetInstalled: Boolean;
var
Release: Cardinal;
begin
Result := False;
// .NET Framework 4.8 的 Release 值为 528040 或更高
// .NET Framework 4.6.2 的 Release 值为 394802 或更高
if RegQueryDWordValue(HKLM, 'SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full', 'Release', Release) then
begin
Result := (Release >= 528040);
Result := (Release >= 394802);
end;
end;
@@ -113,18 +113,18 @@ begin
begin
NetVersion := GetDotNetVersionStr;
if MsgBox('此程序需要 .NET Framework 4.8 才能运行。' + #13#10 + #13#10 +
if MsgBox('此程序需要 .NET Framework 4.6.2 才能运行。' + #13#10 + #13#10 +
'当前检测到的版本: ' + NetVersion + #13#10 + #13#10 +
'是否要打开微软官网下载 .NET Framework 4.8' + #13#10 +
'是否要打开微软官网下载 .NET Framework 4.6.2' + #13#10 +
'(下载完成后请先安装运行时,再重新运行此安装程序)',
mbConfirmation, MB_YESNO) = IDYES then
begin
// 打开 .NET Framework 4.8 下载页面
ShellExec('open', 'https://dotnet.microsoft.com/download/dotnet-framework/net48', '', '', SW_SHOW, ewNoWait, ErrorCode);
// 打开 .NET Framework 4.6.2 下载页面
ShellExec('open', 'https://dotnet.microsoft.com/download/dotnet-framework/net462', '', '', SW_SHOW, ewNoWait, ErrorCode);
end;
Result := MsgBox('是否仍要继续安装?' + #13#10 + #13#10 +
'注意:如果没有安装 .NET Framework 4.8,程序将无法运行。',
'注意:如果没有安装 .NET Framework 4.6.2,程序将无法运行。',
mbConfirmation, MB_YESNO) = IDYES;
end;
end;