-
Notifications
You must be signed in to change notification settings - Fork 25
/
windows_installer.nsi
120 lines (91 loc) · 3.82 KB
/
windows_installer.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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
;General
Unicode True
!define APP_NAME "csgoverview"
Name "${APP_NAME}"
Icon "csgoverview.ico"
OutFile "${APP_NAME}_windows_v1.2.0_install.exe"
LicenseData "LICENSE"
RequestExecutionLevel admin
; Set default InstallDir
InstallDir "$PROGRAMFILES64\${APP_NAME}"
; check string in registry and use it as the install dir if that string is valid
InstallDirRegKey HKLM "Software\${APP_NAME}" "InstallLocation"
;Pages
Page license
Page components
Page directory
Page instfiles
UninstPage uninstConfirm
UninstPage instfiles
Section "Install CSGOverview" SecCSGOverview
SetRegView 64
SetOutPath "$INSTDIR"
FILE csgoverview.exe
FILE DejaVuSans.ttf
FILE LICENSE
CreateDirectory $INSTDIR\assets\maps
;Store installation folder
WriteRegStr HKLM "Software\${APP_NAME}" "InstallLocation" $INSTDIR
;Create uninstaller
WriteUninstaller "$INSTDIR\Uninstall.exe"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}" "DisplayName" "CSGOverview - CS:GO Demo Viewer"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}" "UninstallString" "$\"$INSTDIR\Uninstall.exe$\""
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}" "DisplayIcon" "$\"$INSTDIR\csgoverview.exe$\""
SectionEnd
Section "Register .dem Files" SecFile
SetRegView 64
;register file association
WriteRegStr HKLM "Software\${APP_NAME}" "RegisterDemFiles" "Yes"
;just overwrite lul
WriteRegStr HKCR ".dem" "" "CSGOverview.demo"
WriteRegStr HKCR "CSGOverview.demo" "" "CS:GO Demo File"
WriteRegStr HKCR "CSGOverview.demo\DefaultIcon" "" "$INSTDIR\csgoverview.exe,0"
WriteRegStr HKCR "CSGOverview.demo\shell" "" "open"
WriteRegStr HKCR "CSGOverview.demo\shell\open\command" "" '"$INSTDIR\csgoverview.exe" "%1"'
SectionEnd
Section "Download Maps" SecMaps
SetOutPath "$INSTDIR\assets\maps"
; DOWNLOADS
inetc::get "https://i.imgur.com/VHWIjSB.jpeg" de_overpass.jpg
inetc::get "https://i.imgur.com/6HLCCp1.jpeg" de_mirage.jpg
inetc::get "https://i.imgur.com/q8HmCHN.jpeg" de_vertigo.jpg
inetc::get "https://i.imgur.com/qCbHmJ2.jpeg" de_vertigo_lower.jpg
inetc::get "https://i.imgur.com/frbUQtK.jpeg" de_nuke.jpg
inetc::get "https://i.imgur.com/vaF05M5.jpeg" de_nuke_lower.jpg
inetc::get "https://i.imgur.com/KqtNKUc.jpeg" de_cache.jpg
inetc::get "https://i.imgur.com/MW7Kp7f.jpeg" de_inferno.jpg
inetc::get "https://i.imgur.com/FSLMR6V.jpeg" de_train.jpg
inetc::get "https://i.imgur.com/OrsYdDq.jpeg" de_dust2.jpg
inetc::get "https://i.imgur.com/2ZWUOt3.jpeg" de_ancient.jpg
SectionEnd
;Uninstaller Section
Section "un.Uninstall"
SetRegView 64
Delete "$INSTDIR\assets\maps\de_overpass.jpg"
Delete "$INSTDIR\assets\maps\de_mirage.jpg"
Delete "$INSTDIR\assets\maps\de_vertigo.jpg"
Delete "$INSTDIR\assets\maps\de_vertigo_lower.jpg"
Delete "$INSTDIR\assets\maps\de_nuke.jpg"
Delete "$INSTDIR\assets\maps\de_nuke_lower.jpg"
Delete "$INSTDIR\assets\maps\de_cache.jpg"
Delete "$INSTDIR\assets\maps\de_inferno.jpg"
Delete "$INSTDIR\assets\maps\de_train.jpg"
Delete "$INSTDIR\assets\maps\de_dust2.jpg"
Delete "$INSTDIR\assets\maps\de_ancient.jpg"
RMDIR "$INSTDIR\assets\maps"
RMDIR "$INSTDIR\assets"
Delete "$INSTDIR\csgoverview.exe"
Delete "$INSTDIR\DejaVuSans.ttf"
Delete "$INSTDIR\LICENSE"
Delete "$INSTDIR\Uninstall.exe"
RMDir "$INSTDIR"
;unregister file association
ReadRegStr $1 HKLM "Software\${APP_NAME}" "RegisterDemFiles"
StrCmp $1 "Yes" UnregisterFile NoUnregisterFile
UnregisterFile:
DeleteRegKey HKCR ".dem"
DeleteRegKey HKCR "CSGOverview.demo"
NoUnregisterFile:
DeleteRegKey HKLM "Software\${APP_NAME}"
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}"
SectionEnd