-
Notifications
You must be signed in to change notification settings - Fork 21
/
bizhawk_prereqs.nsi
106 lines (74 loc) · 3.41 KB
/
bizhawk_prereqs.nsi
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
!include LogicLib.nsh
!include "MUI2.nsh"
!include "NsisDotNetChecker\DotNetChecker.nsh"
; Request application privileges for Windows Vista+
RequestExecutionLevel admin
Function .onInit
UserInfo::GetAccountType
pop $0
${If} $0 != "admin" ;Require admin rights on NT4+
MessageBox mb_iconstop "Administrator rights required!"
SetErrorLevel 740 ;ERROR_ELEVATION_REQUIRED
Quit
${EndIf}
FunctionEnd
; The name of the installer
Name "BizHawk Prerequisites"
; The file to write
OutFile "bizhawk_prereqs.exe"
; Request application privileges for Windows Vista+
RequestExecutionLevel admin
LicenseText "The following prerequisites will be checked and installed:" "OK"
LicenseData "dist\info.txt"
Page license
Page instfiles
Section "KB2999226 (prerequisite for installing 'UCRT' on win7-win8.1)" SEC_KB2999226
SetOutPath "$TEMP"
File "dist\UCRT\Windows6.1-KB2999226-x64.msu"
File "dist\UCRT\Windows8.1-KB2999226-x64.msu"
File "dist\UCRT\Windows8-RT-KB2999226-x64.msu"
DetailPrint "Trying to install 3x KB2999226 for various platforms."
ExecWait 'wusa.exe "dist\UCRT\Windows6.1-KB2999226-x64.msu" /quiet /norestart'
ExecWait 'wusa.exe "dist\UCRT\Windows8.1-KB2999226-x64.msu" /quiet /norestart'
ExecWait 'wusa.exe "dist\UCRT\Windows8-RT-KB2999226-x64.msu" /quiet /norestart'
DetailPrint "Finished KB2999226"
SectionEnd
Section "Microsoft Visual C++ 2010 SP1 Runtime (x64)" SEC_CRT2010_SP1_X64
SetOutPath "$TEMP"
File "dist\vcredist_2010_sp1_x64.exe"
DetailPrint "Running Visual C++ 2010 SP1 Runtime (x64) Setup..."
ExecWait '"$TEMP\vcredist_2010_sp1_x64.exe" /q /promptrestart'
DetailPrint "Finished Visual C++ 2010 SP1 Runtime (x64) Runtime Setup"
Delete "$TEMP\vcredist_2010_sp1_x64.exe"
SectionEnd
Section "'Microsoft Visual C++ Redistributable for Visual Studio 2015, 2017 and 2019' (x64)" SEC_CRTULTIMATE_X64
SetOutPath "$TEMP"
File "dist\VC_redist.x64.exe"
DetailPrint "Running 'Microsoft Visual C++ Redistributable for Visual Studio 2015, 2017 and 2019' (x64) Setup..."
ExecWait '"$TEMP\VC_redist.x64.exe" /quiet'
DetailPrint "Finished 'Microsoft Visual C++ Redistributable for Visual Studio 2015, 2017 and 2019' (x64) Setup"
Delete "$TEMP\VC_redist.x64.exe"
SectionEnd
Section "MS .NET Framework 4.8" SecFramework
!insertmacro CheckNetFramework 48
SectionEnd
Section "DirectX Setup" SEC_DIRECTX
;SectionIn RO
SetOutPath "$TEMP"
File "dist\DirectX.exe"
DetailPrint "Running DirectX Setup (just in case web setup isn't going to work)..."
RMDir /r "$TEMP\bizphrack-dxsetup"
ExecWait '"$TEMP\DirectX.exe" /S'
Delete "$TEMP\DirectX.exe"
RMDir /r "$TEMP\bizphrack-dxsetup"
DetailPrint "Finished DirectX Setup"
SectionEnd
Section "DirectX Web Setup" SEC_DIRECTXWEB
;SectionIn RO
SetOutPath "$TEMP"
File "dist\dxwebsetup.exe"
DetailPrint "Running DirectX Web Setup..."
ExecWait '"$TEMP\dxwebsetup.exe" /Q'
DetailPrint "Finished DirectX Web Setup"
Delete "$TEMP\dxwebsetup.exe"
SectionEnd