From: Pat Thoyts Date: Wed, 16 Jun 2010 12:38:07 +0000 (+0100) Subject: Provide a Windows installer. X-Git-Tag: v0.4~19 X-Git-Url: http://privyetmir.co.uk/gitweb.cgi?a=commitdiff_plain;h=a7c47d4e6c6316e20433da64f97e05ccd8bf643c;p=anagramarama Provide a Windows installer. This patch implements an installer for Windows using the open source Nullsoft Scriptable Installation System (http://nsis.sourceforge.net) to create a simple installation option for end users. Signed-off-by: Pat Thoyts --- diff --git a/Anagramarama.nsi b/Anagramarama.nsi new file mode 100644 index 0000000..725c951 --- /dev/null +++ b/Anagramarama.nsi @@ -0,0 +1,158 @@ +;; Anagramarama.nsi - Copyright (C) 2006 Pat Thoyts +;; +;; ------------------------------------------------------------------------- +;; +;; This is an NSIS installer script to create a Windows installer for +;; Anagramarama. +;; +;; This script needs to be compiled by the NullSoft installer compiler. +;; +;; ------------------------------------------------------------------------- +;; +;; Copyright (c) 2006 Pat Thoyts +;; +;; Licensed under the Apache License, Version 2.0 (the "License"); +;; you may not use this file except in compliance with the License. +;; You may obtain a copy of the License at +;; +;; http://www.apache.org/licenses/LICENSE-2.0 +;; +;; Unless required by applicable law or agreed to in writing, software +;; distributed under the License is distributed on an "AS IS" BASIS, +;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +;; See the License for the specific language governing permissions and +;; limitations under the License. +;; +;; ------------------------------------------------------------------------- + +!include "MUI.nsh" + +!define AG_RELEASE_MAJOR 0 +!define AG_RELEASE_MINOR 3 +!define AG_RELEASE_PATCH 1 + +Name "Anagramarama" +OutFile "Anagramarama${AG_RELEASE_MAJOR}${AG_RELEASE_MINOR}.exe" +SetCompressor /solid lzma +CRCCheck on +XPStyle on +SilentInstall normal +ShowInstDetails hide +RequestExecutionLevel admin + +InstallDir $PROGRAMFILES\Anagramarama +InstallDirRegKey HKLM "SOFTWARE\Anagramarama" "" +!define UninstallRegistryKey SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Anagramarama + +;; ------------------------------------------------------------------------- +;; Version resource +;; +ViProductVersion "${AG_RELEASE_MAJOR}.${AG_RELEASE_MINOR}.0.0" +VIAddVersionKey FileVersion ${AG_RELEASE_MAJOR}.${AG_RELEASE_MINOR}.0.${AG_RELEASE_PATCH}" +VIAddVersionKey ProductVersion ${AG_RELEASE_MAJOR}.${AG_RELEASE_MINOR}.0.0" +VIAddVersionKey ProductName "Anagramarama" +VIAddVersionKey CompanyName "Colm Gallagher" +VIAddVersionKey LegalCopyright "Copyright (c) Colm Gallagher" +VIAddVersionKey FileDescription "Anagramarama Installer" + +;; ------------------------------------------------------------------------- +;; Language strings +;; +LangString DESC_SecMain ${LANG_ENGLISH} \ + "Install program files and English resources (required)." +LangString DESC_SecDocs ${LANG_ENGLISH} \ + "Install documentation." +LangString DESC_SecLangPt ${LANG_ENGLISH} \ + "Include Partugese support." +LangString DESC_SecMenu ${LANG_ENGLISH} \ + "Create Start menu shortcuts." +LangString DESC_FinishPageText ${LANG_ENGLISH} \ + "Successfully installed Anagramarama." + +;; ------------------------------------------------------------------------- +;; Interface Settings + +!define MUI_ABORTWARNING + +;; ------------------------------------------------------------------------- +;; Pages + +!insertmacro MUI_PAGE_WELCOME +!insertmacro MUI_PAGE_LICENSE "gpl.txt" +!insertmacro MUI_PAGE_COMPONENTS +!insertmacro MUI_PAGE_DIRECTORY +!define MUI_FINISHPAGE_NOAUTOCLOSE "True" +!insertmacro MUI_PAGE_INSTFILES +!define MUI_FINISHPAGE_TEXT $(DESC_FinishPageText) +!insertmacro MUI_PAGE_FINISH + +!insertmacro MUI_UNPAGE_WELCOME +!insertmacro MUI_UNPAGE_CONFIRM +!insertmacro MUI_UNPAGE_INSTFILES +!define MUI_UNFINISHPAGE_NOAUTOCLOSE "True" +!insertmacro MUI_UNPAGE_FINISH + +;; ------------------------------------------------------------------------- +;; Installer Sections +;; +Section "Anagramara" SecMain + SectionIn RO + SetOutPath "$INSTDIR" + File "Release\ag.exe" + File "Release\SDL.dll" + File "Release\SDL_mixer.dll" + File /r "audio" + SetOutPath "$INSTDIR\i18n" + File /r "i18n\en_GB" + WriteRegStr HKLM "${UninstallRegistryKey}" "DisplayName" "Anagramarama" + WriteRegStr HKLM "${UninstallRegistryKey}" "UninstallString" "$INSTDIR\Uninstall.exe" + WriteRegDWORD HKLM "${UninstallRegistryKey}" "NoModify" 1 + WriteRegDWORD HKLM "${UninstallRegistryKey}" "NoRepair" 1 + WriteUninstaller "$INSTDIR\Uninstall.exe" +SectionEnd + +Section "Documentation" SecDocs + SetOutPath "$INSTDIR" + File "readme" +SectionEnd + +Section /o "Portugese" SecLangPt + SetOutPath "$INSTDIR\i18n" + File /r "i18n\pt_BR" +SectionEnd + +Section /o "Start Menu Shortcuts" SecMenu + SetOutPath "$INSTDIR" + CreateDirectory "$SMPROGRAMS\Anagramarama" + CreateShortCut "$SMPROGRAMS\Anagramarama\Anagramarama.lnk" "$INSTDIR\ag.exe" "" "$INSTDIR\ag.exe" 0 + CreateShortCut "$SMPROGRAMS\Anagramarama\Uninstall.lnk" "$INSTDIR\Uninstall.exe" "" "$INSTDIR\Uninstall.exe" 0 +SectionEnd + +;; ------------------------------------------------------------------------- +;; Uninstaller Section +;; +Section "Uninstall" + Delete "$INSTDIR\Uninstall.exe" + RMDir /r "$INSTDIR" + DeleteRegKey HKLM "${UninstallRegistryKey}" + DeleteRegKey HKLM SOFTWARE\Anagramarama +SectionEnd + +;; ------------------------------------------------------------------------- +;; Assign language strings to sections +!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN + !insertmacro MUI_DESCRIPTION_TEXT ${SecMain} $(DESC_SecMain) + !insertmacro MUI_DESCRIPTION_TEXT ${SecDocs} $(DESC_SecDocs) + !insertmacro MUI_DESCRIPTION_TEXT ${SecLangPt} $(DESC_SecLangPt) + !insertmacro MUI_DESCRIPTION_TEXT ${SecMenu} $(DESC_SecMenu) +!insertmacro MUI_FUNCTION_DESCRIPTION_END + +!insertmacro MUI_LANGUAGE "English" +!insertmacro MUI_LANGUAGE "PortugueseBR" + +;; ------------------------------------------------------------------------- +;; Initialize variables +;; +Function .onInit +FunctionEnd + diff --git a/Makefile.vc b/Makefile.vc index 5e2a0c1..32c81a2 100644 --- a/Makefile.vc +++ b/Makefile.vc @@ -7,7 +7,7 @@ # $Id$ #------------------------------------------------------------------------- -VERSION=0.2 +VERSION=0.3 # You should set SDLDIR to the directory containing your SDL include # and lib directories. @@ -63,6 +63,8 @@ RMDIR = rmdir /s /q >NUL RMDIR = deltree /y !endif DEL = del /f /q +CP = copy /y >NUL +MAKENSIS = "C:\Program Files (x86)\NSIS\makensis.exe" TMPDIR =$(OUTDIR)\Objects @@ -88,6 +90,11 @@ ag: setup $(OUTDIR)\ag.exe $(OUTDIR)\ag.exe: $(OBJS) $(LD) $(LDFLAGS) -out:$@ $** $(LIBS) +release: ag + @$(CP) $(SDLDIR:/=\)\bin\sdl.dll $(OUTDIR)\SDL.dll + @$(CP) $(SDLDIR:/=\)\bin\SDL_mixer.dll $(OUTDIR)\SDL_mixer.dll + @$(MAKENSIS) /V2 Anagramarama.nsi + .PHONY: all ag #------------------------------------------------------------------------- diff --git a/src/ag.ico b/src/ag.ico new file mode 100644 index 0000000..fe16070 Binary files /dev/null and b/src/ag.ico differ diff --git a/src/ag.rc b/src/ag.rc index 8563d59..5ce4cad 100644 --- a/src/ag.rc +++ b/src/ag.rc @@ -22,12 +22,12 @@ BEGIN BEGIN BLOCK "040904b0" BEGIN - VALUE "FileDescription", "Anagramarama " VERSION "\0" - VALUE "OriginalFilename", "ag" VERSION ".exe\0" + VALUE "FileDescription", "Anagramarama\0" + VALUE "OriginalFilename", "ag.exe\0" VALUE "CompanyName", "GPL\0" VALUE "FileVersion", VERSION "\0" - VALUE "LegalCopyright", "Copyright \251 2003 Colm Gallagher\0" - VALUE "ProductName", "Anagramarama " VERSION "\0" + VALUE "LegalCopyright", "GNU General Public License\0" + VALUE "ProductName", "Anagramarama\0" VALUE "ProductVersion", VERSION "\0" END END @@ -36,3 +36,5 @@ BEGIN VALUE "Translation", 0x409, 1200 END END + +100 ICON "ag.ico"