feat: 完善登录验证码、订单同步和打包功能
- 添加验证码登录支持(图形验证码显示和输入) - 修复订单同步,正确解析收件人信息(从logisticses合并) - 修复API端点配置(user.api.it120.cc) - 添加Costura.Fody实现单文件EXE打包 - 添加应用图标(app.ico) - 添加Inno Setup安装脚本(支持Win7+) - 暂时禁用导入发货功能 - 添加.gitignore文件 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
148
setup.iss
Normal file
148
setup.iss
Normal file
@@ -0,0 +1,148 @@
|
||||
; Inno Setup Script for 包装商城发货助手
|
||||
; Requires Inno Setup 6.x
|
||||
|
||||
#define MyAppName "包装商城发货助手"
|
||||
#define MyAppVersion "1.0.0"
|
||||
#define MyAppPublisher "PackagingMall"
|
||||
#define MyAppExeName "PackagingMallShipper.exe"
|
||||
|
||||
[Setup]
|
||||
; 应用程序信息
|
||||
AppId={{A1B2C3D4-E5F6-7890-ABCD-EF1234567890}
|
||||
AppName={#MyAppName}
|
||||
AppVersion={#MyAppVersion}
|
||||
AppPublisher={#MyAppPublisher}
|
||||
DefaultDirName={autopf}\{#MyAppName}
|
||||
DefaultGroupName={#MyAppName}
|
||||
AllowNoIcons=yes
|
||||
; 输出设置
|
||||
OutputDir=installer
|
||||
OutputBaseFilename=PackagingMallShipper_Setup_v{#MyAppVersion}
|
||||
; 压缩设置
|
||||
Compression=lzma2/ultra64
|
||||
SolidCompression=yes
|
||||
; 权限设置
|
||||
PrivilegesRequired=admin
|
||||
; 系统要求 - Windows 7 SP1 或更高版本
|
||||
MinVersion=6.1.7601
|
||||
; 安装向导设置
|
||||
WizardStyle=modern
|
||||
DisableProgramGroupPage=yes
|
||||
; 卸载设置
|
||||
UninstallDisplayName={#MyAppName}
|
||||
UninstallDisplayIcon={app}\{#MyAppExeName}
|
||||
|
||||
[Languages]
|
||||
Name: "chinesesimplified"; MessagesFile: "compiler:Languages\ChineseSimplified.isl"
|
||||
|
||||
[Tasks]
|
||||
Name: "desktopicon"; Description: "创建桌面快捷方式"; GroupDescription: "附加选项:"; Flags: checkedonce
|
||||
|
||||
[Files]
|
||||
; 主程序
|
||||
Source: "publish\PackagingMallShipper.exe"; DestDir: "{app}"; Flags: ignoreversion
|
||||
Source: "publish\PackagingMallShipper.exe.config"; DestDir: "{app}"; Flags: ignoreversion
|
||||
; 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
|
||||
|
||||
[Icons]
|
||||
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
|
||||
Name: "{group}\卸载 {#MyAppName}"; Filename: "{uninstallexe}"
|
||||
Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
|
||||
|
||||
[Run]
|
||||
; 安装完成后运行程序
|
||||
Filename: "{app}\{#MyAppExeName}"; Description: "运行 {#MyAppName}"; Flags: nowait postinstall skipifsilent
|
||||
|
||||
[Code]
|
||||
// 检查 .NET Framework 4.8 是否已安装
|
||||
function IsDotNetInstalled: Boolean;
|
||||
var
|
||||
Release: Cardinal;
|
||||
begin
|
||||
Result := False;
|
||||
// .NET Framework 4.8 的 Release 值为 528040 或更高
|
||||
if RegQueryDWordValue(HKLM, 'SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full', 'Release', Release) then
|
||||
begin
|
||||
Result := (Release >= 528040);
|
||||
end;
|
||||
end;
|
||||
|
||||
// 获取 .NET Framework 版本描述
|
||||
function GetDotNetVersionStr: String;
|
||||
var
|
||||
Release: Cardinal;
|
||||
begin
|
||||
Result := '未安装';
|
||||
if RegQueryDWordValue(HKLM, 'SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full', 'Release', Release) then
|
||||
begin
|
||||
if Release >= 533320 then
|
||||
Result := '4.8.1 或更高'
|
||||
else if Release >= 528040 then
|
||||
Result := '4.8'
|
||||
else if Release >= 461808 then
|
||||
Result := '4.7.2'
|
||||
else if Release >= 461308 then
|
||||
Result := '4.7.1'
|
||||
else if Release >= 460798 then
|
||||
Result := '4.7'
|
||||
else if Release >= 394802 then
|
||||
Result := '4.6.2'
|
||||
else if Release >= 394254 then
|
||||
Result := '4.6.1'
|
||||
else if Release >= 393295 then
|
||||
Result := '4.6'
|
||||
else
|
||||
Result := '4.5.x 或更低';
|
||||
end;
|
||||
end;
|
||||
|
||||
// 初始化安装向导
|
||||
function InitializeSetup: Boolean;
|
||||
var
|
||||
ErrorCode: Integer;
|
||||
NetVersion: String;
|
||||
begin
|
||||
Result := True;
|
||||
|
||||
// 检查 .NET Framework
|
||||
if not IsDotNetInstalled then
|
||||
begin
|
||||
NetVersion := GetDotNetVersionStr;
|
||||
|
||||
if MsgBox('此程序需要 .NET Framework 4.8 才能运行。' + #13#10 + #13#10 +
|
||||
'当前检测到的版本: ' + NetVersion + #13#10 + #13#10 +
|
||||
'是否要打开微软官网下载 .NET Framework 4.8?' + #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);
|
||||
end;
|
||||
|
||||
Result := MsgBox('是否仍要继续安装?' + #13#10 + #13#10 +
|
||||
'注意:如果没有安装 .NET Framework 4.8,程序将无法运行。',
|
||||
mbConfirmation, MB_YESNO) = IDYES;
|
||||
end;
|
||||
end;
|
||||
|
||||
// 卸载时清理数据目录(可选)
|
||||
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
|
||||
var
|
||||
DataDir: String;
|
||||
begin
|
||||
if CurUninstallStep = usPostUninstall then
|
||||
begin
|
||||
DataDir := ExpandConstant('{localappdata}\PackagingMallShipper');
|
||||
if DirExists(DataDir) then
|
||||
begin
|
||||
if MsgBox('是否删除程序数据(包括本地缓存的订单数据)?', mbConfirmation, MB_YESNO) = IDYES then
|
||||
begin
|
||||
DelTree(DataDir, True, True, True);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
Reference in New Issue
Block a user