1 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2 ; NSIS installer script for vlc ;
3 ; (http://nsis.sourceforge.net) ;
4 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
6 !include "languages\declaration.nsh"
8 !define PRODUCT_NAME "VLC media player"
9 !define VERSION @VERSION@
10 !define PRODUCT_VERSION @VERSION@
11 !define PRODUCT_GROUP "VideoLAN"
12 !define PRODUCT_PUBLISHER "VideoLAN Team"
13 !define PRODUCT_WEB_SITE "http://www.videolan.org"
14 !define PRODUCT_DIR_REGKEY "Software\VideoLAN\VLC"
15 !define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
16 !define PRODUCT_UNINST_ROOT_KEY "HKLM"
17 !define PRODUCT_ID "{ea92ef52-afe4-4212-bacb-dfe9fca94cd6}"
19 !define MUI_LANGDLL_REGISTRY_ROOT "HKLM"
20 !define MUI_LANGDLL_REGISTRY_KEY "${PRODUCT_DIR_REGKEY}"
21 !define MUI_LANGDLL_REGISTRY_VALUENAME "Language"
23 @BUILD_ACTIVEX_TRUE@ !define INSTALL_ACTIVEX
24 @BUILD_MOZILLA_TRUE@ !define INSTALL_MOZILLA
29 ;;;;;;;;;;;;;;;;;;;;;;;;;
30 ; General configuration ;
31 ;;;;;;;;;;;;;;;;;;;;;;;;;
33 Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
34 OutFile ..\vlc-${VERSION}-win32.exe
35 InstallDir "$PROGRAMFILES\VideoLAN\VLC"
36 InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" ""
37 !ifdef NSIS_LZMA_COMPRESS_WHOLE
40 SetCompressor /SOLID lzma
44 ;ShowUnInstDetails show
47 BrandingText "${PRODUCT_GROUP} ${PRODUCT_NAME}"
49 InstType $Name_InstTypeRecommended
50 InstType $Name_InstTypeMinimum
51 InstType $Name_InstTypeFull
53 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
54 ; NSIS Modern User Interface configuration ;
55 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
57 ; MUI 1.67 compatible ------
61 !define MUI_ABORTWARNING
62 !define MUI_ICON "vlc.ico"
63 !define MUI_UNICON "vlc.ico"
64 !define MUI_COMPONENTSPAGE_SMALLDESC
68 !define MUI_WELCOMEPAGE_TITLE_3LINES
69 !insertmacro MUI_PAGE_WELCOME
71 !insertmacro MUI_PAGE_LICENSE "COPYING.txt"
73 !insertmacro MUI_PAGE_COMPONENTS
75 !insertmacro MUI_PAGE_DIRECTORY
77 !insertmacro MUI_PAGE_INSTFILES
79 !define MUI_FINISHPAGE_RUN "$INSTDIR\vlc.exe"
80 !define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\README.txt"
81 !define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED
82 !define MUI_FINISHPAGE_LINK $Link_VisitWebsite
83 !define MUI_FINISHPAGE_LINK_LOCATION "http://www.videolan.org/vlc/"
84 !define MUI_FINISHPAGE_NOREBOOTSUPPORT
85 !insertmacro MUI_PAGE_FINISH
88 !insertmacro MUI_UNPAGE_CONFIRM
89 !insertmacro MUI_UNPAGE_COMPONENTS
90 !insertmacro MUI_UNPAGE_INSTFILES
91 !insertmacro MUI_UNPAGE_FINISH
94 !insertmacro MUI_LANGUAGE "English" # first language is the default language
95 !insertmacro MUI_LANGUAGE "French"
96 !insertmacro MUI_LANGUAGE "German"
97 !insertmacro MUI_LANGUAGE "Spanish"
98 !insertmacro MUI_LANGUAGE "SimpChinese"
99 !insertmacro MUI_LANGUAGE "TradChinese"
100 !insertmacro MUI_LANGUAGE "Japanese"
101 !insertmacro MUI_LANGUAGE "Korean"
102 !insertmacro MUI_LANGUAGE "Italian"
103 !insertmacro MUI_LANGUAGE "Dutch"
104 !insertmacro MUI_LANGUAGE "Danish"
105 !insertmacro MUI_LANGUAGE "Swedish"
106 !insertmacro MUI_LANGUAGE "Norwegian"
107 !insertmacro MUI_LANGUAGE "Finnish"
108 !insertmacro MUI_LANGUAGE "Greek"
109 !insertmacro MUI_LANGUAGE "Russian"
110 !insertmacro MUI_LANGUAGE "Portuguese"
111 !insertmacro MUI_LANGUAGE "PortugueseBR"
112 !insertmacro MUI_LANGUAGE "Arabic"
113 !insertmacro MUI_LANGUAGE "Polish"
114 !insertmacro MUI_LANGUAGE "Romanian"
115 !insertmacro MUI_LANGUAGE "Slovak"
116 !insertmacro MUI_LANGUAGE "Czech"
117 !insertmacro MUI_LANGUAGE "Hungarian"
118 !insertmacro MUI_LANGUAGE "Catalan"
119 !insertmacro MUI_LANGUAGE "Bulgarian"
121 ; Reserve files for solid compression
122 !insertmacro MUI_RESERVEFILE_LANGDLL
123 !insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
127 ;;;;;;;;;;;;;;;;;;;;;;;
128 ; Macro and Functions ;
129 ;;;;;;;;;;;;;;;;;;;;;;;
131 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
132 ; 1. File type associations ;
133 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
135 ;; Function that register one extension for VLC
136 Function RegisterExtension
137 ; back up old value for extension $R0 (eg. ".opt")
138 ReadRegStr $1 HKCR "$R0" ""
139 StrCmp $1 "" NoBackup
140 StrCmp $1 "VLC$R0" "NoBackup"
141 WriteRegStr HKCR "$R0" "VLC.backup" $1
143 WriteRegStr HKCR "$R0" "" "VLC$R0"
144 ReadRegStr $0 HKCR "VLC$R0" ""
145 WriteRegStr HKCR "VLC$R0" "" "VLC media file ($R0)"
146 WriteRegStr HKCR "VLC$R0\shell" "" "Open"
147 WriteRegStr HKCR "VLC$R0\shell\Open" "" $ShellAssociation_Play
148 WriteRegStr HKCR "VLC$R0\shell\Open\command" "" '"$INSTDIR\vlc.exe" --started-from-file "%1"'
149 WriteRegStr HKCR "VLC$R0\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'
153 ReadRegStr $R1 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion
155 StrCmp $R2 '6.0' ForVista ToEnd
157 WriteRegStr HKLM "Software\Clients\Media\VLC\Capabilities\FileAssociations" "$R0" "VLC$R0"
162 ;; Function that removes one extension that VLC owns.
163 Function un.RegisterExtension
164 ;start of restore script
165 ReadRegStr $1 HKCR "$R0" ""
166 StrCmp $1 "VLC$R0" 0 NoOwn ; only do this if we own it
167 ; Read the old value from Backup
168 ReadRegStr $1 HKCR "$R0" "VLC.backup"
169 StrCmp $1 "" 0 Restore ; if backup="" then delete the whole key
170 DeleteRegKey HKCR "$R0"
173 WriteRegStr HKCR "$R0" "" $1
174 DeleteRegValue HKCR "$R0" "VLC.backup"
176 DeleteRegKey HKCR "VLC$R0" ;Delete key with association settings
177 DeleteRegKey HKLM "Software\Clients\Media\VLC\Capabilities\FileAssociations\VLC$R0" ; for vista
180 !macro RegisterExtensionSection EXT
185 Call RegisterExtension
190 !macro UnRegisterExtensionSection EXT
193 Call un.RegisterExtension
197 !macro WriteRegStrSupportedTypes EXT
198 WriteRegStr HKCR Applications\vlc.exe\SupportedTypes ${EXT} ""
201 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
202 ; Extension lists Macros ;
203 ; Those macros calls the previous functions ;
204 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
206 !macro MacroAudioExtensions _action
207 !insertmacro ${_action} ".a52"
208 !insertmacro ${_action} ".aac"
209 !insertmacro ${_action} ".ac3"
210 !insertmacro ${_action} ".dts"
211 !insertmacro ${_action} ".flac"
212 !insertmacro ${_action} ".m4a"
213 !insertmacro ${_action} ".m4p"
214 !insertmacro ${_action} ".mka"
215 !insertmacro ${_action} ".mod"
216 !insertmacro ${_action} ".mp1"
217 !insertmacro ${_action} ".mp2"
218 !insertmacro ${_action} ".mp3"
219 !insertmacro ${_action} ".oma"
220 !insertmacro ${_action} ".oga"
221 !insertmacro ${_action} ".spx"
222 !insertmacro ${_action} ".wav"
223 !insertmacro ${_action} ".wma"
224 !insertmacro ${_action} ".wv"
225 !insertmacro ${_action} ".xm"
228 !macro MacroVideoExtensions _action
229 !insertmacro ${_action} ".asf"
230 !insertmacro ${_action} ".avi"
231 !insertmacro ${_action} ".divx"
232 !insertmacro ${_action} ".dv"
233 !insertmacro ${_action} ".flv"
234 !insertmacro ${_action} ".gxf"
235 !insertmacro ${_action} ".m1v"
236 !insertmacro ${_action} ".m2v"
237 !insertmacro ${_action} ".m2ts"
238 !insertmacro ${_action} ".m4v"
239 !insertmacro ${_action} ".mkv"
240 !insertmacro ${_action} ".mov"
241 !insertmacro ${_action} ".mp4"
242 !insertmacro ${_action} ".mpeg"
243 !insertmacro ${_action} ".mpeg1"
244 !insertmacro ${_action} ".mpeg2"
245 !insertmacro ${_action} ".mpeg4"
246 !insertmacro ${_action} ".mpg"
247 !insertmacro ${_action} ".mts"
248 !insertmacro ${_action} ".mxf"
249 !insertmacro ${_action} ".nuv"
250 !insertmacro ${_action} ".ogg"
251 !insertmacro ${_action} ".ogm"
252 !insertmacro ${_action} ".ogx"
253 !insertmacro ${_action} ".ogv"
254 !insertmacro ${_action} ".rmvb"
255 !insertmacro ${_action} ".ts"
256 !insertmacro ${_action} ".vob"
257 !insertmacro ${_action} ".wmv"
260 !macro MacroOtherExtensions _action
261 !insertmacro ${_action} ".asx"
262 !insertmacro ${_action} ".bin"
263 !insertmacro ${_action} ".cue"
264 !insertmacro ${_action} ".m3u"
265 !insertmacro ${_action} ".pls"
266 !insertmacro ${_action} ".vlc"
267 !insertmacro ${_action} ".xspf"
270 ; One macro to rule them all
271 !macro MacroAllExtensions _action
272 !insertmacro MacroAudioExtensions ${_action}
273 !insertmacro MacroVideoExtensions ${_action}
274 !insertmacro MacroOtherExtensions ${_action}
277 ;;;;;;;;;;;;;;;;;;;;;;;;;;;
278 ; 2. Context menu entries ;
279 ;;;;;;;;;;;;;;;;;;;;;;;;;;;
281 ; Generic function for adding the context menu for one ext.
282 !macro AddContextMenuExt EXT
283 WriteRegStr HKCR ${EXT}\shell\PlayWithVLC "" $ContextMenuEntry_PlayWith
284 WriteRegStr HKCR ${EXT}\shell\PlayWithVLC\command "" '"$INSTDIR\vlc.exe" --started-from-file --no-playlist-enqueue "%1"'
286 WriteRegStr HKCR ${EXT}\shell\AddToPlaylistVLC "" $ContextMenuEntry_AddToPlaylist
287 WriteRegStr HKCR ${EXT}\shell\AddToPlaylistVLC\command "" '"$INSTDIR\vlc.exe" --started-from-file --playlist-enqueue "%1"'
290 !macro AddContextMenu EXT
292 ReadRegStr $R0 HKCR ${EXT} ""
293 !insertmacro AddContextMenuExt $R0
297 !macro DeleteContextMenuExt EXT
298 DeleteRegKey HKCR ${EXT}\shell\PlayWithVLC
299 DeleteRegKey HKCR ${EXT}\shell\AddToPlaylistVLC
302 !macro DeleteContextMenu EXT
304 ReadRegStr $R0 HKCR ${EXT} ""
305 !insertmacro DeleteContextMenuExt $R0
309 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
310 ; 3. Delete prefs and cache ;
311 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
315 !define Index 'Line${__LINE__}'
318 ; this will loop through all the logged users and "virtual" windows users
319 ; (it looks like users are only present in HKEY_USERS when they are logged in)
321 EnumRegKey $1 HKU "" $0
322 StrCmp $1 "" "${Index}-End"
324 ReadRegStr $2 HKU "$1\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" AppData
325 StrCmp $2 "" "${Index}-Loop"
336 !macro OpenUninstallLog
337 FileOpen $UninstallLog "$INSTDIR\uninstall.log" a
338 FileSeek $UninstallLog 0 END
341 !macro CloseUninstallLog
342 FileClose $UninstallLog
343 SetFileAttributes "$INSTDIR\uninstall.log" HIDDEN
349 !macro InstallFile FILEREGEX
351 !define Index 'Line${__LINE__}'
352 FindFirst $0 $1 "$INSTDIR\${FILEREGEX}"
353 StrCmp $0 "" "${Index}-End"
355 StrCmp $1 "" "${Index}-End"
356 FileWrite $UninstallLog "$1$\r$\n"
363 !macro InstallFolder FOLDER
366 Call InstallFolderInternal
369 Function InstallFolderInternal
371 !define Index 'Line${__LINE__}'
372 FindFirst $0 $1 "$INSTDIR\$9\*"
373 StrCmp $0 "" "${Index}-End"
375 StrCmp $1 "" "${Index}-End"
376 StrCmp $1 "." "${Index}-Next"
377 StrCmp $1 ".." "${Index}-Next"
378 IfFileExists "$9\$1\*" 0 "${Index}-Write"
382 Call InstallFolderInternal
387 FileWrite $UninstallLog "$9\$1$\r$\n"
397 ;;;;;;;;;;;;;;;;;;;;;;
398 ; Installer sections ;
401 ;;;;;;;;;;;;;;;;;;;;;;
403 Section $Name_Section01 SEC01
405 SetShellVarContext all
406 SetOutPath "$INSTDIR"
408 !insertmacro OpenUninstallLog
410 ; VLC.exe, libvlc.dll
411 !insertmacro InstallFile vlc.exe
412 !insertmacro InstallFile vlc.exe.manifest
415 !insertmacro InstallFile *.dll
418 !insertmacro InstallFile *.txt
421 !insertmacro InstallFolder plugins
422 !insertmacro InstallFolder locale
423 @BUILD_OSDMENU_TRUE@ !insertmacro InstallFolder osdmenu
424 @BUILD_SKINS_TRUE@ !insertmacro InstallFolder skins
425 @BUILD_HTTPD_TRUE@ !insertmacro InstallFolder http
426 @BUILD_LUA_TRUE@ !insertmacro InstallFolder lua
430 WriteIniStr "$INSTDIR\${PRODUCT_GROUP} Website.url" "InternetShortcut" "URL" \
431 "${PRODUCT_WEB_SITE}"
432 FileWrite $UninstallLog "${PRODUCT_GROUP} Website.url$\r$\n"
433 WriteIniStr "$INSTDIR\Documentation.url" "InternetShortcut" "URL" \
434 "${PRODUCT_WEB_SITE}/doc/"
435 FileWrite $UninstallLog "Documentation.url$\r$\n"
436 WriteIniStr "$INSTDIR\New_Skins.url" "InternetShortcut" "URL" \
437 "${PRODUCT_WEB_SITE}/vlc/skins.php"
438 FileWrite $UninstallLog "New_Skins.url$\r$\n"
440 !insertmacro CloseUninstallLog
442 ; Add VLC to "recomended programs" for the following extensions
443 WriteRegStr HKCR Applications\vlc.exe "" ""
444 WriteRegStr HKCR Applications\vlc.exe "FriendlyAppName" "VLC media player"
445 WriteRegStr HKCR Applications\vlc.exe\shell\Open "" $ContextMenuEntry_PlayWith
446 WriteRegStr HKCR Applications\vlc.exe\shell\Open\command "" \
447 '"$INSTDIR\vlc.exe" --started-from-file "%1"'
448 !insertmacro MacroAllExtensions WriteRegStrSupportedTypes
452 ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion
454 StrCmp $R1 '6.0' lbl_vista lbl_done
457 WriteRegStr HKLM "Software\RegisteredApplications" "VLC" "Software\Clients\Media\VLC\Capabilities"
458 WriteRegStr HKLM "Software\Clients\Media\VLC\Capabilities" "ApplicationName" "VLC media player"
459 WriteRegStr HKLM "Software\Clients\Media\VLC\Capabilities" "ApplicationDescription" "VLC - The video swiss knife"
464 Section $Name_Section02a SEC02a
466 CreateDirectory "$SMPROGRAMS\VideoLAN"
467 CreateDirectory "$SMPROGRAMS\VideoLAN\Quick Settings"
468 CreateDirectory "$SMPROGRAMS\VideoLAN\Quick Settings\Audio"
469 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Audio\Set Audio mode to DirectX (default).lnk" \
470 "$INSTDIR\vlc.exe" "--aout aout_directx --save-config vlc://quit"
471 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Audio\Set Audio mode to Waveout.lnk" \
472 "$INSTDIR\vlc.exe" "--aout waveout --save-config vlc://quit"
473 CreateDirectory "$SMPROGRAMS\VideoLAN\Quick Settings\Interface"
474 @BUILD_SKINS_TRUE@ CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Interface\Set Main Interface to Skinnable.lnk" \
475 @BUILD_SKINS_TRUE@ "$INSTDIR\vlc.exe" "-I skins --save-config vlc://quit"
476 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Interface\Set Main Interface to Qt (default).lnk" \
477 "$INSTDIR\vlc.exe" "-I qt --save-config vlc://quit"
478 CreateDirectory "$SMPROGRAMS\VideoLAN\Quick Settings\Video"
479 ; FIXME add detection for Vista. Direct3D will be default there, for all others it's DirectX
480 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to Direct3D.lnk" \
481 "$INSTDIR\vlc.exe" "--vout direct3d --overlay --directx-hw-yuv --save-config vlc://quit"
482 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to Direct3D (no hardware acceleration).lnk" \
483 "$INSTDIR\vlc.exe" "--vout direct3d --overlay --no-directx-hw-yuv --save-config vlc://quit"
484 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to DirectX.lnk" \
485 "$INSTDIR\vlc.exe" "--vout directx --overlay --directx-hw-yuv --save-config vlc://quit"
486 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to DirectX (no hardware acceleration).lnk" \
487 "$INSTDIR\vlc.exe" "--vout directx --no-overlay --no-directx-hw-yuv --save-config vlc://quit"
488 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to DirectX (no video overlay).lnk" \
489 "$INSTDIR\vlc.exe" "--vout directx --no-overlay --directx-hw-yuv --save-config vlc://quit"
490 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to OpenGL.lnk" \
491 "$INSTDIR\vlc.exe" "--vout opengl --overlay --save-config vlc://quit"
492 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Reset VLC media player preferences and cache files.lnk" \
493 "$INSTDIR\vlc.exe" "--reset-config --reset-plugins-cache vlc://quit"
494 CreateShortCut "$SMPROGRAMS\VideoLAN\Documentation.lnk" \
495 "$INSTDIR\Documentation.url"
496 CreateShortCut "$SMPROGRAMS\VideoLAN\Release Notes.lnk" \
497 "$INSTDIR\NEWS.txt" ""
498 CreateShortCut "$SMPROGRAMS\VideoLAN\${PRODUCT_GROUP} Website.lnk" \
499 "$INSTDIR\${PRODUCT_GROUP} Website.url"
500 CreateShortCut "$SMPROGRAMS\VideoLAN\VLC media player.lnk" \
501 "$INSTDIR\vlc.exe" ""
504 Section $Name_Section02b SEC02b
506 CreateShortCut "$DESKTOP\VLC media player.lnk" \
507 "$INSTDIR\vlc.exe" ""
510 !ifdef INSTALL_MOZILLA
511 Section /o $Name_Section03 SEC03
514 SetOutPath "$INSTDIR"
515 !insertmacro OpenUninstallLog
516 !insertmacro InstallFile mozilla\npvlc.dll
517 !insertmacro InstallFile mozilla\npvlc.dll.manifest
518 !insertmacro CloseUninstallLog
520 !define Moz "SOFTWARE\MozillaPlugins\@videolan.org/vlc,version=${VERSION}"
521 WriteRegStr HKLM ${Moz} "Description" "VLC Multimedia Plugin"
522 WriteRegStr HKLM ${Moz} "Path" "$INSTDIR\npvlc.dll"
523 WriteRegStr HKLM ${Moz} "Product" "VLC media player"
524 WriteRegStr HKLM ${Moz} "Vendor" "VideoLAN"
525 WriteRegStr HKLM ${Moz} "Version" "${VERSION}"
527 ; for very old version of mozilla, these lines may be needed
532 ;!define Index 'Line${__LINE__}'
538 ; EnumRegKey $R0 HKLM "SOFTWARE\Mozilla" "$R1"
539 ; StrCmp $R0 "" "${Index}-End"
541 ; ReadRegStr $R2 HKLM "SOFTWARE\Mozilla\$R0\Extensions" "Plugins"
542 ; StrCmp $R2 "" "${Index}-Loop" ""
544 ; CopyFiles "$INSTDIR\npvlc.dll" "$R2"
546 ; CopyFiles ${LIBVLC_DLL} "$R2"
548 ; !ifdef LIBVLC_CONTROL_DLL
549 ; CopyFiles ${LIBVLC_CONTROL_DLL} "$R2"
551 ; Goto "${Index}-Loop"
559 !ifdef INSTALL_ACTIVEX
560 Section $Name_Section04 SEC04
562 SetOutPath "$INSTDIR"
563 !insertmacro OpenUninstallLog
564 !insertmacro InstallFile activex\axvlc.dll
565 !insertmacro InstallFile activex\axvlc.dll.manifest
566 !insertmacro CloseUninstallLog
567 RegDLL "$INSTDIR\axvlc.dll"
572 Section $Name_Section05 SEC05
574 WriteRegStr HKCR "AudioCD\shell\PlayWithVLC" "" $ContextMenuEntry_PlayWith
575 WriteRegStr HKCR "AudioCD\shell\PlayWithVLC\command" "" \
576 '"$INSTDIR\vlc.exe" --started-from-file cdda://%1'
577 WriteRegStr HKCR "DVD\shell\PlayWithVLC" "" $ContextMenuEntry_PlayWith
578 WriteRegStr HKCR "DVD\shell\PlayWithVLC\command" "" \
579 '"$INSTDIR\vlc.exe" --started-from-file dvd://%1'
581 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayDVDMovieOnArrival" "VLCPlayDVDMovieOnArrival" ""
582 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "Action" $Action_OnArrivalDVD
583 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "DefaultIcon" '"$INSTDIR\vlc.exe",0'
584 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "InvokeProgID" "VLC.DVDMovie"
585 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "InvokeVerb" "play"
586 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "Provider" "VideoLAN VLC media player"
588 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayCDAudioOnArrival" "VLCPlayCDAudioOnArrival" ""
589 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "Action" $Action_OnArrivalAudioCD
590 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "DefaultIcon" '"$INSTDIR\vlc.exe",0'
591 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "InvokeProgID" "VLC.CDAudio"
592 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "InvokeVerb" "play"
593 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "Provider" "VideoLAN VLC media player"
594 WriteRegStr HKCR "VLC.DVDMovie" "" "VLC DVD Movie"
595 WriteRegStr HKCR "VLC.DVDMovie\shell" "" "Open"
596 WriteRegStr HKCR "VLC.DVDMovie\shell\Open\command" "" \
597 '"$INSTDIR\vlc.exe" --started-from-file dvd://%1'
598 WriteRegStr HKCR "VLC.DVDMovie\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'
599 WriteRegStr HKCR "VLC.CDAudio" "" "VLC CD Audio"
600 WriteRegStr HKCR "VLC.CDAudio\shell" "" "Open"
601 WriteRegStr HKCR "VLC.CDAudio\shell\Open\command" "" \
602 '"$INSTDIR\vlc.exe" --started-from-file cdda://%1'
603 WriteRegStr HKCR "VLC.CDAudio\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'
608 SectionGroup /e !$Name_Section06 SEC06
609 SectionGroup $Name_SectionGroupAudio
610 !insertmacro MacroAudioExtensions RegisterExtensionSection
612 SectionGroup $Name_SectionGroupVideo
613 !insertmacro MacroVideoExtensions RegisterExtensionSection
615 SectionGroup $Name_SectionGroupOther
616 !insertmacro MacroOtherExtensions RegisterExtensionSection
620 Section $Name_Section07 SEC07
622 !insertmacro MacroAllExtensions AddContextMenu
623 !insertmacro AddContextMenuExt "Directory"
626 Section $Name_Section08 SEC08
627 !insertmacro delprefs
630 ; Installer section descriptions
631 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
632 !insertmacro MUI_DESCRIPTION_TEXT ${SEC01} $Desc_Section01
633 !insertmacro MUI_DESCRIPTION_TEXT ${SEC02a} $Desc_Section02a
634 !insertmacro MUI_DESCRIPTION_TEXT ${SEC02b} $Desc_Section02b
635 @BUILD_MOZILLA_TRUE@ !insertmacro MUI_DESCRIPTION_TEXT ${SEC03} $Desc_Section03
636 @BUILD_ACTIVEX_TRUE@ !insertmacro MUI_DESCRIPTION_TEXT ${SEC04} $Desc_Section04
637 !insertmacro MUI_DESCRIPTION_TEXT ${SEC05} $Desc_Section05
638 !insertmacro MUI_DESCRIPTION_TEXT ${SEC06} $Desc_Section06
639 !insertmacro MUI_DESCRIPTION_TEXT ${SEC07} $Desc_Section07
640 !insertmacro MUI_DESCRIPTION_TEXT ${SEC08} $Desc_Section08
641 !insertmacro MUI_FUNCTION_DESCRIPTION_END
645 !insertmacro MUI_LANGDLL_DISPLAY
647 !include "languages\english.nsh"
648 StrCmp $LANGUAGE ${LANG_FRENCH} French 0
649 StrCmp $LANGUAGE ${LANG_ITALIAN} Italian 0
650 StrCmp $LANGUAGE ${LANG_HUNGARIAN} Hungarian 0
651 StrCmp $LANGUAGE ${LANG_ROMANIAN} Romanian 0
652 StrCmp $LANGUAGE ${LANG_CATALAN} Catalan 0
653 StrCmp $LANGUAGE ${LANG_BULGARIAN} Bulgarian 0
654 StrCmp $LANGUAGE ${LANG_SLOVAK} Slovak 0
655 StrCmp $LANGUAGE ${LANG_POLISH} Polish 0
656 StrCmp $LANGUAGE ${LANG_DUTCH} Dutch 0
657 StrCmp $LANGUAGE ${LANG_SIMPCHINESE} SChinese 0
658 StrCmp $LANGUAGE ${LANG_FINNISH} Finnish 0
659 StrCmp $LANGUAGE ${LANG_PORTUGUESEBR} Brazilian EndLanguageCmp
661 !include "languages\french.nsh"
664 !include "languages\italian.nsh"
667 !include "languages\hungarian.nsh"
670 !include "languages\romanian.nsh"
673 !include "languages\catalan.nsh"
676 !include "languages\bulgarian.nsh"
679 !include "languages\slovak.nsh"
682 !include "languages\polish.nsh"
685 !include "languages\dutch.nsh"
688 !include "languages\schinese.nsh"
691 !include "languages\finnish.nsh"
694 !include "languages\brazilian_portuguese.nsh"
697 ReadRegStr $R0 ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
701 MessageBox MB_YESNO|MB_ICONEXCLAMATION $Message_AlreadyInstalled IDNO done
706 ExecWait '$R0 _?=$INSTDIR' ;Do not copy the uninstaller to a temp file
713 WriteUninstaller "$INSTDIR\uninstall.exe"
714 WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "InstallDir" $INSTDIR
715 WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "Version" "${VERSION}"
716 WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\vlc.exe"
718 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
719 "DisplayName" "$(^Name)"
720 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
721 "UninstallString" "$INSTDIR\uninstall.exe"
722 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
723 "DisplayIcon" "$INSTDIR\vlc.exe"
724 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
725 "DisplayVersion" "${PRODUCT_VERSION}"
726 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
727 "URLInfoAbout" "${PRODUCT_WEB_SITE}"
728 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
729 "Publisher" "${PRODUCT_PUBLISHER}"
732 ;;;;;;;;;;;;;;;;;;;;;;;;
733 ; Uninstaller sections ;
734 ;;;;;;;;;;;;;;;;;;;;;;;;
736 ; TrimNewlines (copied from NSIS documentation)
737 ; input, top of stack (e.g. whatever$\r$\n)
738 ; output, top of stack (replaces, with e.g. whatever)
739 ; modifies no other variables.
741 Function un.TrimNewlines
750 StrCmp $R2 "$\r" loop
751 StrCmp $R2 "$\n" loop
753 IntCmp $R1 0 no_trim_needed
762 Function un.RemoveEmptyDirs
764 !define Index 'Line${__LINE__}'
765 FindFirst $0 $1 "$INSTDIR$9*"
766 StrCmp $0 "" "${Index}-End"
768 StrCmp $1 "" "${Index}-End"
769 StrCmp $1 "." "${Index}-Next"
770 StrCmp $1 ".." "${Index}-Next"
775 Call un.RemoveEmptyDirs
789 Section "un.$Name_Section91" SEC91
791 SetShellVarContext all
793 !insertmacro MacroAllExtensions DeleteContextMenu
794 !insertmacro MacroAllExtensions UnRegisterExtensionSection
795 !insertmacro DeleteContextMenuExt "Directory"
797 ;remove activex plugin
798 UnRegDLL "$INSTDIR\axvlc.dll"
799 Delete /REBOOTOK "$INSTDIR\axvlc.dll"
800 Delete /REBOOTOK "$INSTDIR\axvlc.dll.manifest"
802 ;remove mozilla plugin
807 !define Index 'Line${__LINE__}'
813 EnumRegKey $R0 HKLM "SOFTWARE\Mozilla" "$R1"
814 StrCmp $R0 "" "${Index}-End"
816 ReadRegStr $R2 HKLM "SOFTWARE\Mozilla\$R0\Extensions" "Plugins"
817 StrCmp $R2 "" "${Index}-Loop" ""
819 ; old files (0.8.5 and before) that may be lying around
820 Delete /REBOOTOK "$R2\npvlc.dll"
821 Delete /REBOOTOK "$R2\libvlc.dll"
822 Delete /REBOOTOK "$R2\vlcintf.xpt"
827 Delete /REBOOTOK "$INSTDIR\npvlc.dll"
828 Delete /REBOOTOK "$INSTDIR\npvlc.dll.manifest"
830 RMDir "$SMPROGRAMS\VideoLAN"
831 RMDir /r $SMPROGRAMS\VideoLAN
833 FileOpen $UninstallLog "$INSTDIR\uninstall.log" r
836 FileRead $UninstallLog $R0
837 IfErrors UninstallEnd
841 Delete "$INSTDIR\$R0"
844 FileClose $UninstallLog
845 Delete "$INSTDIR\uninstall.log"
846 Delete "$INSTDIR\uninstall.exe"
848 Call un.RemoveEmptyDirs
851 DeleteRegKey HKLM Software\VideoLAN
853 DeleteRegKey HKCR Applications\vlc.exe
854 DeleteRegKey HKCR AudioCD\shell\PlayWithVLC
855 DeleteRegKey HKCR DVD\shell\PlayWithVLC
856 DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayDVDMovieOnArrival" "VLCPlayDVDMovieOnArrival"
857 DeleteRegKey HKLM Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival
858 DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayCDAudioOnArrival" "VLCPlayCDAudioOnArrival"
859 DeleteRegKey HKLM Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival
860 DeleteRegKey HKLM Software\Clients\Media\VLC
861 DeleteRegKey HKCR "VLC.MediaFile"
864 "SOFTWARE\MozillaPlugins\@videolan.org/vlc,version=${VERSION}"
867 "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
869 Delete "$DESKTOP\VLC media player.lnk"
871 DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
872 DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}"
876 Section /o "un.$Name_Section92" SEC92
877 !insertmacro delprefs
880 ; Uninstaller section descriptions
881 !insertmacro MUI_UNFUNCTION_DESCRIPTION_BEGIN
882 !insertmacro MUI_DESCRIPTION_TEXT ${SEC91} $Desc_Section91
883 !insertmacro MUI_DESCRIPTION_TEXT ${SEC92} $Desc_Section92
884 !insertmacro MUI_UNFUNCTION_DESCRIPTION_END
886 ;Function un.onUninstSuccess
888 ; MessageBox MB_ICONINFORMATION|MB_OK \
889 ; "$(^Name) was successfully removed from your computer."
893 !insertmacro MUI_UNGETLANGUAGE
895 !include "languages\english.nsh"
896 StrCmp $LANGUAGE ${LANG_FRENCH} French 0
897 StrCmp $LANGUAGE ${LANG_ITALIAN} Italian 0
898 StrCmp $LANGUAGE ${LANG_HUNGARIAN} Hungarian 0
899 StrCmp $LANGUAGE ${LANG_ROMANIAN} Romanian 0
900 StrCmp $LANGUAGE ${LANG_CATALAN} Catalan 0
901 StrCmp $LANGUAGE ${LANG_BULGARIAN} Bulgarian 0
902 StrCmp $LANGUAGE ${LANG_SLOVAK} Slovak 0
903 StrCmp $LANGUAGE ${LANG_POLISH} Polish 0
904 StrCmp $LANGUAGE ${LANG_DUTCH} Dutch 0
905 StrCmp $LANGUAGE ${LANG_SIMPCHINESE} SChinese 0
906 StrCmp $LANGUAGE ${LANG_FINNISH} Finnish 0
907 StrCmp $LANGUAGE ${LANG_PORTUGUESEBR} Brazilian EndLanguageCmp
909 !include "languages\french.nsh"
912 !include "languages\italian.nsh"
915 !include "languages\hungarian.nsh"
918 !include "languages\romanian.nsh"
921 !include "languages\catalan.nsh"
924 !include "languages\bulgarian.nsh"
927 !include "languages\slovak.nsh"
930 !include "languages\polish.nsh"
933 !include "languages\dutch.nsh"
936 !include "languages\schinese.nsh"
939 !include "languages\finnish.nsh"
942 !include "languages\brazilian_portuguese.nsh"