Skip to content

Commit ba2c561

Browse files
committed
Cleaning up installer
1 parent 6414d6a commit ba2c561

3 files changed

Lines changed: 68 additions & 40 deletions

File tree

‎install/win/installer.nsi‎

Lines changed: 26 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,24 @@
11
;NSIS OpenXcom Windows Installer
22

3+
;--------------------------------
4+
;Defines
5+
6+
!define GAME_NAME "OpenXcom"
7+
!define GAME_VERSION "0.9"
8+
!define GAME_AUTHOR "OpenXcom Developers"
9+
310
;--------------------------------
411
;Includes
512

613
!include "MUI2.nsh"
714
!include "ZipDLL.nsh"
815
!include "FileFunc.nsh"
916
!include "x64.nsh"
17+
!include "oxlang.nsh" ; Language strings
1018

1119
;--------------------------------
1220
;General
1321

14-
!define GAME_NAME "OpenXcom"
15-
!define GAME_VERSION "0.9"
16-
!define GAME_AUTHOR "OpenXcom Developers"
17-
1822
;Name and file
1923
Name "${GAME_NAME} ${GAME_VERSION}"
2024
OutFile "openxcom-v${GAME_VERSION}-win.exe"
@@ -67,14 +71,8 @@ FunctionEnd
6771
;--------------------------------
6872
;Pages
6973

70-
;Language strings
71-
LangString PAGE_UfoFolder ${LANG_ENGLISH} "${GAME_NAME} requires a copy of UFO: Enemy Unknown / X-Com: UFO Defense. You can skip this step if you're upgrading an existing installation.$\n$\nSetup will copy the required files from the following folder. To copy from a different folder, click Browse and select another folder. Click Next to continue."
72-
LangString PAGE_UfoFolder_TITLE ${LANG_ENGLISH} "Choose UFO Location"
73-
LangString PAGE_UfoFolder_SUBTITLE ${LANG_ENGLISH} "Choose the folder where you have UFO installed."
74-
LangString DEST_UfoFolder ${LANG_ENGLISH} "UFO Folder"
75-
7674
!insertmacro MUI_PAGE_WELCOME
77-
!insertmacro MUI_PAGE_LICENSE "gpl.txt"
75+
!insertmacro MUI_PAGE_LICENSE "$(MUILicense)"
7876
!insertmacro MUI_PAGE_COMPONENTS
7977
!insertmacro MUI_PAGE_DIRECTORY
8078

@@ -116,7 +114,7 @@ FunctionEnd
116114
;--------------------------------
117115
;Installer Sections
118116

119-
Section "Game Files" SecMain
117+
Section "$(NAME_SecMain)" SecMain
120118

121119
SectionIn RO
122120

@@ -219,17 +217,17 @@ ${EndIf}
219217
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
220218

221219
CreateDirectory "$SMPROGRAMS\$StartMenuFolder"
222-
CreateShortCut "$SMPROGRAMS\$StartMenuFolder\Data Folder.lnk" "$INSTDIR\data"
223-
CreateShortCut "$SMPROGRAMS\$StartMenuFolder\OpenXcom.lnk" "$INSTDIR\OpenXcom.exe"
224-
CreateShortCut "$SMPROGRAMS\$StartMenuFolder\Readme.lnk" "$INSTDIR\README.TXT"
225-
CreateShortCut "$SMPROGRAMS\$StartMenuFolder\Uninstall.lnk" "$INSTDIR\Uninstall.exe"
226-
CreateShortCut "$SMPROGRAMS\$StartMenuFolder\User Folder.lnk" "$DOCUMENTS\OpenXcom"
220+
CreateShortCut "$SMPROGRAMS\$StartMenuFolder\$(LINK_DataFolder).lnk" "$INSTDIR\data"
221+
CreateShortCut "$SMPROGRAMS\$StartMenuFolder\${GAME_NAME}.lnk" "$INSTDIR\OpenXcom.exe"
222+
CreateShortCut "$SMPROGRAMS\$StartMenuFolder\$(LINK_Readme).lnk" "$INSTDIR\README.TXT"
223+
CreateShortCut "$SMPROGRAMS\$StartMenuFolder\$(LINK_Uninstall).lnk" "$INSTDIR\Uninstall.exe"
224+
CreateShortCut "$SMPROGRAMS\$StartMenuFolder\$(LINK_UserFolder).lnk" "$DOCUMENTS\OpenXcom"
227225

228226
!insertmacro MUI_STARTMENU_WRITE_END
229227

230228
SectionEnd
231229

232-
Section "Data Patch" SecPatch
230+
Section "$(NAME_SecPatch)" SecPatch
233231

234232
;(uses NSISdl.dll)
235233
NSISdl::download "http://openxcom.org/download/extras/universal-patch.zip" "$TEMP\universal-patch.zip"
@@ -253,10 +251,12 @@ Section "Data Patch" SecPatch
253251

254252
SectionEnd
255253

256-
Section "DOS Music" SecMusic
254+
Section "$(NAME_SecMusic)" SecMusic
255+
256+
AddSize 31112
257257

258258
;(uses NSISdl.dll)
259-
NSISdl::download "original-music-ogg-128.zip" "$TEMP\original-music-ogg-128.zip"
259+
NSISdl::download "http://openxcom.org/download/extras/original-music-ogg-128.zip" "$TEMP\original-music-ogg-128.zip"
260260
Pop $0
261261
StrCmp $0 success success1
262262
SetDetailsView show
@@ -277,23 +277,17 @@ Section "DOS Music" SecMusic
277277

278278
SectionEnd
279279

280-
Section /o "Desktop Shortcut" SecDesktop
280+
Section /o "$(NAME_SecDesktop)" SecDesktop
281281

282282
SetOutPath "$INSTDIR"
283283

284-
CreateShortCut "$DESKTOP\OpenXcom.lnk" "$INSTDIR\OpenXcom.exe"
284+
CreateShortCut "$DESKTOP\${GAME_NAME}.lnk" "$INSTDIR\OpenXcom.exe"
285285

286286
SectionEnd
287287

288288
;--------------------------------
289289
;Descriptions
290290

291-
;Language strings
292-
LangString DESC_SecMain ${LANG_ENGLISH} "Files required to run ${GAME_NAME}."
293-
LangString DESC_SecPatch ${LANG_ENGLISH} "Fixes errors in the original X-Com data. Recommended for first installations. (requires an internet connection)"
294-
LangString DESC_SecMusic ${LANG_ENGLISH} "Adlib/SoundBlaster music recording. Fixes Windows playback issues. (requires an internet connection)"
295-
LangString DESC_SecDesktop ${LANG_ENGLISH} "Creates a shortcut in the desktop to play ${GAME_NAME}."
296-
297291
;Assign language strings to sections
298292
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
299293
!insertmacro MUI_DESCRIPTION_TEXT ${SecMain} $(DESC_SecMain)
@@ -305,11 +299,11 @@ SectionEnd
305299
;--------------------------------
306300
;Uninstaller Sections
307301

308-
Section /o "un.Delete X-Com Data" UnData
302+
Section /o "un.$(NAME_UnData)" UnData
309303
RMDir /r "$INSTDIR\data"
310304
SectionEnd
311305

312-
Section /o "un.Delete User Data" UnUser
306+
Section /o "un.$(NAME_UnUser)" UnUser
313307
RMDir /r "$DOCUMENTS\OpenXcom"
314308
SectionEnd
315309

@@ -349,14 +343,10 @@ Section "-un.Main"
349343

350344
!insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuFolder
351345

352-
Delete "$SMPROGRAMS\$StartMenuFolder\Data Folder.lnk"
353-
Delete "$SMPROGRAMS\$StartMenuFolder\OpenXcom.lnk"
354-
Delete "$SMPROGRAMS\$StartMenuFolder\Readme.lnk"
355-
Delete "$SMPROGRAMS\$StartMenuFolder\Uninstall.lnk"
356-
Delete "$SMPROGRAMS\$StartMenuFolder\User Folder.lnk"
346+
Delete "$SMPROGRAMS\$StartMenuFolder\*.*"
357347
RMDir "$SMPROGRAMS\$StartMenuFolder"
358348

359-
Delete "$DESKTOP\OpenXcom.lnk"
349+
Delete "$DESKTOP\${GAME_NAME}.lnk"
360350

361351
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${GAME_NAME}"
362352
DeleteRegKey /ifempty HKLM "Software\${GAME_NAME}"
@@ -366,10 +356,6 @@ SectionEnd
366356
;--------------------------------
367357
;Uninstaller Descriptions
368358

369-
;Language strings
370-
LangString DESC_UnData ${LANG_ENGLISH} "Deletes all OpenXcom data, including mods and X-Com resources. Recommended for a clean reinstall."
371-
LangString DESC_UnUser ${LANG_ENGLISH} "Deletes all OpenXcom user data, like savegames, screenshots and options. Recommended for a complete wipe."
372-
373359
;Assign language strings to sections
374360
!insertmacro MUI_UNFUNCTION_DESCRIPTION_BEGIN
375361
!insertmacro MUI_DESCRIPTION_TEXT ${UnData} $(DESC_UnData)

‎install/win/oxlang.nsh‎

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
;NSIS OpenXcom Windows Installer Language
2+
3+
;--------------------------------
4+
;General
5+
6+
LicenseLangString MUILicense ${LANG_ENGLISH} "gpl-en.txt"
7+
8+
;--------------------------------
9+
;Pages
10+
11+
LangString PAGE_UfoFolder ${LANG_ENGLISH} "${GAME_NAME} requires a copy of UFO: Enemy Unknown / X-Com: UFO Defense. You can skip this step if you're upgrading an existing installation.$\n$\nSetup will copy the required files from the following folder. To copy from a different folder, click Browse and select another folder. Click Next to continue."
12+
LangString PAGE_UfoFolder_TITLE ${LANG_ENGLISH} "Choose UFO Location"
13+
LangString PAGE_UfoFolder_SUBTITLE ${LANG_ENGLISH} "Choose the folder where you have UFO installed."
14+
LangString DEST_UfoFolder ${LANG_ENGLISH} "UFO Folder"
15+
16+
;--------------------------------
17+
;Installer Sections
18+
19+
LangString NAME_SecMain ${LANG_ENGLISH} "Game Files"
20+
LangString DESC_SecMain ${LANG_ENGLISH} "Files required to run ${GAME_NAME}."
21+
LangString NAME_SecPatch ${LANG_ENGLISH} "Data Patch"
22+
LangString DESC_SecPatch ${LANG_ENGLISH} "Fixes errors in the original X-Com data. Recommended for first installations. (requires an internet connection)"
23+
LangString NAME_SecMusic ${LANG_ENGLISH} "DOS Music"
24+
LangString DESC_SecMusic ${LANG_ENGLISH} "Adlib/SoundBlaster music recording. Fixes Windows playback issues. (requires an internet connection)"
25+
LangString NAME_SecDesktop ${LANG_ENGLISH} "Desktop Shortcut"
26+
LangString DESC_SecDesktop ${LANG_ENGLISH} "Creates a shortcut in the desktop to play ${GAME_NAME}."
27+
28+
;--------------------------------
29+
;Uninstaller Descriptions
30+
31+
LangString NAME_UnData ${LANG_ENGLISH} "Delete X-Com Data"
32+
LangString DESC_UnData ${LANG_ENGLISH} "Deletes all OpenXcom data, including mods and X-Com resources. Recommended for a clean reinstall."
33+
LangString NAME_UnUser ${LANG_ENGLISH} "Delete User Data"
34+
LangString DESC_UnUser ${LANG_ENGLISH} "Deletes all OpenXcom user data, like savegames, screenshots and options. Recommended for a complete wipe."
35+
36+
;--------------------------------
37+
;Shortcuts
38+
39+
LangString LINK_DataFolder ${LANG_ENGLISH} "Data Folder"
40+
LangString LINK_Readme ${LANG_ENGLISH} "Readme"
41+
LangString LINK_UserFolder ${LANG_ENGLISH} "User Folder"
42+
LangString LINK_Uninstall ${LANG_ENGLISH} "Uninstall"

0 commit comments

Comments
 (0)