Files
crown/Update/Config.h
T
admin aa59132330 Rewrite Update module and update client/server sources
Update: drop Qt dependency, rewrite as pure Win32 using v142 toolset. Replace Update.ui/qrc and miniz-based Zip with Api/Crypto/Http/Json/Unzip/UpdateWindow modules.

CrownClient/CrownServer: update Verify and main sources, retarget x64 configs to v142 (VS2019) with SDK 10.0.19041.0, fix VMProtect SDK paths.
2026-10-17 16:31:54 +08:00

82 lines
2.8 KiB
C
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#pragma once
// 编译期配置:按实际情况修改下面几个宏后重新编译
// 服务端地址(末尾不要带斜杠)
#ifndef UPDATER_SERVER_URL
#define UPDATER_SERVER_URL L"https://gendan.xyz"
#endif
// 应用 AppKey,取自 verify 后台 -> 应用 -> AppKey
#ifndef UPDATER_APP_KEY
#define UPDATER_APP_KEY L"abab3280114bfe824acfdbc6255538fb"
#endif
// 通信加密方式:0 = 不加密,1 = RC4,2 = AES-256-GCM
// 取自 verify 后台 -> 应用 -> 安全设置 -> 加密方式
#ifndef UPDATER_ENCRYPT_TYPE
#define UPDATER_ENCRYPT_TYPE 2
#endif
// 通信密钥,取自 verify 后台 -> 应用 -> 安全设置 -> 加密密钥
// 服务端用 AES-GCM 加密整个响应体,密钥不对会直接解密失败
#ifndef UPDATER_ENCRYPT_KEY
#define UPDATER_ENCRYPT_KEY L"07dab7c3c772a8a8f2dad3f45e2e397806d92f560ac954532ee7562a03c1df14"
#endif
// 窗口标题
#ifndef UPDATER_TITLE
#define UPDATER_TITLE L"自动更新"
#endif
// 更新完成后拉起的程序(相对更新目录),留空则不拉起
#ifndef UPDATER_LAUNCH_EXE
#define UPDATER_LAUNCH_EXE L"金运来客户端2.exe"
#endif
// 应用名称,显示在安装目录选择界面上
#ifndef UPDATER_APP_NAME
#define UPDATER_APP_NAME L"金运来皇冠跟单软件"
#endif
// 完整包安装时建议的默认目录,留空则用更新器自身所在目录
// (更新器由主程序从自身目录启动,所以默认就是主程序所在目录)
#ifndef UPDATER_DEFAULT_INSTALL_DIR
#define UPDATER_DEFAULT_INSTALL_DIR L""
#endif
// 更新目标目录,留空表示更新器自身所在目录(完整包模式下会先让用户选择)
#ifndef UPDATER_TARGET_DIR
#define UPDATER_TARGET_DIR L""
#endif
// 是否校验下载包的 SHA256(与服务端返回的 file_hash 比对)
#ifndef UPDATER_VERIFY_HASH
#define UPDATER_VERIFY_HASH 1
#endif
// 下载时是否允许使用系统代理
#ifndef UPDATER_USE_PROXY
#define UPDATER_USE_PROXY 1
#endif
// 更新前等待主程序退出的秒数(0 表示不等待)
#ifndef UPDATER_WAIT_EXIT_SEC
#define UPDATER_WAIT_EXIT_SEC 10
#endif
// 网络超时(秒)
#define UPDATER_TIMEOUT_SEC 30
// 窗口尺寸
#define UPDATER_WINDOW_WIDTH 860
#define UPDATER_WINDOW_HEIGHT 480
// 静默检查(--check-only)的退出码,主程序据此决定继续启动还是交给更新器
#define UPDATER_EXIT_NO_UPDATE 0 // 已是最新,主程序正常往下走
#define UPDATER_EXIT_HAS_UPDATE 1 // 有更新,主程序拉起更新器后退出
#define UPDATER_EXIT_FAILED 2 // 检查失败(网络异常/解密失败/解析失败)
#define UPDATER_EXIT_BAD_VERSION 3 // 服务端不认识这个版本(HTTP 400 版本号参数错误),只能整包重装
// 主程序收到“检查失败”时是否放行由主程序决定(默认放行,避免断网把用户挡在门外)