修复启动时误弹出 Update 界面
Update: 新增 --full/-f,整包模式改由显式标志指定。原判定 clientVersion.empty() 会让 check-update 缺少 version 参数,服务端返回 400「版本号参数错误」。CrownServer/CrownClient: 退出码 3(badVersion) 归入放行,不再打断启动;整包分支补上 --version。CrownClient.rc: 版本 1.0.6.8 -> 1.0.7.8 与服务端对齐,后台无 1.0.6.8 会导致客户端一直被判为版本不认。
This commit is contained in:
+11
-1
@@ -68,12 +68,20 @@ int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE /*prev*/, LPWSTR /*cmdLine*/
|
||||
options.appKey = UPDATER_APP_KEY;
|
||||
options.targetDir = UPDATER_TARGET_DIR;
|
||||
|
||||
// --full / -f:显式要求整包安装,区别于"没传版本号"的隐含整包
|
||||
bool forceFull = false;
|
||||
|
||||
// 无命令行参数 = 完整包更新;有参数则按传入信息检查版本并更新补丁包
|
||||
if (args.empty()) {
|
||||
options.fullMode = true;
|
||||
} else {
|
||||
std::vector<std::wstring> positional;
|
||||
for (size_t i = 0; i < args.size(); ++i) {
|
||||
if (args[i] == L"--full" || args[i] == L"-f") {
|
||||
forceFull = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
std::wstring key = updater::Utils::Trim(ArgValue(args, i, L"--app-key", L"-k"));
|
||||
if (!key.empty()) { options.appKey = key; continue; }
|
||||
|
||||
@@ -93,7 +101,9 @@ int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE /*prev*/, LPWSTR /*cmdLine*/
|
||||
if (positional.size() >= 2) options.clientVersion = positional[1];
|
||||
if (positional.size() >= 3) options.targetDir = positional[2];
|
||||
|
||||
options.fullMode = options.clientVersion.empty();
|
||||
// 空版本号会让 check-update 缺少 version 参数,被服务端判为"版本号参数错误"。
|
||||
// 整包模式改由 --full 显式指定,这样版本号可以始终带上
|
||||
options.fullMode = forceFull || options.clientVersion.empty();
|
||||
}
|
||||
|
||||
if (checkOnly) {
|
||||
|
||||
Reference in New Issue
Block a user