| 117 | | ;;;;;;;;;;;;;;;;;;; |
|---|
| 118 | | ; Extension lists ; |
|---|
| 119 | | ;;;;;;;;;;;;;;;;;;; |
|---|
| | 117 | ;;;;;;;;;;;;;;;;;;;;;;; |
|---|
| | 118 | ; Macro and Functions ; |
|---|
| | 119 | ;;;;;;;;;;;;;;;;;;;;;;; |
|---|
| | 120 | |
|---|
| | 121 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
|---|
| | 122 | ; 1. File type associations ; |
|---|
| | 123 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
|---|
| | 124 | |
|---|
| | 125 | ;; Function that register one extension for VLC |
|---|
| | 126 | Function RegisterExtension |
|---|
| | 127 | ; back up old value for extension $R0 (eg. ".opt") |
|---|
| | 128 | ReadRegStr $1 HKCR "$R0" "" |
|---|
| | 129 | StrCmp $1 "" NoBackup |
|---|
| | 130 | StrCmp $1 "VLC$R0" "NoBackup" |
|---|
| | 131 | WriteRegStr HKCR "$R0" "VLC.backup" $1 |
|---|
| | 132 | NoBackup: |
|---|
| | 133 | WriteRegStr HKCR "$R0" "" "VLC$R0" |
|---|
| | 134 | ReadRegStr $0 HKCR "VLC$R0" "" |
|---|
| | 135 | WriteRegStr HKCR "VLC$R0" "" "VLC media file ($R0)" |
|---|
| | 136 | WriteRegStr HKCR "VLC$R0\shell" "" "Play" |
|---|
| | 137 | WriteRegStr HKCR "VLC$R0\shell\Play\command" "" '"$INSTDIR\vlc.exe" --started-from-file "%1"' |
|---|
| | 138 | WriteRegStr HKCR "VLC$R0\DefaultIcon" "" '"$INSTDIR\vlc.exe",0' |
|---|
| | 139 | |
|---|
| | 140 | ;;; Vista Only part |
|---|
| | 141 | ; Vista detection |
|---|
| | 142 | ReadRegStr $R1 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion |
|---|
| | 143 | StrCpy $R2 $R1 3 |
|---|
| | 144 | StrCmp $R2 '6.0' ForVista ToEnd |
|---|
| | 145 | ForVista: |
|---|
| | 146 | WriteRegStr HKLM "Software\Clients\Media\VLC\Capabilities\FileAssociations" "$R0" "VLC$R0" |
|---|
| | 147 | |
|---|
| | 148 | ToEnd: |
|---|
| | 149 | FunctionEnd |
|---|
| | 150 | |
|---|
| | 151 | ;; Function that removes one extension that VLC owns. |
|---|
| | 152 | Function un.RegisterExtension |
|---|
| | 153 | ;start of restore script |
|---|
| | 154 | ReadRegStr $1 HKCR "$R0" "" |
|---|
| | 155 | StrCmp $1 "VLC$R0" 0 NoOwn ; only do this if we own it |
|---|
| | 156 | ; Read the old value from Backup |
|---|
| | 157 | ReadRegStr $1 HKCR "$R0" "VLC.backup" |
|---|
| | 158 | StrCmp $1 "" 0 Restore ; if backup="" then delete the whole key |
|---|
| | 159 | DeleteRegKey HKCR "$R0" |
|---|
| | 160 | Goto NoOwn |
|---|
| | 161 | Restore: |
|---|
| | 162 | WriteRegStr HKCR "$R0" "" $1 |
|---|
| | 163 | DeleteRegValue HKCR "$R0" "VLC.backup" |
|---|
| | 164 | NoOwn: |
|---|
| | 165 | DeleteRegKey HKCR "VLC$R0" ;Delete key with association settings |
|---|
| | 166 | DeleteRegKey HKLM "Software\Clients\Media\VLC\Capabilities\FileAssociations\VLC$R0" ; for vista |
|---|
| | 167 | FunctionEnd |
|---|
| | 168 | |
|---|
| | 169 | !macro RegisterExtensionSection EXT |
|---|
| | 170 | Section ${EXT} |
|---|
| | 171 | SectionIn 1 3 |
|---|
| | 172 | Push $R0 |
|---|
| | 173 | StrCpy $R0 ${EXT} |
|---|
| | 174 | Call RegisterExtension |
|---|
| | 175 | Pop $R0 |
|---|
| | 176 | SectionEnd |
|---|
| | 177 | !macroend |
|---|
| | 178 | |
|---|
| | 179 | !macro UnRegisterExtensionSection EXT |
|---|
| | 180 | Push $R0 |
|---|
| | 181 | StrCpy $R0 ${EXT} |
|---|
| | 182 | Call un.RegisterExtension |
|---|
| | 183 | Pop $R0 |
|---|
| | 184 | !macroend |
|---|
| | 185 | |
|---|
| | 186 | !macro WriteRegStrSupportedTypes EXT |
|---|
| | 187 | WriteRegStr HKCR Applications\vlc.exe\SupportedTypes ${EXT} "" |
|---|
| | 188 | !macroend |
|---|
| | 189 | |
|---|
| | 190 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
|---|
| | 191 | ; Extension lists Macros ; |
|---|
| | 192 | ; Those macros calls the previous functions ; |
|---|
| | 193 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
|---|
| 175 | | ;;;;;;;;;;;;;;;;;;;;;;;;;; |
|---|
| 176 | | ; File type associations ; |
|---|
| 177 | | ;;;;;;;;;;;;;;;;;;;;;;;;;; |
|---|
| 178 | | |
|---|
| 179 | | Function RegisterExtension |
|---|
| 180 | | ; back up old value for extension $R0 (eg. ".opt") |
|---|
| 181 | | ReadRegStr $1 HKCR "$R0" "" |
|---|
| 182 | | StrCmp $1 "" NoBackup |
|---|
| 183 | | StrCmp $1 "VLC$R0" "NoBackup" |
|---|
| 184 | | WriteRegStr HKCR "$R0" "VLC.backup" $1 |
|---|
| 185 | | NoBackup: |
|---|
| 186 | | WriteRegStr HKCR "$R0" "" "VLC$R0" |
|---|
| 187 | | ReadRegStr $0 HKCR "VLC$R0" "" |
|---|
| 188 | | WriteRegStr HKCR "VLC$R0" "" "VLC media file ($R0)" |
|---|
| 189 | | WriteRegStr HKCR "VLC$R0\shell" "" "Play" |
|---|
| 190 | | WriteRegStr HKCR "VLC$R0\shell\Play\command" "" '"$INSTDIR\vlc.exe" --started-from-file "%1"' |
|---|
| 191 | | WriteRegStr HKCR "VLC$R0\DefaultIcon" "" '"$INSTDIR\vlc.exe",0' |
|---|
| 192 | | |
|---|
| 193 | | ; Vista detection |
|---|
| 194 | | ReadRegStr $R1 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion |
|---|
| 195 | | StrCpy $R2 $R1 3 |
|---|
| 196 | | StrCmp $R2 '6.0' ForVista ToEnd |
|---|
| 197 | | ForVista: |
|---|
| 198 | | WriteRegStr HKLM "Software\Clients\Media\VLC\Capabilities\FileAssociations" "$R0" "VLC$R0" |
|---|
| 199 | | ToEnd: |
|---|
| 200 | | |
|---|
| 201 | | FunctionEnd |
|---|
| 202 | | |
|---|
| 203 | | Function un.RegisterExtension |
|---|
| 204 | | ;start of restore script |
|---|
| 205 | | ReadRegStr $1 HKCR "$R0" "" |
|---|
| 206 | | StrCmp $1 "VLC$R0" 0 NoOwn ; only do this if we own it |
|---|
| 207 | | ReadRegStr $1 HKCR "$R0" "VLC.backup" |
|---|
| 208 | | StrCmp $1 "" 0 Restore ; if backup="" then delete the whole key |
|---|
| 209 | | DeleteRegKey HKCR "$R0" |
|---|
| 210 | | Goto NoOwn |
|---|
| 211 | | Restore: |
|---|
| 212 | | WriteRegStr HKCR "$R0" "" $1 |
|---|
| 213 | | DeleteRegValue HKCR "$R0" "VLC.backup" |
|---|
| 214 | | NoOwn: |
|---|
| 215 | | DeleteRegKey HKCR "VLC$R0" ;Delete key with association settings |
|---|
| 216 | | FunctionEnd |
|---|
| 217 | | |
|---|
| 218 | | !macro RegisterExtensionSection EXT |
|---|
| 219 | | Section ${EXT} |
|---|
| 220 | | SectionIn 1 3 |
|---|
| 221 | | Push $R0 |
|---|
| 222 | | StrCpy $R0 ${EXT} |
|---|
| 223 | | Call RegisterExtension |
|---|
| 224 | | Pop $R0 |
|---|
| 225 | | SectionEnd |
|---|
| 226 | | !macroend |
|---|
| 227 | | |
|---|
| 228 | | !macro UnRegisterExtensionSection EXT |
|---|
| 229 | | Push $R0 |
|---|
| 230 | | StrCpy $R0 ${EXT} |
|---|
| 231 | | Call un.RegisterExtension |
|---|
| 232 | | Pop $R0 |
|---|
| 233 | | !macroend |
|---|
| 234 | | |
|---|
| 235 | | !macro WriteRegStrSupportedTypes EXT |
|---|
| 236 | | WriteRegStr HKCR Applications\vlc.exe\SupportedTypes ${EXT} "" |
|---|
| 237 | | !macroend |
|---|
| 238 | | |
|---|
| 239 | | ;;;;;;;;;;;;;;;;;;;;;;;; |
|---|
| 240 | | ; Context menu entries ; |
|---|
| 241 | | ;;;;;;;;;;;;;;;;;;;;;;;; |
|---|
| 242 | | |
|---|
| | 250 | ;;;;;;;;;;;;;;;;;;;;;;;;;;; |
|---|
| | 251 | ; 2. Context menu entries ; |
|---|
| | 252 | ;;;;;;;;;;;;;;;;;;;;;;;;;;; |
|---|
| | 253 | |
|---|
| | 254 | ; Generic function for adding the context menu for one ext. |
|---|
| 396 | | |
|---|
| 397 | | WriteRegStr HKCR "AudioCD\shell\PlayWithVLC" "" "Play with VLC media player" |
|---|
| 398 | | WriteRegStr HKCR "AudioCD\shell\PlayWithVLC\command" "" \ |
|---|
| 399 | | "$INSTDIR\vlc.exe --started-from-file cdda:%1" |
|---|
| 400 | | WriteRegStr HKCR "DVD\shell\PlayWithVLC" "" "Play with VLC media player" |
|---|
| 401 | | WriteRegStr HKCR "DVD\shell\PlayWithVLC\command" "" \ |
|---|
| 402 | | "$INSTDIR\vlc.exe --started-from-file dvd:%1" |
|---|
| 403 | | |
|---|
| 404 | | WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayDVDMovieOnArrival" "VLCPlayDVDMovieOnArrival" "" |
|---|
| 405 | | WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "Action" "Play DVD movie" |
|---|
| 406 | | WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "DefaultIcon" '"$INSTDIR\vlc.exe",0' |
|---|
| 407 | | WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "InvokeProgID" "VLC.DVDMovie" |
|---|
| 408 | | WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "InvokeVerb" "play" |
|---|
| 409 | | WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "Provider" "VideoLAN VLC media player" |
|---|
| 410 | | |
|---|
| 411 | | WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayCDAudioOnArrival" "VLCPlayCDAudioOnArrival" "" |
|---|
| 412 | | WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "Action" "Play CD audio" |
|---|
| 413 | | WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "DefaultIcon" '"$INSTDIR\vlc.exe",0' |
|---|
| 414 | | WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "InvokeProgID" "VLC.CDAudio" |
|---|
| 415 | | WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "InvokeVerb" "play" |
|---|
| 416 | | WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "Provider" "VideoLAN VLC media player" |
|---|
| 417 | | WriteRegStr HKCR "VLC.DVDMovie" "" "VLC DVD Movie" |
|---|
| 418 | | WriteRegStr HKCR "VLC.DVDMovie\shell" "" "Play" |
|---|
| 419 | | WriteRegStr HKCR "VLC.DVDMovie\shell\Play\command" "" \ |
|---|
| 420 | | '$INSTDIR\vlc.exe --started-from-file dvd:%1' |
|---|
| 421 | | WriteRegStr HKCR "VLC.DVDMovie\DefaultIcon" "" '"$INSTDIR\vlc.exe",0' |
|---|
| 422 | | WriteRegStr HKCR "VLC.CDAudio" "" "VLC CD Audio" |
|---|
| 423 | | WriteRegStr HKCR "VLC.CDAudio\shell" "" "Play" |
|---|
| 424 | | WriteRegStr HKCR "VLC.CDAudio\shell\Play\command" "" \ |
|---|
| 425 | | '$INSTDIR\vlc.exe --started-from-file cdda:%1' |
|---|
| 426 | | WriteRegStr HKCR "VLC.CDAudio\DefaultIcon" "" '"$INSTDIR\vlc.exe",0' |
|---|
| 427 | | |
|---|
| | 425 | |
|---|
| | 426 | ; Vista Registration |
|---|
| | 541 | Section "Discs Playback" SEC05 |
|---|
| | 542 | SectionIn 1 2 3 |
|---|
| | 543 | WriteRegStr HKCR "AudioCD\shell\PlayWithVLC" "" "Play with VLC media player" |
|---|
| | 544 | WriteRegStr HKCR "AudioCD\shell\PlayWithVLC\command" "" \ |
|---|
| | 545 | "$INSTDIR\vlc.exe --started-from-file cdda:%1" |
|---|
| | 546 | WriteRegStr HKCR "DVD\shell\PlayWithVLC" "" "Play with VLC media player" |
|---|
| | 547 | WriteRegStr HKCR "DVD\shell\PlayWithVLC\command" "" \ |
|---|
| | 548 | "$INSTDIR\vlc.exe --started-from-file dvd:%1" |
|---|
| | 549 | |
|---|
| | 550 | WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayDVDMovieOnArrival" "VLCPlayDVDMovieOnArrival" "" |
|---|
| | 551 | WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "Action" "Play DVD movie" |
|---|
| | 552 | WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "DefaultIcon" '"$INSTDIR\vlc.exe",0' |
|---|
| | 553 | WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "InvokeProgID" "VLC.DVDMovie" |
|---|
| | 554 | WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "InvokeVerb" "play" |
|---|
| | 555 | WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "Provider" "VideoLAN VLC media player" |
|---|
| | 556 | |
|---|
| | 557 | WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayCDAudioOnArrival" "VLCPlayCDAudioOnArrival" "" |
|---|
| | 558 | WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "Action" "Play CD audio" |
|---|
| | 559 | WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "DefaultIcon" '"$INSTDIR\vlc.exe",0' |
|---|
| | 560 | WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "InvokeProgID" "VLC.CDAudio" |
|---|
| | 561 | WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "InvokeVerb" "play" |
|---|
| | 562 | WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "Provider" "VideoLAN VLC media player" |
|---|
| | 563 | WriteRegStr HKCR "VLC.DVDMovie" "" "VLC DVD Movie" |
|---|
| | 564 | WriteRegStr HKCR "VLC.DVDMovie\shell" "" "Play" |
|---|
| | 565 | WriteRegStr HKCR "VLC.DVDMovie\shell\Play\command" "" \ |
|---|
| | 566 | '$INSTDIR\vlc.exe --started-from-file dvd:%1' |
|---|
| | 567 | WriteRegStr HKCR "VLC.DVDMovie\DefaultIcon" "" '"$INSTDIR\vlc.exe",0' |
|---|
| | 568 | WriteRegStr HKCR "VLC.CDAudio" "" "VLC CD Audio" |
|---|
| | 569 | WriteRegStr HKCR "VLC.CDAudio\shell" "" "Play" |
|---|
| | 570 | WriteRegStr HKCR "VLC.CDAudio\shell\Play\command" "" \ |
|---|
| | 571 | '$INSTDIR\vlc.exe --started-from-file cdda:%1' |
|---|
| | 572 | WriteRegStr HKCR "VLC.CDAudio\DefaultIcon" "" '"$INSTDIR\vlc.exe",0' |
|---|
| | 573 | |
|---|
| | 574 | SectionEnd |
|---|
| | 575 | |
|---|