forked from Mirrors/openclonk
Renamed IsWindowsVista to IsWindowsWithUAC including Windows 7
parent
2b33c734a3
commit
50e16e8cfc
|
@ -147,7 +147,7 @@ void C4UpdateDlg::UpdateText()
|
||||||
// --------------------------------------------------
|
// --------------------------------------------------
|
||||||
// static update application function
|
// static update application function
|
||||||
|
|
||||||
static bool IsWindowsVista()
|
static bool IsWindowsWithUAC()
|
||||||
{
|
{
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
// Determine windows version
|
// Determine windows version
|
||||||
|
@ -155,7 +155,7 @@ static bool IsWindowsVista()
|
||||||
ver.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
|
ver.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
|
||||||
bool fWindowsXP = false;
|
bool fWindowsXP = false;
|
||||||
if (GetVersionEx((LPOSVERSIONINFO) &ver))
|
if (GetVersionEx((LPOSVERSIONINFO) &ver))
|
||||||
return ((ver.dwMajorVersion == 6) && (ver.dwMinorVersion == 0));
|
return (ver.dwMajorVersion == 6);
|
||||||
#endif
|
#endif
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -189,8 +189,8 @@ bool C4UpdateDlg::ApplyUpdate(const char *strUpdateFile, bool fDeleteUpdate, C4G
|
||||||
if (SEqual(C4_OS, "win32")) strUpdateProg += ".exe";
|
if (SEqual(C4_OS, "win32")) strUpdateProg += ".exe";
|
||||||
// Determine name of local extract of update program
|
// Determine name of local extract of update program
|
||||||
StdStrBuf strUpdateProgEx; strUpdateProgEx.Copy(strUpdateProg);
|
StdStrBuf strUpdateProgEx; strUpdateProgEx.Copy(strUpdateProg);
|
||||||
// Windows Vista: rename update program to setup.exe for UAC elevation and in temp path
|
// Windows Vista/7: rename update program to setup.exe for UAC elevation and in temp path
|
||||||
if (IsWindowsVista()) strUpdateProgEx.Copy(Config.AtTempPath("setup.exe"));
|
if (IsWindowsWithUAC()) strUpdateProgEx.Copy(Config.AtTempPath("setup.exe"));
|
||||||
// Extract update program (the update should be applied using the new version)
|
// Extract update program (the update should be applied using the new version)
|
||||||
C4Group UpdateGroup, SubGroup;
|
C4Group UpdateGroup, SubGroup;
|
||||||
char strSubGroup[1024+1];
|
char strSubGroup[1024+1];
|
||||||
|
|
Loading…
Reference in New Issue