Torne Wuff | b9592e8 | 2011-11-06 22:52:21 +0000 | [diff] [blame] | 1 | ; __________ __ ___. |
| 2 | ; Open \______ \ ____ ____ | | _\_ |__ _______ ___ |
| 3 | ; Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / |
| 4 | ; Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < |
| 5 | ; Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ |
| 6 | ; \/ \/ \/ \/ \/ |
| 7 | ; $Id$ |
| 8 | ; |
| 9 | ; Copyright (c) 2010 Dominik Riebeling |
| 10 | ; |
| 11 | ; All files in this archive are subject to the GNU General Public License. |
| 12 | ; See the file COPYING in the source tree root for full license agreement. |
| 13 | ; |
| 14 | ; This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY |
| 15 | ; KIND, either express or implied. |
| 16 | ; |
| 17 | |
| 18 | ; NSIS installer using Modern UI |
| 19 | ; Expects a static build of the Theme Editor (Qt DLLs are not packaged) and to |
| 20 | ; find the input files in the source tree (in-tree build). |
| 21 | ; This installer uses the ZipDll plugin for font pack extraction |
| 22 | ; (http://nsis.sourceforge.net/ZipDLL_plug-in) |
| 23 | |
| 24 | !include "MUI2.nsh" |
| 25 | |
| 26 | ;Name and file |
| 27 | Name "Rockbox Theme Editor" |
| 28 | OutFile "rbthemeeditor-setup.exe" |
| 29 | |
| 30 | ;Default installation folder |
| 31 | InstallDir "$PROGRAMFILES\Rockbox Theme Editor" |
| 32 | |
| 33 | ; global registry shortcuts |
| 34 | !define UNINSTALL_HIVE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Rockbox Theme Editor" |
| 35 | !define SETTINGS_HIVE "Software\rockbox.org\Rockbox Theme Editor" |
| 36 | |
| 37 | ;Get installation folder from registry if available |
| 38 | InstallDirRegKey HKCU "${SETTINGS_HIVE}" "" |
| 39 | |
| 40 | SetCompressor /solid lzma |
| 41 | VIAddVersionKey "ProductName" "Rockbox Theme Editor" |
| 42 | VIAddVersionKey "FileVersion" "0.0.0" |
| 43 | VIAddVersionKey "FileDescription" "Editor for the Rockbox Firmware Theme files" |
| 44 | VIAddVersionKey "LegalCopyright" "Contributing Developers" |
| 45 | VIProductVersion "0.0.0.0" |
| 46 | !define MUI_ICON resources\windowicon.ico |
| 47 | ; embed XP manifest |
| 48 | XPStyle on |
| 49 | |
| 50 | ;Interface Configuration. Use Rockbox blue for header. |
| 51 | !define MUI_BGCOLOR b6c6e5 |
| 52 | !define MUI_HEADERIMAGE |
| 53 | !define MUI_HEADERIMAGE_BITMAP "themeeditor-setup.bmp" |
| 54 | !define MUI_HEADERIMAGE_RIGHT |
| 55 | !define MUI_ABORTWARNING |
| 56 | |
| 57 | ;Pages |
| 58 | !insertmacro MUI_PAGE_LICENSE "..\..\docs\COPYING" |
| 59 | !insertmacro MUI_PAGE_COMPONENTS |
| 60 | !insertmacro MUI_PAGE_DIRECTORY |
| 61 | !insertmacro MUI_PAGE_INSTFILES |
| 62 | |
| 63 | !insertmacro MUI_UNPAGE_CONFIRM |
| 64 | !insertmacro MUI_UNPAGE_INSTFILES |
| 65 | |
| 66 | ;Languages |
| 67 | !insertmacro MUI_LANGUAGE "English" |
| 68 | |
| 69 | ;Installer Sections |
| 70 | Section "Theme Editor" SecThemeEditor |
| 71 | SectionSetFlags ${SecThemeEditor} ${SF_RO} |
| 72 | SectionIn RO |
| 73 | SetOutPath "$INSTDIR" |
| 74 | ; Store installation folder |
| 75 | WriteRegStr HKCU "${SETTINGS_HIVE}" "" $INSTDIR |
| 76 | ; files |
| 77 | CreateDirectory "$INSTDIR" |
| 78 | File /oname=$INSTDIR\rbthemeeditor.exe release\rbthemeeditor.exe |
| 79 | |
| 80 | ; Create uninstaller and uninstall information |
| 81 | WriteUninstaller "$INSTDIR\Uninstall.exe" |
| 82 | WriteRegStr HKLM "${UNINSTALL_HIVE}" "DisplayName" "Rockbox Theme Editor" |
| 83 | WriteRegStr HKLM "${UNINSTALL_HIVE}" "UninstallString" "$\"$INSTDIR\Uninstall.exe$\"" |
| 84 | WriteRegStr HKLM "${UNINSTALL_HIVE}" "QuietUninstallString" "$\"$INSTDIR\Uninstall.exe$\" /S" |
| 85 | WriteRegStr HKLM "${UNINSTALL_HIVE}" "URLInfoAbout" "http://www.rockbox.org/wiki/ThemeEditor" |
| 86 | SectionEnd |
| 87 | |
| 88 | Section "Download Fonts Package" SecFontsPackage |
| 89 | SetOutPath "$INSTDIR" |
| 90 | NSISdl::download http://download.rockbox.org/daily/fonts/rockbox-fonts.zip "$INSTDIR\rockbox-fonts.zip" |
| 91 | ZipDLL::extractall "$INSTDIR\rockbox-fonts.zip" "$INSTDIR" <ALL> |
| 92 | ; the fonts package uses the Rockbox folder structure. Move all fonts into a |
| 93 | ; flat directory instead. |
| 94 | Rename "$INSTDIR\.rockbox\fonts" "$INSTDIR\fonts" |
| 95 | RMDir /r "$INSTDIR\.rockbox" |
| 96 | WriteRegStr HKCU "${SETTINGS_HIVE}\RBFont" "fontDir" "$INSTDIR\fonts\" |
| 97 | SectionEnd |
| 98 | |
| 99 | Section "Start Menu Shortcut" SecShortCuts |
| 100 | CreateDirectory "$SMPROGRAMS\Rockbox" |
| 101 | CreateShortCut "$SMPROGRAMS\Rockbox\Theme Editor.lnk" "$INSTDIR\rbthemeeditor.exe" |
| 102 | CreateShortCut "$SMPROGRAMS\Rockbox\Uninstall Theme Editor.lnk" "$INSTDIR\Uninstall.exe" |
| 103 | SectionEnd |
| 104 | |
| 105 | ; Assign language strings to sections |
| 106 | !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN |
| 107 | !insertmacro MUI_DESCRIPTION_TEXT ${SecThemeEditor} \ |
| 108 | "Rockbox Theme Editor. Required." |
| 109 | !insertmacro MUI_DESCRIPTION_TEXT ${SecFontsPackage} \ |
| 110 | "Download and install the Rockbox Fonts package into program folder. \ |
| 111 | This will set the correct path in the program configuration for the current user only." |
| 112 | !insertmacro MUI_DESCRIPTION_TEXT ${SecShortCuts} \ |
| 113 | "Create Shortcut in Start Menu." |
| 114 | !insertmacro MUI_FUNCTION_DESCRIPTION_END |
| 115 | |
| 116 | ; Uninstaller Section |
| 117 | Section "Uninstall" |
| 118 | ; files |
| 119 | Delete "$INSTDIR\Uninstall.exe" |
| 120 | Delete "$INSTDIR\rbthemeeditor.exe" |
| 121 | Delete "$INSTDIR\rockbox-fonts.zip" |
| 122 | ; folders |
| 123 | RMDir /r "$INSTDIR\fonts" |
| 124 | RMDir "$INSTDIR" |
| 125 | ; start menu folder |
| 126 | RMDir /r "$SMPROGRAMS\Rockbox" |
| 127 | |
| 128 | ; remove registry information |
| 129 | DeleteRegKey HKLM "${UNINSTALL_HIVE}" |
| 130 | DeleteRegKey HKCU "Software\rockbox.org\Rockbox Theme Editor" |
| 131 | SectionEnd |
| 132 | |