Renamed IsWindowsVista to IsWindowsWithUAC including Windows 7

Benedict Etzel 2010-11-27 14:32:48 +01:00
parent 2b33c734a3
commit 50e16e8cfc
1 changed files with 4 additions and 4 deletions

View File

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