]> git.sesse.net Git - vlc/blobdiff - vlc.win32.nsi.in
Compile fix
[vlc] / vlc.win32.nsi.in
index 2fdab899eed4e3c506c7f39f026caf0a92a37d16..8a4a5dc84c9566ed47afe44b1d0430690062aa24 100644 (file)
 !define PRODUCT_UNINST_ROOT_KEY "HKLM"\r
 !define PRODUCT_ID "{ea92ef52-afe4-4212-bacb-dfe9fca94cd6}"\r
 \r
+!define MUI_LANGDLL_REGISTRY_ROOT "HKLM"\r
+!define MUI_LANGDLL_REGISTRY_KEY "${PRODUCT_DIR_REGKEY}"\r
+!define MUI_LANGDLL_REGISTRY_VALUENAME "Language"\r
+\r
 @FILE_LIBVLC_DLL@\r
+@FILE_LIBVLC_CONTROL_DLL@\r
 \r
 ;;;;;;;;;;;;;;;;;;;;;;;;;\r
 ; General configuration ;\r
@@ -96,6 +101,8 @@ InstType "Full"
   !insertmacro MUI_LANGUAGE "Russian"\r
   !insertmacro MUI_LANGUAGE "Portuguese"\r
   !insertmacro MUI_LANGUAGE "Arabic"\r
+  !insertmacro MUI_LANGUAGE "Polish"\r
+  !insertmacro MUI_LANGUAGE "Romanian"\r
 \r
 !insertmacro MUI_RESERVEFILE_LANGDLL\r
 \r
@@ -139,6 +146,7 @@ InstType "Full"
   !insertmacro ${_action} ".mpeg2"\r
   !insertmacro ${_action} ".mpeg4"\r
   !insertmacro ${_action} ".mpg"\r
+  !insertmacro ${_action} ".mxf"\r
   !insertmacro ${_action} ".ps"\r
   !insertmacro ${_action} ".ts"\r
   !insertmacro ${_action} ".ogm"\r
@@ -178,6 +186,15 @@ NoBackup:
   WriteRegStr HKCR "VLC$R0\shell" "" "Play"\r
   WriteRegStr HKCR "VLC$R0\shell\Play\command" "" '"$INSTDIR\vlc.exe" --started-from-file "%1"'\r
   WriteRegStr HKCR "VLC$R0\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'\r
+\r
+  ; Vista detection\r
+  ReadRegStr $R1 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion\r
+  StrCpy $R2 $R1 3\r
+  StrCmp $R2 '6.0' ForVista ToEnd\r
+ForVista:\r
+  WriteRegStr HKLM "Software\Clients\Media\VLC\Capabilities\FileAssociations" "$R0" "VLC$R0"\r
+ToEnd:\r
+\r
 FunctionEnd\r
 \r
 Function un.RegisterExtension\r
@@ -196,7 +213,7 @@ NoOwn:
 FunctionEnd\r
 \r
 !macro RegisterExtensionSection EXT\r
-  Section /o ${EXT}\r
+  Section ${EXT}\r
     SectionIn 1 3\r
     Push $R0\r
     StrCpy $R0 ${EXT}\r
@@ -220,7 +237,7 @@ FunctionEnd
 ; Context menu entries ;\r
 ;;;;;;;;;;;;;;;;;;;;;;;;\r
 \r
-!macro AddContextMenu EXT\r
+!macro AddContextMenuExt EXT\r
   WriteRegStr HKCR ${EXT}\shell\PlayWithVLC "" "Play with VLC media player"\r
   WriteRegStr HKCR ${EXT}\shell\PlayWithVLC\command "" '$INSTDIR\vlc.exe --started-from-file --no-playlist-enqueue "%1"'\r
 \r
@@ -228,17 +245,30 @@ FunctionEnd
   WriteRegStr HKCR ${EXT}\shell\AddToPlaylistVLC\command "" '$INSTDIR\vlc.exe --started-from-file --playlist-enqueue "%1"'\r
 !macroend\r
 \r
-!macro DeleteContextMenu EXT\r
+!macro AddContextMenu EXT\r
+  Push $R0\r
+  ReadRegStr $R0 HKCR ${EXT} ""\r
+  !insertmacro AddContextMenuExt $R0\r
+  Pop $R0\r
+!macroend\r
+\r
+!macro DeleteContextMenuExt EXT\r
   DeleteRegKey HKCR ${EXT}\shell\PlayWithVLC\r
   DeleteRegKey HKCR ${EXT}\shell\AddToPlaylistVLC\r
 !macroend\r
 \r
+!macro DeleteContextMenu EXT\r
+  Push $R0\r
+  ReadRegStr $R0 HKCR ${EXT} ""\r
+  !insertmacro DeleteContextMenuExt $R0\r
+  Pop $R0\r
+!macroend\r
+\r
 ;;;;;;;;;;;;;;;;;;;;;;;;;;\r
 ; Delete prefs and cache ;\r
 ;;;;;;;;;;;;;;;;;;;;;;;;;;\r
 \r
 !macro delprefs\r
-  SectionIn 1 3\r
   StrCpy $0 0\r
   !define Index 'Line${__LINE__}'\r
   "${Index}-Loop:"\r
@@ -332,6 +362,9 @@ Section "Media player (required)" SEC01
   !ifdef LIBVLC_DLL\r
   !insertmacro InstallFile ${LIBVLC_DLL}\r
   !endif\r
+  !ifdef LIBVLC_CONTROL_DLL\r
+  !insertmacro InstallFile ${LIBVLC_CONTROL_DLL}\r
+  !endif\r
   !insertmacro InstallFile *.txt\r
 \r
   !insertmacro InstallFolder plugins\r
@@ -339,6 +372,7 @@ Section "Media player (required)" SEC01
   !insertmacro InstallFolder osdmenu\r
   !insertmacro InstallFolder skins\r
   !insertmacro InstallFolder http\r
+  !insertmacro InstallFolder share\r
 \r
   WriteIniStr "$INSTDIR\${PRODUCT_GROUP} Website.url" "InternetShortcut" "URL" \\r
     "${PRODUCT_WEB_SITE}"\r
@@ -388,6 +422,18 @@ Section "Media player (required)" SEC01
     '$INSTDIR\vlc.exe --started-from-file cdda:%1'\r
   WriteRegStr HKCR "VLC.CDAudio\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'\r
 \r
+  ; Vista detection\r
+  ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion\r
+  StrCpy $R1 $R0 3\r
+  StrCmp $R1 '6.0' lbl_vista lbl_done\r
+\r
+  lbl_vista:\r
+  WriteRegStr HKLM "Software\RegisteredApplications" "VLC" "Software\Clients\Media\VLC\Capabilities"\r
+  WriteRegStr HKLM "Software\Clients\Media\VLC\Capabilities" "ApplicationName" "VLC media player"\r
+  WriteRegStr HKLM "Software\Clients\Media\VLC\Capabilities" "ApplicationDescription" "VLC - The video swiss knife"\r
+\r
+  lbl_done:\r
+\r
 SectionEnd\r
 \r
 Section "Start Menu Shortcut" SEC02a\r
@@ -407,7 +453,9 @@ Section "Start Menu Shortcut" SEC02a
   CreateDirectory "$SMPROGRAMS\VideoLAN\Quick Settings\Video"\r
   ; FIXME add detection for Vista. Direct3D will be default there, for all others it's DirectX\r
   CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to Direct3D.lnk" \\r
-    "$INSTDIR\vlc.exe" "--vout direct3d --overlay --save-config vlc:quit"\r
+    "$INSTDIR\vlc.exe" "--vout direct3d --overlay --directx-hw-yuv --save-config vlc:quit"\r
+  CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to Direct3D (no hardware acceleration).lnk" \\r
+    "$INSTDIR\vlc.exe" "--vout direct3d --overlay --no-directx-hw-yuv --save-config vlc:quit"\r
   CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to DirectX.lnk" \\r
     "$INSTDIR\vlc.exe" "--vout directx --overlay --directx-hw-yuv --save-config vlc:quit"\r
   CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to DirectX (no hardware acceleration).lnk" \\r
@@ -435,50 +483,52 @@ Section "Desktop Shortcut" SEC02b
 SectionEnd\r
 \r
 Section /o "Mozilla plugin" SEC03\r
-  SectionIn 3\r
+  SectionIn 3\r
 \r
+  SetOutPath "$INSTDIR"\r
   !insertmacro OpenUninstallLog\r
-  !insertmacro InstallFolder mozilla\r
+  !insertmacro InstallFile mozilla\npvlc.dll\r
   !insertmacro CloseUninstallLog\r
 \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
-    !ifdef LIBVLC_DLL\r
-    CopyFiles ${LIBVLC_DLL} "$R2"\r
-    !endif\r
-    Goto "${Index}-Loop"\r
-\r
-  "${Index}-End:"\r
-  !undef Index\r
+  !define Moz "SOFTWARE\MozillaPlugins\@videolan.org/vlc,version=${VERSION}"\r
+  WriteRegStr HKLM ${Moz} "Description" "VLC Multimedia Plugin"\r
+  WriteRegStr HKLM ${Moz} "Path" "$INSTDIR\npvlc.dll"\r
+  WriteRegStr HKLM ${Moz} "Product" "VLC media player"\r
+  WriteRegStr HKLM ${Moz} "Vendor" "VideoLAN"\r
+  WriteRegStr HKLM ${Moz} "Version" "${VERSION}"\r
+\r
+ ; for very old version of mozilla, these lines may be needed \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\npvlc.dll" "$R2"\r
+ ;  !ifdef LIBVLC_DLL\r
+ ;  CopyFiles ${LIBVLC_DLL} "$R2"\r
+ ;  !endif\r
+ ;  !ifdef LIBVLC_CONTROL_DLL\r
+ ;  CopyFiles ${LIBVLC_CONTROL_DLL} "$R2"\r
+ ;  !endif\r
+ ;  Goto "${Index}-Loop"\r
+\r
+ ;"${Index}-End:"\r
+ ;!undef Index\r
 \r
 SectionEnd\r
 \r
-Section /o "ActiveX plugin" SEC04\r
+Section "ActiveX plugin" SEC04\r
   SectionIn 1 3\r
   SetOutPath "$INSTDIR"\r
   !insertmacro OpenUninstallLog\r
@@ -487,12 +537,6 @@ Section /o "ActiveX plugin" SEC04
   RegDLL "$INSTDIR\axvlc.dll"\r
 SectionEnd\r
 \r
-Section /o "Context Menus" SEC05\r
-  SectionIn 3\r
-  !insertmacro MacroAllExtensions AddContextMenu\r
-  !insertmacro AddContextMenu "Directory"\r
-SectionEnd\r
-\r
 SectionGroup "File type associations" SEC06\r
   SectionGroup "Audio Files"\r
     !insertmacro MacroAudioExtensions RegisterExtensionSection\r
@@ -505,6 +549,12 @@ SectionGroup "File type associations" SEC06
   SectionGroupEnd\r
 SectionGroupEnd\r
 \r
+Section /o "Context Menus" SEC05\r
+  SectionIn 3\r
+  !insertmacro MacroAllExtensions AddContextMenu\r
+  !insertmacro AddContextMenuExt "Directory"\r
+SectionEnd\r
+\r
 Section /o "Delete preferences and cache" SEC07\r
   !insertmacro delprefs\r
 SectionEnd\r
@@ -630,8 +680,9 @@ Section "Uninstall" SEC91
 \r
   !insertmacro MacroAllExtensions DeleteContextMenu\r
   !insertmacro MacroAllExtensions UnRegisterExtensionSection\r
-  !insertmacro DeleteContextMenu "Directory"\r
+  !insertmacro DeleteContextMenuExt "Directory"\r
 \r
+  ;remove activex plugin\r
   UnRegDLL "$INSTDIR\axvlc.dll"\r
   Delete /REBOOTOK "$INSTDIR\axvlc.dll"\r
 \r
@@ -652,11 +703,15 @@ Section "Uninstall" SEC91
     ReadRegStr $R2 HKLM "SOFTWARE\Mozilla\$R0\Extensions" "Plugins"\r
     StrCmp $R2 "" "${Index}-Loop" ""\r
 \r
-    Delete "$R2\npvlc.dll"\r
+    ; old files (0.8.5 and before) that may be lying around\r
+    Delete /REBOOTOK "$R2\npvlc.dll"\r
+    Delete /REBOOTOK "$R2\libvlc.dll"\r
+    Delete /REBOOTOK "$R2\vlcintf.xpt"\r
     Goto "${Index}-Loop"\r
 \r
   "${Index}-End:"\r
   !undef Index\r
+  Delete /REBOOTOK "$INSTDIR\npvlc.dll"\r
 \r
   RMDir "$SMPROGRAMS\VideoLAN"\r
   RMDir /r $SMPROGRAMS\VideoLAN\r
@@ -688,6 +743,7 @@ Section "Uninstall" SEC91
   DeleteRegKey HKLM Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival\r
   DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayCDAudioOnArrival" "VLCPlayCDAudioOnArrival"\r
   DeleteRegKey HKLM Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival\r
+  DeleteRegKey HKLM Software\Clients\Media\VLC\r
   DeleteRegKey HKCR "VLC.MediaFile"\r
 \r
   DeleteRegKey HKLM \\r
@@ -704,7 +760,6 @@ Section "Uninstall" SEC91
 SectionEnd\r
 \r
 Section /o "un.Delete preferences and cache" SEC92\r
-  SectionIn 1 3\r
   !insertmacro delprefs\r
 SectionEnd\r
 \r
@@ -723,5 +778,5 @@ SectionEnd
 ;FunctionEnd\r
 \r
 Function un.onInit\r
-  !insertmacro MUI_LANGDLL_DISPLAY\r
+  !insertmacro MUI_UNGETLANGUAGE\r
 FunctionEnd\r