forked from sonyps5201314/msvcr14x
-
Notifications
You must be signed in to change notification settings - Fork 0
/
check_prerequisite.vbs
79 lines (67 loc) · 3.61 KB
/
check_prerequisite.vbs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
Sub CheckPrerequisite()
On Error Resume Next
Dim objShell 'As WshShell
Set objShell = CreateObject("WScript.Shell")
Dim fs 'As FileSystemObject
Set fs = CreateObject("Scripting.FileSystemObject")
fs.DeleteFile("CheckPrerequisite_Result.txt")
Dim ExeProc 'As WshExec
Set ExeProc = objShell.Exec("git.exe")
If ExeProc Is Nothing Then
MsgBox "Please install git for windows first!", vbCritical, "msvcr14x"
objShell.Run ("https://git-scm.com/download/win")
Exit Sub
End If
Dim VS_EDITION
VS_EDITION = objShell.Environment("Process").Item("VS_EDITION")
If Len(VS_EDITION) = 0 then
VS_EDITION = "Enterprise"
End If
While fs.FolderExists("C:\Program Files\Microsoft Visual Studio\2022\" & VS_EDITION) = False
If MsgBox("Please install Visual Studio 2022 " & VS_EDITION & " edition first!", vbCritical Or vbYesNo Or vbDefaultButton1, "msvcr14x") <> vbYes Then
Exit Sub
End If
objShell.Run ("https://visualstudio.microsoft.com/zh-hans/thank-you-downloading-visual-studio/?sku=" & VS_EDITION & "&rel=17")
Wend
While fs.FolderExists("C:\Program Files\Microsoft Visual Studio\2022\" & VS_EDITION & "\VC\Tools\MSVC") = False
If MsgBox("Please check 'Desktop development with C++' in Visual Studio 2022 Installer first!", vbCritical Or vbYesNo Or vbDefaultButton1, "msvcr14x") <> vbYes Then
Exit Sub
End If
objShell.Exec ("C:\Program Files (x86)\Microsoft Visual Studio\Installer\vs_installer.exe")
Wend
While fs.FolderExists("C:\Program Files\Microsoft Visual Studio\2022\" & VS_EDITION & "\VC\Tools\MSVC") = False
If MsgBox("Please check 'Desktop development with C++' in Visual Studio 2022 Installer first!", vbCritical Or vbYesNo Or vbDefaultButton1, "msvcr14x") <> vbYes Then
Exit Sub
End If
objShell.Exec ("C:\Program Files (x86)\Microsoft Visual Studio\Installer\vs_installer.exe")
Wend
While fs.FolderExists("C:\Program Files (x86)\Windows Kits\10\Source\10.0.22000.0\ucrt") = False
If MsgBox("Please install Windows 11 SDK (10.0.22000.0) first!", vbCritical Or vbYesNo Or vbDefaultButton1, "msvcr14x") <> vbYes Then
Exit Sub
End If
objShell.Run ("https://developer.microsoft.com/en-us/windows/downloads/windows-sdk/")
Wend
While fs.FolderExists("C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Include") = False
If MsgBox("Please check 'Windows XP support for C++' in Visual Studio 2022 Installer first!", vbCritical Or vbYesNo Or vbDefaultButton1, "msvcr14x") <> vbYes Then
Exit Sub
End If
objShell.Exec ("C:\Program Files (x86)\Microsoft Visual Studio\Installer\vs_installer.exe")
Wend
Dim boost_ROOT
boost_ROOT = objShell.Environment("User").Item("boost_ROOT")
While Len(boost_ROOT) = 0 Or fs.FolderExists(boost_ROOT) = False
If MsgBox("Please install Boost (1.77.0) first!", vbCritical Or vbYesNo Or vbDefaultButton1, "msvcr14x") <> vbYes Then
Exit Sub
End If
objShell.Run ("https://boostorg.jfrog.io/artifactory/main/release/1.77.0/source/")
boost_ROOT = InputBox("Please input your Boost (1.77.0) root directory!", "Set boost_ROOT environment variable")
If Len(boost_ROOT) > 0 And fs.FolderExists(boost_ROOT) Then
objShell.Environment("User").Item("boost_ROOT") = boost_ROOT
End If
Wend
Dim ts 'As TextStream
Set ts = fs.CreateTextFile("CheckPrerequisite_Result.txt")
ts.Write ("True")
ts.Close
End Sub
CheckPrerequisite