Warning, /multimedia/amarok/release_scripts/windows/amarok.nsi is written in an unsupported language. File is not indexed.
0001 /****************************************************************************************
0002 * Copyright (c) 2012 Patrick von Reth <vonreth@kde.org> *
0003 * *
0004 * This program is free software; you can redistribute it and/or modify it under *
0005 * the terms of the GNU General Public License as published by the Free Software *
0006 * Foundation; either version 2 of the License, or (at your option) any later *
0007 * version. *
0008 * *
0009 * This program is distributed in the hope that it will be useful, but WITHOUT ANY *
0010 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A *
0011 * PARTICULAR PURPOSE. See the GNU General Public License for more details. *
0012 * *
0013 * You should have received a copy of the GNU General Public License along with *
0014 * this program. If not, see <http://www.gnu.org/licenses/>. *
0015 ****************************************************************************************/
0016
0017 /*
0018 This script requires the Unicode NSIS framework http://www.scratchpaper.com/
0019 You will also need to install http://nsis.sourceforge.net/Nsis7z_plug-in
0020 */
0021 ; registry stuff
0022 !define regkey "Software\${company}\Amarok"
0023 !define uninstkey "Software\Microsoft\Windows\CurrentVersion\Uninstall\Amarok"
0024
0025 !define startmenu "$SMPROGRAMS\Amarok"
0026 !define uninstaller "uninstall.exe"
0027
0028 Var StartMenuFolder
0029
0030 !define MUI_LANGDLL_ALLLANGUAGES
0031 !define MUI_ICON "amarok.ico"
0032 !define PRODUCT_WEB_SITE http://amarok.kde.org/
0033
0034 ;save language
0035 !define MUI_LANGDLL_REGISTRY_ROOT "HKLM"
0036 !define MUI_LANGDLL_REGISTRY_KEY "${regkey}"
0037 !define MUI_LANGDLL_REGISTRY_VALUENAME "Installer Language"
0038
0039 ;Start Menu Folder Page Configuration
0040 !define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKLM"
0041 !define MUI_STARTMENUPAGE_REGISTRY_KEY "${regkey}"
0042 !define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Start Menu Folder"
0043 ;--------------------------------
0044 Unicode true
0045 XPStyle on
0046 ShowInstDetails hide
0047 ShowUninstDetails hide
0048
0049 SetCompressor /SOLID lzma
0050
0051
0052 Name "${productname}"
0053 Caption "${productname}"
0054
0055 OutFile "${setupname}"
0056
0057 !include "MUI2.nsh"
0058 ; all required LangStrings
0059 !include "amarok_translation.nsh"
0060 ; a list of all supported language packages
0061 !include "languages.nsh"
0062
0063 SetDateSave on
0064 SetDatablockOptimize on
0065 CRCCheck on
0066 SilentInstall normal
0067
0068 InstallDir "$PROGRAMFILES\Amarok"
0069 InstallDirRegKey HKLM "${regkey}" ""
0070
0071 ;--------------------------------
0072
0073 AutoCloseWindow false
0074 ShowInstDetails hide
0075
0076
0077 !insertmacro MUI_PAGE_WELCOME
0078 !define MUI_PAGE_HEADER_TEXT $(PAGE_LICENSE_HEADER_TEXT)
0079 !define MUI_PAGE_HEADER_SUBTEXT $(PAGE_LICENSE_SUBTEXT)
0080 !define MUI_LICENSEPAGE_TEXT_BOTTOM " "
0081 !define MUI_LICENSEPAGE_BUTTON $(^NextBtn)
0082 !insertmacro MUI_PAGE_LICENSE "..\..\COPYING"
0083 !insertmacro MUI_PAGE_DIRECTORY
0084 !insertmacro MUI_PAGE_STARTMENU Application $StartMenuFolder
0085 !define MUI_COMPONENTSPAGE_NODESC
0086 !insertmacro MUI_PAGE_COMPONENTS
0087 !insertmacro MUI_PAGE_INSTFILES
0088 !define MUI_FINISHPAGE_LINK "$(VISIT_PROJECT_HOMEPAGE)"
0089 !define MUI_FINISHPAGE_LINK_LOCATION "${PRODUCT_WEB_SITE}"
0090 !define MUI_FINISHPAGE_RUN "$INSTDIR\bin\amarok.exe"
0091 !insertmacro MUI_PAGE_FINISH
0092
0093
0094 !insertmacro MUI_UNPAGE_WELCOME
0095 !insertmacro MUI_UNPAGE_CONFIRM
0096 !insertmacro MUI_UNPAGE_INSTFILES
0097 !insertmacro MUI_UNPAGE_FINISH
0098
0099
0100
0101 Section "Amarok" SECTION_AMAROK
0102 SectionIn RO
0103 SetOutPath $INSTDIR
0104 SetShellVarContext all
0105
0106 ExecWait '"$INSTDIR\bin\kdeinit4.exe" "--terminate"'
0107 WriteRegStr HKLM "${regkey}" "Install_Dir" "$INSTDIR"
0108 WriteRegStr HKLM "${regkey}" "Version" "${version}"
0109 WriteRegStr HKLM "${regkey}" "" "$INSTDIR\bin\amarok.exe"
0110
0111 WriteRegStr HKLM "${uninstkey}" "DisplayName" "Amarok (remove only)"
0112 WriteRegStr HKLM "${uninstkey}" "DisplayIcon" "$INSTDIR\${MUI_ICON}"
0113 WriteRegStr HKLM "${uninstkey}" "DisplayVersion" "${version}"
0114 WriteRegStr HKLM "${uninstkey}" "URLInfoAbout" "${PRODUCT_WEB_SITE}"
0115 WriteRegStr HKLM "${uninstkey}" "UninstallString" '"$INSTDIR\${uninstaller}"'
0116 WriteRegStr HKLM "${uninstkey}" "Publisher" "${company}"
0117
0118 ; package all files, recursively, preserving attributes
0119 ; assume files are in the correct places
0120
0121 File /a /r /x "*.nsi" /x "${setupname}" "${srcdir}\*.*"
0122 File ${MUI_ICON}
0123 File "/oname=$INSTDIR\bin\kde.conf" "kde.conf"
0124
0125 WriteUninstaller "${uninstaller}"
0126
0127 ;Create shortcuts
0128 !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
0129 CreateDirectory "$SMPROGRAMS\$StartMenuFolder"
0130 CreateShortCut "$SMPROGRAMS\$StartMenuFolder\Amarok.lnk" "$INSTDIR\bin\Amarok.exe"
0131 CreateShortCut "$SMPROGRAMS\$StartMenuFolder\$(APPEARANCE_SETTINGS).lnk" "$INSTDIR\bin\kcmshell4.exe" "style" "$INSTDIR\bin\systemsettings.exe"
0132 CreateShortCut "$SMPROGRAMS\$StartMenuFolder\$(LANGUAGE_SETTINGS).lnk" "$INSTDIR\bin\kcmshell4.exe" "language" "$INSTDIR\bin\systemsettings.exe"
0133 CreateShortCut "$SMPROGRAMS\$StartMenuFolder\Uninstall.lnk" "$INSTDIR\uninstall.exe"
0134 !insertmacro MUI_STARTMENU_WRITE_END
0135 SectionEnd
0136
0137 Section /o $(SECTION_SNORE) SECTION_SNORE
0138 !insertmacro KDE_FETCH_AND_EXTRACT "http://winkde.org/~pvonreth/downloads/Amarok/${version}/" "snorenotify-${architecture}-0.3.7z" "Installing Snore..."
0139 !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
0140 CreateShortCut "$SMPROGRAMS\$StartMenuFolder\Snorenotify.lnk" "$INSTDIR\bin\snorenotify.exe"
0141 !insertmacro MUI_STARTMENU_WRITE_END
0142 SectionEnd
0143
0144 !insertmacro KDE_LANGUAGE_PACKAGES
0145
0146 Section
0147 ExecWait '"$INSTDIR\bin\update-mime-database.exe" "$INSTDIR\share\mime"'
0148 ExecWait '"$INSTDIR\bin\kbuildsycoca4.exe" "--noincremental"'
0149 SectionEnd
0150
0151 ; Uninstaller
0152 ; All section names prefixed by "Un" will be in the uninstaller
0153
0154 Section "Uninstall"
0155 SetShellVarContext all
0156 ExecWait '"$INSTDIR\bin\kdeinit4.exe" "--terminate"'
0157
0158 DeleteRegKey HKLM "${uninstkey}"
0159 DeleteRegKey HKLM "${regkey}"
0160
0161 !insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuFolder
0162
0163 RMDir /r "$SMPROGRAMS\$StartMenuFolder"
0164 RMDir /r "$INSTDIR"
0165 SectionEnd
0166
0167
0168
0169 ;initialize the translations
0170 !insertmacro AMAROK_TRANSLATIONS
0171
0172
0173 ;installer Fcuntion
0174 Function .onInit
0175
0176 !insertmacro MUI_LANGDLL_DISPLAY
0177 !insertmacro INIT_KDE "amarok"
0178
0179
0180 ReadRegStr $R0 HKLM "${uninstkey}" "UninstallString"
0181 StrCmp $R0 "" done
0182 ReadRegStr $INSTDIR HKLM "${regkey}" "Install_Dir"
0183 ;Run the uninstaller
0184 ;uninst:
0185 ClearErrors
0186 ExecWait '$R0 _?=$INSTDIR' ;Do not copy the uninstaller to a temp file
0187 done:
0188 FunctionEnd
0189
0190 ; Uninstaller Functions
0191
0192 Function un.onInit
0193
0194 !insertmacro MUI_UNGETLANGUAGE
0195
0196 FunctionEnd
0197
0198
0199
0200
0201
0202