forked from garglk/garglk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
installer.nsi
175 lines (142 loc) · 6.9 KB
/
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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
;
; Gargoyle NSIS 2 installer script
;
Name "Gargoyle"
OutFile "gargoyle-2011.1-windows.exe"
InstallDir $PROGRAMFILES\Gargoyle
InstallDirRegKey HKLM "Software\Tor Andersson\Gargoyle\Install" "Directory"
SetCompressor lzma
;
; The required plugins
;
!define MULTIUSER_EXECUTIONLEVEL Admin
!include MultiUser.nsh
!include MUI.nsh
!include FontReg.nsh
!include FontName.nsh
;
; The installer theme
;
!define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\orange-install.ico"
!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\orange-uninstall.ico"
!define MUI_WELCOMEFINISHPAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Wizard\orange.bmp"
!define MUI_HEADERIMAGE
!define MUI_HEADERIMAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Header\orange.bmp"
!define MUI_HEADERIMAGE_UNBITMAP "${NSISDIR}\Contrib\Graphics\Header\orange-uninstall.bmp"
;
; Define which pages we want
;
!define MUI_ABORTWARNING
Var SMFOLDER
!define MUI_STARTMENUPAGE_DEFAULTFOLDER "Gargoyle"
!define MUI_STARTMENUPAGE_REGISTRY_ROOT HKLM
!define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\Tor Andersson\Gargoyle\Install"
!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Start Menu"
; !insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE "License.txt"
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_STARTMENU Application $SMFOLDER
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
!insertmacro MUI_LANGUAGE "English"
;
; The installation script
;
Section "DoInstall"
; Elevate rights
!insertmacro MULTIUSER_INIT
SetOutPath $INSTDIR
File "build\dist\*.exe"
File "build\dist\*.dll"
File "licenses\*.txt"
File "garglk\garglk.ini"
WriteUninstaller "uninstall.exe"
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
CreateDirectory "$SMPROGRAMS\$SMFOLDER"
CreateShortCut "$SMPROGRAMS\$SMFOLDER\Gargoyle.lnk" "$INSTDIR\gargoyle.exe" "" "$INSTDIR\gargoyle.exe" 0
CreateShortCut "$SMPROGRAMS\Gargoyle\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0
!insertmacro MUI_STARTMENU_WRITE_END
; Write the installation path into the registry
WriteRegStr HKLM "Software\Tor Andersson\Gargoyle" "Directory" "$INSTDIR"
; Write the uninstall keys for Windows
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Gargoyle" "DisplayName" "Gargoyle"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Gargoyle" "UninstallString" '"$INSTDIR\uninstall.exe"'
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Gargoyle" "NoModify" 1
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Gargoyle" "NoRepair" 1
; Associate file types except dat because it's too generic
WriteRegStr HKCR ".l9" "" "Gargoyle.Story"
WriteRegStr HKCR ".sna" "" "Gargoyle.Story"
WriteRegStr HKCR ".t3" "" "Gargoyle.Story"
WriteRegStr HKCR ".z3" "" "Gargoyle.Story"
WriteRegStr HKCR ".z4" "" "Gargoyle.Story"
WriteRegStr HKCR ".z5" "" "Gargoyle.Story"
WriteRegStr HKCR ".z6" "" "Gargoyle.Story"
WriteRegStr HKCR ".z8" "" "Gargoyle.Story"
WriteRegStr HKCR ".taf" "" "Gargoyle.Story"
WriteRegStr HKCR ".agx" "" "Gargoyle.Story"
WriteRegStr HKCR ".acd" "" "Gargoyle.Story"
WriteRegStr HKCR ".a3c" "" "Gargoyle.Story"
WriteRegStr HKCR ".asl" "" "Gargoyle.Story"
WriteRegStr HKCR ".cas" "" "Gargoyle.Story"
WriteRegStr HKCR ".ulx" "" "Gargoyle.Story"
WriteRegStr HKCR ".hex" "" "Gargoyle.Story"
WriteRegStr HKCR ".jacl" "" "Gargoyle.Story"
WriteRegStr HKCR ".j2" "" "Gargoyle.Story"
WriteRegStr HKCR ".gam" "" "Gargoyle.Story"
WriteRegStr HKCR ".mag" "" "Gargoyle.Story"
WriteRegStr HKCR ".blb" "" "Gargoyle.Story"
WriteRegStr HKCR ".glb" "" "Gargoyle.Story"
WriteRegStr HKCR ".zlb" "" "Gargoyle.Story"
WriteRegStr HKCR ".blorb" "" "Gargoyle.Story"
WriteRegStr HKCR ".gblorb" "" "Gargoyle.Story"
WriteRegStr HKCR ".zblorb" "" "Gargoyle.Story"
WriteRegStr HKCR ".d$$$$" "" "Gargoyle.Story"
WriteRegStr HKCR ".saga" "" "Gargoyle.Story"
WriteRegStr HKCR "Gargoyle.Story" "" "Interactive Fiction Story File"
WriteRegStr HKCR "Gargoyle.Story\DefaultIcon" "" "$INSTDIR\gargoyle.exe,1"
WriteRegStr HKCR "Gargoyle.Story\shell" "" "open"
WriteRegStr HKCR "Gargoyle.Story\shell\open" "" "Play"
WriteRegStr HKCR "Gargoyle.Story\shell\open\command" "" "$INSTDIR\gargoyle.exe $\"%1$\""
WriteRegStr HKCR "garglk" "" "URL:Gargoyle File Protocol"
WriteRegStr HKCR "garglk" "URL Protocol" ""
WriteRegStr HKCR "garglk\shell\open\command" "" "$INSTDIR\gargoyle.exe $\"%1$\""
SectionEnd
Section "Fonts"
StrCpy $FONT_DIR $FONTS
!insertmacro InstallFONFont "fonts\LuxiMono-Regular.ttf" "Luxi Mono Regular (TrueType)"
!insertmacro InstallFONFont "fonts\LuxiMono-Bold.ttf" "Luxi Mono Bold (TrueType)"
!insertmacro InstallFONFont "fonts\LuxiMono-Oblique.ttf" "Luxi Mono Oblique (TrueType)"
!insertmacro InstallFONFont "fonts\LuxiMono-BoldOblique.ttf" "Luxi Mono Bold Oblique (TrueType)"
!insertmacro InstallFONFont "fonts\CharterBT-Roman.ttf" "Bitstream Charter (TrueType)"
!insertmacro InstallFONFont "fonts\CharterBT-Bold.ttf" "Bitstream Charter Bold (TrueType)"
!insertmacro InstallFONFont "fonts\CharterBT-Italic.ttf" "Bitstream Charter Italic (TrueType)"
!insertmacro InstallFONFont "fonts\CharterBT-BoldItalic.ttf" "Bitstream Charter Bold Italic (TrueType)"
!insertmacro InstallFONFont "fonts\LiberationMono-Regular.ttf" "Liberation Mono (TrueType)"
!insertmacro InstallFONFont "fonts\LiberationMono-Bold.ttf" "Liberation Mono Bold (TrueType)"
!insertmacro InstallFONFont "fonts\LiberationMono-Italic.ttf" "Liberation Mono Italic (TrueType)"
!insertmacro InstallFONFont "fonts\LiberationMono-BoldItalic.ttf" "Liberation Mono Bold Italic (TrueType)"
!insertmacro InstallFONFont "fonts\LinLibertine_Re-4.7.5.otf" "LinLibertineO (TrueType)"
!insertmacro InstallFONFont "fonts\LinLibertine_Bd-4.1.5.otf" "LinLibertineOB (TrueType)"
!insertmacro InstallFONFont "fonts\LinLibertine_It-4.2.6.otf" "LinLibertineOI (TrueType)"
!insertmacro InstallFONFont "fonts\LinLibertine_BI-4.1.0.otf" "LinLibertineOBI (TrueType)"
SendMessage ${HWND_BROADCAST} ${WM_FONTCHANGE} 0 0 /TIMEOUT=5000
SectionEnd
;
; The uninstallation script
;
Section "Uninstall"
; Elevate rights
!insertmacro MULTIUSER_UNINIT
DeleteRegKey HKCR "Gargoyle.Story"
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Gargoyle"
DeleteRegKey HKLM "Software\Tor Andersson\Gargoyle"
Delete $INSTDIR\*.exe
Delete $INSTDIR\*.dll
Delete $INSTDIR\*.txt
; Remove shortcuts, if any
!insertmacro MUI_STARTMENU_GETFOLDER Application $R0
Delete "$SMPROGRAMS\$R0\*.*"
RMDir "$SMPROGRAMS\Gargoyle"
RMDir "$INSTDIR"
SectionEnd