Commit 3e2e7f2a authored by Jean-Philippe André's avatar 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)
parent 79d1e54c
...@@ -146,7 +146,7 @@ RequestExecutionLevel user ...@@ -146,7 +146,7 @@ RequestExecutionLevel user
; 1. File type associations ; ; 1. File type associations ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Function that register one extension for VLC ;; Function that registers one extension for VLC
Function RegisterExtension Function RegisterExtension
; back up old value for extension $R0 (eg. ".opt") ; back up old value for extension $R0 (eg. ".opt")
ReadRegStr $1 HKCR "$R0" "" ReadRegStr $1 HKCR "$R0" ""
...@@ -173,6 +173,33 @@ ForVista: ...@@ -173,6 +173,33 @@ ForVista:
ToEnd: ToEnd:
FunctionEnd 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 that removes one extension that VLC owns.
Function un.RegisterExtension Function un.RegisterExtension
;start of restore script ;start of restore script
...@@ -201,6 +228,16 @@ FunctionEnd ...@@ -201,6 +228,16 @@ FunctionEnd
SectionEnd SectionEnd
!macroend !macroend
!macro RegisterSkinExtensionSection EXT
Section /o ${EXT}
SectionIn 1 3
Push $R0
StrCpy $R0 ${EXT}
Call RegisterSkinExtension
Pop $R0
SectionEnd
!macroend
!macro UnRegisterExtensionSection EXT !macro UnRegisterExtensionSection EXT
Push $R0 Push $R0
StrCpy $R0 ${EXT} StrCpy $R0 ${EXT}
...@@ -287,6 +324,11 @@ FunctionEnd ...@@ -287,6 +324,11 @@ FunctionEnd
!insertmacro ${_action} ".xspf" !insertmacro ${_action} ".xspf"
!macroend !macroend
!macro MacroSkinExtensions _action
!insertmacro ${_action} ".vlt"
!insertmacro ${_action} ".wsz"
!macroend
; One macro to rule them all ; One macro to rule them all
!macro MacroAllExtensions _action !macro MacroAllExtensions _action
!insertmacro MacroAudioExtensions ${_action} !insertmacro MacroAudioExtensions ${_action}
...@@ -595,6 +637,7 @@ SectionGroup /e !$Name_Section06 SEC06 ...@@ -595,6 +637,7 @@ SectionGroup /e !$Name_Section06 SEC06
SectionGroupEnd SectionGroupEnd
SectionGroup $Name_SectionGroupOther SectionGroup $Name_SectionGroupOther
!insertmacro MacroOtherExtensions RegisterExtensionSection !insertmacro MacroOtherExtensions RegisterExtensionSection
!insertmacro MacroSkinExtensions RegisterSkinExtensionSection
SectionGroupEnd SectionGroupEnd
SectionGroupEnd SectionGroupEnd
...@@ -832,6 +875,7 @@ Section "un.$Name_Section91" SEC91 ...@@ -832,6 +875,7 @@ Section "un.$Name_Section91" SEC91
!insertmacro MacroAllExtensions DeleteContextMenu !insertmacro MacroAllExtensions DeleteContextMenu
!insertmacro MacroAllExtensions UnRegisterExtensionSection !insertmacro MacroAllExtensions UnRegisterExtensionSection
!insertmacro MacroSkinExtensions UnRegisterExtensionSection
!insertmacro DeleteContextMenuExt "Directory" !insertmacro DeleteContextMenuExt "Directory"
;remove activex plugin ;remove activex plugin
...@@ -1031,5 +1075,5 @@ UAC_Success: ...@@ -1031,5 +1075,5 @@ UAC_Success:
Brazilian: Brazilian:
!include "languages\brazilian_portuguese.nsh" !include "languages\brazilian_portuguese.nsh"
EndLanguageCmp: EndLanguageCmp:
FunctionEnd FunctionEnd
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