OSDN Git Service

Updated the installer script.
[x264-launcher/x264-launcher.git] / etc / check_os.nsh
1 !include "WinVer.nsh"
2
3 Function .onInit
4         System::Call 'kernel32::CreateMutexA(i 0, i 0, t "{79d6a7e5-35af-47b1-a7d6-f20d0e5df772}") i .r1 ?e'
5         Pop $0
6         ${If} $0 <> 0
7                 MessageBox MB_ICONSTOP|MB_TOPMOST "Sorry, the installer is already running!"
8                 Quit
9         ${EndIf}
10         
11         ; --------
12         
13         ${IfNot} ${IsNT}
14                 MessageBox MB_TOPMOST|MB_ICONSTOP "Sorry, this application does NOT support Windows 9x !!!"
15                 Quit
16         ${EndIf}
17         
18         ${IfNot} ${AtLeastWinXP}
19                 MessageBox MB_TOPMOST|MB_ICONSTOP "Sorry, this application requires Windows XP or later!"
20                 Quit
21         ${EndIf}
22
23         ${If} ${IsWinXP}
24         ${AndIf} ${AtMostServicePack} 1
25                 MessageBox MB_TOPMOST|MB_ICONSTOP "Sorry, this application requires Service-Pack 2 for Windows XP or later!"
26                 ExecShell "open" "http://www.microsoft.com/download/en/details.aspx?id=24"
27                 Quit
28         ${EndIf}
29         
30         ; --------
31         
32         UserInfo::GetAccountType
33         Pop $0
34         ${If} $0 != "Admin"
35                 MessageBox MB_ICONSTOP|MB_TOPMOST "Your system requires administrative permissions in order to install this software."
36                 Quit
37         ${EndIf}
38 FunctionEnd