2015-02-15 02:44:43 -05:00
|
|
|
;NSIS based Icecast Installer
|
|
|
|
;Written by Thomas B. Rücker
|
|
|
|
;Initial version written by Stephan Jauernick
|
|
|
|
;Based on "Start Menu Folder Selection Example Script" by Joost Verburg
|
|
|
|
|
|
|
|
;--------------------------------
|
|
|
|
;Includes
|
|
|
|
|
|
|
|
; Modern UI
|
|
|
|
!include "MUI2.nsh"
|
|
|
|
|
|
|
|
;File functions
|
|
|
|
!include "FileFunc.nsh"
|
|
|
|
|
|
|
|
;--------------------------------
|
|
|
|
;General
|
|
|
|
|
|
|
|
;Name and file
|
|
|
|
Name "Icecast"
|
2022-03-13 14:30:26 -04:00
|
|
|
OutFile "icecast_win32_2.5-beta3.exe"
|
2015-02-15 02:44:43 -05:00
|
|
|
|
|
|
|
;Default installation folder
|
|
|
|
InstallDir "$PROGRAMFILES32\Icecast"
|
2015-02-15 03:23:39 -05:00
|
|
|
|
2015-02-15 02:44:43 -05:00
|
|
|
;Get installation folder from registry if available
|
|
|
|
InstallDirRegKey HKCU "Software\Xiph.org\Icecast" ""
|
|
|
|
|
|
|
|
;Request application privileges for Windows Vista
|
2015-02-15 03:23:39 -05:00
|
|
|
RequestExecutionLevel admin
|
2015-02-15 02:44:43 -05:00
|
|
|
|
|
|
|
;Installer icon
|
|
|
|
!define MUI_ICON "bin/icecast.ico"
|
|
|
|
!define MUI_HEADERIMAGE
|
|
|
|
!define MUI_HEADERIMAGE_BITMAP "icecast2logo3.bmp"
|
|
|
|
!define MUI_HEADERIMAGE_RIGHT
|
|
|
|
|
|
|
|
!define /date BUILDTIMESTAMP "%Y-%m-%dT%H:%M:%S+%z"
|
|
|
|
|
|
|
|
;--------------------------------
|
|
|
|
;Variables
|
|
|
|
|
|
|
|
Var RegistryPathForUninstall
|
|
|
|
Var StartMenuFolder
|
|
|
|
Var EstimatedSize
|
|
|
|
Var Day
|
|
|
|
Var Month
|
|
|
|
Var Year
|
|
|
|
Var DoW
|
|
|
|
Var Hour
|
|
|
|
Var Minute
|
|
|
|
Var Second
|
2015-02-15 03:23:39 -05:00
|
|
|
|
2015-02-15 02:44:43 -05:00
|
|
|
;--------------------------------
|
|
|
|
; Create URL file macro
|
|
|
|
|
|
|
|
!macro CreateInternetShortcut FILENAME URL ICONFILE ICONINDEX
|
|
|
|
WriteINIStr "${FILENAME}.url" "InternetShortcut" "URL" "${URL}"
|
|
|
|
WriteINIStr "${FILENAME}.url" "InternetShortcut" "IconFile" "${ICONFILE}"
|
|
|
|
WriteINIStr "${FILENAME}.url" "InternetShortcut" "IconIndex" "${ICONINDEX}"
|
|
|
|
!macroend
|
|
|
|
|
|
|
|
;--------------------------------
|
|
|
|
;Interface Settings
|
|
|
|
|
|
|
|
!define MUI_ABORTWARNING
|
|
|
|
|
|
|
|
;--------------------------------
|
|
|
|
;Pages
|
|
|
|
|
|
|
|
!insertmacro MUI_PAGE_LICENSE doc/COPYING
|
|
|
|
!insertmacro MUI_PAGE_COMPONENTS
|
|
|
|
!insertmacro MUI_PAGE_DIRECTORY
|
2015-02-15 03:23:39 -05:00
|
|
|
|
2015-02-15 02:44:43 -05:00
|
|
|
;Start Menu Folder Page Configuration
|
2015-02-15 03:23:39 -05:00
|
|
|
!define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKCU"
|
|
|
|
!define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\Xiph.org\Icecast"
|
2015-02-15 02:44:43 -05:00
|
|
|
!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Start Menu Folder"
|
2015-02-15 03:23:39 -05:00
|
|
|
|
2015-02-15 02:44:43 -05:00
|
|
|
!insertmacro MUI_PAGE_STARTMENU Application $StartMenuFolder
|
2015-02-15 03:23:39 -05:00
|
|
|
|
2015-02-15 02:44:43 -05:00
|
|
|
!insertmacro MUI_PAGE_INSTFILES
|
2015-02-15 03:23:39 -05:00
|
|
|
|
2015-02-15 02:44:43 -05:00
|
|
|
!insertmacro MUI_UNPAGE_CONFIRM
|
|
|
|
!insertmacro MUI_UNPAGE_INSTFILES
|
|
|
|
|
|
|
|
;--------------------------------
|
|
|
|
;Languages
|
2015-02-15 03:23:39 -05:00
|
|
|
|
2015-02-15 02:44:43 -05:00
|
|
|
!insertmacro MUI_LANGUAGE "English"
|
|
|
|
|
|
|
|
;--------------------------------
|
|
|
|
;Installer Sections
|
|
|
|
|
|
|
|
Section "Icecast" SecIcecastWin32
|
|
|
|
|
|
|
|
;Image - not supported on non-win32 builds
|
|
|
|
;AddBrandingImage left 175 32
|
|
|
|
;SetBrandingImage "icecast2logo2.bmp"
|
|
|
|
|
|
|
|
SetOutPath "$INSTDIR"
|
2015-02-15 03:23:39 -05:00
|
|
|
|
2015-02-15 02:44:43 -05:00
|
|
|
;ADD YOUR OWN FILES HERE...
|
2015-02-15 03:23:39 -05:00
|
|
|
|
2015-02-15 02:44:43 -05:00
|
|
|
File /r "bin"
|
|
|
|
File /r "doc"
|
|
|
|
File /r "web"
|
|
|
|
File /r "admin"
|
|
|
|
File "mime.types"
|
|
|
|
File "icecast.bat"
|
|
|
|
;OMG my eyes, why is Goto inherent
|
|
|
|
IfFileExists "$INSTDIR\icecast.xml" config_exists config_nonexistent
|
|
|
|
config_exists:
|
|
|
|
Goto config_done
|
|
|
|
config_nonexistent:
|
|
|
|
File "icecast.xml"
|
|
|
|
config_done:
|
|
|
|
|
|
|
|
;Store installation folder
|
|
|
|
WriteRegStr HKCU "Software\Xiph.org\Icecast" "" $INSTDIR
|
2015-02-15 03:23:39 -05:00
|
|
|
|
2015-02-15 02:44:43 -05:00
|
|
|
;Determine installed size (will include all files, even user placed in $INSTDIR!)
|
|
|
|
${GetSize} "$INSTDIR" "/S=0K" $0 $1 $2
|
|
|
|
IntFmt $EstimatedSize "0x%08X" $0
|
|
|
|
|
|
|
|
${GetTime} "" "LS" $Day $Month $Year $DoW $Hour $Minute $Second
|
|
|
|
|
|
|
|
;Registry path for Windows uninstaller and software management
|
|
|
|
StrCpy $RegistryPathForUninstall "Software\Microsoft\Windows\CurrentVersion\Uninstall\Xiph.org-Icecast"
|
|
|
|
|
|
|
|
;Create uninstaller
|
|
|
|
WriteUninstaller "$INSTDIR\Uninstall.exe"
|
|
|
|
WriteRegDWORD HKLM $RegistryPathForUninstall "EstimatedSize" "$EstimatedSize"
|
2015-02-15 03:23:39 -05:00
|
|
|
WriteRegStr HKLM $RegistryPathForUninstall "DisplayName" "Icecast"
|
2015-02-15 02:44:43 -05:00
|
|
|
WriteRegStr HKLM $RegistryPathForUninstall "UninstallString" "$\"$INSTDIR\Uninstall.exe$\""
|
|
|
|
WriteRegStr HKLM $RegistryPathForUninstall "DisplayIcon" "$INSTDIR\bin\icecast.ico"
|
|
|
|
WriteRegStr HKLM $RegistryPathForUninstall "Publisher" "Xiph.org Foundation / The Icecast Project"
|
|
|
|
WriteRegStr HKLM $RegistryPathForUninstall "HelpLink" "http://icecast.org/contact"
|
|
|
|
WriteRegStr HKLM $RegistryPathForUninstall "URLInfoAbout" "http://icecast.org/"
|
2022-03-13 14:30:26 -04:00
|
|
|
WriteRegStr HKLM $RegistryPathForUninstall "DisplayVersion" "2.5 beta3"
|
2015-02-15 02:44:43 -05:00
|
|
|
WriteRegStr HKLM $RegistryPathForUninstall "InstallLocation" "$INSTDIR"
|
|
|
|
WriteRegStr HKLM $RegistryPathForUninstall "InstallDate" "$Year$Month$Day"
|
|
|
|
WriteRegDWORD HKLM $RegistryPathForUninstall "NoModify" 0x1
|
|
|
|
WriteRegDWORD HKLM $RegistryPathForUninstall "NoRepair" 0x1
|
|
|
|
WriteRegDWORD HKLM $RegistryPathForUninstall "VersionMajor" 0x2
|
|
|
|
WriteRegDWORD HKLM $RegistryPathForUninstall "VersionMinor" 0x4
|
|
|
|
WriteRegDWORD HKLM $RegistryPathForUninstall "VersionServicePack" 0x63
|
|
|
|
;WriteRegStr HKLM "$RegistryPathForUninstall "" ""
|
2015-02-15 03:23:39 -05:00
|
|
|
|
2015-02-15 02:44:43 -05:00
|
|
|
|
|
|
|
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
|
2015-02-15 03:23:39 -05:00
|
|
|
|
2015-02-15 02:44:43 -05:00
|
|
|
;Create shortcuts
|
|
|
|
CreateDirectory "$SMPROGRAMS\$StartMenuFolder"
|
|
|
|
CreateShortcut "$SMPROGRAMS\$StartMenuFolder\Run Icecast (Console).lnk" "$INSTDIR\icecast.bat" "" "$INSTDIR\bin\icecast.ico" "" "" "" "Icecast (Starts in a console window)"
|
|
|
|
CreateShortcut "$SMPROGRAMS\$StartMenuFolder\Icecast Config.lnk" "%SystemRoot%\system32\notepad.exe" "$INSTDIR\icecast.xml" "" "" "" "" "Open Icecast config for editing in Notepad"
|
|
|
|
!insertmacro CreateInternetShortcut "$SMPROGRAMS\$StartMenuFolder\Icecast web status (public)" "http://127.0.0.1:8000/" "$INSTDIR\bin\icecast.ico" "0"
|
|
|
|
!insertmacro CreateInternetShortcut "$SMPROGRAMS\$StartMenuFolder\Icecast web admin interface" "http://127.0.0.1:8000/admin/" "$INSTDIR\bin\icecast.ico" "0"
|
|
|
|
CreateShortcut "$SMPROGRAMS\$StartMenuFolder\Icecast documentation.lnk" "$INSTDIR\doc\index.html"
|
2015-02-15 03:23:39 -05:00
|
|
|
|
2015-02-15 02:44:43 -05:00
|
|
|
!insertmacro MUI_STARTMENU_WRITE_END
|
|
|
|
|
|
|
|
;Create logging directory
|
|
|
|
CreateDirectory "$INSTDIR\log"
|
|
|
|
|
|
|
|
SectionEnd
|
|
|
|
|
|
|
|
;--------------------------------
|
|
|
|
;Descriptions
|
|
|
|
|
|
|
|
;Language strings
|
|
|
|
LangString DESC_SecIcecastWin32 ${LANG_ENGLISH} "Icecast for win32 with all required files and libraries"
|
|
|
|
|
|
|
|
;Assign language strings to sections
|
|
|
|
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
|
|
|
|
!insertmacro MUI_DESCRIPTION_TEXT ${SecIcecastWin32} $(DESC_SecIcecastWin32)
|
|
|
|
!insertmacro MUI_FUNCTION_DESCRIPTION_END
|
2015-02-15 03:23:39 -05:00
|
|
|
|
2015-02-15 02:44:43 -05:00
|
|
|
;--------------------------------
|
|
|
|
;Uninstaller Section
|
|
|
|
|
|
|
|
Section "Uninstall"
|
|
|
|
|
|
|
|
;ADD YOUR OWN FILES HERE...
|
|
|
|
RMDir /r "$INSTDIR\bin"
|
|
|
|
RMDir /r "$INSTDIR\doc"
|
|
|
|
Delete "$INSTDIR\mime.types"
|
|
|
|
Delete "$INSTDIR\icecast.bat"
|
|
|
|
|
|
|
|
Delete "$INSTDIR\Uninstall.exe"
|
|
|
|
|
|
|
|
RMDir "$INSTDIR"
|
2015-02-15 03:23:39 -05:00
|
|
|
|
2015-02-15 02:44:43 -05:00
|
|
|
!insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuFolder
|
2015-02-15 03:23:39 -05:00
|
|
|
|
2015-02-15 02:44:43 -05:00
|
|
|
Delete "$SMPROGRAMS\$StartMenuFolder\Run Icecast (Console).lnk"
|
|
|
|
Delete "$SMPROGRAMS\$StartMenuFolder\Icecast Config.lnk"
|
|
|
|
Delete "$SMPROGRAMS\$StartMenuFolder\Icecast documentation.lnk"
|
|
|
|
Delete "$SMPROGRAMS\$StartMenuFolder\Icecast web status (public).url"
|
|
|
|
Delete "$SMPROGRAMS\$StartMenuFolder\Icecast web admin interface.url"
|
|
|
|
RMDir "$SMPROGRAMS\$StartMenuFolder"
|
|
|
|
|
|
|
|
;Registry path for Windows uninstaller and software management
|
|
|
|
StrCpy $RegistryPathForUninstall "Software\Microsoft\Windows\CurrentVersion\Uninstall\Xiph.org-Icecast"
|
|
|
|
DeleteRegKey HKLM "$RegistryPathForUninstall"
|
2015-02-15 03:23:39 -05:00
|
|
|
|
2015-02-15 02:44:43 -05:00
|
|
|
;DeleteRegKey /ifempty HKCU "Software\Xiph.org\Icecast"
|
|
|
|
|
|
|
|
SectionEnd
|
|
|
|
|
|
|
|
Function .onInit
|
|
|
|
SectionSetFlags ${SecIcecastWin32} 17
|
|
|
|
FunctionEnd
|