Commit 35bb5df5 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Windows Installer improvements.

parent 8501e4a2
......@@ -4,7 +4,7 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
!define PRODUCT_NAME "VLC media player"
!define PRODUCT_VERSION '${VERSION}'
!define PRODUCT_VERSION '0.9.0-git'
!define PRODUCT_GROUP "VideoLAN"
!define PRODUCT_PUBLISHER "VideoLAN Team"
!define PRODUCT_WEB_SITE "http://www.videolan.org"
......@@ -33,6 +33,7 @@ SetCompressor lzma
!else
SetCompressor /SOLID lzma
!endif
;ShowInstDetails show
;ShowUnInstDetails show
SetOverwrite ifnewer
......@@ -107,75 +108,21 @@ InstType "Full"
!insertmacro MUI_LANGUAGE "Slovak"
!insertmacro MUI_LANGUAGE "Czech"
!insertmacro MUI_RESERVEFILE_LANGDLL
; Reserve files
; Reserve files for solid compression
!insertmacro MUI_RESERVEFILE_LANGDLL
!insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
; MUI end ------
;;;;;;;;;;;;;;;;;;;
; Extension lists ;
;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;
; Macro and Functions ;
;;;;;;;;;;;;;;;;;;;;;;;
!macro MacroAudioExtensions _action
!insertmacro ${_action} ".a52"
!insertmacro ${_action} ".aac"
!insertmacro ${_action} ".ac3"
!insertmacro ${_action} ".dts"
!insertmacro ${_action} ".flac"
!insertmacro ${_action} ".mka"
!insertmacro ${_action} ".mp1"
!insertmacro ${_action} ".mp2"
!insertmacro ${_action} ".mp3"
!insertmacro ${_action} ".ogg"
!insertmacro ${_action} ".spx"
!insertmacro ${_action} ".wav"
!insertmacro ${_action} ".wma"
!macroend
!macro MacroVideoExtensions _action
!insertmacro ${_action} ".asf"
!insertmacro ${_action} ".avi"
!insertmacro ${_action} ".divx"
!insertmacro ${_action} ".dv"
!insertmacro ${_action} ".m1v"
!insertmacro ${_action} ".m2v"
!insertmacro ${_action} ".mkv"
!insertmacro ${_action} ".mov"
!insertmacro ${_action} ".mp4"
!insertmacro ${_action} ".mpeg"
!insertmacro ${_action} ".mpeg1"
!insertmacro ${_action} ".mpeg2"
!insertmacro ${_action} ".mpeg4"
!insertmacro ${_action} ".mpg"
!insertmacro ${_action} ".mxf"
!insertmacro ${_action} ".ps"
!insertmacro ${_action} ".ts"
!insertmacro ${_action} ".ogm"
!insertmacro ${_action} ".vob"
!insertmacro ${_action} ".wmv"
!macroend
!macro MacroOtherExtensions _action
!insertmacro ${_action} ".asx"
!insertmacro ${_action} ".bin"
!insertmacro ${_action} ".cue"
!insertmacro ${_action} ".m3u"
!insertmacro ${_action} ".pls"
!insertmacro ${_action} ".vlc"
!macroend
!macro MacroAllExtensions _action
!insertmacro MacroAudioExtensions ${_action}
!insertmacro MacroVideoExtensions ${_action}
!insertmacro MacroOtherExtensions ${_action}
!macroend
;;;;;;;;;;;;;;;;;;;;;;;;;;
; File type associations ;
;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; 1. File type associations ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Function that register one extension for VLC
Function RegisterExtension
; back up old value for extension $R0 (eg. ".opt")
ReadRegStr $1 HKCR "$R0" ""
......@@ -190,20 +137,23 @@ NoBackup:
WriteRegStr HKCR "VLC$R0\shell\Play\command" "" '"$INSTDIR\vlc.exe" --started-from-file "%1"'
WriteRegStr HKCR "VLC$R0\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'
;;; Vista Only part
; Vista detection
ReadRegStr $R1 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion
StrCpy $R2 $R1 3
StrCmp $R2 '6.0' ForVista ToEnd
ForVista:
WriteRegStr HKLM "Software\Clients\Media\VLC\Capabilities\FileAssociations" "$R0" "VLC$R0"
ToEnd:
ToEnd:
FunctionEnd
;; Function that removes one extension that VLC owns.
Function un.RegisterExtension
;start of restore script
ReadRegStr $1 HKCR "$R0" ""
StrCmp $1 "VLC$R0" 0 NoOwn ; only do this if we own it
; Read the old value from Backup
ReadRegStr $1 HKCR "$R0" "VLC.backup"
StrCmp $1 "" 0 Restore ; if backup="" then delete the whole key
DeleteRegKey HKCR "$R0"
......@@ -213,6 +163,7 @@ Restore:
DeleteRegValue HKCR "$R0" "VLC.backup"
NoOwn:
DeleteRegKey HKCR "VLC$R0" ;Delete key with association settings
DeleteRegKey HKLM "Software\Clients\Media\VLC\Capabilities\FileAssociations\VLC$R0" ; for vista
FunctionEnd
!macro RegisterExtensionSection EXT
......@@ -236,10 +187,71 @@ FunctionEnd
WriteRegStr HKCR Applications\vlc.exe\SupportedTypes ${EXT} ""
!macroend
;;;;;;;;;;;;;;;;;;;;;;;;
; Context menu entries ;
;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Extension lists Macros ;
; Those macros calls the previous functions ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
!macro MacroAudioExtensions _action
!insertmacro ${_action} ".a52"
!insertmacro ${_action} ".aac"
!insertmacro ${_action} ".ac3"
!insertmacro ${_action} ".dts"
!insertmacro ${_action} ".flac"
!insertmacro ${_action} ".mka"
!insertmacro ${_action} ".mp1"
!insertmacro ${_action} ".mp2"
!insertmacro ${_action} ".mp3"
!insertmacro ${_action} ".ogg"
!insertmacro ${_action} ".spx"
!insertmacro ${_action} ".wav"
!insertmacro ${_action} ".wma"
!macroend
!macro MacroVideoExtensions _action
!insertmacro ${_action} ".asf"
!insertmacro ${_action} ".avi"
!insertmacro ${_action} ".divx"
!insertmacro ${_action} ".dv"
!insertmacro ${_action} ".m1v"
!insertmacro ${_action} ".m2v"
!insertmacro ${_action} ".mkv"
!insertmacro ${_action} ".mov"
!insertmacro ${_action} ".mp4"
!insertmacro ${_action} ".mpeg"
!insertmacro ${_action} ".mpeg1"
!insertmacro ${_action} ".mpeg2"
!insertmacro ${_action} ".mpeg4"
!insertmacro ${_action} ".mpg"
!insertmacro ${_action} ".mxf"
!insertmacro ${_action} ".ps"
!insertmacro ${_action} ".ts"
!insertmacro ${_action} ".ogm"
!insertmacro ${_action} ".vob"
!insertmacro ${_action} ".wmv"
!macroend
!macro MacroOtherExtensions _action
!insertmacro ${_action} ".asx"
!insertmacro ${_action} ".bin"
!insertmacro ${_action} ".cue"
!insertmacro ${_action} ".m3u"
!insertmacro ${_action} ".pls"
!insertmacro ${_action} ".vlc"
!macroend
; One macro to rule them all
!macro MacroAllExtensions _action
!insertmacro MacroAudioExtensions ${_action}
!insertmacro MacroVideoExtensions ${_action}
!insertmacro MacroOtherExtensions ${_action}
!macroend
;;;;;;;;;;;;;;;;;;;;;;;;;;;
; 2. Context menu entries ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Generic function for adding the context menu for one ext.
!macro AddContextMenuExt EXT
WriteRegStr HKCR ${EXT}\shell\PlayWithVLC "" "Play with VLC media player"
WriteRegStr HKCR ${EXT}\shell\PlayWithVLC\command "" '$INSTDIR\vlc.exe --started-from-file --no-playlist-enqueue "%1"'
......@@ -267,9 +279,9 @@ FunctionEnd
Pop $R0
!macroend
;;;;;;;;;;;;;;;;;;;;;;;;;;
; Delete prefs and cache ;
;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; 3. Delete prefs and cache ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
!macro delprefs
StrCpy $0 0
......@@ -290,8 +302,10 @@ FunctionEnd
!undef Index
!macroend
;;;;;;;;;;;;;;;
; 4. Logging ;
;;;;;;;;;;;;;;;
Var UninstallLog
!macro OpenUninstallLog
FileOpen $UninstallLog "$INSTDIR\uninstall.log" a
FileSeek $UninstallLog 0 END
......@@ -302,6 +316,9 @@ Var UninstallLog
SetFileAttributes "$INSTDIR\uninstall.log" HIDDEN
!macroend
;;;;;;;;;;;;;;;;;;;;
; 5. Installations ;
;;;;;;;;;;;;;;;;;;;;
!macro InstallFile FILEREGEX
File "${FILEREGEX}"
!define Index 'Line${__LINE__}'
......@@ -347,10 +364,13 @@ Function InstallFolderInternal
"${Index}-End:"
!undef Index
FunctionEnd
;;; End of Macros
;;;;;;;;;;;;;;;;;;;;;;
; Installer sections ;
; The CORE of the ;
; installer ;
;;;;;;;;;;;;;;;;;;;;;;
Section "Media player (required)" SEC01
......@@ -360,6 +380,7 @@ Section "Media player (required)" SEC01
!insertmacro OpenUninstallLog
; VLC.exe, libvlc.dll
!insertmacro InstallFile vlc.exe
!insertmacro InstallFile vlc.exe.manifest
!ifdef LIBVLC_DLL
......@@ -368,21 +389,29 @@ Section "Media player (required)" SEC01
!ifdef LIBVLC_CONTROL_DLL
!insertmacro InstallFile ${LIBVLC_CONTROL_DLL}
!endif
; Text files
!insertmacro InstallFile *.txt
; Subfolders
!insertmacro InstallFolder plugins
!insertmacro InstallFolder locale
!insertmacro InstallFolder osdmenu
!insertmacro InstallFolder skins
!insertmacro InstallFolder http
!insertmacro InstallFolder share
;!insertmacro InstallFolder scripts
; URLs
WriteIniStr "$INSTDIR\${PRODUCT_GROUP} Website.url" "InternetShortcut" "URL" \
"${PRODUCT_WEB_SITE}"
FileWrite $UninstallLog "${PRODUCT_GROUP} Website.url$\r$\n"
WriteIniStr "$INSTDIR\Documentation.url" "InternetShortcut" "URL" \
"${PRODUCT_WEB_SITE}/doc/"
FileWrite $UninstallLog "Documentation.url$\r$\n"
WriteIniStr "$INSTDIR\New_Skins.url" "InternetShortcut" "URL" \
"${PRODUCT_WEB_SITE}/vlc/skins.php"
FileWrite $UninstallLog "New_Skins.url$\r$\n"
!insertmacro CloseUninstallLog
......@@ -394,37 +423,7 @@ Section "Media player (required)" SEC01
'$INSTDIR\vlc.exe --started-from-file "%1"'
!insertmacro MacroAllExtensions WriteRegStrSupportedTypes
WriteRegStr HKCR "AudioCD\shell\PlayWithVLC" "" "Play with VLC media player"
WriteRegStr HKCR "AudioCD\shell\PlayWithVLC\command" "" \
"$INSTDIR\vlc.exe --started-from-file cdda:%1"
WriteRegStr HKCR "DVD\shell\PlayWithVLC" "" "Play with VLC media player"
WriteRegStr HKCR "DVD\shell\PlayWithVLC\command" "" \
"$INSTDIR\vlc.exe --started-from-file dvd:%1"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayDVDMovieOnArrival" "VLCPlayDVDMovieOnArrival" ""
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "Action" "Play DVD movie"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "DefaultIcon" '"$INSTDIR\vlc.exe",0'
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "InvokeProgID" "VLC.DVDMovie"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "InvokeVerb" "play"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "Provider" "VideoLAN VLC media player"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayCDAudioOnArrival" "VLCPlayCDAudioOnArrival" ""
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "Action" "Play CD audio"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "DefaultIcon" '"$INSTDIR\vlc.exe",0'
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "InvokeProgID" "VLC.CDAudio"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "InvokeVerb" "play"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "Provider" "VideoLAN VLC media player"
WriteRegStr HKCR "VLC.DVDMovie" "" "VLC DVD Movie"
WriteRegStr HKCR "VLC.DVDMovie\shell" "" "Play"
WriteRegStr HKCR "VLC.DVDMovie\shell\Play\command" "" \
'$INSTDIR\vlc.exe --started-from-file dvd:%1'
WriteRegStr HKCR "VLC.DVDMovie\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'
WriteRegStr HKCR "VLC.CDAudio" "" "VLC CD Audio"
WriteRegStr HKCR "VLC.CDAudio\shell" "" "Play"
WriteRegStr HKCR "VLC.CDAudio\shell\Play\command" "" \
'$INSTDIR\vlc.exe --started-from-file cdda:%1'
WriteRegStr HKCR "VLC.CDAudio\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'
; Vista Registration
; Vista detection
ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion
StrCpy $R1 $R0 3
......@@ -436,7 +435,6 @@ Section "Media player (required)" SEC01
WriteRegStr HKLM "Software\Clients\Media\VLC\Capabilities" "ApplicationDescription" "VLC - The video swiss knife"
lbl_done:
SectionEnd
Section "Start Menu Shortcut" SEC02a
......@@ -540,6 +538,41 @@ Section "ActiveX plugin" SEC04
RegDLL "$INSTDIR\axvlc.dll"
SectionEnd
Section "Discs Playback" SEC05
SectionIn 1 2 3
WriteRegStr HKCR "AudioCD\shell\PlayWithVLC" "" "Play with VLC media player"
WriteRegStr HKCR "AudioCD\shell\PlayWithVLC\command" "" \
"$INSTDIR\vlc.exe --started-from-file cdda:%1"
WriteRegStr HKCR "DVD\shell\PlayWithVLC" "" "Play with VLC media player"
WriteRegStr HKCR "DVD\shell\PlayWithVLC\command" "" \
"$INSTDIR\vlc.exe --started-from-file dvd:%1"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayDVDMovieOnArrival" "VLCPlayDVDMovieOnArrival" ""
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "Action" "Play DVD movie"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "DefaultIcon" '"$INSTDIR\vlc.exe",0'
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "InvokeProgID" "VLC.DVDMovie"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "InvokeVerb" "play"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "Provider" "VideoLAN VLC media player"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayCDAudioOnArrival" "VLCPlayCDAudioOnArrival" ""
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "Action" "Play CD audio"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "DefaultIcon" '"$INSTDIR\vlc.exe",0'
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "InvokeProgID" "VLC.CDAudio"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "InvokeVerb" "play"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "Provider" "VideoLAN VLC media player"
WriteRegStr HKCR "VLC.DVDMovie" "" "VLC DVD Movie"
WriteRegStr HKCR "VLC.DVDMovie\shell" "" "Play"
WriteRegStr HKCR "VLC.DVDMovie\shell\Play\command" "" \
'$INSTDIR\vlc.exe --started-from-file dvd:%1'
WriteRegStr HKCR "VLC.DVDMovie\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'
WriteRegStr HKCR "VLC.CDAudio" "" "VLC CD Audio"
WriteRegStr HKCR "VLC.CDAudio\shell" "" "Play"
WriteRegStr HKCR "VLC.CDAudio\shell\Play\command" "" \
'$INSTDIR\vlc.exe --started-from-file cdda:%1'
WriteRegStr HKCR "VLC.CDAudio\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'
SectionEnd
SectionGroup "File type associations" SEC06
SectionGroup "Audio Files"
!insertmacro MacroAudioExtensions RegisterExtensionSection
......@@ -552,13 +585,13 @@ SectionGroup "File type associations" SEC06
SectionGroupEnd
SectionGroupEnd
Section /o "Context Menus" SEC05
Section "Context Menus" SEC07
SectionIn 3
!insertmacro MacroAllExtensions AddContextMenu
!insertmacro AddContextMenuExt "Directory"
SectionEnd
Section /o "Delete preferences and cache" SEC07
Section /o "Delete preferences and cache" SEC08
!insertmacro delprefs
SectionEnd
......@@ -575,13 +608,16 @@ SectionEnd
!insertmacro MUI_DESCRIPTION_TEXT ${SEC04} \
"The VLC ActiveX plugin"
!insertmacro MUI_DESCRIPTION_TEXT ${SEC05} \
"Add context menu items ('Play With VLC' and 'Add To VLC's Playlist')"
"DVD and CD playback registration"
!insertmacro MUI_DESCRIPTION_TEXT ${SEC06} \
"Sets VLC media player as the default application for the specified file type"
!insertmacro MUI_DESCRIPTION_TEXT ${SEC07} \
"Add context menu items ('Play With VLC' and 'Add To VLC's Playlist')"
!insertmacro MUI_DESCRIPTION_TEXT ${SEC08} \
"Deletes VLC media player preferences and cache files leftover from previous installations"
!insertmacro MUI_FUNCTION_DESCRIPTION_END
;;; Start function
Function .onInit
ReadRegStr $R0 ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
"UninstallString"
......@@ -600,15 +636,15 @@ Function .onInit
!insertmacro MUI_LANGDLL_DISPLAY
;Win98 detection
ReadRegStr $R0 HKLM \
"SOFTWARE\Microsoft\Windows\CurrentVersion" VersionNumber
StrCmp $R0 '4.9' lbl_win98
ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion" VersionNumber
StrCmp $R0 "4.9" lbl_win98
lbl_win98:
MessageBox MB_OK|MB_ICONQUESTION "Windows 98 ! Remember to install MSLU" IDOK
FunctionEnd
;; End function
Section -Post
WriteUninstaller "$INSTDIR\uninstall.exe"
WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "InstallDir" $INSTDIR
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment