Skip to content

Commit 9a23cb6

Browse files
brlironDoremyR3d
authored andcommitted
self update: hardcode the thcrap download page URL.
We removed the dependency on base_tsa for the version number, so we don't want to keep a small dependency like that. And now we update *before* loading the patches, so it was broken.
1 parent 26bd8aa commit 9a23cb6

File tree

4 files changed

+7
-2
lines changed

4 files changed

+7
-2
lines changed

thcrap/src/global.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ const char* PROJECT_NAME_SHORT(void)
2020
{
2121
return "thcrap";
2222
}
23+
const char* PROJECT_URL(void)
24+
{
25+
return "https://www.thpatch.net/wiki/Touhou_Patch_Center:Download";
26+
}
2327
DWORD PROJECT_VERSION(void)
2428
{
2529
return 0x20191005;

thcrap/src/global.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ extern json_t *run_cfg;
1414
// Project stats
1515
const char* PROJECT_NAME(void);
1616
const char* PROJECT_NAME_SHORT(void);
17+
const char* PROJECT_URL(void);
1718
DWORD PROJECT_VERSION(void);
1819
const char* PROJECT_VERSION_STRING(void);
1920
const char* PROJECT_BRANCH(void);

thcrap/thcrap.def

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ EXPORTS
6565
; -------
6666
PROJECT_NAME
6767
PROJECT_NAME_SHORT
68+
PROJECT_URL
6869
PROJECT_VERSION
6970
PROJECT_VERSION_STRING
7071
PROJECT_BRANCH

thcrap_update/src/notify.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,15 +151,14 @@ int update_notify_thcrap(void)
151151
self_body[ret]
152152
);
153153

154-
const char* thcrap_url = json_object_get_string(run_cfg, "thcrap_url");
155154
if(ret == SELF_NO_SIG || ret == SELF_SIG_FAIL) {
156155
strings_strcat(SELF_MSG_SLOT, self_sig_error);
157156
}
158157
strings_replace(SELF_MSG_SLOT, "${project}", PROJECT_NAME());
159158
strings_replace(SELF_MSG_SLOT, "${project_short}", PROJECT_NAME_SHORT());
160159
strings_replace(SELF_MSG_SLOT, "${build}", self_get_target_version());
161160
strings_replace(SELF_MSG_SLOT, "${thcrap_dir}", thcrap_dir);
162-
strings_replace(SELF_MSG_SLOT, "${desc_url}", thcrap_url);
161+
strings_replace(SELF_MSG_SLOT, "${desc_url}", PROJECT_URL());
163162
self_msg = strings_replace(SELF_MSG_SLOT, "${arc_fn}", arc_fn);
164163

165164
// Write message

0 commit comments

Comments
 (0)