]> git.sesse.net Git - vlc/blobdiff - extras/package/win32/vlc.win32.nsi.in
remove npvlc.dll.manifest and axvlc.dll.manifest while uninstalling
[vlc] / extras / package / win32 / vlc.win32.nsi.in
index 91d3d693f6d9cd8698a5980d4ff903463ffebf7d..6e99b9afcc94404d07bcafda432579ad96fc67a8 100644 (file)
@@ -3,6 +3,8 @@
 ; (http://nsis.sourceforge.net) ;
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
+!include "languages\declaration.nsh"
+
 !define PRODUCT_NAME "VLC media player"
 !define VERSION @VERSION@
 !define PRODUCT_VERSION @VERSION@
@@ -41,9 +43,9 @@ SetOverwrite ifnewer
 CRCCheck on
 BrandingText "${PRODUCT_GROUP} ${PRODUCT_NAME}"
 
-InstType "Recommended"
-InstType "Minimum"
-InstType "Full"
+InstType $Name_InstTypeRecommended
+InstType $Name_InstTypeMinimum
+InstType $Name_InstTypeFull
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ; NSIS Modern User Interface configuration ;
@@ -74,7 +76,7 @@ InstType "Full"
     !define MUI_FINISHPAGE_RUN "$INSTDIR\vlc.exe"
     !define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\README.txt"
     !define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED
-    !define MUI_FINISHPAGE_LINK "Visit the VideoLAN VLC media player Website"
+    !define MUI_FINISHPAGE_LINK $Link_VisitWebsite
     !define MUI_FINISHPAGE_LINK_LOCATION "http://www.videolan.org/vlc/"
     !define MUI_FINISHPAGE_NOREBOOTSUPPORT
     !insertmacro MUI_PAGE_FINISH
@@ -135,6 +137,7 @@ NoBackup:
   ReadRegStr $0 HKCR "VLC$R0" ""
   WriteRegStr HKCR "VLC$R0" "" "VLC media file ($R0)"
   WriteRegStr HKCR "VLC$R0\shell" "" "Play"
+  WriteRegStr HKCR "VLC$R0\shell\Play" "" $ShellAssociation_Play
   WriteRegStr HKCR "VLC$R0\shell\Play\command" "" '"$INSTDIR\vlc.exe" --started-from-file "%1"'
   WriteRegStr HKCR "VLC$R0\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'
 
@@ -199,14 +202,19 @@ FunctionEnd
   !insertmacro ${_action} ".ac3"
   !insertmacro ${_action} ".dts"
   !insertmacro ${_action} ".flac"
+  !insertmacro ${_action} ".m4a"
+  !insertmacro ${_action} ".m4p"
   !insertmacro ${_action} ".mka"
+  !insertmacro ${_action} ".mod"
   !insertmacro ${_action} ".mp1"
   !insertmacro ${_action} ".mp2"
   !insertmacro ${_action} ".mp3"
-  !insertmacro ${_action} ".ogg"
+  !insertmacro ${_action} ".oma"
+  !insertmacro ${_action} ".oga"
   !insertmacro ${_action} ".spx"
   !insertmacro ${_action} ".wav"
   !insertmacro ${_action} ".wma"
+  !insertmacro ${_action} ".xm"
 !macroend
 
 !macro MacroVideoExtensions _action
@@ -214,8 +222,12 @@ FunctionEnd
   !insertmacro ${_action} ".avi"
   !insertmacro ${_action} ".divx"
   !insertmacro ${_action} ".dv"
+  !insertmacro ${_action} ".flv"
+  !insertmacro ${_action} ".gxf"
   !insertmacro ${_action} ".m1v"
   !insertmacro ${_action} ".m2v"
+  !insertmacro ${_action} ".m2ts"
+  !insertmacro ${_action} ".m4v"
   !insertmacro ${_action} ".mkv"
   !insertmacro ${_action} ".mov"
   !insertmacro ${_action} ".mp4"
@@ -224,10 +236,14 @@ FunctionEnd
   !insertmacro ${_action} ".mpeg2"
   !insertmacro ${_action} ".mpeg4"
   !insertmacro ${_action} ".mpg"
+  !insertmacro ${_action} ".mts"
   !insertmacro ${_action} ".mxf"
-  !insertmacro ${_action} ".ps"
-  !insertmacro ${_action} ".ts"
+  !insertmacro ${_action} ".nuv"
+  !insertmacro ${_action} ".ogg"
   !insertmacro ${_action} ".ogm"
+  !insertmacro ${_action} ".ogx"
+  !insertmacro ${_action} ".ogv"
+  !insertmacro ${_action} ".ts"
   !insertmacro ${_action} ".vob"
   !insertmacro ${_action} ".wmv"
 !macroend
@@ -239,6 +255,7 @@ FunctionEnd
   !insertmacro ${_action} ".m3u"
   !insertmacro ${_action} ".pls"
   !insertmacro ${_action} ".vlc"
+  !insertmacro ${_action} ".xspf"
 !macroend
 
 ; One macro to rule them all
@@ -254,11 +271,11 @@ FunctionEnd
 
 ; 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"'
+  WriteRegStr HKCR ${EXT}\shell\PlayWithVLC "" $ContextMenuEntry_PlayWith
+  WriteRegStr HKCR ${EXT}\shell\PlayWithVLC\command "" '"$INSTDIR\vlc.exe" --started-from-file --no-playlist-enqueue "%1"'
 
-  WriteRegStr HKCR ${EXT}\shell\AddToPlaylistVLC "" "Add to VLC media player's Playlist"
-  WriteRegStr HKCR ${EXT}\shell\AddToPlaylistVLC\command "" '$INSTDIR\vlc.exe --started-from-file --playlist-enqueue "%1"'
+  WriteRegStr HKCR ${EXT}\shell\AddToPlaylistVLC "" $ContextMenuEntry_AddToPlaylist
+  WriteRegStr HKCR ${EXT}\shell\AddToPlaylistVLC\command "" '"$INSTDIR\vlc.exe" --started-from-file --playlist-enqueue "%1"'
 !macroend
 
 !macro AddContextMenu EXT
@@ -373,8 +390,8 @@ FunctionEnd
 ; The CORE of the    ;
 ; installer          ;
 ;;;;;;;;;;;;;;;;;;;;;;
-
-Section "Media player (required)" SEC01
+  
+Section $Name_Section01 SEC01
   SectionIn 1 2 3 RO
   SetShellVarContext all
   SetOutPath "$INSTDIR"
@@ -418,9 +435,9 @@ Section "Media player (required)" SEC01
   ; Add VLC to "recomended programs" for the following extensions
   WriteRegStr HKCR Applications\vlc.exe "" ""
   WriteRegStr HKCR Applications\vlc.exe "FriendlyAppName" "VLC media player"
-  WriteRegStr HKCR Applications\vlc.exe\shell\Play "" "Play with VLC"
+  WriteRegStr HKCR Applications\vlc.exe\shell\Play "" $ContextMenuEntry_PlayWith
   WriteRegStr HKCR Applications\vlc.exe\shell\Play\command "" \
-    '$INSTDIR\vlc.exe --started-from-file "%1"'
+    '"$INSTDIR\vlc.exe" --started-from-file "%1"'
   !insertmacro MacroAllExtensions WriteRegStrSupportedTypes
 
 ; Vista Registration
@@ -437,7 +454,7 @@ Section "Media player (required)" SEC01
   lbl_done:
 SectionEnd
 
-Section "Start Menu Shortcut" SEC02a
+Section $Name_Section02a SEC02a
   SectionIn 1 2 3
   CreateDirectory "$SMPROGRAMS\VideoLAN"
   CreateDirectory "$SMPROGRAMS\VideoLAN\Quick Settings"
@@ -477,18 +494,19 @@ Section "Start Menu Shortcut" SEC02a
     "$INSTDIR\vlc.exe" ""
 SectionEnd
 
-Section "Desktop Shortcut" SEC02b
+Section $Name_Section02b SEC02b
   SectionIn 1 2 3
   CreateShortCut "$DESKTOP\VLC media player.lnk" \
     "$INSTDIR\vlc.exe" ""
 SectionEnd
 
-Section /o "Mozilla plugin" SEC03
+Section /o $Name_Section03 SEC03
   SectionIn 3
 
   SetOutPath "$INSTDIR"
   !insertmacro OpenUninstallLog
   !insertmacro InstallFile mozilla\npvlc.dll
+  !insertmacro InstallFile mozilla\npvlc.dll.manifest
   !insertmacro CloseUninstallLog
 
   !define Moz "SOFTWARE\MozillaPlugins\@videolan.org/vlc,version=${VERSION}"
@@ -529,33 +547,47 @@ Section /o "Mozilla plugin" SEC03
 
 SectionEnd
 
-Section "ActiveX plugin" SEC04
-  SectionIn 3
+Section /o $Name_Section04 SEC04
+  SectionIn 3
   SetOutPath "$INSTDIR"
   !insertmacro OpenUninstallLog
   !insertmacro InstallFile activex\axvlc.dll
+  !insertmacro InstallFile activex\axvlc.dll.manifest
   !insertmacro CloseUninstallLog
   RegDLL "$INSTDIR\axvlc.dll"
 SectionEnd
 
-Section "Discs Playback" SEC05
+SectionGroup /e !$Name_Section06 SEC05
+  SectionGroup $Name_SectionGroupAudio
+    !insertmacro MacroAudioExtensions RegisterExtensionSection
+  SectionGroupEnd
+  SectionGroup $Name_SectionGroupVideo
+    !insertmacro MacroVideoExtensions RegisterExtensionSection
+  SectionGroupEnd
+  SectionGroup $Name_SectionGroupOther
+    !insertmacro MacroOtherExtensions RegisterExtensionSection
+  SectionGroupEnd
+SectionGroupEnd
+
+
+Section $Name_Section05 SEC06
   SectionIn 1 2 3
-  WriteRegStr HKCR "AudioCD\shell\PlayWithVLC" "" "Play with VLC media player"
+  WriteRegStr HKCR "AudioCD\shell\PlayWithVLC" "" $ContextMenuEntry_PlayWith
   WriteRegStr HKCR "AudioCD\shell\PlayWithVLC\command" "" \
-    "$INSTDIR\vlc.exe --started-from-file cdda://%1"
-  WriteRegStr HKCR "DVD\shell\PlayWithVLC" "" "Play with VLC media player"
+    '"$INSTDIR\vlc.exe" --started-from-file "cdda://%1"'
+  WriteRegStr HKCR "DVD\shell\PlayWithVLC" "" $ContextMenuEntry_PlayWith
   WriteRegStr HKCR "DVD\shell\PlayWithVLC\command" "" \
-    "$INSTDIR\vlc.exe --started-from-file dvd://%1"
+    '"$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" "Action" $Action_OnArrivalDVD
   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" "Action" $Action_OnArrivalAudioCD
   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"
@@ -563,77 +595,60 @@ Section "Discs Playback" SEC05
   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'
+    '"$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'
+    '"$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
-  SectionGroupEnd
-  SectionGroup "Video Files"
-    !insertmacro MacroVideoExtensions RegisterExtensionSection
-  SectionGroupEnd
-  SectionGroup "Other"
-    !insertmacro MacroOtherExtensions RegisterExtensionSection
-  SectionGroupEnd
-SectionGroupEnd
-
-Section "Context Menus" SEC07
-  SectionIn 3
+Section $Name_Section07 SEC07
+  SectionIn 1 3
   !insertmacro MacroAllExtensions AddContextMenu
   !insertmacro AddContextMenuExt "Directory"
 SectionEnd
 
-Section /o "Delete preferences and cache" SEC08
+Section $Name_Section08 SEC08
   !insertmacro delprefs
 SectionEnd
 
 ; Installer section descriptions
 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
-  !insertmacro MUI_DESCRIPTION_TEXT ${SEC01} \
-    "The media player itself"
-  !insertmacro MUI_DESCRIPTION_TEXT ${SEC02a} \
-    "Adds icons to your start menu for easy access"
-  !insertmacro MUI_DESCRIPTION_TEXT ${SEC02b} \
-    "Adds icon to your desktop for easy access"
-  !insertmacro MUI_DESCRIPTION_TEXT ${SEC03} \
-    "The VLC Mozilla and Mozilla Firefox plugin"
-  !insertmacro MUI_DESCRIPTION_TEXT ${SEC04} \
-    "The VLC ActiveX plugin"
-  !insertmacro MUI_DESCRIPTION_TEXT ${SEC05} \
-    "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_DESCRIPTION_TEXT ${SEC01} $Desc_Section01
+  !insertmacro MUI_DESCRIPTION_TEXT ${SEC02a} $Desc_Section02a
+  !insertmacro MUI_DESCRIPTION_TEXT ${SEC02b} $Desc_Section02b
+  !insertmacro MUI_DESCRIPTION_TEXT ${SEC03} $Desc_Section03
+  !insertmacro MUI_DESCRIPTION_TEXT ${SEC04} $Desc_Section04
+  !insertmacro MUI_DESCRIPTION_TEXT ${SEC05} $Desc_Section05
+  !insertmacro MUI_DESCRIPTION_TEXT ${SEC06} $Desc_Section06
+  !insertmacro MUI_DESCRIPTION_TEXT ${SEC07} $Desc_Section07
+  !insertmacro MUI_DESCRIPTION_TEXT ${SEC08} $Desc_Section08
 !insertmacro MUI_FUNCTION_DESCRIPTION_END
 
 ;;; Start function
 Function .onInit
+  !insertmacro MUI_LANGDLL_DISPLAY
+
+  !include "languages\english.nsh"
+  StrCmp $LANGUAGE ${LANG_FRENCH} French EndLanguageCmp
+  French:
+  !include "languages\french.nsh"
+  EndLanguageCmp:
+
   ReadRegStr $R0  ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
   "UninstallString"
   StrCmp $R0 "" done
 
-  MessageBox MB_YESNO|MB_ICONEXCLAMATION \
-  "VLC media player has already been installed. $\nDo you want to remove \
-  the previous version before installing $(^Name) ?" \
-  IDNO done
+  MessageBox MB_YESNO|MB_ICONEXCLAMATION $Message_AlreadyInstalled IDNO done
 
   ;Run the uninstaller
   ;uninst:
     ClearErrors
     ExecWait '$R0 _?=$INSTDIR' ;Do not copy the uninstaller to a temp file
   done:
-  !insertmacro MUI_LANGDLL_DISPLAY
 
 FunctionEnd
 
@@ -715,7 +730,7 @@ Function un.RemoveEmptyDirs
   !undef Index
 FunctionEnd
 
-Section "Uninstall" SEC91
+Section "un.$Name_Section91" SEC91
   SectionIn 1 2 3 RO
   SetShellVarContext all
 
@@ -726,6 +741,7 @@ Section "Uninstall" SEC91
   ;remove activex plugin
   UnRegDLL "$INSTDIR\axvlc.dll"
   Delete /REBOOTOK "$INSTDIR\axvlc.dll"
+  Delete /REBOOTOK "$INSTDIR\axvlc.dll.manifest"
 
   ;remove mozilla plugin
   Push $R0
@@ -753,6 +769,7 @@ Section "Uninstall" SEC91
   "${Index}-End:"
   !undef Index
   Delete /REBOOTOK "$INSTDIR\npvlc.dll"
+  Delete /REBOOTOK "$INSTDIR\npvlc.dll.manifest"
 
   RMDir "$SMPROGRAMS\VideoLAN"
   RMDir /r $SMPROGRAMS\VideoLAN
@@ -800,16 +817,14 @@ Section "Uninstall" SEC91
   SetAutoClose true
 SectionEnd
 
-Section /o "un.Delete preferences and cache" SEC92
+Section /o "un.$Name_Section92" SEC92
   !insertmacro delprefs
 SectionEnd
 
 ; Uninstaller section descriptions
 !insertmacro MUI_UNFUNCTION_DESCRIPTION_BEGIN
-  !insertmacro MUI_DESCRIPTION_TEXT ${SEC91} \
-    "Uninstall VLC media player and all its components"
-  !insertmacro MUI_DESCRIPTION_TEXT ${SEC92} \
-    "Deletes VLC media player preferences and cache files"
+  !insertmacro MUI_DESCRIPTION_TEXT ${SEC91} $Desc_Section91
+  !insertmacro MUI_DESCRIPTION_TEXT ${SEC92} $Desc_Section92
 !insertmacro MUI_UNFUNCTION_DESCRIPTION_END
 
 ;Function un.onUninstSuccess
@@ -820,4 +835,11 @@ SectionEnd
 
 Function un.onInit
   !insertmacro MUI_UNGETLANGUAGE
+  
+  !include "languages\english.nsh"
+  StrCmp $LANGUAGE ${LANG_FRENCH} French EndLanguageCmp
+  French:
+  !include "languages\french.nsh"
+  EndLanguageCmp:
+  
 FunctionEnd