1 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2 ; NSIS installer script for vlc ;
3 ; (http://nsis.sourceforge.net) ;
4 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
6 !define PRODUCT_NAME "VLC media player"
7 !define PRODUCT_VERSION '0.9.0-git'
8 !define PRODUCT_GROUP "VideoLAN"
9 !define PRODUCT_PUBLISHER "VideoLAN Team"
10 !define PRODUCT_WEB_SITE "http://www.videolan.org"
11 !define PRODUCT_DIR_REGKEY "Software\VideoLAN\VLC"
12 !define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
13 !define PRODUCT_UNINST_ROOT_KEY "HKLM"
14 !define PRODUCT_ID "{ea92ef52-afe4-4212-bacb-dfe9fca94cd6}"
16 !define MUI_LANGDLL_REGISTRY_ROOT "HKLM"
17 !define MUI_LANGDLL_REGISTRY_KEY "${PRODUCT_DIR_REGKEY}"
18 !define MUI_LANGDLL_REGISTRY_VALUENAME "Language"
21 @FILE_LIBVLC_CONTROL_DLL@
23 ;;;;;;;;;;;;;;;;;;;;;;;;;
24 ; General configuration ;
25 ;;;;;;;;;;;;;;;;;;;;;;;;;
27 Name "${PRODUCT_GROUP} ${PRODUCT_NAME} ${PRODUCT_VERSION}"
28 OutFile ..\vlc-${VERSION}-win32.exe
29 InstallDir "$PROGRAMFILES\VideoLAN\VLC"
30 InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" ""
31 !ifdef NSIS_LZMA_COMPRESS_WHOLE
34 SetCompressor /SOLID lzma
38 ;ShowUnInstDetails show
41 BrandingText "${PRODUCT_GROUP} ${PRODUCT_NAME}"
43 InstType "Recommended"
47 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
48 ; NSIS Modern User Interface configuration ;
49 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
51 ; MUI 1.67 compatible ------
55 !define MUI_ABORTWARNING
56 !define MUI_ICON "vlc48x48.ico"
57 !define MUI_UNICON "vlc48x48.ico"
58 !define MUI_COMPONENTSPAGE_SMALLDESC
62 !define MUI_WELCOMEPAGE_TITLE_3LINES
63 !insertmacro MUI_PAGE_WELCOME
65 !insertmacro MUI_PAGE_LICENSE "COPYING.txt"
67 !insertmacro MUI_PAGE_COMPONENTS
69 !insertmacro MUI_PAGE_DIRECTORY
71 !insertmacro MUI_PAGE_INSTFILES
73 !define MUI_FINISHPAGE_RUN "$INSTDIR\vlc.exe"
74 !define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\README.txt"
75 !define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED
76 !define MUI_FINISHPAGE_LINK "Visit the VideoLAN VLC media player Website"
77 !define MUI_FINISHPAGE_LINK_LOCATION "http://www.videolan.org/vlc/"
78 !define MUI_FINISHPAGE_NOREBOOTSUPPORT
79 !insertmacro MUI_PAGE_FINISH
82 !insertmacro MUI_UNPAGE_CONFIRM
83 !insertmacro MUI_UNPAGE_COMPONENTS
84 !insertmacro MUI_UNPAGE_INSTFILES
85 !insertmacro MUI_UNPAGE_FINISH
88 !insertmacro MUI_LANGUAGE "English" # first language is the default language
89 !insertmacro MUI_LANGUAGE "French"
90 !insertmacro MUI_LANGUAGE "German"
91 !insertmacro MUI_LANGUAGE "Spanish"
92 !insertmacro MUI_LANGUAGE "SimpChinese"
93 !insertmacro MUI_LANGUAGE "TradChinese"
94 !insertmacro MUI_LANGUAGE "Japanese"
95 !insertmacro MUI_LANGUAGE "Korean"
96 !insertmacro MUI_LANGUAGE "Italian"
97 !insertmacro MUI_LANGUAGE "Dutch"
98 !insertmacro MUI_LANGUAGE "Danish"
99 !insertmacro MUI_LANGUAGE "Swedish"
100 !insertmacro MUI_LANGUAGE "Norwegian"
101 !insertmacro MUI_LANGUAGE "Finnish"
102 !insertmacro MUI_LANGUAGE "Greek"
103 !insertmacro MUI_LANGUAGE "Russian"
104 !insertmacro MUI_LANGUAGE "Portuguese"
105 !insertmacro MUI_LANGUAGE "Arabic"
106 !insertmacro MUI_LANGUAGE "Polish"
107 !insertmacro MUI_LANGUAGE "Romanian"
108 !insertmacro MUI_LANGUAGE "Slovak"
109 !insertmacro MUI_LANGUAGE "Czech"
111 ; Reserve files for solid compression
112 !insertmacro MUI_RESERVEFILE_LANGDLL
113 !insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
117 ;;;;;;;;;;;;;;;;;;;;;;;
118 ; Macro and Functions ;
119 ;;;;;;;;;;;;;;;;;;;;;;;
121 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
122 ; 1. File type associations ;
123 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
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
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'
142 ReadRegStr $R1 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion
144 StrCmp $R2 '6.0' ForVista ToEnd
146 WriteRegStr HKLM "Software\Clients\Media\VLC\Capabilities\FileAssociations" "$R0" "VLC$R0"
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"
162 WriteRegStr HKCR "$R0" "" $1
163 DeleteRegValue HKCR "$R0" "VLC.backup"
165 DeleteRegKey HKCR "VLC$R0" ;Delete key with association settings
166 DeleteRegKey HKLM "Software\Clients\Media\VLC\Capabilities\FileAssociations\VLC$R0" ; for vista
169 !macro RegisterExtensionSection EXT
174 Call RegisterExtension
179 !macro UnRegisterExtensionSection EXT
182 Call un.RegisterExtension
186 !macro WriteRegStrSupportedTypes EXT
187 WriteRegStr HKCR Applications\vlc.exe\SupportedTypes ${EXT} ""
190 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
191 ; Extension lists Macros ;
192 ; Those macros calls the previous functions ;
193 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
195 !macro MacroAudioExtensions _action
196 !insertmacro ${_action} ".a52"
197 !insertmacro ${_action} ".aac"
198 !insertmacro ${_action} ".ac3"
199 !insertmacro ${_action} ".dts"
200 !insertmacro ${_action} ".flac"
201 !insertmacro ${_action} ".mka"
202 !insertmacro ${_action} ".mp1"
203 !insertmacro ${_action} ".mp2"
204 !insertmacro ${_action} ".mp3"
205 !insertmacro ${_action} ".ogg"
206 !insertmacro ${_action} ".spx"
207 !insertmacro ${_action} ".wav"
208 !insertmacro ${_action} ".wma"
211 !macro MacroVideoExtensions _action
212 !insertmacro ${_action} ".asf"
213 !insertmacro ${_action} ".avi"
214 !insertmacro ${_action} ".divx"
215 !insertmacro ${_action} ".dv"
216 !insertmacro ${_action} ".m1v"
217 !insertmacro ${_action} ".m2v"
218 !insertmacro ${_action} ".mkv"
219 !insertmacro ${_action} ".mov"
220 !insertmacro ${_action} ".mp4"
221 !insertmacro ${_action} ".mpeg"
222 !insertmacro ${_action} ".mpeg1"
223 !insertmacro ${_action} ".mpeg2"
224 !insertmacro ${_action} ".mpeg4"
225 !insertmacro ${_action} ".mpg"
226 !insertmacro ${_action} ".mxf"
227 !insertmacro ${_action} ".ps"
228 !insertmacro ${_action} ".ts"
229 !insertmacro ${_action} ".ogm"
230 !insertmacro ${_action} ".vob"
231 !insertmacro ${_action} ".wmv"
234 !macro MacroOtherExtensions _action
235 !insertmacro ${_action} ".asx"
236 !insertmacro ${_action} ".bin"
237 !insertmacro ${_action} ".cue"
238 !insertmacro ${_action} ".m3u"
239 !insertmacro ${_action} ".pls"
240 !insertmacro ${_action} ".vlc"
243 ; One macro to rule them all
244 !macro MacroAllExtensions _action
245 !insertmacro MacroAudioExtensions ${_action}
246 !insertmacro MacroVideoExtensions ${_action}
247 !insertmacro MacroOtherExtensions ${_action}
250 ;;;;;;;;;;;;;;;;;;;;;;;;;;;
251 ; 2. Context menu entries ;
252 ;;;;;;;;;;;;;;;;;;;;;;;;;;;
254 ; Generic function for adding the context menu for one ext.
255 !macro AddContextMenuExt EXT
256 WriteRegStr HKCR ${EXT}\shell\PlayWithVLC "" "Play with VLC media player"
257 WriteRegStr HKCR ${EXT}\shell\PlayWithVLC\command "" '$INSTDIR\vlc.exe --started-from-file --no-playlist-enqueue "%1"'
259 WriteRegStr HKCR ${EXT}\shell\AddToPlaylistVLC "" "Add to VLC media player's Playlist"
260 WriteRegStr HKCR ${EXT}\shell\AddToPlaylistVLC\command "" '$INSTDIR\vlc.exe --started-from-file --playlist-enqueue "%1"'
263 !macro AddContextMenu EXT
265 ReadRegStr $R0 HKCR ${EXT} ""
266 !insertmacro AddContextMenuExt $R0
270 !macro DeleteContextMenuExt EXT
271 DeleteRegKey HKCR ${EXT}\shell\PlayWithVLC
272 DeleteRegKey HKCR ${EXT}\shell\AddToPlaylistVLC
275 !macro DeleteContextMenu EXT
277 ReadRegStr $R0 HKCR ${EXT} ""
278 !insertmacro DeleteContextMenuExt $R0
282 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
283 ; 3. Delete prefs and cache ;
284 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
288 !define Index 'Line${__LINE__}'
291 ; this will loop through all the logged users and "virtual" windows users
292 ; (it looks like users are only present in HKEY_USERS when they are logged in)
294 EnumRegKey $1 HKU "" $0
295 StrCmp $1 "" "${Index}-End"
297 ReadRegStr $2 HKU "$1\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" AppData
298 StrCmp $2 "" "${Index}-Loop"
309 !macro OpenUninstallLog
310 FileOpen $UninstallLog "$INSTDIR\uninstall.log" a
311 FileSeek $UninstallLog 0 END
314 !macro CloseUninstallLog
315 FileClose $UninstallLog
316 SetFileAttributes "$INSTDIR\uninstall.log" HIDDEN
322 !macro InstallFile FILEREGEX
324 !define Index 'Line${__LINE__}'
325 FindFirst $0 $1 "$INSTDIR\${FILEREGEX}"
326 StrCmp $0 "" "${Index}-End"
328 StrCmp $1 "" "${Index}-End"
329 FileWrite $UninstallLog "$1$\r$\n"
336 !macro InstallFolder FOLDER
339 Call InstallFolderInternal
342 Function InstallFolderInternal
344 !define Index 'Line${__LINE__}'
345 FindFirst $0 $1 "$INSTDIR\$9\*"
346 StrCmp $0 "" "${Index}-End"
348 StrCmp $1 "" "${Index}-End"
349 StrCmp $1 "." "${Index}-Next"
350 StrCmp $1 ".." "${Index}-Next"
351 IfFileExists "$9\$1\*" 0 "${Index}-Write"
355 Call InstallFolderInternal
360 FileWrite $UninstallLog "$9\$1$\r$\n"
370 ;;;;;;;;;;;;;;;;;;;;;;
371 ; Installer sections ;
374 ;;;;;;;;;;;;;;;;;;;;;;
376 Section "Media player (required)" SEC01
378 SetShellVarContext all
379 SetOutPath "$INSTDIR"
381 !insertmacro OpenUninstallLog
383 ; VLC.exe, libvlc.dll
384 !insertmacro InstallFile vlc.exe
385 !insertmacro InstallFile vlc.exe.manifest
387 !insertmacro InstallFile ${LIBVLC_DLL}
389 !ifdef LIBVLC_CONTROL_DLL
390 !insertmacro InstallFile ${LIBVLC_CONTROL_DLL}
394 !insertmacro InstallFile *.txt
397 !insertmacro InstallFolder plugins
398 !insertmacro InstallFolder locale
399 !insertmacro InstallFolder osdmenu
400 !insertmacro InstallFolder skins
401 !insertmacro InstallFolder http
402 !insertmacro InstallFolder share
403 ;!insertmacro InstallFolder scripts
406 WriteIniStr "$INSTDIR\${PRODUCT_GROUP} Website.url" "InternetShortcut" "URL" \
407 "${PRODUCT_WEB_SITE}"
408 FileWrite $UninstallLog "${PRODUCT_GROUP} Website.url$\r$\n"
409 WriteIniStr "$INSTDIR\Documentation.url" "InternetShortcut" "URL" \
410 "${PRODUCT_WEB_SITE}/doc/"
411 FileWrite $UninstallLog "Documentation.url$\r$\n"
412 WriteIniStr "$INSTDIR\New_Skins.url" "InternetShortcut" "URL" \
413 "${PRODUCT_WEB_SITE}/vlc/skins.php"
414 FileWrite $UninstallLog "New_Skins.url$\r$\n"
416 !insertmacro CloseUninstallLog
418 ; Add VLC to "recomended programs" for the following extensions
419 WriteRegStr HKCR Applications\vlc.exe "" ""
420 WriteRegStr HKCR Applications\vlc.exe "FriendlyAppName" "VLC media player"
421 WriteRegStr HKCR Applications\vlc.exe\shell\Play "" "Play with VLC"
422 WriteRegStr HKCR Applications\vlc.exe\shell\Play\command "" \
423 '$INSTDIR\vlc.exe --started-from-file "%1"'
424 !insertmacro MacroAllExtensions WriteRegStrSupportedTypes
428 ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion
430 StrCmp $R1 '6.0' lbl_vista lbl_done
433 WriteRegStr HKLM "Software\RegisteredApplications" "VLC" "Software\Clients\Media\VLC\Capabilities"
434 WriteRegStr HKLM "Software\Clients\Media\VLC\Capabilities" "ApplicationName" "VLC media player"
435 WriteRegStr HKLM "Software\Clients\Media\VLC\Capabilities" "ApplicationDescription" "VLC - The video swiss knife"
440 Section "Start Menu Shortcut" SEC02a
442 CreateDirectory "$SMPROGRAMS\VideoLAN"
443 CreateDirectory "$SMPROGRAMS\VideoLAN\Quick Settings"
444 CreateDirectory "$SMPROGRAMS\VideoLAN\Quick Settings\Audio"
445 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Audio\Set Audio mode to DirectX (default).lnk" \
446 "$INSTDIR\vlc.exe" "--aout aout_directx --save-config vlc:quit"
447 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Audio\Set Audio mode to Waveout.lnk" \
448 "$INSTDIR\vlc.exe" "--aout waveout --save-config vlc:quit"
449 CreateDirectory "$SMPROGRAMS\VideoLAN\Quick Settings\Interface"
450 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Interface\Set Main Interface to Skinnable.lnk" \
451 "$INSTDIR\vlc.exe" "-I skins --save-config vlc:quit"
452 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Interface\Set Main Interface to wxWidgets (default).lnk" \
453 "$INSTDIR\vlc.exe" "-I wxwin --save-config vlc:quit"
454 CreateDirectory "$SMPROGRAMS\VideoLAN\Quick Settings\Video"
455 ; FIXME add detection for Vista. Direct3D will be default there, for all others it's DirectX
456 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to Direct3D.lnk" \
457 "$INSTDIR\vlc.exe" "--vout direct3d --overlay --directx-hw-yuv --save-config vlc:quit"
458 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to Direct3D (no hardware acceleration).lnk" \
459 "$INSTDIR\vlc.exe" "--vout direct3d --overlay --no-directx-hw-yuv --save-config vlc:quit"
460 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to DirectX.lnk" \
461 "$INSTDIR\vlc.exe" "--vout directx --overlay --directx-hw-yuv --save-config vlc:quit"
462 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to DirectX (no hardware acceleration).lnk" \
463 "$INSTDIR\vlc.exe" "--vout directx --no-overlay --no-directx-hw-yuv --save-config vlc:quit"
464 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to DirectX (no video overlay).lnk" \
465 "$INSTDIR\vlc.exe" "--vout directx --no-overlay --directx-hw-yuv --save-config vlc:quit"
466 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to OpenGL.lnk" \
467 "$INSTDIR\vlc.exe" "--vout opengl --overlay --save-config vlc:quit"
468 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Reset VLC media player preferences and cache files.lnk" \
469 "$INSTDIR\vlc.exe" "--reset-config --reset-plugins-cache --save-config vlc:quit"
470 CreateShortCut "$SMPROGRAMS\VideoLAN\Documentation.lnk" \
471 "$INSTDIR\Documentation.url"
472 CreateShortCut "$SMPROGRAMS\VideoLAN\Release Notes.lnk" \
473 "$INSTDIR\NEWS.txt" ""
474 CreateShortCut "$SMPROGRAMS\VideoLAN\${PRODUCT_GROUP} Website.lnk" \
475 "$INSTDIR\${PRODUCT_GROUP} Website.url"
476 CreateShortCut "$SMPROGRAMS\VideoLAN\VLC media player.lnk" \
477 "$INSTDIR\vlc.exe" ""
480 Section "Desktop Shortcut" SEC02b
482 CreateShortCut "$DESKTOP\VLC media player.lnk" \
483 "$INSTDIR\vlc.exe" ""
486 Section /o "Mozilla plugin" SEC03
489 SetOutPath "$INSTDIR"
490 !insertmacro OpenUninstallLog
491 !insertmacro InstallFile mozilla\npvlc.dll
492 !insertmacro CloseUninstallLog
494 !define Moz "SOFTWARE\MozillaPlugins\@videolan.org/vlc,version=${VERSION}"
495 WriteRegStr HKLM ${Moz} "Description" "VLC Multimedia Plugin"
496 WriteRegStr HKLM ${Moz} "Path" "$INSTDIR\npvlc.dll"
497 WriteRegStr HKLM ${Moz} "Product" "VLC media player"
498 WriteRegStr HKLM ${Moz} "Vendor" "VideoLAN"
499 WriteRegStr HKLM ${Moz} "Version" "${VERSION}"
501 ; for very old version of mozilla, these lines may be needed
506 ;!define Index 'Line${__LINE__}'
512 ; EnumRegKey $R0 HKLM "SOFTWARE\Mozilla" "$R1"
513 ; StrCmp $R0 "" "${Index}-End"
515 ; ReadRegStr $R2 HKLM "SOFTWARE\Mozilla\$R0\Extensions" "Plugins"
516 ; StrCmp $R2 "" "${Index}-Loop" ""
518 ; CopyFiles "$INSTDIR\npvlc.dll" "$R2"
520 ; CopyFiles ${LIBVLC_DLL} "$R2"
522 ; !ifdef LIBVLC_CONTROL_DLL
523 ; CopyFiles ${LIBVLC_CONTROL_DLL} "$R2"
525 ; Goto "${Index}-Loop"
532 Section "ActiveX plugin" SEC04
534 SetOutPath "$INSTDIR"
535 !insertmacro OpenUninstallLog
536 !insertmacro InstallFile activex\axvlc.dll
537 !insertmacro CloseUninstallLog
538 RegDLL "$INSTDIR\axvlc.dll"
541 Section "Discs Playback" SEC05
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"
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"
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'
576 SectionGroup "File type associations" SEC06
577 SectionGroup "Audio Files"
578 !insertmacro MacroAudioExtensions RegisterExtensionSection
580 SectionGroup "Video Files"
581 !insertmacro MacroVideoExtensions RegisterExtensionSection
584 !insertmacro MacroOtherExtensions RegisterExtensionSection
588 Section "Context Menus" SEC07
590 !insertmacro MacroAllExtensions AddContextMenu
591 !insertmacro AddContextMenuExt "Directory"
594 Section /o "Delete preferences and cache" SEC08
595 !insertmacro delprefs
598 ; Installer section descriptions
599 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
600 !insertmacro MUI_DESCRIPTION_TEXT ${SEC01} \
601 "The media player itself"
602 !insertmacro MUI_DESCRIPTION_TEXT ${SEC02a} \
603 "Adds icons to your start menu for easy access"
604 !insertmacro MUI_DESCRIPTION_TEXT ${SEC02b} \
605 "Adds icon to your desktop for easy access"
606 !insertmacro MUI_DESCRIPTION_TEXT ${SEC03} \
607 "The VLC Mozilla and Mozilla Firefox plugin"
608 !insertmacro MUI_DESCRIPTION_TEXT ${SEC04} \
609 "The VLC ActiveX plugin"
610 !insertmacro MUI_DESCRIPTION_TEXT ${SEC05} \
611 "DVD and CD playback registration"
612 !insertmacro MUI_DESCRIPTION_TEXT ${SEC06} \
613 "Sets VLC media player as the default application for the specified file type"
614 !insertmacro MUI_DESCRIPTION_TEXT ${SEC07} \
615 "Add context menu items ('Play With VLC' and 'Add To VLC's Playlist')"
616 !insertmacro MUI_DESCRIPTION_TEXT ${SEC08} \
617 "Deletes VLC media player preferences and cache files leftover from previous installations"
618 !insertmacro MUI_FUNCTION_DESCRIPTION_END
622 ReadRegStr $R0 ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
626 MessageBox MB_YESNO|MB_ICONEXCLAMATION \
627 "VLC media player has already been installed. $\nDo you want to remove \
628 the previous version before installing $(^Name) ?" \
634 ExecWait '$R0 _?=$INSTDIR' ;Do not copy the uninstaller to a temp file
636 !insertmacro MUI_LANGDLL_DISPLAY
639 ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion" VersionNumber
640 StrCmp $R0 "4.9" lbl_win98
643 MessageBox MB_OK|MB_ICONQUESTION "Windows 98 ! Remember to install MSLU" IDOK
649 WriteUninstaller "$INSTDIR\uninstall.exe"
650 WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "InstallDir" $INSTDIR
651 WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "Version" "${VERSION}"
652 WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\vlc.exe"
654 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
655 "DisplayName" "$(^Name)"
656 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
657 "UninstallString" "$INSTDIR\uninstall.exe"
658 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
659 "DisplayIcon" "$INSTDIR\vlc.exe"
660 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
661 "DisplayVersion" "${PRODUCT_VERSION}"
662 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
663 "URLInfoAbout" "${PRODUCT_WEB_SITE}"
664 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
665 "Publisher" "${PRODUCT_PUBLISHER}"
668 ;;;;;;;;;;;;;;;;;;;;;;;;
669 ; Uninstaller sections ;
670 ;;;;;;;;;;;;;;;;;;;;;;;;
672 ; TrimNewlines (copied from NSIS documentation)
673 ; input, top of stack (e.g. whatever$\r$\n)
674 ; output, top of stack (replaces, with e.g. whatever)
675 ; modifies no other variables.
677 Function un.TrimNewlines
686 StrCmp $R2 "$\r" loop
687 StrCmp $R2 "$\n" loop
689 IntCmp $R1 0 no_trim_needed
698 Function un.RemoveEmptyDirs
700 !define Index 'Line${__LINE__}'
701 FindFirst $0 $1 "$INSTDIR$9*"
702 StrCmp $0 "" "${Index}-End"
704 StrCmp $1 "" "${Index}-End"
705 StrCmp $1 "." "${Index}-Next"
706 StrCmp $1 ".." "${Index}-Next"
711 Call un.RemoveEmptyDirs
725 Section "Uninstall" SEC91
727 SetShellVarContext all
729 !insertmacro MacroAllExtensions DeleteContextMenu
730 !insertmacro MacroAllExtensions UnRegisterExtensionSection
731 !insertmacro DeleteContextMenuExt "Directory"
733 ;remove activex plugin
734 UnRegDLL "$INSTDIR\axvlc.dll"
735 Delete /REBOOTOK "$INSTDIR\axvlc.dll"
737 ;remove mozilla plugin
742 !define Index 'Line${__LINE__}'
748 EnumRegKey $R0 HKLM "SOFTWARE\Mozilla" "$R1"
749 StrCmp $R0 "" "${Index}-End"
751 ReadRegStr $R2 HKLM "SOFTWARE\Mozilla\$R0\Extensions" "Plugins"
752 StrCmp $R2 "" "${Index}-Loop" ""
754 ; old files (0.8.5 and before) that may be lying around
755 Delete /REBOOTOK "$R2\npvlc.dll"
756 Delete /REBOOTOK "$R2\libvlc.dll"
757 Delete /REBOOTOK "$R2\vlcintf.xpt"
762 Delete /REBOOTOK "$INSTDIR\npvlc.dll"
764 RMDir "$SMPROGRAMS\VideoLAN"
765 RMDir /r $SMPROGRAMS\VideoLAN
767 FileOpen $UninstallLog "$INSTDIR\uninstall.log" r
770 FileRead $UninstallLog $R0
771 IfErrors UninstallEnd
775 Delete "$INSTDIR\$R0"
778 FileClose $UninstallLog
779 Delete "$INSTDIR\uninstall.log"
780 Delete "$INSTDIR\uninstall.exe"
782 Call un.RemoveEmptyDirs
785 DeleteRegKey HKLM Software\VideoLAN
787 DeleteRegKey HKCR Applications\vlc.exe
788 DeleteRegKey HKCR AudioCD\shell\PlayWithVLC
789 DeleteRegKey HKCR DVD\shell\PlayWithVLC
790 DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayDVDMovieOnArrival" "VLCPlayDVDMovieOnArrival"
791 DeleteRegKey HKLM Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival
792 DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayCDAudioOnArrival" "VLCPlayCDAudioOnArrival"
793 DeleteRegKey HKLM Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival
794 DeleteRegKey HKLM Software\Clients\Media\VLC
795 DeleteRegKey HKCR "VLC.MediaFile"
798 "SOFTWARE\MozillaPlugins\@videolan.org/vlc,version=${VERSION}"
801 "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
803 Delete "$DESKTOP\VLC media player.lnk"
805 DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
806 DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}"
810 Section /o "un.Delete preferences and cache" SEC92
811 !insertmacro delprefs
814 ; Uninstaller section descriptions
815 !insertmacro MUI_UNFUNCTION_DESCRIPTION_BEGIN
816 !insertmacro MUI_DESCRIPTION_TEXT ${SEC91} \
817 "Uninstall VLC media player and all its components"
818 !insertmacro MUI_DESCRIPTION_TEXT ${SEC92} \
819 "Deletes VLC media player preferences and cache files"
820 !insertmacro MUI_UNFUNCTION_DESCRIPTION_END
822 ;Function un.onUninstSuccess
824 ; MessageBox MB_ICONINFORMATION|MB_OK \
825 ; "$(^Name) was successfully removed from your computer."
829 !insertmacro MUI_UNGETLANGUAGE