]> git.sesse.net Git - vlc/blobdiff - vlc.win32.nsi
* modules/demux/mp4/mp4.c: fixed bug with some HE-AAC audio tracks.
[vlc] / vlc.win32.nsi
index 37d0b9c83087dee336775dae36fe26f4dfc00df7..df09c49b5c617ea0cbf4c926f897067a57a2037c 100644 (file)
@@ -11,6 +11,7 @@
 !define PRODUCT_DIR_REGKEY "Software\VideoLAN\VLC"\r
 !define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"\r
 !define PRODUCT_UNINST_ROOT_KEY "HKLM"\r
 !define PRODUCT_DIR_REGKEY "Software\VideoLAN\VLC"\r
 !define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"\r
 !define PRODUCT_UNINST_ROOT_KEY "HKLM"\r
+!define PRODUCT_ID "{ea92ef52-afe4-4212-bacb-dfe9fca94cd6}"\r
 \r
 ;;;;;;;;;;;;;;;;;;;;;;;;;\r
 ; General configuration ;\r
 \r
 ;;;;;;;;;;;;;;;;;;;;;;;;;\r
 ; General configuration ;\r
@@ -20,9 +21,13 @@ Name "${PRODUCT_GROUP} ${PRODUCT_NAME} ${PRODUCT_VERSION}"
 OutFile ..\vlc-${VERSION}-win32.exe\r
 InstallDir "$PROGRAMFILES\VideoLAN\VLC"\r
 InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" "Install_Dir"\r
 OutFile ..\vlc-${VERSION}-win32.exe\r
 InstallDir "$PROGRAMFILES\VideoLAN\VLC"\r
 InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" "Install_Dir"\r
+!ifdef NSIS_LZMA_COMPRESS_WHOLE\r
 SetCompressor lzma\r
 SetCompressor lzma\r
-ShowInstDetails show\r
-ShowUnInstDetails show\r
+!else\r
+SetCompressor /SOLID lzma\r
+!endif\r
+;ShowInstDetails show\r
+;ShowUnInstDetails show\r
 SetOverwrite ifnewer\r
 CRCCheck on\r
 \r
 SetOverwrite ifnewer\r
 CRCCheck on\r
 \r
@@ -34,40 +39,125 @@ InstType "Full"
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\r
 \r
 ; MUI 1.67 compatible ------\r
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\r
 \r
 ; MUI 1.67 compatible ------\r
-!include "MUI.nsh"\r
+  !include "MUI.nsh"\r
 \r
 ; MUI Settings\r
 \r
 ; MUI Settings\r
-!define MUI_ABORTWARNING\r
-!define MUI_ICON "vlc48x48.ico"\r
-!define MUI_UNICON "vlc48x48.ico"\r
-!define MUI_COMPONENTSPAGE_SMALLDESC\r
-\r
-; Welcome page\r
-!insertmacro MUI_PAGE_WELCOME\r
-; License page\r
-!insertmacro MUI_PAGE_LICENSE "COPYING.txt"\r
-; Components page\r
-!insertmacro MUI_PAGE_COMPONENTS\r
-; Directory page\r
-!insertmacro MUI_PAGE_DIRECTORY\r
-; Instfiles page\r
-!insertmacro MUI_PAGE_INSTFILES\r
-; Finish page\r
-!define MUI_FINISHPAGE_RUN "$INSTDIR\vlc.exe"\r
-!define MUI_FINISHPAGE_NOREBOOTSUPPORT\r
-!insertmacro MUI_PAGE_FINISH\r
+  !define MUI_ABORTWARNING\r
+  !define MUI_ICON "vlc48x48.ico"\r
+  !define MUI_UNICON "vlc48x48.ico"\r
+  !define MUI_COMPONENTSPAGE_SMALLDESC\r
+\r
+; Installer pages\r
+  ; Welcome page\r
+    !define MUI_WELCOMEPAGE_TITLE_3LINES\r
+    !insertmacro MUI_PAGE_WELCOME\r
+  ; License page\r
+    !insertmacro MUI_PAGE_LICENSE "COPYING.txt"\r
+  ; Components page\r
+    !insertmacro MUI_PAGE_COMPONENTS\r
+  ; Directory page\r
+    !insertmacro MUI_PAGE_DIRECTORY\r
+  ; Instfiles page\r
+    !insertmacro MUI_PAGE_INSTFILES\r
+  ; Finish page\r
+    !define MUI_FINISHPAGE_RUN "$INSTDIR\vlc.exe"\r
+    !define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\README.txt"\r
+    !define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED\r
+    !define MUI_FINISHPAGE_LINK "Visit the VideoLAN VLC media player Website"\r
+    !define MUI_FINISHPAGE_LINK_LOCATION "http://www.videolan.org/vlc/"\r
+    !define MUI_FINISHPAGE_NOREBOOTSUPPORT\r
+    !insertmacro MUI_PAGE_FINISH\r
 \r
 ; Uninstaller pages\r
 \r
 ; Uninstaller pages\r
-!insertmacro MUI_UNPAGE_INSTFILES\r
+    !insertmacro MUI_UNPAGE_CONFIRM\r
+    !insertmacro MUI_UNPAGE_COMPONENTS\r
+    !insertmacro MUI_UNPAGE_INSTFILES\r
+    !insertmacro MUI_UNPAGE_FINISH\r
 \r
 ; Language files\r
 \r
 ; Language files\r
-!insertmacro MUI_LANGUAGE "English"\r
+  !insertmacro MUI_LANGUAGE "English" # first language is the default language\r
+  !insertmacro MUI_LANGUAGE "French"\r
+  !insertmacro MUI_LANGUAGE "German"\r
+  !insertmacro MUI_LANGUAGE "Spanish"\r
+  !insertmacro MUI_LANGUAGE "SimpChinese"\r
+  !insertmacro MUI_LANGUAGE "TradChinese"\r
+  !insertmacro MUI_LANGUAGE "Japanese"\r
+  !insertmacro MUI_LANGUAGE "Korean"\r
+  !insertmacro MUI_LANGUAGE "Italian"\r
+  !insertmacro MUI_LANGUAGE "Dutch"\r
+  !insertmacro MUI_LANGUAGE "Danish"\r
+  !insertmacro MUI_LANGUAGE "Swedish"\r
+  !insertmacro MUI_LANGUAGE "Norwegian"\r
+  !insertmacro MUI_LANGUAGE "Finnish"\r
+  !insertmacro MUI_LANGUAGE "Greek"\r
+  !insertmacro MUI_LANGUAGE "Russian"\r
+  !insertmacro MUI_LANGUAGE "Portuguese"\r
+  !insertmacro MUI_LANGUAGE "Arabic"\r
+\r
+!insertmacro MUI_RESERVEFILE_LANGDLL\r
 \r
 ; Reserve files\r
 \r
 ; Reserve files\r
-!insertmacro MUI_RESERVEFILE_INSTALLOPTIONS\r
+  !insertmacro MUI_RESERVEFILE_INSTALLOPTIONS\r
 \r
 ; MUI end ------\r
 \r
 \r
 ; MUI end ------\r
 \r
+;;;;;;;;;;;;;;;;;;;\r
+; Extension lists ;\r
+;;;;;;;;;;;;;;;;;;;\r
+\r
+!macro MacroAudioExtensions _action\r
+  !insertmacro ${_action} ".a52"\r
+  !insertmacro ${_action} ".aac"\r
+  !insertmacro ${_action} ".ac3"\r
+  !insertmacro ${_action} ".dts"\r
+  !insertmacro ${_action} ".flac"\r
+  !insertmacro ${_action} ".mka"\r
+  !insertmacro ${_action} ".mp1"\r
+  !insertmacro ${_action} ".mp2"\r
+  !insertmacro ${_action} ".mp3"\r
+  !insertmacro ${_action} ".ogg"\r
+  !insertmacro ${_action} ".spx"\r
+  !insertmacro ${_action} ".wav"\r
+  !insertmacro ${_action} ".wma"\r
+!macroend\r
+\r
+!macro MacroVideoExtensions _action\r
+  !insertmacro ${_action} ".asf"\r
+  !insertmacro ${_action} ".avi"\r
+  !insertmacro ${_action} ".divx"\r
+  !insertmacro ${_action} ".dv"\r
+  !insertmacro ${_action} ".m1v"\r
+  !insertmacro ${_action} ".m2v"\r
+  !insertmacro ${_action} ".mkv"\r
+  !insertmacro ${_action} ".mov"\r
+  !insertmacro ${_action} ".mp4"\r
+  !insertmacro ${_action} ".mpeg"\r
+  !insertmacro ${_action} ".mpeg1"\r
+  !insertmacro ${_action} ".mpeg2"\r
+  !insertmacro ${_action} ".mpeg4"\r
+  !insertmacro ${_action} ".mpg"\r
+  !insertmacro ${_action} ".ps"\r
+  !insertmacro ${_action} ".ts"\r
+  !insertmacro ${_action} ".ogm"\r
+  !insertmacro ${_action} ".vob"\r
+  !insertmacro ${_action} ".wmv"\r
+!macroend\r
+\r
+!macro MacroOtherExtensions _action\r
+  !insertmacro ${_action} ".asx"\r
+  !insertmacro ${_action} ".bin"\r
+  !insertmacro ${_action} ".cue"\r
+  !insertmacro ${_action} ".m3u"\r
+  !insertmacro ${_action} ".pls"\r
+  !insertmacro ${_action} ".vlc"\r
+!macroend\r
+\r
+!macro MacroAllExtensions _action\r
+  !insertmacro MacroAudioExtensions ${_action}\r
+  !insertmacro MacroVideoExtensions ${_action}\r
+  !insertmacro MacroOtherExtensions ${_action}\r
+!macroend\r
+\r
 ;;;;;;;;;;;;;;;;;;;;;;;;;;\r
 ; File type associations ;\r
 ;;;;;;;;;;;;;;;;;;;;;;;;;;\r
 ;;;;;;;;;;;;;;;;;;;;;;;;;;\r
 ; File type associations ;\r
 ;;;;;;;;;;;;;;;;;;;;;;;;;;\r
@@ -104,6 +194,7 @@ FunctionEnd
 \r
 !macro RegisterExtensionSection EXT\r
   Section /o ${EXT}\r
 \r
 !macro RegisterExtensionSection EXT\r
   Section /o ${EXT}\r
+    SectionIn 2 3\r
     Push $R0\r
     StrCpy $R0 ${EXT}\r
     Call RegisterExtension\r
     Push $R0\r
     StrCpy $R0 ${EXT}\r
     Call RegisterExtension\r
@@ -118,6 +209,51 @@ FunctionEnd
   Pop $R0\r
 !macroend\r
 \r
   Pop $R0\r
 !macroend\r
 \r
+!macro WriteRegStrSupportedTypes EXT\r
+  WriteRegStr HKCR Applications\vlc.exe\SupportedTypes ${EXT} ""\r
+!macroend\r
+\r
+;;;;;;;;;;;;;;;;;;;;;;;;\r
+; Context menu entries ;\r
+;;;;;;;;;;;;;;;;;;;;;;;;\r
+\r
+!macro AddContextMenu EXT\r
+  WriteRegStr HKCR ${EXT}\shell\PlayWithVLC "" "Play with VLC media player"\r
+  WriteRegStr HKCR ${EXT}\shell\PlayWithVLC\command "" '$INSTDIR\vlc.exe --no-playlist-enqueue "%1"'\r
+\r
+  WriteRegStr HKCR ${EXT}\shell\AddToPlaylistVLC "" "Add to VLC media player's Playlist"\r
+  WriteRegStr HKCR ${EXT}\shell\AddToPlaylistVLC\command "" '$INSTDIR\vlc.exe --one-instance --playlist-enqueue "%1"'\r
+!macroend\r
+\r
+!macro DeleteContextMenu EXT\r
+  DeleteRegKey HKCR ${EXT}\shell\PlayWithVLC\r
+  DeleteRegKey HKCR ${EXT}\shell\AddToPlaylistVLC\r
+!macroend\r
+\r
+;;;;;;;;;;;;;;;;;;;;;;;;;;\r
+; Delete prefs and cache ;\r
+;;;;;;;;;;;;;;;;;;;;;;;;;;\r
+\r
+!macro delprefs\r
+  SectionIn 2 3\r
+  StrCpy $0 0\r
+  !define Index 'Line${__LINE__}'\r
+  "${Index}-Loop:"\r
+  ; FIXME\r
+  ; this will loop through all the logged users and "virtual" windows users\r
+  ; (it looks like users are only present in HKEY_USERS when they are logged in)\r
+    ClearErrors\r
+    EnumRegKey $1 HKU "" $0\r
+    StrCmp $1 "" "${Index}-End"\r
+    IntOp $0 $0 + 1\r
+    ReadRegStr $2 HKU "$1\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" AppData\r
+    StrCmp $2 "" "${Index}-Loop"\r
+    RMDir /r "$2\vlc"\r
+    Goto "${Index}-Loop"\r
+  "${Index}-End:"\r
+  !undef Index\r
+!macroend\r
+\r
 ;;;;;;;;;;;;;;;;;;;;;;\r
 ; Installer sections ;\r
 ;;;;;;;;;;;;;;;;;;;;;;\r
 ;;;;;;;;;;;;;;;;;;;;;;\r
 ; Installer sections ;\r
 ;;;;;;;;;;;;;;;;;;;;;;\r
@@ -133,13 +269,17 @@ Section "Media player (required)" SEC01
 \r
   File  /r plugins\r
   File  /r locale\r
 \r
   File  /r plugins\r
   File  /r locale\r
+  File  /r osdmenu\r
   File  /r skins\r
   File  /r http\r
 \r
   File  /r skins\r
   File  /r http\r
 \r
+  ; Add VLC to "recomended programs" for the following extensions\r
   WriteRegStr HKCR Applications\vlc.exe "" ""\r
   WriteRegStr HKCR Applications\vlc.exe "" ""\r
-  WriteRegStr HKCR Applications\vlc.exe\shell "" "Play"\r
+  WriteRegStr HKCR Applications\vlc.exe "FriendlyAppName" "VLC media player"\r
+  WriteRegStr HKCR Applications\vlc.exe\shell\Play "" "Play with VLC"\r
   WriteRegStr HKCR Applications\vlc.exe\shell\Play\command "" \\r
     '$INSTDIR\vlc.exe "%1"'\r
   WriteRegStr HKCR Applications\vlc.exe\shell\Play\command "" \\r
     '$INSTDIR\vlc.exe "%1"'\r
+  !insertmacro MacroAllExtensions WriteRegStrSupportedTypes\r
 \r
   WriteRegStr HKCR "AudioCD\shell\PlayWithVLC" "" "Play with VLC media player"\r
   WriteRegStr HKCR "AudioCD\shell\PlayWithVLC\command" "" \\r
 \r
   WriteRegStr HKCR "AudioCD\shell\PlayWithVLC" "" "Play with VLC media player"\r
   WriteRegStr HKCR "AudioCD\shell\PlayWithVLC\command" "" \\r
@@ -164,7 +304,7 @@ Section "Media player (required)" SEC01
   WriteRegStr HKCR "VLC.DVDMovie" "" "VLC DVD Movie"\r
   WriteRegStr HKCR "VLC.DVDMovie\shell" "" "Play"\r
   WriteRegStr HKCR "VLC.DVDMovie\shell\Play\command" "" \\r
   WriteRegStr HKCR "VLC.DVDMovie" "" "VLC DVD Movie"\r
   WriteRegStr HKCR "VLC.DVDMovie\shell" "" "Play"\r
   WriteRegStr HKCR "VLC.DVDMovie\shell\Play\command" "" \\r
-    '$INSTDIR\vlc.exe dvd:%1@1:0'\r
+    '$INSTDIR\vlc.exe dvd:%1'\r
   WriteRegStr HKCR "VLC.DVDMovie\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'\r
   WriteRegStr HKCR "VLC.CDAudio" "" "VLC CD Audio"\r
   WriteRegStr HKCR "VLC.CDAudio\shell" "" "Play"\r
   WriteRegStr HKCR "VLC.DVDMovie\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'\r
   WriteRegStr HKCR "VLC.CDAudio" "" "VLC CD Audio"\r
   WriteRegStr HKCR "VLC.CDAudio\shell" "" "Play"\r
@@ -174,32 +314,69 @@ Section "Media player (required)" SEC01
 \r
 SectionEnd\r
 \r
 \r
 SectionEnd\r
 \r
-Section "Start Menu + Desktop Shortcut" SEC02\r
+Section "Start Menu Shortcut" SEC02a\r
   SectionIn 1 2 3\r
   CreateDirectory "$SMPROGRAMS\VideoLAN"\r
   CreateShortCut "$SMPROGRAMS\VideoLAN\VLC media player.lnk" \\r
   SectionIn 1 2 3\r
   CreateDirectory "$SMPROGRAMS\VideoLAN"\r
   CreateShortCut "$SMPROGRAMS\VideoLAN\VLC media player.lnk" \\r
-    "$INSTDIR\vlc.exe" "--intf wxwin --wxwin-embed"\r
+    "$INSTDIR\vlc.exe" "--intf wx --wx-embed"\r
   CreateShortCut "$SMPROGRAMS\VideoLAN\VLC media player (alt).lnk" \\r
   CreateShortCut "$SMPROGRAMS\VideoLAN\VLC media player (alt).lnk" \\r
-    "$INSTDIR\vlc.exe" "--intf wxwin --no-wxwin-embed"\r
+    "$INSTDIR\vlc.exe" "--intf wx --no-wx-embed"\r
   CreateShortCut "$SMPROGRAMS\VideoLAN\VLC media player (skins).lnk" \\r
     "$INSTDIR\vlc.exe" "--intf skins"\r
   CreateShortCut "$SMPROGRAMS\VideoLAN\Reset VLC defaults and quit.lnk" \\r
     "$INSTDIR\vlc.exe" "--reset-config --reset-plugins-cache --save-config vlc:quit "\r
   CreateShortCut "$SMPROGRAMS\VideoLAN\VLC media player (skins).lnk" \\r
     "$INSTDIR\vlc.exe" "--intf skins"\r
   CreateShortCut "$SMPROGRAMS\VideoLAN\Reset VLC defaults and quit.lnk" \\r
     "$INSTDIR\vlc.exe" "--reset-config --reset-plugins-cache --save-config vlc:quit "\r
-  CreateShortCut "$DESKTOP\VLC media player.lnk" \\r
-    "$INSTDIR\vlc.exe" "--intf wxwin"\r
   WriteIniStr "$INSTDIR\${PRODUCT_NAME}.url" "InternetShortcut" "URL" \\r
     "${PRODUCT_WEB_SITE}"\r
   WriteIniStr "$INSTDIR\${PRODUCT_NAME}.url" "InternetShortcut" "URL" \\r
     "${PRODUCT_WEB_SITE}"\r
-  CreateShortCut "$SMPROGRAMS\VideoLAN\Website.lnk" \\r
+  CreateShortCut "$SMPROGRAMS\VideoLAN\${PRODUCT_NAME} Website.lnk" \\r
     "$INSTDIR\${PRODUCT_NAME}.url"\r
     "$INSTDIR\${PRODUCT_NAME}.url"\r
+  WriteIniStr "$INSTDIR\Documentation.url" "InternetShortcut" "URL" \\r
+    "${PRODUCT_WEB_SITE}/doc/"\r
+  CreateShortCut "$SMPROGRAMS\VideoLAN\Documentation.lnk" \\r
+    "$INSTDIR\Documentation.url"\r
+SectionEnd\r
+\r
+Section "Desktop Shortcut" SEC02b\r
+  SectionIn 1 2 3\r
+  CreateShortCut "$DESKTOP\VLC media player.lnk" \\r
+    "$INSTDIR\vlc.exe" "--intf wx"\r
 SectionEnd\r
 \r
 Section /o "Mozilla plugin" SEC03\r
   SectionIn 2 3\r
   File /r mozilla\r
 \r
 SectionEnd\r
 \r
 Section /o "Mozilla plugin" SEC03\r
   SectionIn 2 3\r
   File /r mozilla\r
 \r
-  WriteRegStr HKLM \\r
-    SOFTWARE\MozillaPlugins\@videolan.org/vlc,version=${VERSION} \\r
-    "Path" '"$INSTDIR\mozilla\npvlc.dll"'\r
+  ; doesn't work. bug in mozilla/mozilla firefox or moz documentation (xpt file isn't loaded)\r
+  ; see mozilla bugs 184506 and 159445\r
+  ;!define Moz "SOFTWARE\MozillaPlugins\@videolan.org/vlc,version=${VERSION}"\r
+  ;WriteRegStr HKLM ${Moz} "Description" "VideoLAN VLC plugin for Mozilla"\r
+  ;WriteRegStr HKLM ${Moz} "Path" "$INSTDIR\mozilla\npvlc.dll"\r
+  ;WriteRegStr HKLM ${Moz} "Product" "VLC media player"\r
+  ;WriteRegStr HKLM ${Moz} "Vendor" "VideoLAN"\r
+  ;WriteRegStr HKLM ${Moz} "Version" "${VERSION}"\r
+  ;WriteRegStr HKLM ${Moz} "XPTPath" "$INSTDIR\mozilla\vlcintf.xpt"\r
+\r
+  Push $R0\r
+  Push $R1\r
+  Push $R2\r
+\r
+  !define Index 'Line${__LINE__}'\r
+  StrCpy $R1 "0"\r
+\r
+  "${Index}-Loop:"\r
+\r
+    ; Check for Key\r
+    EnumRegKey $R0 HKLM "SOFTWARE\Mozilla" "$R1"\r
+    StrCmp $R0 "" "${Index}-End"\r
+    IntOp $R1 $R1 + 1\r
+    ReadRegStr $R2 HKLM "SOFTWARE\Mozilla\$R0\Extensions" "Plugins"\r
+    StrCmp $R2 "" "${Index}-Loop" ""\r
+\r
+    CopyFiles "$INSTDIR\mozilla\*" "$R2"\r
+    Goto "${Index}-Loop"\r
+\r
+  "${Index}-End:"\r
+  !undef Index\r
+\r
 SectionEnd\r
 \r
 Section /o "ActiveX plugin" SEC04\r
 SectionEnd\r
 \r
 Section /o "ActiveX plugin" SEC04\r
@@ -209,45 +386,65 @@ Section /o "ActiveX plugin" SEC04
   RegDLL "$INSTDIR\axvlc.dll"\r
 SectionEnd\r
 \r
   RegDLL "$INSTDIR\axvlc.dll"\r
 SectionEnd\r
 \r
-SubSection "File type associations" SEC05\r
-  ; Make sure we have the same list in uninstall\r
-  !insertmacro RegisterExtensionSection ".a52"\r
-  !insertmacro RegisterExtensionSection ".aac"\r
-  !insertmacro RegisterExtensionSection ".ac3"\r
-  !insertmacro RegisterExtensionSection ".asf"\r
-  !insertmacro RegisterExtensionSection ".asx"\r
-  !insertmacro RegisterExtensionSection ".avi"\r
-  !insertmacro RegisterExtensionSection ".bin"\r
-  !insertmacro RegisterExtensionSection ".cue"\r
-  !insertmacro RegisterExtensionSection ".divx"\r
-  !insertmacro RegisterExtensionSection ".dts"\r
-  !insertmacro RegisterExtensionSection ".dv"\r
-  !insertmacro RegisterExtensionSection ".flac"\r
-  !insertmacro RegisterExtensionSection ".m1v"\r
-  !insertmacro RegisterExtensionSection ".m2v"\r
-  !insertmacro RegisterExtensionSection ".m3u"\r
-  !insertmacro RegisterExtensionSection ".mka"\r
-  !insertmacro RegisterExtensionSection ".mkv"\r
-  !insertmacro RegisterExtensionSection ".mov"\r
-  !insertmacro RegisterExtensionSection ".mp1"\r
-  !insertmacro RegisterExtensionSection ".mp2"\r
-  !insertmacro RegisterExtensionSection ".mp3"\r
-  !insertmacro RegisterExtensionSection ".mp4"\r
-  !insertmacro RegisterExtensionSection ".mpeg"\r
-  !insertmacro RegisterExtensionSection ".mpeg1"\r
-  !insertmacro RegisterExtensionSection ".mpeg2"\r
-  !insertmacro RegisterExtensionSection ".mpeg4"\r
-  !insertmacro RegisterExtensionSection ".mpg"\r
-  !insertmacro RegisterExtensionSection ".ogg"\r
-  !insertmacro RegisterExtensionSection ".ogm"\r
-  !insertmacro RegisterExtensionSection ".pls"\r
-  !insertmacro RegisterExtensionSection ".spx"\r
-  !insertmacro RegisterExtensionSection ".vob"\r
-  !insertmacro RegisterExtensionSection ".vlc"\r
-  !insertmacro RegisterExtensionSection ".wav"\r
-  !insertmacro RegisterExtensionSection ".wma"\r
-  !insertmacro RegisterExtensionSection ".wmv"\r
-SubSectionEnd\r
+Section "Context Menus" SEC05\r
+  SectionIn 2 3\r
+  !insertmacro MacroAllExtensions AddContextMenu\r
+  !insertmacro AddContextMenu "Folder"\r
+SectionEnd\r
+\r
+SectionGroup "File type associations" SEC06\r
+  SectionGroup "Audio Files"\r
+    !insertmacro MacroAudioExtensions RegisterExtensionSection\r
+  SectionGroupEnd\r
+  SectionGroup "Video Files"\r
+    !insertmacro MacroVideoExtensions RegisterExtensionSection\r
+  SectionGroupEnd\r
+  SectionGroup "Other"\r
+    !insertmacro MacroOtherExtensions RegisterExtensionSection\r
+  SectionGroupEnd\r
+SectionGroupEnd\r
+\r
+Section /o "Delete preferences and cache" SEC07\r
+  !insertmacro delprefs\r
+SectionEnd\r
+\r
+; Installer section descriptions\r
+!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN\r
+  !insertmacro MUI_DESCRIPTION_TEXT ${SEC01} \\r
+    "The media player itself"\r
+  !insertmacro MUI_DESCRIPTION_TEXT ${SEC02a} \\r
+    "Adds icons to your start menu for easy access"\r
+  !insertmacro MUI_DESCRIPTION_TEXT ${SEC02b} \\r
+    "Adds icon to your desktop for easy access"\r
+  !insertmacro MUI_DESCRIPTION_TEXT ${SEC03} \\r
+    "The VLC Mozilla and Mozilla Firefox plugin"\r
+  !insertmacro MUI_DESCRIPTION_TEXT ${SEC04} \\r
+    "The VLC ActiveX plugin"\r
+  !insertmacro MUI_DESCRIPTION_TEXT ${SEC05} \\r
+    "Add context menu items ('Play With VLC' and 'Add To VLC's Playlist')"\r
+  !insertmacro MUI_DESCRIPTION_TEXT ${SEC06} \\r
+    "Sets VLC media player as the default application for the specified file type"\r
+  !insertmacro MUI_DESCRIPTION_TEXT ${SEC07} \\r
+    "Deletes VLC media player preferences and cache files leftover from previous installations"\r
+!insertmacro MUI_FUNCTION_DESCRIPTION_END\r
+\r
+Function .onInit\r
+  ReadRegStr $R0  ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \\r
+  "UninstallString"\r
+  StrCmp $R0 "" done\r
\r
+  MessageBox MB_YESNO|MB_ICONEXCLAMATION \\r
+  "VLC media player has already been installed. $\nDo you want to remove \\r
+  the previous version before installing $(^Name) ?" \\r
+  IDNO done\r
+  \r
+  ;Run the uninstaller\r
+  ;uninst:\r
+    ClearErrors\r
+    ExecWait '$R0 _?=$INSTDIR' ;Do not copy the uninstaller to a temp file\r
+  done:\r
+  !insertmacro MUI_LANGDLL_DISPLAY\r
+FunctionEnd\r
 \r
 Section -Post\r
   WriteUninstaller "$INSTDIR\uninstall.exe"\r
 \r
 Section -Post\r
   WriteUninstaller "$INSTDIR\uninstall.exe"\r
@@ -269,77 +466,45 @@ Section -Post
     "Publisher" "${PRODUCT_PUBLISHER}"\r
 SectionEnd\r
 \r
     "Publisher" "${PRODUCT_PUBLISHER}"\r
 SectionEnd\r
 \r
-; Section descriptions\r
-!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN\r
-  !insertmacro MUI_DESCRIPTION_TEXT ${SEC01} \\r
-    "The media player itself"\r
-  !insertmacro MUI_DESCRIPTION_TEXT ${SEC02} \\r
-    "Adds icons to your start menu and your desktop for easy access"\r
-  !insertmacro MUI_DESCRIPTION_TEXT ${SEC03} \\r
-    "The VLC mozilla plugin"\r
-  !insertmacro MUI_DESCRIPTION_TEXT ${SEC04} \\r
-    "The VLC ActiveX plugin"\r
-  !insertmacro MUI_DESCRIPTION_TEXT ${SEC05} \\r
-    "Sets VLC media player as the default application for the specified file type"\r
-!insertmacro MUI_FUNCTION_DESCRIPTION_END\r
-\r
+;;;;;;;;;;;;;;;;;;;;;;;;\r
+; Uninstaller sections ;\r
+;;;;;;;;;;;;;;;;;;;;;;;;\r
 \r
 \r
-Function un.onUninstSuccess\r
-  HideWindow\r
-  MessageBox MB_ICONINFORMATION|MB_OK \\r
-    "$(^Name) was successfully removed from your computer."\r
-FunctionEnd\r
-\r
-Function un.onInit\r
-  MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 \\r
-    "Are you sure you want to completely remove $(^Name) and all of its components?" IDYES +2\r
-  Abort\r
-FunctionEnd\r
-\r
-Section Uninstall\r
+Section "Uninstall" SEC91\r
+  SectionIn 1 2 3 RO\r
   SetShellVarContext all\r
 \r
   SetShellVarContext all\r
 \r
-  ; Make sure we have the same list in install\r
-  !insertmacro UnRegisterExtensionSection ".a52"\r
-  !insertmacro UnRegisterExtensionSection ".aac"\r
-  !insertmacro UnRegisterExtensionSection ".ac3"\r
-  !insertmacro UnRegisterExtensionSection ".asf"\r
-  !insertmacro UnRegisterExtensionSection ".asx"\r
-  !insertmacro UnRegisterExtensionSection ".avi"\r
-  !insertmacro UnRegisterExtensionSection ".bin"\r
-  !insertmacro UnRegisterExtensionSection ".cue"\r
-  !insertmacro UnRegisterExtensionSection ".divx"\r
-  !insertmacro UnRegisterExtensionSection ".dts"\r
-  !insertmacro UnRegisterExtensionSection ".dv"\r
-  !insertmacro UnRegisterExtensionSection ".flac"\r
-  !insertmacro UnRegisterExtensionSection ".m1v"\r
-  !insertmacro UnRegisterExtensionSection ".m2v"\r
-  !insertmacro UnRegisterExtensionSection ".m3u"\r
-  !insertmacro UnRegisterExtensionSection ".mka"\r
-  !insertmacro UnRegisterExtensionSection ".mkv"\r
-  !insertmacro UnRegisterExtensionSection ".mov"\r
-  !insertmacro UnRegisterExtensionSection ".mp1"\r
-  !insertmacro UnRegisterExtensionSection ".mp2"\r
-  !insertmacro UnRegisterExtensionSection ".mp3"\r
-  !insertmacro UnRegisterExtensionSection ".mp4"\r
-  !insertmacro UnRegisterExtensionSection ".mpeg"\r
-  !insertmacro UnRegisterExtensionSection ".mpeg1"\r
-  !insertmacro UnRegisterExtensionSection ".mpeg2"\r
-  !insertmacro UnRegisterExtensionSection ".mpeg4"\r
-  !insertmacro UnRegisterExtensionSection ".mpg"\r
-  !insertmacro UnRegisterExtensionSection ".ogg"\r
-  !insertmacro UnRegisterExtensionSection ".ogm"\r
-  !insertmacro UnRegisterExtensionSection ".pls"\r
-  !insertmacro UnRegisterExtensionSection ".spx"\r
-  !insertmacro UnRegisterExtensionSection ".vob"\r
-  !insertmacro UnRegisterExtensionSection ".vlc"\r
-  !insertmacro UnRegisterExtensionSection ".wav"\r
-  !insertmacro UnRegisterExtensionSection ".wma"\r
-  !insertmacro UnRegisterExtensionSection ".wmv"\r
+  !insertmacro MacroAllExtensions DeleteContextMenu\r
+  !insertmacro MacroAllExtensions UnRegisterExtensionSection\r
+  !insertmacro DeleteContextMenu "Folder"\r
 \r
   UnRegDLL "$INSTDIR\axvlc.dll"\r
   Delete /REBOOTOK "$INSTDIR\axvlc.dll"\r
 \r
 \r
   UnRegDLL "$INSTDIR\axvlc.dll"\r
   Delete /REBOOTOK "$INSTDIR\axvlc.dll"\r
 \r
+  ;remove mozilla plugin\r
+  Push $R0\r
+  Push $R1\r
+  Push $R2\r
+\r
+  !define Index 'Line${__LINE__}'\r
+  StrCpy $R1 "0"\r
+\r
+  "${Index}-Loop:"\r
+\r
+    ; Check for Key\r
+    EnumRegKey $R0 HKLM "SOFTWARE\Mozilla" "$R1"\r
+    StrCmp $R0 "" "${Index}-End"\r
+    IntOp $R1 $R1 + 1\r
+    ReadRegStr $R2 HKLM "SOFTWARE\Mozilla\$R0\Extensions" "Plugins"\r
+    StrCmp $R2 "" "${Index}-Loop" ""\r
+\r
+    Delete "$R2\vlcintf.xpt"\r
+    Delete "$R2\npvlc.dll"\r
+    Goto "${Index}-Loop"\r
+\r
+  "${Index}-End:"\r
+  !undef Index\r
+\r
   RMDir "$SMPROGRAMS\VideoLAN"\r
   RMDir /r $SMPROGRAMS\VideoLAN\r
   RMDir /r $INSTDIR\r
   RMDir "$SMPROGRAMS\VideoLAN"\r
   RMDir /r $SMPROGRAMS\VideoLAN\r
   RMDir /r $INSTDIR\r
@@ -355,10 +520,10 @@ Section Uninstall
   DeleteRegKey HKCR "VLC.MediaFile"\r
 \r
   DeleteRegKey HKLM \\r
   DeleteRegKey HKCR "VLC.MediaFile"\r
 \r
   DeleteRegKey HKLM \\r
-    SOFTWARE\MozillaPlugins\@videolan.org/vlc,version=${VERSION}\r
+    "SOFTWARE\MozillaPlugins\@videolan.org/vlc,version=${VERSION}"\r
 \r
   DeleteRegKey HKLM \\r
 \r
   DeleteRegKey HKLM \\r
-    Software\Microsoft\Windows\CurrentVersion\Uninstall\VideoLAN\r
+    "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"\r
 \r
   Delete "$DESKTOP\VLC media player.lnk"\r
 \r
 \r
   Delete "$DESKTOP\VLC media player.lnk"\r
 \r
@@ -366,3 +531,25 @@ Section Uninstall
   DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}"\r
   SetAutoClose true\r
 SectionEnd\r
   DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}"\r
   SetAutoClose true\r
 SectionEnd\r
+\r
+Section /o "un.Delete preferences and cache" SEC92\r
+  !insertmacro delprefs\r
+SectionEnd\r
+\r
+; Uninstaller section descriptions\r
+!insertmacro MUI_UNFUNCTION_DESCRIPTION_BEGIN\r
+  !insertmacro MUI_DESCRIPTION_TEXT ${SEC91} \\r
+    "Uninstall VLC media player and all its components"\r
+  !insertmacro MUI_DESCRIPTION_TEXT ${SEC92} \\r
+    "Deletes VLC media player preferences and cache files"\r
+!insertmacro MUI_UNFUNCTION_DESCRIPTION_END\r
+\r
+;Function un.onUninstSuccess\r
+;  HideWindow\r
+;  MessageBox MB_ICONINFORMATION|MB_OK \\r
+;    "$(^Name) was successfully removed from your computer."\r
+;FunctionEnd\r
+\r
+Function un.onInit\r
+  !insertmacro MUI_LANGDLL_DISPLAY\r
+FunctionEnd\r