Commit 565d5c50 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

nsis: Rework displayed file type

parent 8934fc49
!include "StrFunc.nsh"
;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; 1. File type associations ; ; 1. File type associations ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; "Initialize" string functions
${StrRep}
${StrCase}
;; Function that associates one extension with VLC ;; Function that associates one extension with VLC
Function AssociateExtension Function AssociateExtension
; back up old value for extension $R0 (eg. ".opt") ; back up old value for extension $R0 (eg. ".opt")
...@@ -15,7 +21,13 @@ FunctionEnd ...@@ -15,7 +21,13 @@ FunctionEnd
;; Function that registers one extension for VLC ;; Function that registers one extension for VLC
Function RegisterExtension Function RegisterExtension
WriteRegStr HKCR "VLC$R0" "" "VLC media file ($R0)" ; R0 contains the extension, R1 contains the type (Audio/Video)
; Remove the leading dot from the filetype string
${StrRep} $R2 $R0 "." ""
; And capitalize the extension
${StrCase} $R2 $R2 "U"
; for instance: MKV Video File (VLC)
WriteRegStr HKCR "VLC$R0" "" "$R2 $R1 File (VLC)"
WriteRegStr HKCR "VLC$R0\shell" "" "Open" WriteRegStr HKCR "VLC$R0\shell" "" "Open"
WriteRegStr HKCR "VLC$R0\shell\Open" "" "$(ShellAssociation_Play)" WriteRegStr HKCR "VLC$R0\shell\Open" "" "$(ShellAssociation_Play)"
WriteRegStr HKCR "VLC$R0\shell\Open" "MultiSelectModel" "Player" WriteRegStr HKCR "VLC$R0\shell\Open" "MultiSelectModel" "Player"
...@@ -92,7 +104,10 @@ FunctionEnd ...@@ -92,7 +104,10 @@ FunctionEnd
!macro RegisterExtensionMacro TYPE EXT !macro RegisterExtensionMacro TYPE EXT
Push $R0 Push $R0
StrCpy $R0 ${EXT} StrCpy $R0 ${EXT}
Push $R1
StrCpy $R1 ${TYPE}
Call RegisterExtension Call RegisterExtension
Pop $R1
Pop $R0 Pop $R0
!macroend !macroend
......
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