mirror of
https://github.com/moparisthebest/hexchat
synced 2024-11-29 12:42:16 -05:00
Separate version check for XP, we might need it during the transition to VS2012
This commit is contained in:
parent
6bdbbbea83
commit
cd2f775fe4
@ -35,6 +35,7 @@ static char name[] = "Update Checker";
|
|||||||
static char desc[] = "Check for HexChat updates automatically";
|
static char desc[] = "Check for HexChat updates automatically";
|
||||||
static char version[] = "4.0";
|
static char version[] = "4.0";
|
||||||
static const char upd_help[] = "Update Checker Usage:\n /UPDCHK, check for HexChat updates\n /UPDCHK SET delay|freq, set startup delay or check frequency\n";
|
static const char upd_help[] = "Update Checker Usage:\n /UPDCHK, check for HexChat updates\n /UPDCHK SET delay|freq, set startup delay or check frequency\n";
|
||||||
|
static int legacy_os = 0;
|
||||||
|
|
||||||
static char*
|
static char*
|
||||||
check_version ()
|
check_version ()
|
||||||
@ -120,6 +121,19 @@ check_version ()
|
|||||||
return "Unknown";
|
return "Unknown";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (legacy_os)
|
||||||
|
{
|
||||||
|
hResource = HttpOpenRequest (hConnect,
|
||||||
|
TEXT ("GET"),
|
||||||
|
TEXT ("/hexchat/hexchat/master/win32/version-xp.txt"),
|
||||||
|
TEXT ("HTTP/1.0"),
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
INTERNET_FLAG_SECURE | INTERNET_FLAG_NO_CACHE_WRITE | INTERNET_FLAG_RELOAD | INTERNET_FLAG_NO_AUTH,
|
||||||
|
0);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
hResource = HttpOpenRequest (hConnect,
|
hResource = HttpOpenRequest (hConnect,
|
||||||
TEXT ("GET"),
|
TEXT ("GET"),
|
||||||
TEXT ("/hexchat/hexchat/master/win32/version.txt"),
|
TEXT ("/hexchat/hexchat/master/win32/version.txt"),
|
||||||
@ -128,6 +142,9 @@ check_version ()
|
|||||||
NULL,
|
NULL,
|
||||||
INTERNET_FLAG_SECURE | INTERNET_FLAG_NO_CACHE_WRITE | INTERNET_FLAG_RELOAD | INTERNET_FLAG_NO_AUTH,
|
INTERNET_FLAG_SECURE | INTERNET_FLAG_NO_CACHE_WRITE | INTERNET_FLAG_RELOAD | INTERNET_FLAG_NO_AUTH,
|
||||||
0);
|
0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (!hResource)
|
if (!hResource)
|
||||||
{
|
{
|
||||||
InternetCloseHandle (hConnect);
|
InternetCloseHandle (hConnect);
|
||||||
@ -286,12 +303,21 @@ int
|
|||||||
hexchat_plugin_init (hexchat_plugin *plugin_handle, char **plugin_name, char **plugin_desc, char **plugin_version, char *arg)
|
hexchat_plugin_init (hexchat_plugin *plugin_handle, char **plugin_name, char **plugin_desc, char **plugin_version, char *arg)
|
||||||
{
|
{
|
||||||
int delay;
|
int delay;
|
||||||
|
OSVERSIONINFOEX osvi;
|
||||||
ph = plugin_handle;
|
ph = plugin_handle;
|
||||||
|
|
||||||
*plugin_name = name;
|
*plugin_name = name;
|
||||||
*plugin_desc = desc;
|
*plugin_desc = desc;
|
||||||
*plugin_version = version;
|
*plugin_version = version;
|
||||||
|
|
||||||
|
osvi.dwOSVersionInfoSize = sizeof (OSVERSIONINFOEX);
|
||||||
|
GetVersionEx ((OSVERSIONINFO*) &osvi);
|
||||||
|
|
||||||
|
if (osvi.dwMajorVersion == 5)
|
||||||
|
{
|
||||||
|
legacy_os = 1;
|
||||||
|
}
|
||||||
|
|
||||||
/* these are required for the very first run */
|
/* these are required for the very first run */
|
||||||
delay = hexchat_pluginpref_get_int (ph, "delay");
|
delay = hexchat_pluginpref_get_int (ph, "delay");
|
||||||
if (delay == -1)
|
if (delay == -1)
|
||||||
|
1
version-xp.txt
Normal file
1
version-xp.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
2.9.4
|
Loading…
Reference in New Issue
Block a user