-
Notifications
You must be signed in to change notification settings - Fork 3
/
winarun.nsi
129 lines (104 loc) · 5.05 KB
/
winarun.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
# WinArun installed script using NSIS
#
Unicode True
OutFile "winarun<BUILD>.<PLATFORM>.setup.exe"
;-------------------------------------------------------------------------------
; Includes
!include "MUI2.nsh"
!include "LogicLib.nsh"
!include "WinVer.nsh"
!include "x64.nsh"
;-------------------------------------------------------------------------------
; Constants
!define PRODUCT_NAME "Alan Interpreter for Windows"
!define PRODUCT_DESCRIPTION "Alan V3 Interactive Fiction Interpreter <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\winarun.exe
File <WINGLK_ROOT>\Glk.dll
# File <WINGLK_ROOT>\ScaleGfx.dll -- Was removed in 1.51
File COPYING.txt
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"
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"'
SectionEnd
Section "startmenu"
CreateDirectory "$SMPrograms\${PRODUCT_NAME}"
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}\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 Interpreter.lnk" "$INSTDIR\uninstall.exe"
SectionEnd
Section "uninstall"
Delete "$INSTDIR\uninstall.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
RMDir "$INSTDIR"
Delete "$SMPrograms\${PRODUCT_NAME}\Alan V3 Interpreter.lnk"
Delete "$SMPrograms\${PRODUCT_NAME}\Alan V3 Interpreter on the Web.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 Interpreter.lnk"
RMDir "$SMPrograms\${PRODUCT_NAME}"
SectionEnd