1 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2 ; NSIS installer script for vlc ;
3 ; (http://nsis.sourceforge.net) ;
4 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
6 !define PRODUCT_NAME "VLC media player"
7 !define VERSION @VERSION@
8 !define PRODUCT_VERSION @VERSION@
9 !define PRODUCT_GROUP "VideoLAN"
10 !define PRODUCT_PUBLISHER "VideoLAN Team"
11 !define PRODUCT_WEB_SITE "http://www.videolan.org"
12 !define PRODUCT_DIR_REGKEY "Software\VideoLAN\VLC"
13 !define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
14 !define PRODUCT_UNINST_ROOT_KEY "HKLM"
15 !define PRODUCT_ID "{ea92ef52-afe4-4212-bacb-dfe9fca94cd6}"
17 !define MUI_LANGDLL_REGISTRY_ROOT "HKLM"
18 !define MUI_LANGDLL_REGISTRY_KEY "${PRODUCT_DIR_REGKEY}"
19 !define MUI_LANGDLL_REGISTRY_VALUENAME "Language"
24 ;;;;;;;;;;;;;;;;;;;;;;;;;
25 ; General configuration ;
26 ;;;;;;;;;;;;;;;;;;;;;;;;;
28 Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
29 OutFile ..\vlc-${VERSION}-win32.exe
30 InstallDir "$PROGRAMFILES\VideoLAN\VLC"
31 InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" ""
32 !ifdef NSIS_LZMA_COMPRESS_WHOLE
35 SetCompressor /SOLID lzma
39 ;ShowUnInstDetails show
42 BrandingText "${PRODUCT_GROUP} ${PRODUCT_NAME}"
44 InstType "Recommended"
48 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
49 ; NSIS Modern User Interface configuration ;
50 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
52 ; MUI 1.67 compatible ------
56 !define MUI_ABORTWARNING
57 !define MUI_ICON "vlc48x48.ico"
58 !define MUI_UNICON "vlc48x48.ico"
59 !define MUI_COMPONENTSPAGE_SMALLDESC
63 !define MUI_WELCOMEPAGE_TITLE_3LINES
64 !insertmacro MUI_PAGE_WELCOME
66 !insertmacro MUI_PAGE_LICENSE "COPYING.txt"
68 !insertmacro MUI_PAGE_COMPONENTS
70 !insertmacro MUI_PAGE_DIRECTORY
72 !insertmacro MUI_PAGE_INSTFILES
74 !define MUI_FINISHPAGE_RUN "$INSTDIR\vlc.exe"
75 !define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\README.txt"
76 !define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED
77 !define MUI_FINISHPAGE_LINK "Visit the VideoLAN VLC media player Website"
78 !define MUI_FINISHPAGE_LINK_LOCATION "http://www.videolan.org/vlc/"
79 !define MUI_FINISHPAGE_NOREBOOTSUPPORT
80 !insertmacro MUI_PAGE_FINISH
83 !insertmacro MUI_UNPAGE_CONFIRM
84 !insertmacro MUI_UNPAGE_COMPONENTS
85 !insertmacro MUI_UNPAGE_INSTFILES
86 !insertmacro MUI_UNPAGE_FINISH
89 !insertmacro MUI_LANGUAGE "English" # first language is the default language
90 !insertmacro MUI_LANGUAGE "French"
91 !insertmacro MUI_LANGUAGE "German"
92 !insertmacro MUI_LANGUAGE "Spanish"
93 !insertmacro MUI_LANGUAGE "SimpChinese"
94 !insertmacro MUI_LANGUAGE "TradChinese"
95 !insertmacro MUI_LANGUAGE "Japanese"
96 !insertmacro MUI_LANGUAGE "Korean"
97 !insertmacro MUI_LANGUAGE "Italian"
98 !insertmacro MUI_LANGUAGE "Dutch"
99 !insertmacro MUI_LANGUAGE "Danish"
100 !insertmacro MUI_LANGUAGE "Swedish"
101 !insertmacro MUI_LANGUAGE "Norwegian"
102 !insertmacro MUI_LANGUAGE "Finnish"
103 !insertmacro MUI_LANGUAGE "Greek"
104 !insertmacro MUI_LANGUAGE "Russian"
105 !insertmacro MUI_LANGUAGE "Portuguese"
106 !insertmacro MUI_LANGUAGE "Arabic"
107 !insertmacro MUI_LANGUAGE "Polish"
108 !insertmacro MUI_LANGUAGE "Romanian"
109 !insertmacro MUI_LANGUAGE "Slovak"
110 !insertmacro MUI_LANGUAGE "Czech"
112 ; Reserve files for solid compression
113 !insertmacro MUI_RESERVEFILE_LANGDLL
114 !insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
118 ;;;;;;;;;;;;;;;;;;;;;;;
119 ; Macro and Functions ;
120 ;;;;;;;;;;;;;;;;;;;;;;;
122 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
123 ; 1. File type associations ;
124 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
126 ;; Function that register one extension for VLC
127 Function RegisterExtension
128 ; back up old value for extension $R0 (eg. ".opt")
129 ReadRegStr $1 HKCR "$R0" ""
130 StrCmp $1 "" NoBackup
131 StrCmp $1 "VLC$R0" "NoBackup"
132 WriteRegStr HKCR "$R0" "VLC.backup" $1
134 WriteRegStr HKCR "$R0" "" "VLC$R0"
135 ReadRegStr $0 HKCR "VLC$R0" ""
136 WriteRegStr HKCR "VLC$R0" "" "VLC media file ($R0)"
137 WriteRegStr HKCR "VLC$R0\shell" "" "Play"
138 WriteRegStr HKCR "VLC$R0\shell\Play\command" "" '"$INSTDIR\vlc.exe" --started-from-file "%1"'
139 WriteRegStr HKCR "VLC$R0\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'
143 ReadRegStr $R1 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion
145 StrCmp $R2 '6.0' ForVista ToEnd
147 WriteRegStr HKLM "Software\Clients\Media\VLC\Capabilities\FileAssociations" "$R0" "VLC$R0"
152 ;; Function that removes one extension that VLC owns.
153 Function un.RegisterExtension
154 ;start of restore script
155 ReadRegStr $1 HKCR "$R0" ""
156 StrCmp $1 "VLC$R0" 0 NoOwn ; only do this if we own it
157 ; Read the old value from Backup
158 ReadRegStr $1 HKCR "$R0" "VLC.backup"
159 StrCmp $1 "" 0 Restore ; if backup="" then delete the whole key
160 DeleteRegKey HKCR "$R0"
163 WriteRegStr HKCR "$R0" "" $1
164 DeleteRegValue HKCR "$R0" "VLC.backup"
166 DeleteRegKey HKCR "VLC$R0" ;Delete key with association settings
167 DeleteRegKey HKLM "Software\Clients\Media\VLC\Capabilities\FileAssociations\VLC$R0" ; for vista
170 !macro RegisterExtensionSection EXT
175 Call RegisterExtension
180 !macro UnRegisterExtensionSection EXT
183 Call un.RegisterExtension
187 !macro WriteRegStrSupportedTypes EXT
188 WriteRegStr HKCR Applications\vlc.exe\SupportedTypes ${EXT} ""
191 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
192 ; Extension lists Macros ;
193 ; Those macros calls the previous functions ;
194 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
196 !macro MacroAudioExtensions _action
197 !insertmacro ${_action} ".a52"
198 !insertmacro ${_action} ".aac"
199 !insertmacro ${_action} ".ac3"
200 !insertmacro ${_action} ".dts"
201 !insertmacro ${_action} ".flac"
202 !insertmacro ${_action} ".m4a"
203 !insertmacro ${_action} ".m4p"
204 !insertmacro ${_action} ".mka"
205 !insertmacro ${_action} ".mod"
206 !insertmacro ${_action} ".mp1"
207 !insertmacro ${_action} ".mp2"
208 !insertmacro ${_action} ".mp3"
209 !insertmacro ${_action} ".oma"
210 !insertmacro ${_action} ".ogg"
211 !insertmacro ${_action} ".spx"
212 !insertmacro ${_action} ".wav"
213 !insertmacro ${_action} ".wma"
214 !insertmacro ${_action} ".wma"
215 !insertmacro ${_action} ".xm"
218 !macro MacroVideoExtensions _action
219 !insertmacro ${_action} ".asf"
220 !insertmacro ${_action} ".avi"
221 !insertmacro ${_action} ".divx"
222 !insertmacro ${_action} ".dv"
223 !insertmacro ${_action} ".flv"
224 !insertmacro ${_action} ".gxf"
225 !insertmacro ${_action} ".m1v"
226 !insertmacro ${_action} ".m2v"
227 !insertmacro ${_action} ".m2ts"
228 !insertmacro ${_action} ".m4v"
229 !insertmacro ${_action} ".mkv"
230 !insertmacro ${_action} ".mov"
231 !insertmacro ${_action} ".mp4"
232 !insertmacro ${_action} ".mpeg"
233 !insertmacro ${_action} ".mpeg1"
234 !insertmacro ${_action} ".mpeg2"
235 !insertmacro ${_action} ".mpeg4"
236 !insertmacro ${_action} ".mpg"
237 !insertmacro ${_action} ".mts"
238 !insertmacro ${_action} ".mxf"
239 !insertmacro ${_action} ".ogm"
240 !insertmacro ${_action} ".ps"
241 !insertmacro ${_action} ".ts"
242 !insertmacro ${_action} ".vob"
243 !insertmacro ${_action} ".wmv"
246 !macro MacroOtherExtensions _action
247 !insertmacro ${_action} ".asx"
248 !insertmacro ${_action} ".bin"
249 !insertmacro ${_action} ".cue"
250 !insertmacro ${_action} ".m3u"
251 !insertmacro ${_action} ".pls"
252 !insertmacro ${_action} ".vlc"
255 ; One macro to rule them all
256 !macro MacroAllExtensions _action
257 !insertmacro MacroAudioExtensions ${_action}
258 !insertmacro MacroVideoExtensions ${_action}
259 !insertmacro MacroOtherExtensions ${_action}
262 ;;;;;;;;;;;;;;;;;;;;;;;;;;;
263 ; 2. Context menu entries ;
264 ;;;;;;;;;;;;;;;;;;;;;;;;;;;
266 ; Generic function for adding the context menu for one ext.
267 !macro AddContextMenuExt EXT
268 WriteRegStr HKCR ${EXT}\shell\PlayWithVLC "" "Play with VLC media player"
269 WriteRegStr HKCR ${EXT}\shell\PlayWithVLC\command "" '$INSTDIR\vlc.exe --started-from-file --no-playlist-enqueue "%1"'
271 WriteRegStr HKCR ${EXT}\shell\AddToPlaylistVLC "" "Add to VLC media player's Playlist"
272 WriteRegStr HKCR ${EXT}\shell\AddToPlaylistVLC\command "" '$INSTDIR\vlc.exe --started-from-file --playlist-enqueue "%1"'
275 !macro AddContextMenu EXT
277 ReadRegStr $R0 HKCR ${EXT} ""
278 !insertmacro AddContextMenuExt $R0
282 !macro DeleteContextMenuExt EXT
283 DeleteRegKey HKCR ${EXT}\shell\PlayWithVLC
284 DeleteRegKey HKCR ${EXT}\shell\AddToPlaylistVLC
287 !macro DeleteContextMenu EXT
289 ReadRegStr $R0 HKCR ${EXT} ""
290 !insertmacro DeleteContextMenuExt $R0
294 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
295 ; 3. Delete prefs and cache ;
296 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
300 !define Index 'Line${__LINE__}'
303 ; this will loop through all the logged users and "virtual" windows users
304 ; (it looks like users are only present in HKEY_USERS when they are logged in)
306 EnumRegKey $1 HKU "" $0
307 StrCmp $1 "" "${Index}-End"
309 ReadRegStr $2 HKU "$1\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" AppData
310 StrCmp $2 "" "${Index}-Loop"
321 !macro OpenUninstallLog
322 FileOpen $UninstallLog "$INSTDIR\uninstall.log" a
323 FileSeek $UninstallLog 0 END
326 !macro CloseUninstallLog
327 FileClose $UninstallLog
328 SetFileAttributes "$INSTDIR\uninstall.log" HIDDEN
334 !macro InstallFile FILEREGEX
336 !define Index 'Line${__LINE__}'
337 FindFirst $0 $1 "$INSTDIR\${FILEREGEX}"
338 StrCmp $0 "" "${Index}-End"
340 StrCmp $1 "" "${Index}-End"
341 FileWrite $UninstallLog "$1$\r$\n"
348 !macro InstallFolder FOLDER
351 Call InstallFolderInternal
354 Function InstallFolderInternal
356 !define Index 'Line${__LINE__}'
357 FindFirst $0 $1 "$INSTDIR\$9\*"
358 StrCmp $0 "" "${Index}-End"
360 StrCmp $1 "" "${Index}-End"
361 StrCmp $1 "." "${Index}-Next"
362 StrCmp $1 ".." "${Index}-Next"
363 IfFileExists "$9\$1\*" 0 "${Index}-Write"
367 Call InstallFolderInternal
372 FileWrite $UninstallLog "$9\$1$\r$\n"
382 ;;;;;;;;;;;;;;;;;;;;;;
383 ; Installer sections ;
386 ;;;;;;;;;;;;;;;;;;;;;;
388 Section "Media player (required)" SEC01
390 SetShellVarContext all
391 SetOutPath "$INSTDIR"
393 !insertmacro OpenUninstallLog
395 ; VLC.exe, libvlc.dll
396 !insertmacro InstallFile vlc.exe
397 !insertmacro InstallFile vlc.exe.manifest
398 !ifdef LIBVLCCORE_DLL
399 !insertmacro InstallFile ${LIBVLCCORE_DLL}
402 !insertmacro InstallFile ${LIBVLC_DLL}
406 !insertmacro InstallFile *.txt
409 !insertmacro InstallFolder plugins
410 !insertmacro InstallFolder locale
411 !insertmacro InstallFolder osdmenu
412 !insertmacro InstallFolder skins
413 !insertmacro InstallFolder http
414 !insertmacro InstallFolder lua
417 WriteIniStr "$INSTDIR\${PRODUCT_GROUP} Website.url" "InternetShortcut" "URL" \
418 "${PRODUCT_WEB_SITE}"
419 FileWrite $UninstallLog "${PRODUCT_GROUP} Website.url$\r$\n"
420 WriteIniStr "$INSTDIR\Documentation.url" "InternetShortcut" "URL" \
421 "${PRODUCT_WEB_SITE}/doc/"
422 FileWrite $UninstallLog "Documentation.url$\r$\n"
423 WriteIniStr "$INSTDIR\New_Skins.url" "InternetShortcut" "URL" \
424 "${PRODUCT_WEB_SITE}/vlc/skins.php"
425 FileWrite $UninstallLog "New_Skins.url$\r$\n"
427 !insertmacro CloseUninstallLog
429 ; Add VLC to "recomended programs" for the following extensions
430 WriteRegStr HKCR Applications\vlc.exe "" ""
431 WriteRegStr HKCR Applications\vlc.exe "FriendlyAppName" "VLC media player"
432 WriteRegStr HKCR Applications\vlc.exe\shell\Play "" "Play with VLC"
433 WriteRegStr HKCR Applications\vlc.exe\shell\Play\command "" \
434 '$INSTDIR\vlc.exe --started-from-file "%1"'
435 !insertmacro MacroAllExtensions WriteRegStrSupportedTypes
439 ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion
441 StrCmp $R1 '6.0' lbl_vista lbl_done
444 WriteRegStr HKLM "Software\RegisteredApplications" "VLC" "Software\Clients\Media\VLC\Capabilities"
445 WriteRegStr HKLM "Software\Clients\Media\VLC\Capabilities" "ApplicationName" "VLC media player"
446 WriteRegStr HKLM "Software\Clients\Media\VLC\Capabilities" "ApplicationDescription" "VLC - The video swiss knife"
451 Section "Start Menu Shortcut" SEC02a
453 CreateDirectory "$SMPROGRAMS\VideoLAN"
454 CreateDirectory "$SMPROGRAMS\VideoLAN\Quick Settings"
455 CreateDirectory "$SMPROGRAMS\VideoLAN\Quick Settings\Audio"
456 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Audio\Set Audio mode to DirectX (default).lnk" \
457 "$INSTDIR\vlc.exe" "--aout aout_directx --save-config vlc://quit"
458 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Audio\Set Audio mode to Waveout.lnk" \
459 "$INSTDIR\vlc.exe" "--aout waveout --save-config vlc://quit"
460 CreateDirectory "$SMPROGRAMS\VideoLAN\Quick Settings\Interface"
461 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Interface\Set Main Interface to Skinnable.lnk" \
462 "$INSTDIR\vlc.exe" "-I skins --save-config vlc://quit"
463 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Interface\Set Main Interface to Qt (default).lnk" \
464 "$INSTDIR\vlc.exe" "-I qt --save-config vlc://quit"
465 CreateDirectory "$SMPROGRAMS\VideoLAN\Quick Settings\Video"
466 ; FIXME add detection for Vista. Direct3D will be default there, for all others it's DirectX
467 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to Direct3D.lnk" \
468 "$INSTDIR\vlc.exe" "--vout direct3d --overlay --directx-hw-yuv --save-config vlc://quit"
469 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to Direct3D (no hardware acceleration).lnk" \
470 "$INSTDIR\vlc.exe" "--vout direct3d --overlay --no-directx-hw-yuv --save-config vlc://quit"
471 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to DirectX.lnk" \
472 "$INSTDIR\vlc.exe" "--vout directx --overlay --directx-hw-yuv --save-config vlc://quit"
473 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to DirectX (no hardware acceleration).lnk" \
474 "$INSTDIR\vlc.exe" "--vout directx --no-overlay --no-directx-hw-yuv --save-config vlc://quit"
475 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to DirectX (no video overlay).lnk" \
476 "$INSTDIR\vlc.exe" "--vout directx --no-overlay --directx-hw-yuv --save-config vlc://quit"
477 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to OpenGL.lnk" \
478 "$INSTDIR\vlc.exe" "--vout opengl --overlay --save-config vlc://quit"
479 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Reset VLC media player preferences and cache files.lnk" \
480 "$INSTDIR\vlc.exe" "--reset-config --reset-plugins-cache vlc://quit"
481 CreateShortCut "$SMPROGRAMS\VideoLAN\Documentation.lnk" \
482 "$INSTDIR\Documentation.url"
483 CreateShortCut "$SMPROGRAMS\VideoLAN\Release Notes.lnk" \
484 "$INSTDIR\NEWS.txt" ""
485 CreateShortCut "$SMPROGRAMS\VideoLAN\${PRODUCT_GROUP} Website.lnk" \
486 "$INSTDIR\${PRODUCT_GROUP} Website.url"
487 CreateShortCut "$SMPROGRAMS\VideoLAN\VLC media player.lnk" \
488 "$INSTDIR\vlc.exe" ""
491 Section "Desktop Shortcut" SEC02b
493 CreateShortCut "$DESKTOP\VLC media player.lnk" \
494 "$INSTDIR\vlc.exe" ""
497 Section /o "Mozilla plugin" SEC03
500 SetOutPath "$INSTDIR"
501 !insertmacro OpenUninstallLog
502 !insertmacro InstallFile mozilla\npvlc.dll
503 !insertmacro CloseUninstallLog
505 !define Moz "SOFTWARE\MozillaPlugins\@videolan.org/vlc,version=${VERSION}"
506 WriteRegStr HKLM ${Moz} "Description" "VLC Multimedia Plugin"
507 WriteRegStr HKLM ${Moz} "Path" "$INSTDIR\npvlc.dll"
508 WriteRegStr HKLM ${Moz} "Product" "VLC media player"
509 WriteRegStr HKLM ${Moz} "Vendor" "VideoLAN"
510 WriteRegStr HKLM ${Moz} "Version" "${VERSION}"
512 ; for very old version of mozilla, these lines may be needed
517 ;!define Index 'Line${__LINE__}'
523 ; EnumRegKey $R0 HKLM "SOFTWARE\Mozilla" "$R1"
524 ; StrCmp $R0 "" "${Index}-End"
526 ; ReadRegStr $R2 HKLM "SOFTWARE\Mozilla\$R0\Extensions" "Plugins"
527 ; StrCmp $R2 "" "${Index}-Loop" ""
529 ; CopyFiles "$INSTDIR\npvlc.dll" "$R2"
531 ; CopyFiles ${LIBVLC_DLL} "$R2"
533 ; !ifdef LIBVLC_CONTROL_DLL
534 ; CopyFiles ${LIBVLC_CONTROL_DLL} "$R2"
536 ; Goto "${Index}-Loop"
543 Section "ActiveX plugin" SEC04
545 SetOutPath "$INSTDIR"
546 !insertmacro OpenUninstallLog
547 !insertmacro InstallFile activex\axvlc.dll
548 !insertmacro CloseUninstallLog
549 RegDLL "$INSTDIR\axvlc.dll"
552 Section "Discs Playback" SEC05
554 WriteRegStr HKCR "AudioCD\shell\PlayWithVLC" "" "Play with VLC media player"
555 WriteRegStr HKCR "AudioCD\shell\PlayWithVLC\command" "" \
556 "$INSTDIR\vlc.exe --started-from-file cdda://%1"
557 WriteRegStr HKCR "DVD\shell\PlayWithVLC" "" "Play with VLC media player"
558 WriteRegStr HKCR "DVD\shell\PlayWithVLC\command" "" \
559 "$INSTDIR\vlc.exe --started-from-file dvd://%1"
561 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayDVDMovieOnArrival" "VLCPlayDVDMovieOnArrival" ""
562 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "Action" "Play DVD movie"
563 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "DefaultIcon" '"$INSTDIR\vlc.exe",0'
564 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "InvokeProgID" "VLC.DVDMovie"
565 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "InvokeVerb" "play"
566 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "Provider" "VideoLAN VLC media player"
568 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayCDAudioOnArrival" "VLCPlayCDAudioOnArrival" ""
569 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "Action" "Play CD audio"
570 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "DefaultIcon" '"$INSTDIR\vlc.exe",0'
571 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "InvokeProgID" "VLC.CDAudio"
572 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "InvokeVerb" "play"
573 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "Provider" "VideoLAN VLC media player"
574 WriteRegStr HKCR "VLC.DVDMovie" "" "VLC DVD Movie"
575 WriteRegStr HKCR "VLC.DVDMovie\shell" "" "Play"
576 WriteRegStr HKCR "VLC.DVDMovie\shell\Play\command" "" \
577 '$INSTDIR\vlc.exe --started-from-file dvd://%1'
578 WriteRegStr HKCR "VLC.DVDMovie\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'
579 WriteRegStr HKCR "VLC.CDAudio" "" "VLC CD Audio"
580 WriteRegStr HKCR "VLC.CDAudio\shell" "" "Play"
581 WriteRegStr HKCR "VLC.CDAudio\shell\Play\command" "" \
582 '$INSTDIR\vlc.exe --started-from-file cdda://%1'
583 WriteRegStr HKCR "VLC.CDAudio\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'
587 SectionGroup "File type associations" SEC06
588 SectionGroup "Audio Files"
589 !insertmacro MacroAudioExtensions RegisterExtensionSection
591 SectionGroup "Video Files"
592 !insertmacro MacroVideoExtensions RegisterExtensionSection
595 !insertmacro MacroOtherExtensions RegisterExtensionSection
599 Section "Context Menus" SEC07
601 !insertmacro MacroAllExtensions AddContextMenu
602 !insertmacro AddContextMenuExt "Directory"
605 Section /o "Delete preferences and cache" SEC08
606 !insertmacro delprefs
609 ; Installer section descriptions
610 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
611 !insertmacro MUI_DESCRIPTION_TEXT ${SEC01} \
612 "The media player itself"
613 !insertmacro MUI_DESCRIPTION_TEXT ${SEC02a} \
614 "Adds icons to your start menu for easy access"
615 !insertmacro MUI_DESCRIPTION_TEXT ${SEC02b} \
616 "Adds icon to your desktop for easy access"
617 !insertmacro MUI_DESCRIPTION_TEXT ${SEC03} \
618 "The VLC Mozilla and Mozilla Firefox plugin"
619 !insertmacro MUI_DESCRIPTION_TEXT ${SEC04} \
620 "The VLC ActiveX plugin"
621 !insertmacro MUI_DESCRIPTION_TEXT ${SEC05} \
622 "DVD and CD playback registration"
623 !insertmacro MUI_DESCRIPTION_TEXT ${SEC06} \
624 "Sets VLC media player as the default application for the specified file type"
625 !insertmacro MUI_DESCRIPTION_TEXT ${SEC07} \
626 "Add context menu items ('Play With VLC' and 'Add To VLC's Playlist')"
627 !insertmacro MUI_DESCRIPTION_TEXT ${SEC08} \
628 "Deletes VLC media player preferences and cache files leftover from previous installations"
629 !insertmacro MUI_FUNCTION_DESCRIPTION_END
633 ReadRegStr $R0 ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
637 MessageBox MB_YESNO|MB_ICONEXCLAMATION \
638 "VLC media player has already been installed. $\nDo you want to remove \
639 the previous version before installing $(^Name) ?" \
645 ExecWait '$R0 _?=$INSTDIR' ;Do not copy the uninstaller to a temp file
647 !insertmacro MUI_LANGDLL_DISPLAY
653 WriteUninstaller "$INSTDIR\uninstall.exe"
654 WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "InstallDir" $INSTDIR
655 WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "Version" "${VERSION}"
656 WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\vlc.exe"
658 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
659 "DisplayName" "$(^Name)"
660 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
661 "UninstallString" "$INSTDIR\uninstall.exe"
662 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
663 "DisplayIcon" "$INSTDIR\vlc.exe"
664 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
665 "DisplayVersion" "${PRODUCT_VERSION}"
666 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
667 "URLInfoAbout" "${PRODUCT_WEB_SITE}"
668 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
669 "Publisher" "${PRODUCT_PUBLISHER}"
672 ;;;;;;;;;;;;;;;;;;;;;;;;
673 ; Uninstaller sections ;
674 ;;;;;;;;;;;;;;;;;;;;;;;;
676 ; TrimNewlines (copied from NSIS documentation)
677 ; input, top of stack (e.g. whatever$\r$\n)
678 ; output, top of stack (replaces, with e.g. whatever)
679 ; modifies no other variables.
681 Function un.TrimNewlines
690 StrCmp $R2 "$\r" loop
691 StrCmp $R2 "$\n" loop
693 IntCmp $R1 0 no_trim_needed
702 Function un.RemoveEmptyDirs
704 !define Index 'Line${__LINE__}'
705 FindFirst $0 $1 "$INSTDIR$9*"
706 StrCmp $0 "" "${Index}-End"
708 StrCmp $1 "" "${Index}-End"
709 StrCmp $1 "." "${Index}-Next"
710 StrCmp $1 ".." "${Index}-Next"
715 Call un.RemoveEmptyDirs
729 Section "Uninstall" SEC91
731 SetShellVarContext all
733 !insertmacro MacroAllExtensions DeleteContextMenu
734 !insertmacro MacroAllExtensions UnRegisterExtensionSection
735 !insertmacro DeleteContextMenuExt "Directory"
737 ;remove activex plugin
738 UnRegDLL "$INSTDIR\axvlc.dll"
739 Delete /REBOOTOK "$INSTDIR\axvlc.dll"
741 ;remove mozilla plugin
746 !define Index 'Line${__LINE__}'
752 EnumRegKey $R0 HKLM "SOFTWARE\Mozilla" "$R1"
753 StrCmp $R0 "" "${Index}-End"
755 ReadRegStr $R2 HKLM "SOFTWARE\Mozilla\$R0\Extensions" "Plugins"
756 StrCmp $R2 "" "${Index}-Loop" ""
758 ; old files (0.8.5 and before) that may be lying around
759 Delete /REBOOTOK "$R2\npvlc.dll"
760 Delete /REBOOTOK "$R2\libvlc.dll"
761 Delete /REBOOTOK "$R2\vlcintf.xpt"
766 Delete /REBOOTOK "$INSTDIR\npvlc.dll"
768 RMDir "$SMPROGRAMS\VideoLAN"
769 RMDir /r $SMPROGRAMS\VideoLAN
771 FileOpen $UninstallLog "$INSTDIR\uninstall.log" r
774 FileRead $UninstallLog $R0
775 IfErrors UninstallEnd
779 Delete "$INSTDIR\$R0"
782 FileClose $UninstallLog
783 Delete "$INSTDIR\uninstall.log"
784 Delete "$INSTDIR\uninstall.exe"
786 Call un.RemoveEmptyDirs
789 DeleteRegKey HKLM Software\VideoLAN
791 DeleteRegKey HKCR Applications\vlc.exe
792 DeleteRegKey HKCR AudioCD\shell\PlayWithVLC
793 DeleteRegKey HKCR DVD\shell\PlayWithVLC
794 DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayDVDMovieOnArrival" "VLCPlayDVDMovieOnArrival"
795 DeleteRegKey HKLM Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival
796 DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayCDAudioOnArrival" "VLCPlayCDAudioOnArrival"
797 DeleteRegKey HKLM Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival
798 DeleteRegKey HKLM Software\Clients\Media\VLC
799 DeleteRegKey HKCR "VLC.MediaFile"
802 "SOFTWARE\MozillaPlugins\@videolan.org/vlc,version=${VERSION}"
805 "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
807 Delete "$DESKTOP\VLC media player.lnk"
809 DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
810 DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}"
814 Section /o "un.Delete preferences and cache" SEC92
815 !insertmacro delprefs
818 ; Uninstaller section descriptions
819 !insertmacro MUI_UNFUNCTION_DESCRIPTION_BEGIN
820 !insertmacro MUI_DESCRIPTION_TEXT ${SEC91} \
821 "Uninstall VLC media player and all its components"
822 !insertmacro MUI_DESCRIPTION_TEXT ${SEC92} \
823 "Deletes VLC media player preferences and cache files"
824 !insertmacro MUI_UNFUNCTION_DESCRIPTION_END
826 ;Function un.onUninstSuccess
828 ; MessageBox MB_ICONINFORMATION|MB_OK \
829 ; "$(^Name) was successfully removed from your computer."
833 !insertmacro MUI_UNGETLANGUAGE