2006-07-12 11:03:00 +00:00
|
|
|
/*
|
|
|
|
|
|
|
|
Checks for Windows version
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
2006-10-02 17:21:20 +00:00
|
|
|
;--------------------------------
|
|
|
|
;Macros
|
2006-07-12 11:03:00 +00:00
|
|
|
|
2006-10-02 17:21:20 +00:00
|
|
|
!macro CheckPrivileges
|
2006-07-12 11:03:00 +00:00
|
|
|
|
|
|
|
Push $R0
|
|
|
|
|
|
|
|
UserInfo::GetAccountType
|
|
|
|
Pop $R0
|
|
|
|
|
|
|
|
${if} $R0 == "Admin"
|
|
|
|
StrCpy $AdminOrPowerUser ${TRUE}
|
|
|
|
${elseif} $R0 == "Power"
|
|
|
|
StrCpy $AdminOrPowerUser ${TRUE}
|
|
|
|
${else}
|
|
|
|
StrCpy $AdminOrPowerUser ${FALSE}
|
|
|
|
${endif}
|
|
|
|
|
2006-10-02 17:21:20 +00:00
|
|
|
Pop $R0
|
|
|
|
|
|
|
|
!macroend
|
|
|
|
|
|
|
|
;--------------------------------
|
|
|
|
;Functions
|
|
|
|
|
|
|
|
Function CheckPrivileges
|
|
|
|
!insertmacro CheckPrivileges
|
|
|
|
FunctionEnd
|
|
|
|
|
|
|
|
Function un.CheckPrivileges
|
|
|
|
!insertmacro CheckPrivileges
|
|
|
|
FunctionEnd
|
|
|
|
|
|
|
|
Function CheckWindows
|
|
|
|
|
|
|
|
;Check for Windows NT 5.0 or later (2000, XP, 2003 etc.)
|
|
|
|
|
2006-10-21 22:53:19 +00:00
|
|
|
${unless} ${IsNT}
|
|
|
|
${andunless} ${AtLeastWin2000}
|
|
|
|
|
2006-10-02 17:21:20 +00:00
|
|
|
MessageBox MB_OK|MB_ICONSTOP "${APP_NAME} ${APP_VERSION} only supports Windows 2000, XP, 2003 and later."
|
2006-10-21 22:53:19 +00:00
|
|
|
|
2006-10-02 17:21:20 +00:00
|
|
|
${endif}
|
|
|
|
|
2006-07-12 11:03:00 +00:00
|
|
|
FunctionEnd
|
|
|
|
|
2006-09-22 22:30:06 +00:00
|
|
|
Function UpdatePathEnvironment
|
|
|
|
|
|
|
|
Push $R0
|
|
|
|
Push $R1
|
|
|
|
|
|
|
|
;Updates the path environment variable of the instaler process to the latest system value
|
|
|
|
|
|
|
|
ReadRegStr $R0 HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" Path
|
|
|
|
ReadRegStr $R1 HKCU "Environment" Path
|
|
|
|
|
|
|
|
System::Call 'kernel32::SetEnvironmentVariableA(t, t) i("Path", "$R0;$R1").r0'
|
|
|
|
|
|
|
|
Pop $R1
|
|
|
|
Pop $R0
|
|
|
|
|
|
|
|
FunctionEnd
|