diff --git a/installer/images/hx.bmp b/installer/images/hx.bmp
new file mode 100644
index 000000000..ce7d47047
Binary files /dev/null and b/installer/images/hx.bmp differ
diff --git a/installer/images/hx.png b/installer/images/hx.png
new file mode 100644
index 000000000..a556e04fa
Binary files /dev/null and b/installer/images/hx.png differ
diff --git a/installer/images/installer-header.svg b/installer/images/installer-header.svg
new file mode 100644
index 000000000..70ea2fc5e
--- /dev/null
+++ b/installer/images/installer-header.svg
@@ -0,0 +1,722 @@
+
+
+
+
diff --git a/installer/images/installer-wizard.svg b/installer/images/installer-wizard.svg
new file mode 100644
index 000000000..fdbf7d54e
--- /dev/null
+++ b/installer/images/installer-wizard.svg
@@ -0,0 +1,812 @@
+
+
+
+
diff --git a/installer/images/tango-install.ico b/installer/images/tango-install.ico
new file mode 100644
index 000000000..e5358d015
Binary files /dev/null and b/installer/images/tango-install.ico differ
diff --git a/installer/images/wiz.bmp b/installer/images/wiz.bmp
new file mode 100644
index 000000000..d71c5c608
Binary files /dev/null and b/installer/images/wiz.bmp differ
diff --git a/installer/picard-setup.nsi.in b/installer/picard-setup.nsi.in
index fdd92b7f6..37d012737 100644
--- a/installer/picard-setup.nsi.in
+++ b/installer/picard-setup.nsi.in
@@ -1,16 +1,23 @@
+; Modified to conform to Modern UI 2.0
+
!define PROJECT_PATH ".."
!define PRODUCT_NAME "%(name)s"
!define PRODUCT_VERSION "%(version)s"
+!define PRODUCT_PUBLISHER "MusicBrainz"
+!define PRODUCT_DESCRIPTION "%(description)s"
+!define PRODUCT_URL "%(url)s"
!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
!define PRODUCT_UNINST_ROOT_KEY "HKLM"
-!define PRODUCT_STARTMENU_REGVAL "NSIS:StartMenuDir"
-SetCompressor /SOLID lzma
+SetCompressor /FINAL /SOLID LZMA
Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
OutFile "picard-setup-${PRODUCT_VERSION}.exe"
ShowInstDetails show
ShowUnInstDetails show
+BrandingText " "
+; We need this so Windows 7/Vista lets us install what we need to
+RequestExecutionLevel highest
; The default installation directory
InstallDir "$PROGRAMFILES\${PRODUCT_NAME}"
@@ -18,9 +25,21 @@ InstallDir "$PROGRAMFILES\${PRODUCT_NAME}"
; The default installation directory
InstallDirRegKey HKLM "Software\MusicBrainz\${PRODUCT_NAME}" "InstallDir"
-!include "MUI.nsh"
+!include "MUI2.nsh"
+!include "InstallOptions.nsh"
; MUI Settings
+
+; Make installer pretty
+!define MUI_HEADERIMAGE
+!define MUI_HEADERIMAGE_RIGHT
+!define MUI_HEADERIMAGE_BITMAP "${PROJECT_PATH}\installer\images\hx.bmp" ;
+!define MUI_WELCOMEFINISHPAGE_BITMAP "${PROJECT_PATH}\installer\images\wiz.bmp"
+!define MUI_ICON "${PROJECT_PATH}\installer\images\tango-install.ico"
+!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\classic-uninstall.ico"
+
+
+; Abort Warning
!define MUI_ABORTWARNING
; Welcome page
@@ -33,13 +52,8 @@ InstallDirRegKey HKLM "Software\MusicBrainz\${PRODUCT_NAME}" "InstallDir"
; Directory page
!insertmacro MUI_PAGE_DIRECTORY
-; Start menu page
-var ICONS_GROUP
-!define MUI_STARTMENUPAGE_DEFAULTFOLDER "MusicBrainz"
-!define MUI_STARTMENUPAGE_REGISTRY_ROOT "${PRODUCT_UNINST_ROOT_KEY}"
-!define MUI_STARTMENUPAGE_REGISTRY_KEY "${PRODUCT_UNINST_KEY}"
-!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "${PRODUCT_STARTMENU_REGVAL}"
-!insertmacro MUI_PAGE_STARTMENU Application $ICONS_GROUP
+; Components page
+!insertmacro MUI_PAGE_COMPONENTS
; Instfiles page
!insertmacro MUI_PAGE_INSTFILES
@@ -56,71 +70,163 @@ UninstPage custom un.RemoveSettingsPage
!define MUI_UNPAGE_FINISH_TITLE_3LINES
!insertmacro MUI_UNPAGE_FINISH
+; Reserve files
+ReserveFile "removeSettings.ini"
+ReserveFile "${NSISDIR}\Plugins\InstallOptions.dll"
+
; Language files
!insertmacro MUI_LANGUAGE "English"
-; Reserve files
-ReserveFile "removeSettings.ini"
-!insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
+; Adds info to installer
+VIProductVersion "0.12.0.0"
+VIAddVersionKey /LANG=${LANG_ENGLISH} "ProductName" "${PRODUCT_NAME}"
+VIAddVersionKey /LANG=${LANG_ENGLISH} "Comments" "${PRODUCT_DESCRIPTION}"
+VIAddVersionKey /LANG=${LANG_ENGLISH} "CompanyName" "${PRODUCT_PUBLISHER}"
+VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalCopyright" "© ${PRODUCT_PUBLISHER} under the GNU GPLv2."
+VIAddVersionKey /LANG=${LANG_ENGLISH} "FileDescription" "Installation for ${PRODUCT_NAME}"
+VIAddVersionKey /LANG=${LANG_ENGLISH} "FileVersion" "%(version)s"
-Function un.onInit
+; Install
+Section !Required req
+ SectionIn RO
+ SetOutPath "$INSTDIR"
+ SetOverwrite on
+
+ ; Files
+ File "${PROJECT_PATH}\dist\"
+
+ RMDir "$INSTDIR\imageformats"
+ CreateDirectory "$INSTDIR\imageformats"
+ SetOutPath "$INSTDIR\imageformats"
+ File /r "${PROJECT_PATH}\dist\imageformats\"
- !insertmacro MUI_INSTALLOPTIONS_EXTRACT "removeSettings.ini"
+ ; Write the installation path into the registry
+ WriteRegStr HKLM "Software\MusicBrainz\${PRODUCT_NAME}" "InstallDir" "$INSTDIR"
+
+ ; Create uninstaller
+ WriteUninstaller "$INSTDIR\uninst.exe"
+ WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "${PRODUCT_NAME}"
+ WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayIcon" "$INSTDIR\picard.exe"
+ WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"
+ WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Publisher" "${PRODUCT_PUBLISHER}"
+ WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "InstallSource" "$INSTDIR\"
+ WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Comments" "${PRODUCT_DESCRIPTION}"
+ WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "${PRODUCT_URL}"
+ WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\uninst.exe"
-FunctionEnd
+SectionEnd
+Section "" imgs
+ SectionIn RO
+ RMDir "$INSTDIR\imageformats"
+ CreateDirectory "$INSTDIR\imageformats"
+ SetOutPath "$INSTDIR\imageformats"
+ File /r "${PROJECT_PATH}\dist\imageformats\"
+SectionEnd
+
+Section "Phonon" phonon
+ RMDir "$INSTDIR\phonon_backend"
+ CreateDirectory "$INSTDIR\phonon_backend"
+ SetOutPath "$INSTDIR\phonon_backend"
+ File /r "${PROJECT_PATH}\dist\phonon_backend\"
+SectionEnd
+
+Section "Languages" lang
+ RMDir "$INSTDIR\locale"
+ CreateDirectory "$INSTDIR\locale"
+ SetOutPath "$INSTDIR\locale"
+ File /r "${PROJECT_PATH}\dist\locale\"
+SectionEnd
+
+SubSection "Shortcuts" shortcuts
+
+ Section "Startmenu" startmenu
+ SetShellVarContext all
+ CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}.lnk" "$INSTDIR\picard.exe"
+ SectionEnd
+
+ Section "Desktop" desktop
+ SetShellVarContext all
+ CreateShortCut "$DESKTOP\${PRODUCT_NAME}.lnk" "$INSTDIR\picard.exe"
+ SectionEnd
+
+ Section "Quick Launch" quicklaunch
+ SetShellVarContext all
+ CreateShortCut "$QUICKLAUNCH\${PRODUCT_NAME}.lnk" "$INSTDIR\picard.exe"
+ SectionEnd
+
+SubSectionEnd
+
+Section "Plugins" plugins
+ CreateDirectory "$INSTDIR\plugins"
+ SetOutPath "$INSTDIR\plugins"
+ File /r "${PROJECT_PATH}\dist\plugins\"
+SectionEnd
+
+; Uninstall
Function un.RemoveSettingsPage
!insertmacro MUI_DEFAULT MUI_UNCONFIRMPAGE_TEXT_TOP ""
!insertmacro MUI_DEFAULT MUI_UNCONFIRMPAGE_TEXT_LOCATION ""
- !insertmacro MUI_INSTALLOPTIONS_DISPLAY "removeSettings.ini"
+ !insertmacro INSTALLOPTIONS_DISPLAY "removeSettings.ini"
FunctionEnd
-; Install
-Section "MainSection" SEC01
-
- SetOutPath "$INSTDIR"
-
- ; Files
- File /r "${PROJECT_PATH}\dist\"
- CreateDirectory "$INSTDIR\plugins"
-
- ; Shortcuts
- !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
- CreateDirectory "$SMPROGRAMS\$ICONS_GROUP"
- CreateShortCut "$DESKTOP\${PRODUCT_NAME}.lnk" "$INSTDIR\picard.exe"
- CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\${PRODUCT_NAME}.lnk" "$INSTDIR\picard.exe"
- !insertmacro MUI_STARTMENU_WRITE_END
-
- ; Write the installation path into the registry
- WriteRegStr HKLM "Software\MusicBrainz\${PRODUCT_NAME}" "InstallDir" "$INSTDIR"
-
- ; Create uninstaller
- WriteUninstaller "$INSTDIR\uninst.exe"
- WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)"
- WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayIcon" "$INSTDIR\picard.exe"
- WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"
- WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\uninst.exe"
-
-SectionEnd
-
-; Uninstall
Section Uninstall
- !insertmacro MUI_STARTMENU_GETFOLDER "Application" $ICONS_GROUP
+ ;!insertmacro MUI_STARTMENU_GETFOLDER "Application" $ICONS_GROUP
RMDir /r "$INSTDIR"
-
+
+ SetShellVarContext all
Delete "$DESKTOP\${PRODUCT_NAME}.lnk"
- Delete "$SMPROGRAMS\$ICONS_GROUP\${PRODUCT_NAME}.lnk"
- RMDir "$SMPROGRAMS\$ICONS_GROUP"
+
+ SetShellVarContext all
+ Delete "$SMPROGRAMS\${PRODUCT_NAME}.lnk"
+
+ SetShellVarContext all
+ Delete "$QUICKLAUNCH\${PRODUCT_NAME}.lnk"
DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
DeleteRegKey HKLM "Software\MusicBrainz\${PRODUCT_NAME}"
- !insertmacro MUI_INSTALLOPTIONS_READ $R0 "removeSettings.ini" "Field 1" "State"
+ !insertmacro INSTALLOPTIONS_READ $R0 "removeSettings.ini" "Field 1" "State"
StrCmp $R0 "1" 0 +2
- DeleteRegKey HKCU "Software\MusicBrainz\${PRODUCT_NAME}"
-
+ ; Even more attempts
+ DeleteRegKey HKCU "Software\MusicBrainz\Picard\persist"
+ DeleteRegKey HKCU "Software\MusicBrainz\Picard\setting"
+ DeleteRegKey HKCU "Software\MusicBrainz\Picard"
+ ;RMDir "$APPDATA\MusicBrainz\Picard\plugins"
+
SectionEnd
+
+; Checks whether program is running.
+!define WNDCLASS "QWidget"
+!define WNDTITLE "${PRODUCT_NAME}"
+Function un.onInit
+ !insertmacro INSTALLOPTIONS_EXTRACT "removeSettings.ini"
+ FindWindow $0 "${WNDCLASS}" "${WNDTITLE}"
+ StrCmp $0 0 continueInstall
+ MessageBox MB_ICONSTOP|MB_OK "The application you are trying to remove is running. Close it and try again."
+ Abort
+ continueInstall:
+FunctionEnd
+Function .onInit
+ FindWindow $0 "${WNDCLASS}" "${WNDTITLE}"
+ StrCmp $0 0 continueInstall
+ MessageBox MB_ICONSTOP|MB_OK "The application you are trying to install is running. Close it and try again."
+ Abort
+ continueInstall:
+ !insertmacro UnselectSection ${plugins}
+ !insertmacro UnselectSection ${quicklaunch}
+FunctionEnd
+
+!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
+ !insertmacro MUI_DESCRIPTION_TEXT ${req} "Installs ${PRODUCT_NAME} along with the necessary files for it run."
+ !insertmacro MUI_DESCRIPTION_TEXT ${phonon} "Installs support for limited music playback in ${PRODUCT_NAME}."
+ !insertmacro MUI_DESCRIPTION_TEXT ${lang} "Installs translations of ${PRODUCT_NAME} in different languages."
+ !insertmacro MUI_DESCRIPTION_TEXT ${plugins} "Installs all of the plugins that are bundled with this release."
+ !insertmacro MUI_DESCRIPTION_TEXT ${desktop} "Installs a shortcut on the desktop."
+ !insertmacro MUI_DESCRIPTION_TEXT ${startmenu} "Installs shortcuts in the Start Menu."
+ !insertmacro MUI_DESCRIPTION_TEXT ${quicklaunch} "Installs a shortcut in the quicklaunch bar."
+!insertmacro MUI_FUNCTION_DESCRIPTION_END
\ No newline at end of file