[vlc-commits] commit: Package Win32: add .vlt and .wsz extensions ( Jean-Philippe André )
git at videolan.org
git at videolan.org
Wed Jun 2 16:20:04 CEST 2010
vlc | branch: master | Jean-Philippe André <jpeg at videolan.org> | Wed Jun 2 00:34:33 2010 +0800| [3e2e7f2aa25adb90602e529b9cb0123508186b1a] | committer: Jean-Philippe André
Package Win32: add .vlt and .wsz extensions
To open skins, you have to use a special command, thus a different
ShellAssociation.
Entries are not selected by default (as they may be associated to
the VLC Skin Editor)
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=3e2e7f2aa25adb90602e529b9cb0123508186b1a
---
extras/package/win32/vlc.win32.nsi.in | 48 +++++++++++++++++++++++++++++++-
1 files changed, 46 insertions(+), 2 deletions(-)
diff --git a/extras/package/win32/vlc.win32.nsi.in b/extras/package/win32/vlc.win32.nsi.in
index 3659028..9391581 100644
--- a/extras/package/win32/vlc.win32.nsi.in
+++ b/extras/package/win32/vlc.win32.nsi.in
@@ -146,7 +146,7 @@ RequestExecutionLevel user
; 1. File type associations ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; Function that register one extension for VLC
+;; Function that registers one extension for VLC
Function RegisterExtension
; back up old value for extension $R0 (eg. ".opt")
ReadRegStr $1 HKCR "$R0" ""
@@ -173,6 +173,33 @@ ForVista:
ToEnd:
FunctionEnd
+;; Function that registers one skin extension for VLC
+Function RegisterSkinExtension
+ ; back up old value for extension $R0 (eg. ".opt")
+ ReadRegStr $1 HKCR "$R0" ""
+ StrCmp $1 "" NoBackup
+ StrCmp $1 "VLC$R0" "NoBackup"
+ WriteRegStr HKCR "$R0" "VLC.backup" $1
+NoBackup:
+ WriteRegStr HKCR "$R0" "" "VLC$R0"
+ ReadRegStr $0 HKCR "VLC$R0" ""
+ WriteRegStr HKCR "VLC$R0" "" "VLC skin file ($R0)"
+ WriteRegStr HKCR "VLC$R0\shell" "" "Open"
+ WriteRegStr HKCR "VLC$R0\shell\Open" "" ""
+ WriteRegStr HKCR "VLC$R0\shell\Open\command" "" '"$INSTDIR\vlc.exe" -Iskins --skins2-last "%1"'
+ WriteRegStr HKCR "VLC$R0\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'
+
+;;; Vista Only part
+ ; Vista and above detection
+ ReadRegStr $R1 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion
+ StrCpy $R2 $R1 1
+ StrCmp $R2 '6' ForVista ToEnd
+ForVista:
+ WriteRegStr HKLM "Software\Clients\Media\VLC\Capabilities\FileAssociations" "$R0" "VLC$R0"
+
+ToEnd:
+FunctionEnd
+
;; Function that removes one extension that VLC owns.
Function un.RegisterExtension
;start of restore script
@@ -201,6 +228,16 @@ FunctionEnd
SectionEnd
!macroend
+!macro RegisterSkinExtensionSection EXT
+ Section /o ${EXT}
+ SectionIn 1 3
+ Push $R0
+ StrCpy $R0 ${EXT}
+ Call RegisterSkinExtension
+ Pop $R0
+ SectionEnd
+!macroend
+
!macro UnRegisterExtensionSection EXT
Push $R0
StrCpy $R0 ${EXT}
@@ -287,6 +324,11 @@ FunctionEnd
!insertmacro ${_action} ".xspf"
!macroend
+!macro MacroSkinExtensions _action
+ !insertmacro ${_action} ".vlt"
+ !insertmacro ${_action} ".wsz"
+!macroend
+
; One macro to rule them all
!macro MacroAllExtensions _action
!insertmacro MacroAudioExtensions ${_action}
@@ -595,6 +637,7 @@ SectionGroup /e !$Name_Section06 SEC06
SectionGroupEnd
SectionGroup $Name_SectionGroupOther
!insertmacro MacroOtherExtensions RegisterExtensionSection
+ !insertmacro MacroSkinExtensions RegisterSkinExtensionSection
SectionGroupEnd
SectionGroupEnd
@@ -832,6 +875,7 @@ Section "un.$Name_Section91" SEC91
!insertmacro MacroAllExtensions DeleteContextMenu
!insertmacro MacroAllExtensions UnRegisterExtensionSection
+ !insertmacro MacroSkinExtensions UnRegisterExtensionSection
!insertmacro DeleteContextMenuExt "Directory"
;remove activex plugin
@@ -1031,5 +1075,5 @@ UAC_Success:
Brazilian:
!include "languages\brazilian_portuguese.nsh"
EndLanguageCmp:
-
+
FunctionEnd
More information about the vlc-commits
mailing list