This repository has been archived by the owner on Jun 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 37
/
setup.nsi
199 lines (174 loc) · 6.15 KB
/
setup.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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
/*
********************************
RetroBat Setup NSIS Script
********************************
*/
SetCompressor lzma
RequestExecutionLevel user
Unicode true
!define PRODUCT "RetroBat"
!define FILENAME "retrobat"
;!define BRANCH "stable"
;!define PRODUCT_VERSION "5.0.0"
!define VERSION "${RELEASE_VERSION}"
;!define /date TIMESTAMP "%Y%m%d%H%M"
;!define /date TIMESTAMP2 "%Y/%m/%d %H:%M:%S"
!define PRODUCT_PUBLISHER "RetroBat Team"
!define PRODUCT_WEB_SITE "https://www.retrobat.org/"
!define BASE_SOURCE ".\build"
!define BASE_TARGET "$(^Name)"
!define RESOURCES_PATH "${BASE_SOURCE}\system\resources"
!define SETUP_VERSION "5.1.0.0"
VIAddVersionKey "ProductName" "${PRODUCT}"
VIAddVersionKey "CompanyName" "${PRODUCT}"
VIAddVersionKey "FileVersion" "${SETUP_VERSION}"
VIAddVersionKey "LegalCopyright" "RetroBat Team"
VIAddVersionKey "FileDescription" "This program extracts and copies all major components of RetroBat to the chosen destination."
VIProductVersion "${SETUP_VERSION}"
VIFileVersion "${SETUP_VERSION}"
!include "MUI2.nsh"
!include "FileFunc.nsh"
!include "LogicLib.nsh"
Name "${PRODUCT}"
OutFile "${FILENAME}-v${VERSION}-setup.exe"
InstallDir "C:\${BASE_TARGET}\"
ShowInstDetails "hide"
BrandingText "${PRODUCT} ${VERSION} (c) ${PRODUCT_PUBLISHER}"
SpaceTexts none
!define MUI_ABORTWARNING
!define MUI_ABORTWARNING_TEXT "Are you sure you wish to abort installation?"
!define MUI_COMPONENTSPAGE_SMALLDESC
!define MUI_HEADERIMAGE
!define MUI_HEADERIMAGE_BITMAP "${RESOURCES_PATH}\retrobat_header.bmp"
!define MUI_HEADERIMAGE_BITMAP_STRETCH "FitControl"
!define MUI_HEADER_TRANSPARENT_TEXT
!define MUI_ICON "${RESOURCES_PATH}\retrobat-icon-white.ico"
!define MUI_WELCOMEFINISHPAGE_BITMAP "${RESOURCES_PATH}\retrobat_wizard.bmp"
!define MUI_FINISHPAGE_SHOWREADME
!define MUI_FINISHPAGE_SHOWREADME_TEXT "Create Desktop Shortcut"
!define MUI_FINISHPAGE_SHOWREADME_FUNCTION CreateDesktopShortCut
!define MUI_FINISHPAGE_LINK "Visit official ${PRODUCT} website: ${PRODUCT_WEB_SITE}"
!define MUI_FINISHPAGE_LINK_LOCATION "${PRODUCT_WEB_SITE}"
!define MUI_LANGDLL_REGISTRY_VALUENAME "NSIS:Language"
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE "license.txt"
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_LANGUAGE "Afrikaans"
!insertmacro MUI_LANGUAGE "Albanian"
!insertmacro MUI_LANGUAGE "Arabic"
!insertmacro MUI_LANGUAGE "Basque"
!insertmacro MUI_LANGUAGE "Belarusian"
!insertmacro MUI_LANGUAGE "Bosnian"
!insertmacro MUI_LANGUAGE "Breton"
!insertmacro MUI_LANGUAGE "Bulgarian"
!insertmacro MUI_LANGUAGE "Catalan"
!insertmacro MUI_LANGUAGE "Croatian"
!insertmacro MUI_LANGUAGE "Czech"
!insertmacro MUI_LANGUAGE "Danish"
!insertmacro MUI_LANGUAGE "Dutch"
!insertmacro MUI_LANGUAGE "English"
!insertmacro MUI_LANGUAGE "Estonian"
!insertmacro MUI_LANGUAGE "Farsi"
!insertmacro MUI_LANGUAGE "Finnish"
!insertmacro MUI_LANGUAGE "French"
!insertmacro MUI_LANGUAGE "Galician"
!insertmacro MUI_LANGUAGE "German"
!insertmacro MUI_LANGUAGE "Greek"
!insertmacro MUI_LANGUAGE "Hebrew"
!insertmacro MUI_LANGUAGE "Hungarian"
!insertmacro MUI_LANGUAGE "Icelandic"
!insertmacro MUI_LANGUAGE "Indonesian"
!insertmacro MUI_LANGUAGE "Irish"
!insertmacro MUI_LANGUAGE "Italian"
!insertmacro MUI_LANGUAGE "Japanese"
!insertmacro MUI_LANGUAGE "Korean"
!insertmacro MUI_LANGUAGE "Kurdish"
!insertmacro MUI_LANGUAGE "Latvian"
!insertmacro MUI_LANGUAGE "Lithuanian"
!insertmacro MUI_LANGUAGE "Luxembourgish"
!insertmacro MUI_LANGUAGE "Macedonian"
!insertmacro MUI_LANGUAGE "Malay"
!insertmacro MUI_LANGUAGE "Mongolian"
!insertmacro MUI_LANGUAGE "Norwegian"
!insertmacro MUI_LANGUAGE "NorwegianNynorsk"
!insertmacro MUI_LANGUAGE "Polish"
!insertmacro MUI_LANGUAGE "Portuguese"
!insertmacro MUI_LANGUAGE "PortugueseBR"
!insertmacro MUI_LANGUAGE "Romanian"
!insertmacro MUI_LANGUAGE "Russian"
!insertmacro MUI_LANGUAGE "Serbian"
!insertmacro MUI_LANGUAGE "SerbianLatin"
!insertmacro MUI_LANGUAGE "SimpChinese"
!insertmacro MUI_LANGUAGE "Slovak"
!insertmacro MUI_LANGUAGE "Slovenian"
!insertmacro MUI_LANGUAGE "Spanish"
!insertmacro MUI_LANGUAGE "SpanishInternational"
!insertmacro MUI_LANGUAGE "Swedish"
!insertmacro MUI_LANGUAGE "Thai"
!insertmacro MUI_LANGUAGE "TradChinese"
!insertmacro MUI_LANGUAGE "Turkish"
!insertmacro MUI_LANGUAGE "Ukrainian"
!insertmacro MUI_LANGUAGE "Uzbek"
!insertmacro MUI_LANGUAGE "Welsh"
/*
Function CreateVersionFile
FileOpen $0 "$INSTDIR\system\version.info" w
FileWrite $0 "${VERSION}"
FileClose $0
FunctionEnd
*/
!macro MUI_FINISHPAGE_SHORTCUT
!ifndef MUI_FINISHPAGE_NOREBOOTSUPPORT
!define MUI_FINISHPAGE_NOREBOOTSUPPORT
!ifdef MUI_FINISHPAGE_RUN
!undef MUI_FINISHPAGE_RUN
!endif
!endif
!define MUI_PAGE_CUSTOMFUNCTION_SHOW DisableCancelButton
!insertmacro MUI_PAGE_FINISH
!define MUI_PAGE_CUSTOMFUNCTION_SHOW DisableBackButton
Function DisableCancelButton
EnableWindow $mui.Button.Cancel 0
FunctionEnd
Function DisableBackButton
EnableWindow $mui.Button.Back 0
FunctionEnd
!macroend
Function CreateDesktopShortCut
CreateShortCut "$DESKTOP\RetroBat.lnk" "$INSTDIR\retrobat.exe"
FunctionEnd
Function .onInit
!insertmacro MUI_LANGDLL_DISPLAY
FunctionEnd
;Installer Sections
Section "install"
/*
;Add files
SetOutPath "$INSTDIR"
Delete ${BASE_SOURCE}\*.log
SetOverwrite ifnewer
File ${BASE_SOURCE}\${FILENAME}.exe
File /nonfatal ${BASE_SOURCE}\${FILENAME}.ini
File ${BASE_SOURCE}\${FILENAME}.dat
File ${BASE_SOURCE}\readme.txt
File ${BASE_SOURCE}\license.txt
File /r ${BASE_SOURCE}\*.*
*/
SetOverwrite ifnewer
SetOutPath "$INSTDIR"
File ${BASE_SOURCE}\${FILENAME}.exe
File ${BASE_SOURCE}\${FILENAME}.dat
File ${BASE_SOURCE}\readme.txt
File ${BASE_SOURCE}\license.txt
File /r /x ${BASE_SOURCE}\emulationstation\.emulationstation\es_settings.cfg /x ${BASE_SOURCE}\emulationstation\.emulationstation\es_input.cfg ${BASE_SOURCE}\*.*
SetOverwrite off
SetOutPath "$INSTDIR"
File /nonfatal ${BASE_SOURCE}\${FILENAME}.ini
SetOverwrite off
SetOutPath "$INSTDIR\emulationstation\.emulationstation"
File ${BASE_SOURCE}\emulationstation\.emulationstation\es_settings.cfg
File ${BASE_SOURCE}\emulationstation\.emulationstation\es_input.cfg
; Call CreateVersionFile
SectionEnd