]> git.lyx.org Git - lyx.git/blob - development/Win32/packaging/installer/include/windows.nsh
57633d56eee5cca55a2419747586c2fa7575cd70
[lyx.git] / development / Win32 / packaging / installer / include / windows.nsh
1 /*
2
3 Checks for Windows version
4
5 */
6
7 ;--------------------------------
8 ;Macros
9
10 !macro CheckPrivileges
11
12   Push $R0
13
14   UserInfo::GetAccountType
15   Pop $R0
16   
17   ${if} $R0 == "Admin"
18     StrCpy $AdminOrPowerUser ${TRUE}
19   ${elseif} $R0 == "Power"
20     StrCpy $AdminOrPowerUser ${TRUE}
21   ${else}
22     StrCpy $AdminOrPowerUser ${FALSE}
23   ${endif}
24   
25   Pop $R0
26
27 !macroend
28
29 ;--------------------------------
30 ;Functions
31
32 Function CheckPrivileges
33   !insertmacro CheckPrivileges
34 FunctionEnd
35
36 Function un.CheckPrivileges
37   !insertmacro CheckPrivileges
38 FunctionEnd
39
40 Function CheckWindows
41
42   ;Check for Windows NT 5.0 or later (2000, XP, 2003 etc.)
43
44   ${unless} ${IsNT}
45     ${andunless} ${AtLeastWin2000}
46
47     MessageBox MB_OK|MB_ICONSTOP "${APP_NAME} ${APP_VERSION} only supports Windows 2000, XP, 2003 and later."
48
49   ${endif}
50
51 FunctionEnd
52
53 Function UpdatePathEnvironment
54
55   Push $R0
56   Push $R1
57   
58   ;Updates the path environment variable of the instaler process to the latest system value
59   
60   ReadRegStr $R0 HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" Path
61   ReadRegStr $R1 HKCU "Environment" Path
62   
63   System::Call 'kernel32::SetEnvironmentVariableA(t, t) i("Path", "$R0;$R1").r0'
64   
65   Pop $R1
66   Pop $R0
67
68 FunctionEnd