lyx_mirror/development/Win32/packaging/installer/include/windows.nsh
Joost Verburg 0b0a643aef * New launcher to setup the environment and run LyX. No more flashing console windows and more reliable configuration.
* Initial main window geometry is calculated based on monitor resolution.
* Solved problems with character sets of translations. The latest gettext and libiconv are required. Uploaded patches for Windows/MSVC 2005.
* Default instant preview size matches default font size.
* Included version information resources.
* Corrected language names.
* Installer code improvements.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_4_X@15461 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-21 22:53:19 +00:00

69 lines
1.3 KiB
Plaintext

/*
Checks for Windows version
*/
;--------------------------------
;Macros
!macro CheckPrivileges
Push $R0
UserInfo::GetAccountType
Pop $R0
${if} $R0 == "Admin"
StrCpy $AdminOrPowerUser ${TRUE}
${elseif} $R0 == "Power"
StrCpy $AdminOrPowerUser ${TRUE}
${else}
StrCpy $AdminOrPowerUser ${FALSE}
${endif}
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.)
${unless} ${IsNT}
${andunless} ${AtLeastWin2000}
MessageBox MB_OK|MB_ICONSTOP "${APP_NAME} ${APP_VERSION} only supports Windows 2000, XP, 2003 and later."
${endif}
FunctionEnd
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