-
Notifications
You must be signed in to change notification settings - Fork 3
/
alan.nsi
156 lines (124 loc) · 6.4 KB
/
alan.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
# Alan Windows installer script for NSIS
#
Unicode True
OutFile "alan<BUILD>.<PLATFORM>.setup.exe"
;-------------------------------------------------------------------------------
; Includes
!include "MUI2.nsh"
!include "LogicLib.nsh"
!include "WinVer.nsh"
!include "x64.nsh"
;-------------------------------------------------------------------------------
; Constants
!define PRODUCT_NAME "Alan V3 Adventure Language System"
!define PRODUCT_DESCRIPTION "Alan V3 Adventure System <BUILD>"
!define PRODUCT_VERSION 3.0.0.8 ; Numeric Status (https://en.wikipedia.org/wiki/Software_versioning)
!define COMPANY "AlanIF Adventure Factories"
;-------------------------------------------------------------------------------
; Attributes
Name "${PRODUCT_NAME}"
InstallDir "$PROGRAMFILES\${PRODUCT_NAME}"
InstallDirRegKey HKCU "Software\AlanIF\${PRODUCT_NAME}" ""
;RequestExecutionLevel user ; user|highest|admin
;-------------------------------------------------------------------------------
; Version Info
VIProductVersion "${PRODUCT_VERSION}"
VIAddVersionKey "ProductName" "${PRODUCT_NAME}"
VIAddVersionKey "ProductVersion" "${PRODUCT_VERSION}"
VIAddVersionKey "FileDescription" "${PRODUCT_DESCRIPTION}"
VIAddVersionKey "LegalCopyright" "${COPYRIGHT}"
VIAddVersionKey "FileVersion" "${SETUP_VERSION}"
; NOTE: All BMP's need to be in older Windows 3.x bitmap format!!!
; One converter that generates that is https://www.coolutils.com/online/Image-Converter
;-------------------------------------------------------------------------------
; Modern UI Appearance
!define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\orange-install.ico"
!define MUI_HEADERIMAGE
!define MUI_HEADERIMAGE_BITMAP "images\nsis_setup_header.bmp" ;;"${NSISDIR}\Contrib\Graphics\Header\orange.bmp"
!define MUI_WELCOMEFINISHPAGE_BITMAP "images\nsis_setup_wizard.bmp" ;;"${NSISDIR}\Contrib\Graphics\Wizard\orange.bmp!define MUI_HEADERIMAGE_UNBITMAP "images\nsis_setup_header.bmp" ;;"${NSISDIR}\Contrib\Graphics\Header\orange.bmp"
!define MUI_UNWELCOMEFINISHPAGE_BITMAP "images\nsis_setup_wizard.bmp" ;;"${NSISDIR}\Contrib\Graphics\Wizard\orange.bmp"
!define MUI_FINISHPAGE_NOAUTOCLOSE
!define MUI_WELCOMEPAGE_TITLE "${PRODUCT_DESCRIPTION}"
;-------------------------------------------------------------------------------
; Installer Pages
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE COPYING.txt
#!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
;-------------------------------------------------------------------------------
; Uninstaller Pages
!insertmacro MUI_UNPAGE_WELCOME
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
!insertmacro MUI_UNPAGE_FINISH
;-------------------------------------------------------------------------------
; Languages
!insertmacro MUI_LANGUAGE "English"
Section "install"
SetOutPath "$INSTDIR"
# Files
File bin\winalan.exe
File alan.readme.txt
File bin\winarun.exe
File <WINGLK_ROOT>\Glk.dll
# File <WINGLK_ROOT>\ScaleGfx.dll -- Was removed in 1.51
File CHANGES.txt
File COPYING.txt
File regression\saviour.alan
File regression\saviour.a3c
File regression\saviour.a3r
File regression\logo.png
File games\adventv3\adventv3.a3c
WriteINIStr "$INSTDIR\alanif.url" "InternetShortcut" "URL" "https://www.alanif.se"
WriteINIStr "$INSTDIR\betamanual.url" "InternetShortcut" "URL" "https://alan-if.github.io/alan-docs/manual-beta/manual.html"
WriteINIStr "$INSTDIR\docs.url" "InternetShortcut" "URL" "https://alan-if.github.io/alan-docs/"
writeUninstaller "$INSTDIR\uninstall.exe"
WriteRegStr HKCR ".a3c" "Alan V3 Game File" "AlanV3Game"
WriteRegStr HKCR "AlanV3Game" "" "Alan V3 Game File"
WriteRegStr HKCR "AlanV3Game\DefaultIcon" "" "$INSTDIR\winarun.exe,0"
WriteRegStr HKCR "AlanV3Game\shell\open\command" "" '"$INSTDIR\winarun.exe" "%1"'
WriteRegStr HKCR ".alan" "Alan V3 Source File" "AlanV3Source"
WriteRegStr HKCR "AlanV3Source" "" "Alan V3 Source File"
WriteRegStr HKCR "AlanV3Source\DefaultIcon" "" "$INSTDIR\winalan.exe,0"
WriteRegStr HKCR "AlanV3Source\shell\open\command" "" '"$INSTDIR\winalan.exe" "%1"'
SectionEnd
Section "startmenu"
CreateDirectory "$SMPrograms\${PRODUCT_NAME}"
CreateShortCut "$SMPrograms\${PRODUCT_NAME}\Alan V3 Compiler.lnk" "$INSTDIR\winalan.exe"
CreateShortCut "$SMPrograms\${PRODUCT_NAME}\Alan V3 Interpreter.lnk" "$INSTDIR\winarun.exe"
CreateShortCut "$SMPrograms\${PRODUCT_NAME}\Alan V3 Interactive Fiction System on the Web.lnk" "$INSTDIR\alanif.url"
CreateShortCut "$SMPrograms\${PRODUCT_NAME}\Alan V3 Interactive Fiction Language Manual.lnk" "$INSTDIR\manual.url"
CreateShortCut "$SMPrograms\${PRODUCT_NAME}\Alan V3 Interactive Fiction Documentation.lnk" "$INSTDIR\docs.url"
CreateShortCut "$SMPrograms\${PRODUCT_NAME}\Saviour - a sample game.lnk" "$INSTDIR\saviour.a3c"
CreateShortCut "$SMPrograms\${PRODUCT_NAME}\Advent - a crude conversion of ADVENT.lnk" "$INSTDIR\adventV3.a3c"
CreateShortCut "$SMPrograms\${PRODUCT_NAME}\COPYING.lnk" "$INSTDIR\COPYING.txt"
CreateShortCut "$SMPrograms\${PRODUCT_NAME}\Uninstall Alan V3 Interactive Fiction System.lnk" "$INSTDIR\uninstall.exe"
SectionEnd
Section "uninstall"
Delete "$INSTDIR\winalan.exe"
Delete "$INSTDIR\winarun.exe"
Delete "$INSTDIR\Glk.dll"
# Delete $INSTDIR\ScaleGfx.dll # Removed in WindowsGlk 1.51
Delete "$INSTDIR\COPYING.txt"
Delete "$INSTDIR\saviour.a3c"
Delete "$INSTDIR\saviour.a3r"
Delete "$INSTDIR\logo.png"
Delete "$INSTDIR\adventv3.a3c"
Delete "$INSTDIR\alanif.exe"
Delete "$INSTDIR\manual.exe"
Delete "$INSTDIR\docs.exe"
Delete "$INSTDIR\uninstall.exe"
RMDir "$INSTDIR"
Delete "$SMPrograms\${PRODUCT_NAME}\Alan V3 Compiler.lnk"
Delete "$SMPrograms\${PRODUCT_NAME}\Alan V3 Interpreter.lnk"
Delete "$SMPrograms\${PRODUCT_NAME}\Alan V3 Interactive Fiction System on the Web.lnk"
Delete "$SMPrograms\${PRODUCT_NAME}\Alan V3 Interactive Fiction Language Manual.lnk"
Delete "$SMPrograms\${PRODUCT_NAME}\Alan V3 Interactive Fiction Documentation.lnk"
Delete "$SMPrograms\${PRODUCT_NAME}\Saviour - a sample game.lnk"
Delete "$SMPrograms\${PRODUCT_NAME}\Advent - a crude conversion of ADVENT.lnk"
Delete "$SMPrograms\${PRODUCT_NAME}\COPYING.lnk"
Delete "$SMPrograms\${PRODUCT_NAME}\Uninstall Alan V3 Interactive Fiction System.lnk"
RMDir "$SMPrograms\${PRODUCT_NAME}"
SectionEnd