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
45 BrandingText "${PRODUCT_GROUP} ${PRODUCT_NAME}"
47 InstType $Name_InstTypeRecommended
48 InstType $Name_InstTypeMinimum
49 InstType $Name_InstTypeFull
51 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
52 ; NSIS Modern User Interface configuration ;
53 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
55 ; MUI 1.67 compatible ------
59 !define MUI_ABORTWARNING
60 !define MUI_ICON "vlc.ico"
61 !define MUI_UNICON "vlc.ico"
62 !define MUI_COMPONENTSPAGE_SMALLDESC
66 !define MUI_WELCOMEPAGE_TITLE_3LINES
67 !insertmacro MUI_PAGE_WELCOME
69 !insertmacro MUI_PAGE_LICENSE "COPYING.txt"
71 !insertmacro MUI_PAGE_COMPONENTS
73 !insertmacro MUI_PAGE_DIRECTORY
75 !insertmacro MUI_PAGE_INSTFILES
77 !define MUI_FINISHPAGE_RUN "$INSTDIR\vlc.exe"
78 !define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\README.txt"
79 !define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED
80 !define MUI_FINISHPAGE_LINK $Link_VisitWebsite
81 !define MUI_FINISHPAGE_LINK_LOCATION "http://www.videolan.org/vlc/"
82 !define MUI_FINISHPAGE_NOREBOOTSUPPORT
83 !insertmacro MUI_PAGE_FINISH
86 !insertmacro MUI_UNPAGE_CONFIRM
87 !insertmacro MUI_UNPAGE_COMPONENTS
88 !insertmacro MUI_UNPAGE_INSTFILES
89 !insertmacro MUI_UNPAGE_FINISH
92 !insertmacro MUI_LANGUAGE "English" # first language is the default language
93 !insertmacro MUI_LANGUAGE "French"
94 !insertmacro MUI_LANGUAGE "German"
95 !insertmacro MUI_LANGUAGE "Spanish"
96 !insertmacro MUI_LANGUAGE "SimpChinese"
97 !insertmacro MUI_LANGUAGE "TradChinese"
98 !insertmacro MUI_LANGUAGE "Japanese"
99 !insertmacro MUI_LANGUAGE "Korean"
100 !insertmacro MUI_LANGUAGE "Italian"
101 !insertmacro MUI_LANGUAGE "Dutch"
102 !insertmacro MUI_LANGUAGE "Danish"
103 !insertmacro MUI_LANGUAGE "Swedish"
104 !insertmacro MUI_LANGUAGE "Norwegian"
105 !insertmacro MUI_LANGUAGE "Finnish"
106 !insertmacro MUI_LANGUAGE "Greek"
107 !insertmacro MUI_LANGUAGE "Russian"
108 !insertmacro MUI_LANGUAGE "Portuguese"
109 !insertmacro MUI_LANGUAGE "PortugueseBR"
110 !insertmacro MUI_LANGUAGE "Arabic"
111 !insertmacro MUI_LANGUAGE "Polish"
112 !insertmacro MUI_LANGUAGE "Romanian"
113 !insertmacro MUI_LANGUAGE "Slovak"
114 !insertmacro MUI_LANGUAGE "Czech"
115 !insertmacro MUI_LANGUAGE "Hungarian"
116 !insertmacro MUI_LANGUAGE "Catalan"
117 !insertmacro MUI_LANGUAGE "Bulgarian"
119 ; Reserve files for solid compression
120 !insertmacro MUI_RESERVEFILE_LANGDLL
121 !insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
125 ;;;;;;;;;;;;;;;;;;;;;;;
126 ; Macro and Functions ;
127 ;;;;;;;;;;;;;;;;;;;;;;;
129 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
130 ; 1. File type associations ;
131 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
133 ;; Function that register one extension for VLC
134 Function RegisterExtension
135 ; back up old value for extension $R0 (eg. ".opt")
136 ReadRegStr $1 HKCR "$R0" ""
137 StrCmp $1 "" NoBackup
138 StrCmp $1 "VLC$R0" "NoBackup"
139 WriteRegStr HKCR "$R0" "VLC.backup" $1
141 WriteRegStr HKCR "$R0" "" "VLC$R0"
142 ReadRegStr $0 HKCR "VLC$R0" ""
143 WriteRegStr HKCR "VLC$R0" "" "VLC media file ($R0)"
144 WriteRegStr HKCR "VLC$R0\shell" "" "Open"
145 WriteRegStr HKCR "VLC$R0\shell\Open" "" $ShellAssociation_Play
146 WriteRegStr HKCR "VLC$R0\shell\Open\command" "" '"$INSTDIR\vlc.exe" --started-from-file "%1"'
147 WriteRegStr HKCR "VLC$R0\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'
151 ReadRegStr $R1 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion
153 StrCmp $R2 '6.0' ForVista ToEnd
155 WriteRegStr HKLM "Software\Clients\Media\VLC\Capabilities\FileAssociations" "$R0" "VLC$R0"
160 ;; Function that removes one extension that VLC owns.
161 Function un.RegisterExtension
162 ;start of restore script
163 ReadRegStr $1 HKCR "$R0" ""
164 StrCmp $1 "VLC$R0" 0 NoOwn ; only do this if we own it
165 ; Read the old value from Backup
166 ReadRegStr $1 HKCR "$R0" "VLC.backup"
167 StrCmp $1 "" 0 Restore ; if backup="" then delete the whole key
168 DeleteRegKey HKCR "$R0"
171 WriteRegStr HKCR "$R0" "" $1
172 DeleteRegValue HKCR "$R0" "VLC.backup"
174 DeleteRegKey HKCR "VLC$R0" ;Delete key with association settings
175 DeleteRegKey HKLM "Software\Clients\Media\VLC\Capabilities\FileAssociations\VLC$R0" ; for vista
178 !macro RegisterExtensionSection EXT
183 Call RegisterExtension
188 !macro UnRegisterExtensionSection EXT
191 Call un.RegisterExtension
195 !macro WriteRegStrSupportedTypes EXT
196 WriteRegStr HKCR Applications\vlc.exe\SupportedTypes ${EXT} ""
199 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
200 ; Extension lists Macros ;
201 ; Those macros calls the previous functions ;
202 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
204 !macro MacroAudioExtensions _action
205 !insertmacro ${_action} ".a52"
206 !insertmacro ${_action} ".aac"
207 !insertmacro ${_action} ".ac3"
208 !insertmacro ${_action} ".dts"
209 !insertmacro ${_action} ".flac"
210 !insertmacro ${_action} ".m4a"
211 !insertmacro ${_action} ".m4p"
212 !insertmacro ${_action} ".mka"
213 !insertmacro ${_action} ".mod"
214 !insertmacro ${_action} ".mp1"
215 !insertmacro ${_action} ".mp2"
216 !insertmacro ${_action} ".mp3"
217 !insertmacro ${_action} ".oma"
218 !insertmacro ${_action} ".oga"
219 !insertmacro ${_action} ".spx"
220 !insertmacro ${_action} ".wav"
221 !insertmacro ${_action} ".wma"
222 !insertmacro ${_action} ".wv"
223 !insertmacro ${_action} ".xm"
226 !macro MacroVideoExtensions _action
227 !insertmacro ${_action} ".asf"
228 !insertmacro ${_action} ".avi"
229 !insertmacro ${_action} ".divx"
230 !insertmacro ${_action} ".dv"
231 !insertmacro ${_action} ".flv"
232 !insertmacro ${_action} ".gxf"
233 !insertmacro ${_action} ".m1v"
234 !insertmacro ${_action} ".m2v"
235 !insertmacro ${_action} ".m2ts"
236 !insertmacro ${_action} ".m4v"
237 !insertmacro ${_action} ".mkv"
238 !insertmacro ${_action} ".mov"
239 !insertmacro ${_action} ".mp4"
240 !insertmacro ${_action} ".mpeg"
241 !insertmacro ${_action} ".mpeg1"
242 !insertmacro ${_action} ".mpeg2"
243 !insertmacro ${_action} ".mpeg4"
244 !insertmacro ${_action} ".mpg"
245 !insertmacro ${_action} ".mts"
246 !insertmacro ${_action} ".mxf"
247 !insertmacro ${_action} ".nuv"
248 !insertmacro ${_action} ".ogg"
249 !insertmacro ${_action} ".ogm"
250 !insertmacro ${_action} ".ogx"
251 !insertmacro ${_action} ".ogv"
252 !insertmacro ${_action} ".rmvb"
253 !insertmacro ${_action} ".ts"
254 !insertmacro ${_action} ".vob"
255 !insertmacro ${_action} ".wmv"
258 !macro MacroOtherExtensions _action
259 !insertmacro ${_action} ".asx"
260 !insertmacro ${_action} ".bin"
261 !insertmacro ${_action} ".cue"
262 !insertmacro ${_action} ".m3u"
263 !insertmacro ${_action} ".pls"
264 !insertmacro ${_action} ".vlc"
265 !insertmacro ${_action} ".xspf"
268 ; One macro to rule them all
269 !macro MacroAllExtensions _action
270 !insertmacro MacroAudioExtensions ${_action}
271 !insertmacro MacroVideoExtensions ${_action}
272 !insertmacro MacroOtherExtensions ${_action}
275 ;;;;;;;;;;;;;;;;;;;;;;;;;;;
276 ; 2. Context menu entries ;
277 ;;;;;;;;;;;;;;;;;;;;;;;;;;;
279 ; Generic function for adding the context menu for one ext.
280 !macro AddContextMenuExt EXT
281 WriteRegStr HKCR ${EXT}\shell\PlayWithVLC "" $ContextMenuEntry_PlayWith
282 WriteRegStr HKCR ${EXT}\shell\PlayWithVLC\command "" '"$INSTDIR\vlc.exe" --started-from-file --no-playlist-enqueue "%1"'
284 WriteRegStr HKCR ${EXT}\shell\AddToPlaylistVLC "" $ContextMenuEntry_AddToPlaylist
285 WriteRegStr HKCR ${EXT}\shell\AddToPlaylistVLC\command "" '"$INSTDIR\vlc.exe" --started-from-file --playlist-enqueue "%1"'
288 !macro AddContextMenu EXT
290 ReadRegStr $R0 HKCR ${EXT} ""
291 !insertmacro AddContextMenuExt $R0
295 !macro DeleteContextMenuExt EXT
296 DeleteRegKey HKCR ${EXT}\shell\PlayWithVLC
297 DeleteRegKey HKCR ${EXT}\shell\AddToPlaylistVLC
300 !macro DeleteContextMenu EXT
302 ReadRegStr $R0 HKCR ${EXT} ""
303 !insertmacro DeleteContextMenuExt $R0
307 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
308 ; 3. Delete prefs and cache ;
309 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
313 !define Index 'Line${__LINE__}'
316 ; this will loop through all the logged users and "virtual" windows users
317 ; (it looks like users are only present in HKEY_USERS when they are logged in)
319 EnumRegKey $1 HKU "" $0
320 StrCmp $1 "" "${Index}-End"
322 ReadRegStr $2 HKU "$1\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" AppData
323 StrCmp $2 "" "${Index}-Loop"
334 !macro OpenUninstallLog
335 FileOpen $UninstallLog "$INSTDIR\uninstall.log" a
336 FileSeek $UninstallLog 0 END
339 !macro CloseUninstallLog
340 FileClose $UninstallLog
341 SetFileAttributes "$INSTDIR\uninstall.log" HIDDEN
347 !macro InstallFile FILEREGEX
349 !define Index 'Line${__LINE__}'
350 FindFirst $0 $1 "$INSTDIR\${FILEREGEX}"
351 StrCmp $0 "" "${Index}-End"
353 StrCmp $1 "" "${Index}-End"
354 FileWrite $UninstallLog "$1$\r$\n"
361 !macro InstallFolder FOLDER
364 Call InstallFolderInternal
367 Function InstallFolderInternal
369 !define Index 'Line${__LINE__}'
370 FindFirst $0 $1 "$INSTDIR\$9\*"
371 StrCmp $0 "" "${Index}-End"
373 StrCmp $1 "" "${Index}-End"
374 StrCmp $1 "." "${Index}-Next"
375 StrCmp $1 ".." "${Index}-Next"
376 IfFileExists "$9\$1\*" 0 "${Index}-Write"
380 Call InstallFolderInternal
385 FileWrite $UninstallLog "$9\$1$\r$\n"
395 ;;;;;;;;;;;;;;;;;;;;;;
396 ; Installer sections ;
399 ;;;;;;;;;;;;;;;;;;;;;;
401 Section $Name_Section01 SEC01
403 SetShellVarContext all
404 SetOutPath "$INSTDIR"
406 !insertmacro OpenUninstallLog
408 ; VLC.exe, libvlc.dll
409 !insertmacro InstallFile vlc.exe
410 !insertmacro InstallFile vlc.exe.manifest
413 !insertmacro InstallFile *.dll
416 !insertmacro InstallFile *.txt
419 !insertmacro InstallFolder plugins
420 !insertmacro InstallFolder locale
421 @BUILD_OSDMENU_TRUE@ !insertmacro InstallFolder osdmenu
422 @BUILD_SKINS_TRUE@ !insertmacro InstallFolder skins
423 @BUILD_HTTPD_TRUE@ !insertmacro InstallFolder http
424 @BUILD_LUA_TRUE@ !insertmacro InstallFolder lua
428 WriteIniStr "$INSTDIR\${PRODUCT_GROUP} Website.url" "InternetShortcut" "URL" \
429 "${PRODUCT_WEB_SITE}"
430 FileWrite $UninstallLog "${PRODUCT_GROUP} Website.url$\r$\n"
431 WriteIniStr "$INSTDIR\Documentation.url" "InternetShortcut" "URL" \
432 "${PRODUCT_WEB_SITE}/doc/"
433 FileWrite $UninstallLog "Documentation.url$\r$\n"
434 WriteIniStr "$INSTDIR\New_Skins.url" "InternetShortcut" "URL" \
435 "${PRODUCT_WEB_SITE}/vlc/skins.php"
436 FileWrite $UninstallLog "New_Skins.url$\r$\n"
438 !insertmacro CloseUninstallLog
440 ; Add VLC to "recomended programs" for the following extensions
441 WriteRegStr HKCR Applications\vlc.exe "" ""
442 WriteRegStr HKCR Applications\vlc.exe "FriendlyAppName" "VLC media player"
443 WriteRegStr HKCR Applications\vlc.exe\shell\Open "" $ContextMenuEntry_PlayWith
444 WriteRegStr HKCR Applications\vlc.exe\shell\Open\command "" \
445 '"$INSTDIR\vlc.exe" --started-from-file "%1"'
446 !insertmacro MacroAllExtensions WriteRegStrSupportedTypes
450 ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion
452 StrCmp $R1 '6.0' lbl_vista lbl_done
455 WriteRegStr HKLM "Software\RegisteredApplications" "VLC" "Software\Clients\Media\VLC\Capabilities"
456 WriteRegStr HKLM "Software\Clients\Media\VLC\Capabilities" "ApplicationName" "VLC media player"
457 WriteRegStr HKLM "Software\Clients\Media\VLC\Capabilities" "ApplicationDescription" "VLC - The video swiss knife"
462 Section $Name_Section02a SEC02a
464 CreateDirectory "$SMPROGRAMS\VideoLAN"
465 CreateDirectory "$SMPROGRAMS\VideoLAN\Quick Settings"
466 CreateDirectory "$SMPROGRAMS\VideoLAN\Quick Settings\Audio"
467 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Audio\Set Audio mode to DirectX (default).lnk" \
468 "$INSTDIR\vlc.exe" "--aout aout_directx --save-config vlc://quit"
469 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Audio\Set Audio mode to Waveout.lnk" \
470 "$INSTDIR\vlc.exe" "--aout waveout --save-config vlc://quit"
471 CreateDirectory "$SMPROGRAMS\VideoLAN\Quick Settings\Interface"
472 @BUILD_SKINS_TRUE@ CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Interface\Set Main Interface to Skinnable.lnk" \
473 @BUILD_SKINS_TRUE@ "$INSTDIR\vlc.exe" "-I skins --save-config vlc://quit"
474 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Interface\Set Main Interface to Qt (default).lnk" \
475 "$INSTDIR\vlc.exe" "-I qt --save-config vlc://quit"
476 CreateDirectory "$SMPROGRAMS\VideoLAN\Quick Settings\Video"
477 ; FIXME add detection for Vista. Direct3D will be default there, for all others it's DirectX
478 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to Direct3D.lnk" \
479 "$INSTDIR\vlc.exe" "--vout direct3d --overlay --directx-hw-yuv --save-config vlc://quit"
480 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to Direct3D (no hardware acceleration).lnk" \
481 "$INSTDIR\vlc.exe" "--vout direct3d --overlay --no-directx-hw-yuv --save-config vlc://quit"
482 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to DirectX.lnk" \
483 "$INSTDIR\vlc.exe" "--vout directx --overlay --directx-hw-yuv --save-config vlc://quit"
484 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to DirectX (no hardware acceleration).lnk" \
485 "$INSTDIR\vlc.exe" "--vout directx --no-overlay --no-directx-hw-yuv --save-config vlc://quit"
486 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to DirectX (no video overlay).lnk" \
487 "$INSTDIR\vlc.exe" "--vout directx --no-overlay --directx-hw-yuv --save-config vlc://quit"
488 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to OpenGL.lnk" \
489 "$INSTDIR\vlc.exe" "--vout opengl --overlay --save-config vlc://quit"
490 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Reset VLC media player preferences and cache files.lnk" \
491 "$INSTDIR\vlc.exe" "--reset-config --reset-plugins-cache vlc://quit"
492 CreateShortCut "$SMPROGRAMS\VideoLAN\Documentation.lnk" \
493 "$INSTDIR\Documentation.url"
494 CreateShortCut "$SMPROGRAMS\VideoLAN\Release Notes.lnk" \
495 "$INSTDIR\NEWS.txt" ""
496 CreateShortCut "$SMPROGRAMS\VideoLAN\${PRODUCT_GROUP} Website.lnk" \
497 "$INSTDIR\${PRODUCT_GROUP} Website.url"
498 CreateShortCut "$SMPROGRAMS\VideoLAN\VLC media player.lnk" \
499 "$INSTDIR\vlc.exe" ""
502 Section $Name_Section02b SEC02b
504 CreateShortCut "$DESKTOP\VLC media player.lnk" \
505 "$INSTDIR\vlc.exe" ""
508 !ifdef INSTALL_MOZILLA
509 Section /o $Name_Section03 SEC03
512 SetOutPath "$INSTDIR"
513 !insertmacro OpenUninstallLog
514 !insertmacro InstallFile mozilla\npvlc.dll
515 !insertmacro InstallFile mozilla\npvlc.dll.manifest
516 !insertmacro CloseUninstallLog
518 !define Moz "SOFTWARE\MozillaPlugins\@videolan.org/vlc,version=${VERSION}"
519 WriteRegStr HKLM ${Moz} "Description" "VLC Multimedia Plugin"
520 WriteRegStr HKLM ${Moz} "Path" "$INSTDIR\npvlc.dll"
521 WriteRegStr HKLM ${Moz} "Product" "VLC media player"
522 WriteRegStr HKLM ${Moz} "Vendor" "VideoLAN"
523 WriteRegStr HKLM ${Moz} "Version" "${VERSION}"
525 ; for very old version of mozilla, these lines may be needed
530 ;!define Index 'Line${__LINE__}'
536 ; EnumRegKey $R0 HKLM "SOFTWARE\Mozilla" "$R1"
537 ; StrCmp $R0 "" "${Index}-End"
539 ; ReadRegStr $R2 HKLM "SOFTWARE\Mozilla\$R0\Extensions" "Plugins"
540 ; StrCmp $R2 "" "${Index}-Loop" ""
542 ; CopyFiles "$INSTDIR\npvlc.dll" "$R2"
544 ; CopyFiles ${LIBVLC_DLL} "$R2"
546 ; !ifdef LIBVLC_CONTROL_DLL
547 ; CopyFiles ${LIBVLC_CONTROL_DLL} "$R2"
549 ; Goto "${Index}-Loop"
557 !ifdef INSTALL_ACTIVEX
558 Section $Name_Section04 SEC04
560 SetOutPath "$INSTDIR"
561 !insertmacro OpenUninstallLog
562 !insertmacro InstallFile activex\axvlc.dll
563 !insertmacro InstallFile activex\axvlc.dll.manifest
564 !insertmacro CloseUninstallLog
565 RegDLL "$INSTDIR\axvlc.dll"
570 Section $Name_Section05 SEC05
572 WriteRegStr HKCR "AudioCD\shell\PlayWithVLC" "" $ContextMenuEntry_PlayWith
573 WriteRegStr HKCR "AudioCD\shell\PlayWithVLC\command" "" \
574 '"$INSTDIR\vlc.exe" --started-from-file cdda://%1'
575 WriteRegStr HKCR "DVD\shell\PlayWithVLC" "" $ContextMenuEntry_PlayWith
576 WriteRegStr HKCR "DVD\shell\PlayWithVLC\command" "" \
577 '"$INSTDIR\vlc.exe" --started-from-file dvd://%1'
579 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayDVDMovieOnArrival" "VLCPlayDVDMovieOnArrival" ""
580 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "Action" $Action_OnArrivalDVD
581 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "DefaultIcon" '"$INSTDIR\vlc.exe",0'
582 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "InvokeProgID" "VLC.DVDMovie"
583 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "InvokeVerb" "play"
584 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "Provider" "VideoLAN VLC media player"
586 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayCDAudioOnArrival" "VLCPlayCDAudioOnArrival" ""
587 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "Action" $Action_OnArrivalAudioCD
588 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "DefaultIcon" '"$INSTDIR\vlc.exe",0'
589 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "InvokeProgID" "VLC.CDAudio"
590 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "InvokeVerb" "play"
591 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "Provider" "VideoLAN VLC media player"
592 WriteRegStr HKCR "VLC.DVDMovie" "" "VLC DVD Movie"
593 WriteRegStr HKCR "VLC.DVDMovie\shell" "" "Open"
594 WriteRegStr HKCR "VLC.DVDMovie\shell\Open\command" "" \
595 '"$INSTDIR\vlc.exe" --started-from-file dvd://%1'
596 WriteRegStr HKCR "VLC.DVDMovie\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'
597 WriteRegStr HKCR "VLC.CDAudio" "" "VLC CD Audio"
598 WriteRegStr HKCR "VLC.CDAudio\shell" "" "Open"
599 WriteRegStr HKCR "VLC.CDAudio\shell\Open\command" "" \
600 '"$INSTDIR\vlc.exe" --started-from-file cdda://%1'
601 WriteRegStr HKCR "VLC.CDAudio\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'
606 SectionGroup /e !$Name_Section06 SEC06
607 SectionGroup $Name_SectionGroupAudio
608 !insertmacro MacroAudioExtensions RegisterExtensionSection
610 SectionGroup $Name_SectionGroupVideo
611 !insertmacro MacroVideoExtensions RegisterExtensionSection
613 SectionGroup $Name_SectionGroupOther
614 !insertmacro MacroOtherExtensions RegisterExtensionSection
618 Section $Name_Section07 SEC07
620 !insertmacro MacroAllExtensions AddContextMenu
621 !insertmacro AddContextMenuExt "Directory"
624 Section $Name_Section08 SEC08
625 !insertmacro delprefs
628 ; Installer section descriptions
629 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
630 !insertmacro MUI_DESCRIPTION_TEXT ${SEC01} $Desc_Section01
631 !insertmacro MUI_DESCRIPTION_TEXT ${SEC02a} $Desc_Section02a
632 !insertmacro MUI_DESCRIPTION_TEXT ${SEC02b} $Desc_Section02b
633 @BUILD_MOZILLA_TRUE@ !insertmacro MUI_DESCRIPTION_TEXT ${SEC03} $Desc_Section03
634 @BUILD_ACTIVEX_TRUE@ !insertmacro MUI_DESCRIPTION_TEXT ${SEC04} $Desc_Section04
635 !insertmacro MUI_DESCRIPTION_TEXT ${SEC05} $Desc_Section05
636 !insertmacro MUI_DESCRIPTION_TEXT ${SEC06} $Desc_Section06
637 !insertmacro MUI_DESCRIPTION_TEXT ${SEC07} $Desc_Section07
638 !insertmacro MUI_DESCRIPTION_TEXT ${SEC08} $Desc_Section08
639 !insertmacro MUI_FUNCTION_DESCRIPTION_END
643 !insertmacro MUI_LANGDLL_DISPLAY
645 !include "languages\english.nsh"
646 StrCmp $LANGUAGE ${LANG_FRENCH} French 0
647 StrCmp $LANGUAGE ${LANG_ITALIAN} Italian 0
648 StrCmp $LANGUAGE ${LANG_HUNGARIAN} Hungarian 0
649 StrCmp $LANGUAGE ${LANG_ROMANIAN} Romanian 0
650 StrCmp $LANGUAGE ${LANG_CATALAN} Catalan 0
651 StrCmp $LANGUAGE ${LANG_BULGARIAN} Bulgarian 0
652 StrCmp $LANGUAGE ${LANG_SLOVAK} Slovak 0
653 StrCmp $LANGUAGE ${LANG_POLISH} Polish 0
654 StrCmp $LANGUAGE ${LANG_DUTCH} Dutch 0
655 StrCmp $LANGUAGE ${LANG_SIMPCHINESE} SChinese 0
656 StrCmp $LANGUAGE ${LANG_FINNISH} Finnish 0
657 StrCmp $LANGUAGE ${LANG_PORTUGUESEBR} Brazilian EndLanguageCmp
659 !include "languages\french.nsh"
662 !include "languages\italian.nsh"
665 !include "languages\hungarian.nsh"
668 !include "languages\romanian.nsh"
671 !include "languages\catalan.nsh"
674 !include "languages\bulgarian.nsh"
677 !include "languages\slovak.nsh"
680 !include "languages\polish.nsh"
683 !include "languages\dutch.nsh"
686 !include "languages\schinese.nsh"
689 !include "languages\finnish.nsh"
692 !include "languages\brazilian_portuguese.nsh"
695 ReadRegStr $R0 ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
699 MessageBox MB_YESNO|MB_ICONEXCLAMATION $Message_AlreadyInstalled IDNO done
704 ExecWait '$R0 _?=$INSTDIR' ;Do not copy the uninstaller to a temp file
711 WriteUninstaller "$INSTDIR\uninstall.exe"
712 WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "InstallDir" $INSTDIR
713 WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "Version" "${VERSION}"
714 WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\vlc.exe"
716 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
717 "DisplayName" "$(^Name)"
718 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
719 "UninstallString" "$INSTDIR\uninstall.exe"
720 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
721 "DisplayIcon" "$INSTDIR\vlc.exe"
722 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
723 "DisplayVersion" "${PRODUCT_VERSION}"
724 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
725 "URLInfoAbout" "${PRODUCT_WEB_SITE}"
726 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
727 "Publisher" "${PRODUCT_PUBLISHER}"
730 ;;;;;;;;;;;;;;;;;;;;;;;;
731 ; Uninstaller sections ;
732 ;;;;;;;;;;;;;;;;;;;;;;;;
734 ; TrimNewlines (copied from NSIS documentation)
735 ; input, top of stack (e.g. whatever$\r$\n)
736 ; output, top of stack (replaces, with e.g. whatever)
737 ; modifies no other variables.
739 Function un.TrimNewlines
748 StrCmp $R2 "$\r" loop
749 StrCmp $R2 "$\n" loop
751 IntCmp $R1 0 no_trim_needed
760 Function un.RemoveEmptyDirs
762 !define Index 'Line${__LINE__}'
763 FindFirst $0 $1 "$INSTDIR$9*"
764 StrCmp $0 "" "${Index}-End"
766 StrCmp $1 "" "${Index}-End"
767 StrCmp $1 "." "${Index}-Next"
768 StrCmp $1 ".." "${Index}-Next"
773 Call un.RemoveEmptyDirs
787 Section "un.$Name_Section91" SEC91
789 SetShellVarContext all
791 !insertmacro MacroAllExtensions DeleteContextMenu
792 !insertmacro MacroAllExtensions UnRegisterExtensionSection
793 !insertmacro DeleteContextMenuExt "Directory"
795 ;remove activex plugin
796 UnRegDLL "$INSTDIR\axvlc.dll"
797 Delete /REBOOTOK "$INSTDIR\axvlc.dll"
798 Delete /REBOOTOK "$INSTDIR\axvlc.dll.manifest"
800 ;remove mozilla plugin
805 !define Index 'Line${__LINE__}'
811 EnumRegKey $R0 HKLM "SOFTWARE\Mozilla" "$R1"
812 StrCmp $R0 "" "${Index}-End"
814 ReadRegStr $R2 HKLM "SOFTWARE\Mozilla\$R0\Extensions" "Plugins"
815 StrCmp $R2 "" "${Index}-Loop" ""
817 ; old files (0.8.5 and before) that may be lying around
818 Delete /REBOOTOK "$R2\npvlc.dll"
819 Delete /REBOOTOK "$R2\libvlc.dll"
820 Delete /REBOOTOK "$R2\vlcintf.xpt"
825 Delete /REBOOTOK "$INSTDIR\npvlc.dll"
826 Delete /REBOOTOK "$INSTDIR\npvlc.dll.manifest"
828 RMDir "$SMPROGRAMS\VideoLAN"
829 RMDir /r $SMPROGRAMS\VideoLAN
831 FileOpen $UninstallLog "$INSTDIR\uninstall.log" r
834 FileRead $UninstallLog $R0
835 IfErrors UninstallEnd
839 Delete "$INSTDIR\$R0"
842 FileClose $UninstallLog
843 Delete "$INSTDIR\uninstall.log"
844 Delete "$INSTDIR\uninstall.exe"
846 Call un.RemoveEmptyDirs
849 DeleteRegKey HKLM Software\VideoLAN
851 DeleteRegKey HKCR Applications\vlc.exe
852 DeleteRegKey HKCR AudioCD\shell\PlayWithVLC
853 DeleteRegKey HKCR DVD\shell\PlayWithVLC
854 DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayDVDMovieOnArrival" "VLCPlayDVDMovieOnArrival"
855 DeleteRegKey HKLM Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival
856 DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayCDAudioOnArrival" "VLCPlayCDAudioOnArrival"
857 DeleteRegKey HKLM Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival
858 DeleteRegKey HKLM Software\Clients\Media\VLC
859 DeleteRegKey HKCR "VLC.MediaFile"
862 "SOFTWARE\MozillaPlugins\@videolan.org/vlc,version=${VERSION}"
865 "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
867 Delete "$DESKTOP\VLC media player.lnk"
869 DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
870 DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}"
874 Section /o "un.$Name_Section92" SEC92
875 !insertmacro delprefs
878 ; Uninstaller section descriptions
879 !insertmacro MUI_UNFUNCTION_DESCRIPTION_BEGIN
880 !insertmacro MUI_DESCRIPTION_TEXT ${SEC91} $Desc_Section91
881 !insertmacro MUI_DESCRIPTION_TEXT ${SEC92} $Desc_Section92
882 !insertmacro MUI_UNFUNCTION_DESCRIPTION_END
884 ;Function un.onUninstSuccess
886 ; MessageBox MB_ICONINFORMATION|MB_OK \
887 ; "$(^Name) was successfully removed from your computer."
891 !insertmacro MUI_UNGETLANGUAGE
893 !include "languages\english.nsh"
894 StrCmp $LANGUAGE ${LANG_FRENCH} French 0
895 StrCmp $LANGUAGE ${LANG_ITALIAN} Italian 0
896 StrCmp $LANGUAGE ${LANG_HUNGARIAN} Hungarian 0
897 StrCmp $LANGUAGE ${LANG_ROMANIAN} Romanian 0
898 StrCmp $LANGUAGE ${LANG_CATALAN} Catalan 0
899 StrCmp $LANGUAGE ${LANG_BULGARIAN} Bulgarian 0
900 StrCmp $LANGUAGE ${LANG_SLOVAK} Slovak 0
901 StrCmp $LANGUAGE ${LANG_POLISH} Polish 0
902 StrCmp $LANGUAGE ${LANG_DUTCH} Dutch 0
903 StrCmp $LANGUAGE ${LANG_SIMPCHINESE} SChinese 0
904 StrCmp $LANGUAGE ${LANG_FINNISH} Finnish 0
905 StrCmp $LANGUAGE ${LANG_PORTUGUESEBR} Brazilian EndLanguageCmp
907 !include "languages\french.nsh"
910 !include "languages\italian.nsh"
913 !include "languages\hungarian.nsh"
916 !include "languages\romanian.nsh"
919 !include "languages\catalan.nsh"
922 !include "languages\bulgarian.nsh"
925 !include "languages\slovak.nsh"
928 !include "languages\polish.nsh"
931 !include "languages\dutch.nsh"
934 !include "languages\schinese.nsh"
937 !include "languages\finnish.nsh"
940 !include "languages\brazilian_portuguese.nsh"