2 ; Open \______ \ ____ ____ | | _\_ |__ _______ ___
3 ; Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4 ; Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5 ; Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
9 ; Copyright (c) 2010 Dominik Riebeling
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.
14 ; This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
15 ; KIND, either express or implied.
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)
27 Name "Rockbox Theme Editor"
28 OutFile "rbthemeeditor-setup.exe"
30 ;Default installation folder
31 InstallDir "$PROGRAMFILES\Rockbox Theme Editor"
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"
37 ;Get installation folder from registry if available
38 InstallDirRegKey HKCU "${SETTINGS_HIVE}" ""
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
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
58 !insertmacro MUI_PAGE_LICENSE
"..\..\docs\COPYING"
59 !insertmacro MUI_PAGE_COMPONENTS
60 !insertmacro MUI_PAGE_DIRECTORY
61 !insertmacro MUI_PAGE_INSTFILES
63 !insertmacro MUI_UNPAGE_CONFIRM
64 !insertmacro MUI_UNPAGE_INSTFILES
67 !insertmacro MUI_LANGUAGE
"English"
70 Section "Theme Editor" SecThemeEditor
71 SectionSetFlags
${SecThemeEditor} ${SF_RO}
74 ; Store installation folder
75 WriteRegStr HKCU "${SETTINGS_HIVE}" "" $INSTDIR
77 CreateDirectory "$INSTDIR"
78 File /oname=
$INSTDIR\rbthemeeditor
.exe release\rbthemeeditor
.exe
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"
88 Section "Download Fonts Package" SecFontsPackage
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\"
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"
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
116 ; Uninstaller Section
119 Delete "$INSTDIR\Uninstall.exe"
120 Delete "$INSTDIR\rbthemeeditor.exe"
121 Delete "$INSTDIR\rockbox-fonts.zip"
123 RMDir /r
"$INSTDIR\fonts"
126 RMDir /r
"$SMPROGRAMS\Rockbox"
128 ; remove registry information
129 DeleteRegKey HKLM "${UNINSTALL_HIVE}"
130 DeleteRegKey HKCU "Software\rockbox.org\Rockbox Theme Editor"