summaryrefslogtreecommitdiff
path: root/packaging/windows
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-01-02 01:48:38 +0200
committerAndrei Karas <akaras@inbox.ru>2011-01-02 02:41:24 +0200
commit3eeae12c498d1a4dbe969462d2ba841f77ee3ccb (patch)
treeff8eab35e732bc0749fc11677c8873a7b3a58704 /packaging/windows
downloadmanaverse-3eeae12c498d1a4dbe969462d2ba841f77ee3ccb.tar.gz
manaverse-3eeae12c498d1a4dbe969462d2ba841f77ee3ccb.tar.bz2
manaverse-3eeae12c498d1a4dbe969462d2ba841f77ee3ccb.tar.xz
manaverse-3eeae12c498d1a4dbe969462d2ba841f77ee3ccb.zip
Initial commit.
This code based on mana client http://www.gitorious.org/mana/mana and my private repository.
Diffstat (limited to 'packaging/windows')
-rwxr-xr-xpackaging/windows/make-translations.sh6
-rw-r--r--packaging/windows/make-translations.vbs42
-rw-r--r--packaging/windows/portable.xml6
-rw-r--r--packaging/windows/readme.txt6
-rw-r--r--packaging/windows/setup.nsi336
-rw-r--r--packaging/windows/setup_finish.bmpbin0 -> 206243 bytes
-rw-r--r--packaging/windows/setup_welcome.bmpbin0 -> 206243 bytes
7 files changed, 396 insertions, 0 deletions
diff --git a/packaging/windows/make-translations.sh b/packaging/windows/make-translations.sh
new file mode 100755
index 000000000..1d4132397
--- /dev/null
+++ b/packaging/windows/make-translations.sh
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+for i in `grep -v ^# ../../po/LINGUAS`; do
+ mkdir -p ../../translations/$i/LC_MESSAGES
+ msgfmt -c -o ../../translations/$i/LC_MESSAGES/manaplus.mo ../../po/$i.po
+done
diff --git a/packaging/windows/make-translations.vbs b/packaging/windows/make-translations.vbs
new file mode 100644
index 000000000..339a0299e
--- /dev/null
+++ b/packaging/windows/make-translations.vbs
@@ -0,0 +1,42 @@
+Set fso = CreateObject("Scripting.FileSystemObject")
+Set WshShell = CreateObject("WScript.Shell")
+Dim s, infile, outfile, command
+
+Function CreateFolderIfNonexistent(folder)
+ if not fso.FolderExists(folder) then
+ fso.CreateFolder(folder)
+ end if
+end Function
+
+'check for existence of msgfmt
+if not fso.FileExists("msgfmt.exe") then
+ WScript.echo "msgfmt.exe not found. Please get gettext for windows from http://gnuwin32.sourceforge.net/packages/gettext.htm and copy the files msgfmt.exe and all dll files from the gettext/bin directory into this directory and run this script again."
+ WScript.Quit(1)
+end if
+
+CreateFolderIfNonexistent("..\..\translations\")
+
+'open translation list
+Set stream = fso.GetFile("..\..\po\LINGUAS").OpenAsTextStream(1, 0)
+
+'iterate contents of translations file
+translations = 0
+do while not stream.AtEndOfStream
+ s = stream.ReadLine()
+ if inStr(s, "#") = false then
+ 'create the output directory
+ CreateFolderIfNonexistent("..\..\translations\" + s)
+ CreateFolderIfNonexistent("..\..\translations\" + s + "\LC_MESSAGES")
+ 'build the translate command
+ infile = "../../po/" + s + ".po"
+ outfile = "../../translations/" + s +"/LC_MESSAGES/mana.mo"
+ command = "msgfmt -c -o " + outfile + " " + infile
+ 'execute translate command
+ errval = WshShell.run(command, 0, true)
+ if errval = 0 then
+ translations = translations + 1
+ end if
+ end if
+loop
+
+WScript.echo translations, " translations compiled."
diff --git a/packaging/windows/portable.xml b/packaging/windows/portable.xml
new file mode 100644
index 000000000..0059d1094
--- /dev/null
+++ b/packaging/windows/portable.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0"?>
+<configuration>
+ <option name="dataDir" value="logs"/>
+ <option name="configDir" value="configs"/>
+ <option name="screenshotDir" value="screenshots"/>
+</configuration>
diff --git a/packaging/windows/readme.txt b/packaging/windows/readme.txt
new file mode 100644
index 000000000..4a10fef49
--- /dev/null
+++ b/packaging/windows/readme.txt
@@ -0,0 +1,6 @@
+HOW TO BUILD THE INSTALLER
+
+See the following wiki page, which also deals with the steps needed to produce
+the Windows installer:
+
+ http://wiki.themanaworld.org/index.php/Making_a_new_release
diff --git a/packaging/windows/setup.nsi b/packaging/windows/setup.nsi
new file mode 100644
index 000000000..f4cecdf22
--- /dev/null
+++ b/packaging/windows/setup.nsi
@@ -0,0 +1,336 @@
+; This script allows the following parameters being overwritten from
+; command line. When called without any parameters it behaves exactly
+; like the old install script.
+;
+; DLLDIR - directory containing required dlls
+; EXEDIR - directory containing manaplus.exe
+; EXESUFFIX - offset to SRCDIR pointing to a directory containing manaplus.exe
+; PRODUCT_VERSION - software version
+; UPX - upx binary name
+;
+; For a cmake build on UNIX the following should give you a working installer:
+; makensis -DDLLDIR=/path/to/dlls \
+; -DPRODUCT_VERSION=0.1.`date +%Y%m%d`
+; -DUPX=upx
+; -DEXESUFFIX=/src
+
+CRCCheck on
+SetCompress off
+SetCompressor /SOLID lzma
+
+!define SRCDIR "..\.."
+!ifndef UPX
+ !define "UPX upx\upx.exe"
+!endif
+
+!ifdef EXESUFFIX
+ !define EXEDIR ${SRCDIR}/${EXESUFFIX}
+!endif
+
+!ifndef EXEDIR
+ !define EXEDIR ${SRCDIR}
+!endif
+
+!ifndef DLLDIR
+ !define DLLDIR ${SRCDIR}/dll
+!endif
+
+;--- (and without !defines ) ---
+!System "${UPX} --best --crp-ms=999999 --compress-icons=0 --nrv2d ${EXEDIR}\manaplus.exe"
+
+; HM NIS Edit helper defines
+!define PRODUCT_NAME "ManaPlus"
+!ifndef PRODUCT_VERSION
+ !define PRODUCT_VERSION "0.0.29.1"
+!endif
+!define PRODUCT_PUBLISHER "Mana Development Team"
+!define PRODUCT_WEB_SITE "http://manasource.org"
+!define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\manaplus.exe"
+!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
+!define PRODUCT_UNINST_ROOT_KEY "HKLM"
+
+; MUI 1.67 compatible ------
+!include "MUI.nsh"
+
+; MUI Settings
+!define MUI_ABORTWARNING
+;!define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\win-install.ico"
+!define MUI_ICON "${SRCDIR}\data\icons\manaplus.ico"
+;!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\win-uninstall.ico"
+!define MUI_UNICON "${SRCDIR}\data\icons\manaplus.ico"
+
+;Language Selection Dialog Settings
+;Remember the installer language
+!define MUI_LANGDLL_REGISTRY_ROOT "HKCU"
+!define MUI_LANGDLL_REGISTRY_KEY "Software\Mana"
+!define MUI_LANGDLL_REGISTRY_VALUENAME "Installer Language"
+
+!define MUI_WELCOMEFINISHPAGE_BITMAP "setup_welcome.bmp"
+!define MUI_UNWELCOMEFINISHPAGE_BITMAP "setup_welcome.bmp"
+
+; Welcome page
+
+!define MUI_WELCOMEPAGE_TITLE_3LINES
+!insertmacro MUI_PAGE_WELCOME
+; License page
+!insertmacro MUI_PAGE_LICENSE "${SRCDIR}\COPYING"
+; Directory page
+!insertmacro MUI_PAGE_DIRECTORY
+; Components page
+!insertmacro MUI_PAGE_COMPONENTS
+; Instfiles page
+!insertmacro MUI_PAGE_INSTFILES
+; Finish page
+!define MUI_FINISHPAGE_RUN
+!define MUI_FINISHPAGE_RUN_FUNCTION RunMana
+!define MUI_FINISHPAGE_SHOWREADME 'notepad.exe "$\"$INSTDIR\README$\""'
+!define MUI_PAGE_CUSTOMFUNCTION_PRE changeFinishImage
+!define MUI_FINISHPAGE_LINK "Visit Mana website for the latest news, FAQs and support"
+!define MUI_FINISHPAGE_LINK_LOCATION "http://themanaworld.org"
+!insertmacro MUI_PAGE_FINISH
+
+Function RunMana
+SetOutPath $INSTDIR
+Exec "$INSTDIR\manaplus.exe"
+FunctionEnd
+
+Function changeFinishImage
+!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 1" "Text" "$PLUGINSDIR\setup_finish.bmp"
+FunctionEnd
+
+; Uninstaller pages
+
+!insertmacro MUI_UNPAGE_CONFIRM
+!insertmacro MUI_UNPAGE_INSTFILES
+!define MUI_FINISHPAGE_TITLE_3LINES
+!insertmacro MUI_UNPAGE_FINISH
+
+;Languages
+!insertmacro MUI_LANGUAGE "English" # first language is the default language
+!insertmacro MUI_LANGUAGE "French"
+!insertmacro MUI_LANGUAGE "German"
+!insertmacro MUI_LANGUAGE "Spanish"
+!insertmacro MUI_LANGUAGE "SimpChinese"
+!insertmacro MUI_LANGUAGE "TradChinese"
+!insertmacro MUI_LANGUAGE "Japanese"
+!insertmacro MUI_LANGUAGE "Korean"
+!insertmacro MUI_LANGUAGE "Italian"
+!insertmacro MUI_LANGUAGE "Dutch"
+!insertmacro MUI_LANGUAGE "Danish"
+!insertmacro MUI_LANGUAGE "Swedish"
+!insertmacro MUI_LANGUAGE "Norwegian"
+!insertmacro MUI_LANGUAGE "Finnish"
+!insertmacro MUI_LANGUAGE "Greek"
+!insertmacro MUI_LANGUAGE "Russian"
+!insertmacro MUI_LANGUAGE "Portuguese"
+!insertmacro MUI_LANGUAGE "PortugueseBR"
+!insertmacro MUI_LANGUAGE "Polish"
+!insertmacro MUI_LANGUAGE "Ukrainian"
+!insertmacro MUI_LANGUAGE "Czech"
+!insertmacro MUI_LANGUAGE "Slovak"
+!insertmacro MUI_LANGUAGE "Croatian"
+!insertmacro MUI_LANGUAGE "Bulgarian"
+!insertmacro MUI_LANGUAGE "Hungarian"
+!insertmacro MUI_LANGUAGE "Thai"
+!insertmacro MUI_LANGUAGE "Romanian"
+!insertmacro MUI_LANGUAGE "Latvian"
+!insertmacro MUI_LANGUAGE "Macedonian"
+!insertmacro MUI_LANGUAGE "Estonian"
+!insertmacro MUI_LANGUAGE "Turkish"
+!insertmacro MUI_LANGUAGE "Lithuanian"
+!insertmacro MUI_LANGUAGE "Catalan"
+!insertmacro MUI_LANGUAGE "Slovenian"
+!insertmacro MUI_LANGUAGE "Serbian"
+!insertmacro MUI_LANGUAGE "SerbianLatin"
+!insertmacro MUI_LANGUAGE "Arabic"
+!insertmacro MUI_LANGUAGE "Farsi"
+!insertmacro MUI_LANGUAGE "Hebrew"
+!insertmacro MUI_LANGUAGE "Indonesian"
+!insertmacro MUI_LANGUAGE "Mongolian"
+!insertmacro MUI_LANGUAGE "Luxembourgish"
+!insertmacro MUI_LANGUAGE "Albanian"
+!insertmacro MUI_LANGUAGE "Breton"
+!insertmacro MUI_LANGUAGE "Belarusian"
+!insertmacro MUI_LANGUAGE "Icelandic"
+!insertmacro MUI_LANGUAGE "Malay"
+!insertmacro MUI_LANGUAGE "Bosnian"
+!insertmacro MUI_LANGUAGE "Kurdish"
+
+!insertmacro MUI_RESERVEFILE_LANGDLL
+
+ReserveFile "setup_finish.bmp"
+
+; MUI end ------
+
+Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
+OutFile "manaplus-${PRODUCT_VERSION}-win32.exe"
+InstallDir "$PROGRAMFILES\Mana"
+InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" ""
+ShowInstDetails show
+ShowUnInstDetails show
+
+Function .onInit
+ !insertmacro MUI_LANGDLL_DISPLAY
+ InitPluginsDir
+ File /oname=$PLUGINSDIR\setup_finish.bmp "setup_finish.bmp"
+FunctionEnd
+
+Section "Core files (required)" SecCore
+ SectionIn RO
+ SetOutPath "$INSTDIR"
+ SetOverwrite ifnewer
+ CreateDirectory "$INSTDIR\data"
+ CreateDirectory "$INSTDIR\data\fonts"
+ CreateDirectory "$INSTDIR\data\graphics"
+ CreateDirectory "$INSTDIR\data\help"
+ CreateDirectory "$INSTDIR\data\icons"
+ CreateDirectory "$INSTDIR\data\graphics\gui"
+ CreateDirectory "$INSTDIR\data\graphics\images"
+ CreateDirectory "$INSTDIR\data\graphics\sprites"
+ CreateDirectory "$INSTDIR\data\sfx"
+ CreateDirectory "$INSTDIR\data\sfx\system"
+ CreateDirectory "$INSTDIR\data\themes"
+ CreateDirectory "$INSTDIR\data\themes\blackwood"
+ CreateDirectory "$INSTDIR\data\themes\classic"
+ CreateDirectory "$INSTDIR\data\themes\enchilado"
+ CreateDirectory "$INSTDIR\data\themes\redandblack"
+ CreateDirectory "$INSTDIR\data\themes\wood"
+ CreateDirectory "$INSTDIR\docs"
+
+ SetOverwrite ifnewer
+ SetOutPath "$INSTDIR"
+
+ File "${EXEDIR}\manaplus.exe"
+ File "${DLLDIR}\*.dll"
+ File "${SRCDIR}\AUTHORS"
+ File "${SRCDIR}\COPYING"
+ File "${SRCDIR}\NEWS"
+ File "${SRCDIR}\README.txt"
+ SetOutPath "$INSTDIR\data\fonts"
+ File "${SRCDIR}\data\fonts\*.ttf"
+ SetOutPath "$INSTDIR\data\graphics"
+ File "${SRCDIR}\data\graphics\*.png"
+ SetOutPath "$INSTDIR\data\graphics\gui"
+ File "${SRCDIR}\data\graphics\gui\*.png"
+ File "${SRCDIR}\data\graphics\gui\*.xml"
+ SetOutPath "$INSTDIR\data\graphics\images"
+ File /x minimap_*.png ${SRCDIR}\data\graphics\images\*.png
+ File "${SRCDIR}\data\graphics\images\error.png"
+ SetOutPath "$INSTDIR\data\graphics\sprites"
+ File "${SRCDIR}\data\graphics\sprites\*.gif"
+ File "${SRCDIR}\data\graphics\sprites\*.png"
+ File "${SRCDIR}\data\graphics\sprites\*.xml"
+ SetOutPath "$INSTDIR\data\sfx\system"
+ File "${SRCDIR}\data\sfx\system\*.ogg"
+ SetOutPath "$INSTDIR\data\themes\blackwood"
+ File "${SRCDIR}\data\themes\blackwood\*.png"
+ File "${SRCDIR}\data\themes\blackwood\*.xml"
+ SetOutPath "$INSTDIR\data\themes\classic"
+ File "${SRCDIR}\data\themes\classic\*.png"
+ File "${SRCDIR}\data\themes\classic\*.xml"
+ SetOutPath "$INSTDIR\data\themes\enchilado"
+ File "${SRCDIR}\data\themes\enchilado\*.png"
+ File "${SRCDIR}\data\themes\enchilado\*.xml"
+ SetOutPath "$INSTDIR\data\themes\redandblack"
+ File "${SRCDIR}\data\themes\redandblack\*.png"
+ File "${SRCDIR}\data\themes\redandblack\*.xml"
+ SetOutPath "$INSTDIR\data\themes\wood"
+ File "${SRCDIR}\data\themes\wood\*.png"
+ File "${SRCDIR}\data\themes\wood\*.xml"
+ SetOutPath "$INSTDIR\data\help"
+ File "${SRCDIR}\data\help\*.txt"
+ SetOutPath "$INSTDIR\data\icons\"
+ File "${SRCDIR}\data\icons\manaplus.ico"
+ SetOutPath "$INSTDIR\docs"
+ File "${SRCDIR}\docs\FAQ.txt"
+SectionEnd
+
+Section "Create Shortcuts" SecShortcuts
+ SetOutPath "$INSTDIR"
+ SetOverwrite ifnewer
+ CreateDirectory "$SMPROGRAMS\Mana"
+ CreateShortCut "$SMPROGRAMS\Mana\ManaPlus.lnk" "$INSTDIR\manaplus.exe"
+ CreateShortCut "$SMPROGRAMS\Mana\ManaPlus (no opengl).lnk" "$INSTDIR\manaplus.exe" --no-opengl
+ CreateShortCut "$SMPROGRAMS\Mana\ManaPlus (safemode).lnk" "$INSTDIR\manaplus.exe" --safemode
+ CreateShortCut "$DESKTOP\ManaPlus.lnk" "$INSTDIR\manaplus.exe"
+SectionEnd
+
+Section /o "Music" SecMusic
+ AddSize 17602
+ CreateDirectory "$INSTDIR\data\music"
+ SetOutPath "$INSTDIR\data\music"
+ NSISdl::download "http://downloads.sourceforge.net/themanaworld/tmwmusic-0.2.tar.gz" "$TEMP\tmwmusic-0.2.tar.gz"
+ ;Requires an additional plugin from http://nsis.sourceforge.net/UnTGZ_plug-in Place untgz.dll in your nsis/plugin dir
+ untgz::extract -j -d "$INSTDIR\data\music" "$TEMP\tmwmusic-0.2.tar.gz"
+ Delete "$TEMP\tmwmusic-0.2.tar.gz"
+SectionEnd
+
+Section /o "Portable" SecPortable
+ SetOutPath "$INSTDIR"
+ File "portable.xml"
+SectionEnd
+
+Section "Translations" SecTrans
+ SetOutPath "$INSTDIR"
+ File /nonfatal /r "${SRCDIR}\translations"
+SectionEnd
+
+;Package descriptions
+!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
+ !insertmacro MUI_DESCRIPTION_TEXT ${SecCore} "The core program files."
+ !insertmacro MUI_DESCRIPTION_TEXT ${SecShortcuts} "Create game shortcuts."
+ !insertmacro MUI_DESCRIPTION_TEXT ${SecMusic} "Background music. (If selected the music will be downloaded from the internet.)"
+ !insertmacro MUI_DESCRIPTION_TEXT ${SecPortable} "Portable client. (If selected client will work as portable client.)"
+ !insertmacro MUI_DESCRIPTION_TEXT ${SecTrans} "Translations for the user interface into 23 different languages. Uncheck this component to leave it in English."
+!insertmacro MUI_FUNCTION_DESCRIPTION_END
+
+
+
+Section -AdditionalIcons
+ WriteIniStr "$INSTDIR\${PRODUCT_NAME}.url" "InternetShortcut" "URL" "${PRODUCT_WEB_SITE}"
+ CreateShortCut "$SMPROGRAMS\Mana\Website.lnk" "$INSTDIR\${PRODUCT_NAME}.url"
+ CreateShortCut "$SMPROGRAMS\Mana\Readme.lnk" "notepad.exe" "$INSTDIR\README.txt"
+ CreateShortCut "$SMPROGRAMS\Mana\FAQ.lnk" "$INSTDIR\docs\FAQ.txt"
+ CreateShortCut "$SMPROGRAMS\Mana\Uninstall.lnk" "$INSTDIR\uninst.exe"
+SectionEnd
+
+Section -Post
+ WriteUninstaller "$INSTDIR\uninst.exe"
+ WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\manaplus.exe"
+ WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)"
+ WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\uninst.exe"
+ WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayIcon" "$INSTDIR\manaplus.exe"
+ WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"
+ WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "${PRODUCT_WEB_SITE}"
+ WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Publisher" "${PRODUCT_PUBLISHER}"
+SectionEnd
+
+Function un.onInit
+ !insertmacro MUI_UNGETLANGUAGE
+FunctionEnd
+
+Section Uninstall
+ DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Mana"
+
+ Delete "$INSTDIR\*.*"
+
+ Delete "$SMPROGRAMS\Mana\Uninstall.lnk"
+ Delete "$DESKTOP\ManaPlus.lnk"
+ Delete "$SMPROGRAMS\Mana\ManaPlus.lnk"
+ Delete "$SMPROGRAMS\Mana\ManaPlus (no opengl).lnk"
+ Delete "$SMPROGRAMS\Mana\Website.lnk"
+ Delete "$SMPROGRAMS\Mana\Readme.lnk"
+ Delete "$SMPROGRAMS\Mana\FAQ.lnk"
+
+ RMDir "$SMPROGRAMS\Mana"
+
+ RMDir /r "$INSTDIR\data"
+ RMDir /r "$INSTDIR\docs"
+ RMDir /r "$INSTDIR\translations"
+ RMDir /r "$INSTDIR\updates"
+ RMDir "$INSTDIR"
+
+ DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
+ DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}"
+ SetAutoClose true
+SectionEnd
diff --git a/packaging/windows/setup_finish.bmp b/packaging/windows/setup_finish.bmp
new file mode 100644
index 000000000..c23770b9f
--- /dev/null
+++ b/packaging/windows/setup_finish.bmp
Binary files differ
diff --git a/packaging/windows/setup_welcome.bmp b/packaging/windows/setup_welcome.bmp
new file mode 100644
index 000000000..c23770b9f
--- /dev/null
+++ b/packaging/windows/setup_welcome.bmp
Binary files differ