Skip to content

Commit

Permalink
feat: add testing update channel
Browse files Browse the repository at this point in the history
  • Loading branch information
fxliang committed Jul 23, 2024
1 parent a6c3e99 commit 4196d35
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
Binary file modified WeaselServer/WeaselServer.rc
Binary file not shown.
6 changes: 6 additions & 0 deletions WeaselServer/WeaselServerApp.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ class WeaselServerApp {
static bool check_update() {
// when checked manually, show testing versions too
std::string feed_url = GetCustomResource("ManualUpdateFeedURL", "APPCAST");
std::wstring channel{};
auto ret = RegGetStringValue(HKEY_CURRENT_USER, L"Software\\Rime\\Weasel",
L"UpdateChannel", channel);
if (!ret && channel == L"testing") {
feed_url = GetCustomResource("TestingManualUpdateFeedURL", "APPCAST");
}
if (!feed_url.empty()) {
win_sparkle_set_appcast_url(feed_url.c_str());
}
Expand Down
8 changes: 8 additions & 0 deletions WeaselSetup/WeaselSetup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,14 @@ static int Run(LPTSTR lpCmdLine) {
L"CheckForUpdates", L"0", REG_SZ);
}

if (!wcscmp(L"/testing", lpCmdLine)) {
return SetRegKeyValue(HKEY_CURRENT_USER, L"Software\\Rime\\weasel",
L"UpdateChannel", L"testing", REG_SZ);
}
if (!wcscmp(L"/release", lpCmdLine)) {
return SetRegKeyValue(HKEY_CURRENT_USER, L"Software\\Rime\\weasel",
L"UpdateChannel", L"release", REG_SZ);
}
bool hans = !wcscmp(L"/s", lpCmdLine);
if (hans)
return install(false, silent, old_ime_support);
Expand Down

0 comments on commit 4196d35

Please sign in to comment.