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"
26 ;;;;;;;;;;;;;;;;;;;;;;;;;
27 ; General configuration ;
28 ;;;;;;;;;;;;;;;;;;;;;;;;;
30 Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
31 OutFile ..\vlc-${VERSION}-win32.exe
32 InstallDir "$PROGRAMFILES\VideoLAN\VLC"
33 InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" ""
34 !ifdef NSIS_LZMA_COMPRESS_WHOLE
37 SetCompressor /SOLID lzma
41 ;ShowUnInstDetails show
44 BrandingText "${PRODUCT_GROUP} ${PRODUCT_NAME}"
46 InstType $Name_InstTypeRecommended
47 InstType $Name_InstTypeMinimum
48 InstType $Name_InstTypeFull
50 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
51 ; NSIS Modern User Interface configuration ;
52 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
54 ; MUI 1.67 compatible ------
58 !define MUI_ABORTWARNING
59 !define MUI_ICON "vlc.ico"
60 !define MUI_UNICON "vlc.ico"
61 !define MUI_COMPONENTSPAGE_SMALLDESC
65 !define MUI_WELCOMEPAGE_TITLE_3LINES
66 !insertmacro MUI_PAGE_WELCOME
68 !insertmacro MUI_PAGE_LICENSE "COPYING.txt"
70 !insertmacro MUI_PAGE_COMPONENTS
72 !insertmacro MUI_PAGE_DIRECTORY
74 !insertmacro MUI_PAGE_INSTFILES
76 !define MUI_FINISHPAGE_RUN "$INSTDIR\vlc.exe"
77 !define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\README.txt"
78 !define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED
79 !define MUI_FINISHPAGE_LINK $Link_VisitWebsite
80 !define MUI_FINISHPAGE_LINK_LOCATION "http://www.videolan.org/vlc/"
81 !define MUI_FINISHPAGE_NOREBOOTSUPPORT
82 !insertmacro MUI_PAGE_FINISH
85 !insertmacro MUI_UNPAGE_CONFIRM
86 !insertmacro MUI_UNPAGE_COMPONENTS
87 !insertmacro MUI_UNPAGE_INSTFILES
88 !insertmacro MUI_UNPAGE_FINISH
91 !insertmacro MUI_LANGUAGE "English" # first language is the default language
92 !insertmacro MUI_LANGUAGE "French"
93 !insertmacro MUI_LANGUAGE "German"
94 !insertmacro MUI_LANGUAGE "Spanish"
95 !insertmacro MUI_LANGUAGE "SimpChinese"
96 !insertmacro MUI_LANGUAGE "TradChinese"
97 !insertmacro MUI_LANGUAGE "Japanese"
98 !insertmacro MUI_LANGUAGE "Korean"
99 !insertmacro MUI_LANGUAGE "Italian"
100 !insertmacro MUI_LANGUAGE "Dutch"
101 !insertmacro MUI_LANGUAGE "Danish"
102 !insertmacro MUI_LANGUAGE "Swedish"
103 !insertmacro MUI_LANGUAGE "Norwegian"
104 !insertmacro MUI_LANGUAGE "Finnish"
105 !insertmacro MUI_LANGUAGE "Greek"
106 !insertmacro MUI_LANGUAGE "Russian"
107 !insertmacro MUI_LANGUAGE "Portuguese"
108 !insertmacro MUI_LANGUAGE "PortugueseBR"
109 !insertmacro MUI_LANGUAGE "Arabic"
110 !insertmacro MUI_LANGUAGE "Polish"
111 !insertmacro MUI_LANGUAGE "Romanian"
112 !insertmacro MUI_LANGUAGE "Slovak"
113 !insertmacro MUI_LANGUAGE "Czech"
114 !insertmacro MUI_LANGUAGE "Hungarian"
115 !insertmacro MUI_LANGUAGE "Catalan"
116 !insertmacro MUI_LANGUAGE "Bulgarian"
118 ; Reserve files for solid compression
119 !insertmacro MUI_RESERVEFILE_LANGDLL
120 !insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
124 ;;;;;;;;;;;;;;;;;;;;;;;
125 ; Macro and Functions ;
126 ;;;;;;;;;;;;;;;;;;;;;;;
128 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
129 ; 1. File type associations ;
130 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
132 ;; Function that register one extension for VLC
133 Function RegisterExtension
134 ; back up old value for extension $R0 (eg. ".opt")
135 ReadRegStr $1 HKCR "$R0" ""
136 StrCmp $1 "" NoBackup
137 StrCmp $1 "VLC$R0" "NoBackup"
138 WriteRegStr HKCR "$R0" "VLC.backup" $1
140 WriteRegStr HKCR "$R0" "" "VLC$R0"
141 ReadRegStr $0 HKCR "VLC$R0" ""
142 WriteRegStr HKCR "VLC$R0" "" "VLC media file ($R0)"
143 WriteRegStr HKCR "VLC$R0\shell" "" "Play"
144 WriteRegStr HKCR "VLC$R0\shell\Play" "" $ShellAssociation_Play
145 WriteRegStr HKCR "VLC$R0\shell\Play\command" "" '"$INSTDIR\vlc.exe" --started-from-file "%1"'
146 WriteRegStr HKCR "VLC$R0\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'
150 ReadRegStr $R1 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion
152 StrCmp $R2 '6.0' ForVista ToEnd
154 WriteRegStr HKLM "Software\Clients\Media\VLC\Capabilities\FileAssociations" "$R0" "VLC$R0"
159 ;; Function that removes one extension that VLC owns.
160 Function un.RegisterExtension
161 ;start of restore script
162 ReadRegStr $1 HKCR "$R0" ""
163 StrCmp $1 "VLC$R0" 0 NoOwn ; only do this if we own it
164 ; Read the old value from Backup
165 ReadRegStr $1 HKCR "$R0" "VLC.backup"
166 StrCmp $1 "" 0 Restore ; if backup="" then delete the whole key
167 DeleteRegKey HKCR "$R0"
170 WriteRegStr HKCR "$R0" "" $1
171 DeleteRegValue HKCR "$R0" "VLC.backup"
173 DeleteRegKey HKCR "VLC$R0" ;Delete key with association settings
174 DeleteRegKey HKLM "Software\Clients\Media\VLC\Capabilities\FileAssociations\VLC$R0" ; for vista
177 !macro RegisterExtensionSection EXT
182 Call RegisterExtension
187 !macro UnRegisterExtensionSection EXT
190 Call un.RegisterExtension
194 !macro WriteRegStrSupportedTypes EXT
195 WriteRegStr HKCR Applications\vlc.exe\SupportedTypes ${EXT} ""
198 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
199 ; Extension lists Macros ;
200 ; Those macros calls the previous functions ;
201 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
203 !macro MacroAudioExtensions _action
204 !insertmacro ${_action} ".a52"
205 !insertmacro ${_action} ".aac"
206 !insertmacro ${_action} ".ac3"
207 !insertmacro ${_action} ".dts"
208 !insertmacro ${_action} ".flac"
209 !insertmacro ${_action} ".m4a"
210 !insertmacro ${_action} ".m4p"
211 !insertmacro ${_action} ".mka"
212 !insertmacro ${_action} ".mod"
213 !insertmacro ${_action} ".mp1"
214 !insertmacro ${_action} ".mp2"
215 !insertmacro ${_action} ".mp3"
216 !insertmacro ${_action} ".oma"
217 !insertmacro ${_action} ".oga"
218 !insertmacro ${_action} ".spx"
219 !insertmacro ${_action} ".wav"
220 !insertmacro ${_action} ".wma"
221 !insertmacro ${_action} ".wv"
222 !insertmacro ${_action} ".xm"
225 !macro MacroVideoExtensions _action
226 !insertmacro ${_action} ".asf"
227 !insertmacro ${_action} ".avi"
228 !insertmacro ${_action} ".divx"
229 !insertmacro ${_action} ".dv"
230 !insertmacro ${_action} ".flv"
231 !insertmacro ${_action} ".gxf"
232 !insertmacro ${_action} ".m1v"
233 !insertmacro ${_action} ".m2v"
234 !insertmacro ${_action} ".m2ts"
235 !insertmacro ${_action} ".m4v"
236 !insertmacro ${_action} ".mkv"
237 !insertmacro ${_action} ".mov"
238 !insertmacro ${_action} ".mp4"
239 !insertmacro ${_action} ".mpeg"
240 !insertmacro ${_action} ".mpeg1"
241 !insertmacro ${_action} ".mpeg2"
242 !insertmacro ${_action} ".mpeg4"
243 !insertmacro ${_action} ".mpg"
244 !insertmacro ${_action} ".mts"
245 !insertmacro ${_action} ".mxf"
246 !insertmacro ${_action} ".nuv"
247 !insertmacro ${_action} ".ogg"
248 !insertmacro ${_action} ".ogm"
249 !insertmacro ${_action} ".ogx"
250 !insertmacro ${_action} ".ogv"
251 !insertmacro ${_action} ".rmvb"
252 !insertmacro ${_action} ".ts"
253 !insertmacro ${_action} ".vob"
254 !insertmacro ${_action} ".wmv"
257 !macro MacroOtherExtensions _action
258 !insertmacro ${_action} ".asx"
259 !insertmacro ${_action} ".bin"
260 !insertmacro ${_action} ".cue"
261 !insertmacro ${_action} ".m3u"
262 !insertmacro ${_action} ".pls"
263 !insertmacro ${_action} ".vlc"
264 !insertmacro ${_action} ".xspf"
267 ; One macro to rule them all
268 !macro MacroAllExtensions _action
269 !insertmacro MacroAudioExtensions ${_action}
270 !insertmacro MacroVideoExtensions ${_action}
271 !insertmacro MacroOtherExtensions ${_action}
274 ;;;;;;;;;;;;;;;;;;;;;;;;;;;
275 ; 2. Context menu entries ;
276 ;;;;;;;;;;;;;;;;;;;;;;;;;;;
278 ; Generic function for adding the context menu for one ext.
279 !macro AddContextMenuExt EXT
280 WriteRegStr HKCR ${EXT}\shell\PlayWithVLC "" $ContextMenuEntry_PlayWith
281 WriteRegStr HKCR ${EXT}\shell\PlayWithVLC\command "" '"$INSTDIR\vlc.exe" --started-from-file --no-playlist-enqueue "%1"'
283 WriteRegStr HKCR ${EXT}\shell\AddToPlaylistVLC "" $ContextMenuEntry_AddToPlaylist
284 WriteRegStr HKCR ${EXT}\shell\AddToPlaylistVLC\command "" '"$INSTDIR\vlc.exe" --started-from-file --playlist-enqueue "%1"'
287 !macro AddContextMenu EXT
289 ReadRegStr $R0 HKCR ${EXT} ""
290 !insertmacro AddContextMenuExt $R0
294 !macro DeleteContextMenuExt EXT
295 DeleteRegKey HKCR ${EXT}\shell\PlayWithVLC
296 DeleteRegKey HKCR ${EXT}\shell\AddToPlaylistVLC
299 !macro DeleteContextMenu EXT
301 ReadRegStr $R0 HKCR ${EXT} ""
302 !insertmacro DeleteContextMenuExt $R0
306 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
307 ; 3. Delete prefs and cache ;
308 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
312 !define Index 'Line${__LINE__}'
315 ; this will loop through all the logged users and "virtual" windows users
316 ; (it looks like users are only present in HKEY_USERS when they are logged in)
318 EnumRegKey $1 HKU "" $0
319 StrCmp $1 "" "${Index}-End"
321 ReadRegStr $2 HKU "$1\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" AppData
322 StrCmp $2 "" "${Index}-Loop"
333 !macro OpenUninstallLog
334 FileOpen $UninstallLog "$INSTDIR\uninstall.log" a
335 FileSeek $UninstallLog 0 END
338 !macro CloseUninstallLog
339 FileClose $UninstallLog
340 SetFileAttributes "$INSTDIR\uninstall.log" HIDDEN
346 !macro InstallFile FILEREGEX
348 !define Index 'Line${__LINE__}'
349 FindFirst $0 $1 "$INSTDIR\${FILEREGEX}"
350 StrCmp $0 "" "${Index}-End"
352 StrCmp $1 "" "${Index}-End"
353 FileWrite $UninstallLog "$1$\r$\n"
360 !macro InstallFolder FOLDER
363 Call InstallFolderInternal
366 Function InstallFolderInternal
368 !define Index 'Line${__LINE__}'
369 FindFirst $0 $1 "$INSTDIR\$9\*"
370 StrCmp $0 "" "${Index}-End"
372 StrCmp $1 "" "${Index}-End"
373 StrCmp $1 "." "${Index}-Next"
374 StrCmp $1 ".." "${Index}-Next"
375 IfFileExists "$9\$1\*" 0 "${Index}-Write"
379 Call InstallFolderInternal
384 FileWrite $UninstallLog "$9\$1$\r$\n"
394 ;;;;;;;;;;;;;;;;;;;;;;
395 ; Installer sections ;
398 ;;;;;;;;;;;;;;;;;;;;;;
400 Section $Name_Section01 SEC01
402 SetShellVarContext all
403 SetOutPath "$INSTDIR"
405 !insertmacro OpenUninstallLog
407 ; VLC.exe, libvlc.dll
408 !insertmacro InstallFile vlc.exe
409 !insertmacro InstallFile vlc.exe.manifest
412 !insertmacro InstallFile *.dll
415 !insertmacro InstallFile *.txt
418 !insertmacro InstallFolder plugins
419 !insertmacro InstallFolder locale
420 !insertmacro InstallFolder osdmenu
421 !insertmacro InstallFolder skins
422 !insertmacro InstallFolder http
423 !insertmacro InstallFolder lua
426 WriteIniStr "$INSTDIR\${PRODUCT_GROUP} Website.url" "InternetShortcut" "URL" \
427 "${PRODUCT_WEB_SITE}"
428 FileWrite $UninstallLog "${PRODUCT_GROUP} Website.url$\r$\n"
429 WriteIniStr "$INSTDIR\Documentation.url" "InternetShortcut" "URL" \
430 "${PRODUCT_WEB_SITE}/doc/"
431 FileWrite $UninstallLog "Documentation.url$\r$\n"
432 WriteIniStr "$INSTDIR\New_Skins.url" "InternetShortcut" "URL" \
433 "${PRODUCT_WEB_SITE}/vlc/skins.php"
434 FileWrite $UninstallLog "New_Skins.url$\r$\n"
436 !insertmacro CloseUninstallLog
438 ; Add VLC to "recomended programs" for the following extensions
439 WriteRegStr HKCR Applications\vlc.exe "" ""
440 WriteRegStr HKCR Applications\vlc.exe "FriendlyAppName" "VLC media player"
441 WriteRegStr HKCR Applications\vlc.exe\shell\Play "" $ContextMenuEntry_PlayWith
442 WriteRegStr HKCR Applications\vlc.exe\shell\Play\command "" \
443 '"$INSTDIR\vlc.exe" --started-from-file "%1"'
444 !insertmacro MacroAllExtensions WriteRegStrSupportedTypes
448 ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion
450 StrCmp $R1 '6.0' lbl_vista lbl_done
453 WriteRegStr HKLM "Software\RegisteredApplications" "VLC" "Software\Clients\Media\VLC\Capabilities"
454 WriteRegStr HKLM "Software\Clients\Media\VLC\Capabilities" "ApplicationName" "VLC media player"
455 WriteRegStr HKLM "Software\Clients\Media\VLC\Capabilities" "ApplicationDescription" "VLC - The video swiss knife"
460 Section $Name_Section02a SEC02a
462 CreateDirectory "$SMPROGRAMS\VideoLAN"
463 CreateDirectory "$SMPROGRAMS\VideoLAN\Quick Settings"
464 CreateDirectory "$SMPROGRAMS\VideoLAN\Quick Settings\Audio"
465 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Audio\Set Audio mode to DirectX (default).lnk" \
466 "$INSTDIR\vlc.exe" "--aout aout_directx --save-config vlc://quit"
467 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Audio\Set Audio mode to Waveout.lnk" \
468 "$INSTDIR\vlc.exe" "--aout waveout --save-config vlc://quit"
469 CreateDirectory "$SMPROGRAMS\VideoLAN\Quick Settings\Interface"
470 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Interface\Set Main Interface to Skinnable.lnk" \
471 "$INSTDIR\vlc.exe" "-I skins --save-config vlc://quit"
472 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Interface\Set Main Interface to Qt (default).lnk" \
473 "$INSTDIR\vlc.exe" "-I qt --save-config vlc://quit"
474 CreateDirectory "$SMPROGRAMS\VideoLAN\Quick Settings\Video"
475 ; FIXME add detection for Vista. Direct3D will be default there, for all others it's DirectX
476 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to Direct3D.lnk" \
477 "$INSTDIR\vlc.exe" "--vout direct3d --overlay --directx-hw-yuv --save-config vlc://quit"
478 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to Direct3D (no hardware acceleration).lnk" \
479 "$INSTDIR\vlc.exe" "--vout direct3d --overlay --no-directx-hw-yuv --save-config vlc://quit"
480 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to DirectX.lnk" \
481 "$INSTDIR\vlc.exe" "--vout directx --overlay --directx-hw-yuv --save-config vlc://quit"
482 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to DirectX (no hardware acceleration).lnk" \
483 "$INSTDIR\vlc.exe" "--vout directx --no-overlay --no-directx-hw-yuv --save-config vlc://quit"
484 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to DirectX (no video overlay).lnk" \
485 "$INSTDIR\vlc.exe" "--vout directx --no-overlay --directx-hw-yuv --save-config vlc://quit"
486 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to OpenGL.lnk" \
487 "$INSTDIR\vlc.exe" "--vout opengl --overlay --save-config vlc://quit"
488 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Reset VLC media player preferences and cache files.lnk" \
489 "$INSTDIR\vlc.exe" "--reset-config --reset-plugins-cache vlc://quit"
490 CreateShortCut "$SMPROGRAMS\VideoLAN\Documentation.lnk" \
491 "$INSTDIR\Documentation.url"
492 CreateShortCut "$SMPROGRAMS\VideoLAN\Release Notes.lnk" \
493 "$INSTDIR\NEWS.txt" ""
494 CreateShortCut "$SMPROGRAMS\VideoLAN\${PRODUCT_GROUP} Website.lnk" \
495 "$INSTDIR\${PRODUCT_GROUP} Website.url"
496 CreateShortCut "$SMPROGRAMS\VideoLAN\VLC media player.lnk" \
497 "$INSTDIR\vlc.exe" ""
500 Section $Name_Section02b SEC02b
502 CreateShortCut "$DESKTOP\VLC media player.lnk" \
503 "$INSTDIR\vlc.exe" ""
506 Section /o $Name_Section03 SEC03
509 SetOutPath "$INSTDIR"
510 !insertmacro OpenUninstallLog
511 !insertmacro InstallFile mozilla\npvlc.dll
512 !insertmacro InstallFile mozilla\npvlc.dll.manifest
513 !insertmacro CloseUninstallLog
515 !define Moz "SOFTWARE\MozillaPlugins\@videolan.org/vlc,version=${VERSION}"
516 WriteRegStr HKLM ${Moz} "Description" "VLC Multimedia Plugin"
517 WriteRegStr HKLM ${Moz} "Path" "$INSTDIR\npvlc.dll"
518 WriteRegStr HKLM ${Moz} "Product" "VLC media player"
519 WriteRegStr HKLM ${Moz} "Vendor" "VideoLAN"
520 WriteRegStr HKLM ${Moz} "Version" "${VERSION}"
522 ; for very old version of mozilla, these lines may be needed
527 ;!define Index 'Line${__LINE__}'
533 ; EnumRegKey $R0 HKLM "SOFTWARE\Mozilla" "$R1"
534 ; StrCmp $R0 "" "${Index}-End"
536 ; ReadRegStr $R2 HKLM "SOFTWARE\Mozilla\$R0\Extensions" "Plugins"
537 ; StrCmp $R2 "" "${Index}-Loop" ""
539 ; CopyFiles "$INSTDIR\npvlc.dll" "$R2"
541 ; CopyFiles ${LIBVLC_DLL} "$R2"
543 ; !ifdef LIBVLC_CONTROL_DLL
544 ; CopyFiles ${LIBVLC_CONTROL_DLL} "$R2"
546 ; Goto "${Index}-Loop"
553 Section $Name_Section04 SEC04
555 SetOutPath "$INSTDIR"
556 !insertmacro OpenUninstallLog
557 !insertmacro InstallFile activex\axvlc.dll
558 !insertmacro InstallFile activex\axvlc.dll.manifest
559 !insertmacro CloseUninstallLog
560 RegDLL "$INSTDIR\axvlc.dll"
564 Section $Name_Section05 SEC05
566 WriteRegStr HKCR "AudioCD\shell\PlayWithVLC" "" $ContextMenuEntry_PlayWith
567 WriteRegStr HKCR "AudioCD\shell\PlayWithVLC\command" "" \
568 '"$INSTDIR\vlc.exe" --started-from-file cdda://%1'
569 WriteRegStr HKCR "DVD\shell\PlayWithVLC" "" $ContextMenuEntry_PlayWith
570 WriteRegStr HKCR "DVD\shell\PlayWithVLC\command" "" \
571 '"$INSTDIR\vlc.exe" --started-from-file dvd://%1'
573 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayDVDMovieOnArrival" "VLCPlayDVDMovieOnArrival" ""
574 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "Action" $Action_OnArrivalDVD
575 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "DefaultIcon" '"$INSTDIR\vlc.exe",0'
576 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "InvokeProgID" "VLC.DVDMovie"
577 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "InvokeVerb" "play"
578 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "Provider" "VideoLAN VLC media player"
580 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayCDAudioOnArrival" "VLCPlayCDAudioOnArrival" ""
581 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "Action" $Action_OnArrivalAudioCD
582 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "DefaultIcon" '"$INSTDIR\vlc.exe",0'
583 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "InvokeProgID" "VLC.CDAudio"
584 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "InvokeVerb" "play"
585 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "Provider" "VideoLAN VLC media player"
586 WriteRegStr HKCR "VLC.DVDMovie" "" "VLC DVD Movie"
587 WriteRegStr HKCR "VLC.DVDMovie\shell" "" "Play"
588 WriteRegStr HKCR "VLC.DVDMovie\shell\Play\command" "" \
589 '"$INSTDIR\vlc.exe" --started-from-file dvd://%1'
590 WriteRegStr HKCR "VLC.DVDMovie\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'
591 WriteRegStr HKCR "VLC.CDAudio" "" "VLC CD Audio"
592 WriteRegStr HKCR "VLC.CDAudio\shell" "" "Play"
593 WriteRegStr HKCR "VLC.CDAudio\shell\Play\command" "" \
594 '"$INSTDIR\vlc.exe" --started-from-file cdda://%1'
595 WriteRegStr HKCR "VLC.CDAudio\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'
600 SectionGroup /e !$Name_Section06 SEC06
601 SectionGroup $Name_SectionGroupAudio
602 !insertmacro MacroAudioExtensions RegisterExtensionSection
604 SectionGroup $Name_SectionGroupVideo
605 !insertmacro MacroVideoExtensions RegisterExtensionSection
607 SectionGroup $Name_SectionGroupOther
608 !insertmacro MacroOtherExtensions RegisterExtensionSection
612 Section $Name_Section07 SEC07
614 !insertmacro MacroAllExtensions AddContextMenu
615 !insertmacro AddContextMenuExt "Directory"
618 Section $Name_Section08 SEC08
619 !insertmacro delprefs
622 ; Installer section descriptions
623 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
624 !insertmacro MUI_DESCRIPTION_TEXT ${SEC01} $Desc_Section01
625 !insertmacro MUI_DESCRIPTION_TEXT ${SEC02a} $Desc_Section02a
626 !insertmacro MUI_DESCRIPTION_TEXT ${SEC02b} $Desc_Section02b
627 !insertmacro MUI_DESCRIPTION_TEXT ${SEC03} $Desc_Section03
628 !insertmacro MUI_DESCRIPTION_TEXT ${SEC04} $Desc_Section04
629 !insertmacro MUI_DESCRIPTION_TEXT ${SEC05} $Desc_Section05
630 !insertmacro MUI_DESCRIPTION_TEXT ${SEC06} $Desc_Section06
631 !insertmacro MUI_DESCRIPTION_TEXT ${SEC07} $Desc_Section07
632 !insertmacro MUI_DESCRIPTION_TEXT ${SEC08} $Desc_Section08
633 !insertmacro MUI_FUNCTION_DESCRIPTION_END
637 !insertmacro MUI_LANGDLL_DISPLAY
639 !include "languages\english.nsh"
640 StrCmp $LANGUAGE ${LANG_FRENCH} French 0
641 StrCmp $LANGUAGE ${LANG_ITALIAN} Italian 0
642 StrCmp $LANGUAGE ${LANG_HUNGARIAN} Hungarian 0
643 StrCmp $LANGUAGE ${LANG_ROMANIAN} Romanian 0
644 StrCmp $LANGUAGE ${LANG_CATALAN} Catalan 0
645 StrCmp $LANGUAGE ${LANG_BULGARIAN} Bulgarian 0
646 StrCmp $LANGUAGE ${LANG_SLOVAK} Slovak 0
647 StrCmp $LANGUAGE ${LANG_POLISH} Polish 0
648 StrCmp $LANGUAGE ${LANG_DUTCH} Dutch 0
649 StrCmp $LANGUAGE ${LANG_SIMPCHINESE} SChinese 0
650 StrCmp $LANGUAGE ${LANG_FINNISH} Finnish 0
651 StrCmp $LANGUAGE ${LANG_PORTUGUESEBR} Brazilian EndLanguageCmp
653 !include "languages\french.nsh"
656 !include "languages\italian.nsh"
659 !include "languages\hungarian.nsh"
662 !include "languages\romanian.nsh"
665 !include "languages\catalan.nsh"
668 !include "languages\bulgarian.nsh"
671 !include "languages\slovak.nsh"
674 !include "languages\polish.nsh"
677 !include "languages\dutch.nsh"
680 !include "languages\schinese.nsh"
683 !include "languages\finnish.nsh"
686 !include "languages\brazilian_portuguese.nsh"
689 ReadRegStr $R0 ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
693 MessageBox MB_YESNO|MB_ICONEXCLAMATION $Message_AlreadyInstalled IDNO done
698 ExecWait '$R0 _?=$INSTDIR' ;Do not copy the uninstaller to a temp file
705 WriteUninstaller "$INSTDIR\uninstall.exe"
706 WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "InstallDir" $INSTDIR
707 WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "Version" "${VERSION}"
708 WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\vlc.exe"
710 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
711 "DisplayName" "$(^Name)"
712 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
713 "UninstallString" "$INSTDIR\uninstall.exe"
714 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
715 "DisplayIcon" "$INSTDIR\vlc.exe"
716 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
717 "DisplayVersion" "${PRODUCT_VERSION}"
718 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
719 "URLInfoAbout" "${PRODUCT_WEB_SITE}"
720 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
721 "Publisher" "${PRODUCT_PUBLISHER}"
724 ;;;;;;;;;;;;;;;;;;;;;;;;
725 ; Uninstaller sections ;
726 ;;;;;;;;;;;;;;;;;;;;;;;;
728 ; TrimNewlines (copied from NSIS documentation)
729 ; input, top of stack (e.g. whatever$\r$\n)
730 ; output, top of stack (replaces, with e.g. whatever)
731 ; modifies no other variables.
733 Function un.TrimNewlines
742 StrCmp $R2 "$\r" loop
743 StrCmp $R2 "$\n" loop
745 IntCmp $R1 0 no_trim_needed
754 Function un.RemoveEmptyDirs
756 !define Index 'Line${__LINE__}'
757 FindFirst $0 $1 "$INSTDIR$9*"
758 StrCmp $0 "" "${Index}-End"
760 StrCmp $1 "" "${Index}-End"
761 StrCmp $1 "." "${Index}-Next"
762 StrCmp $1 ".." "${Index}-Next"
767 Call un.RemoveEmptyDirs
781 Section "un.$Name_Section91" SEC91
783 SetShellVarContext all
785 !insertmacro MacroAllExtensions DeleteContextMenu
786 !insertmacro MacroAllExtensions UnRegisterExtensionSection
787 !insertmacro DeleteContextMenuExt "Directory"
789 ;remove activex plugin
790 UnRegDLL "$INSTDIR\axvlc.dll"
791 Delete /REBOOTOK "$INSTDIR\axvlc.dll"
792 Delete /REBOOTOK "$INSTDIR\axvlc.dll.manifest"
794 ;remove mozilla plugin
799 !define Index 'Line${__LINE__}'
805 EnumRegKey $R0 HKLM "SOFTWARE\Mozilla" "$R1"
806 StrCmp $R0 "" "${Index}-End"
808 ReadRegStr $R2 HKLM "SOFTWARE\Mozilla\$R0\Extensions" "Plugins"
809 StrCmp $R2 "" "${Index}-Loop" ""
811 ; old files (0.8.5 and before) that may be lying around
812 Delete /REBOOTOK "$R2\npvlc.dll"
813 Delete /REBOOTOK "$R2\libvlc.dll"
814 Delete /REBOOTOK "$R2\vlcintf.xpt"
819 Delete /REBOOTOK "$INSTDIR\npvlc.dll"
820 Delete /REBOOTOK "$INSTDIR\npvlc.dll.manifest"
822 RMDir "$SMPROGRAMS\VideoLAN"
823 RMDir /r $SMPROGRAMS\VideoLAN
825 FileOpen $UninstallLog "$INSTDIR\uninstall.log" r
828 FileRead $UninstallLog $R0
829 IfErrors UninstallEnd
833 Delete "$INSTDIR\$R0"
836 FileClose $UninstallLog
837 Delete "$INSTDIR\uninstall.log"
838 Delete "$INSTDIR\uninstall.exe"
840 Call un.RemoveEmptyDirs
843 DeleteRegKey HKLM Software\VideoLAN
845 DeleteRegKey HKCR Applications\vlc.exe
846 DeleteRegKey HKCR AudioCD\shell\PlayWithVLC
847 DeleteRegKey HKCR DVD\shell\PlayWithVLC
848 DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayDVDMovieOnArrival" "VLCPlayDVDMovieOnArrival"
849 DeleteRegKey HKLM Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival
850 DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayCDAudioOnArrival" "VLCPlayCDAudioOnArrival"
851 DeleteRegKey HKLM Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival
852 DeleteRegKey HKLM Software\Clients\Media\VLC
853 DeleteRegKey HKCR "VLC.MediaFile"
856 "SOFTWARE\MozillaPlugins\@videolan.org/vlc,version=${VERSION}"
859 "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
861 Delete "$DESKTOP\VLC media player.lnk"
863 DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
864 DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}"
868 Section /o "un.$Name_Section92" SEC92
869 !insertmacro delprefs
872 ; Uninstaller section descriptions
873 !insertmacro MUI_UNFUNCTION_DESCRIPTION_BEGIN
874 !insertmacro MUI_DESCRIPTION_TEXT ${SEC91} $Desc_Section91
875 !insertmacro MUI_DESCRIPTION_TEXT ${SEC92} $Desc_Section92
876 !insertmacro MUI_UNFUNCTION_DESCRIPTION_END
878 ;Function un.onUninstSuccess
880 ; MessageBox MB_ICONINFORMATION|MB_OK \
881 ; "$(^Name) was successfully removed from your computer."
885 !insertmacro MUI_UNGETLANGUAGE
887 !include "languages\english.nsh"
888 StrCmp $LANGUAGE ${LANG_FRENCH} French 0
889 StrCmp $LANGUAGE ${LANG_ITALIAN} Italian 0
890 StrCmp $LANGUAGE ${LANG_HUNGARIAN} Hungarian 0
891 StrCmp $LANGUAGE ${LANG_ROMANIAN} Romanian 0
892 StrCmp $LANGUAGE ${LANG_CATALAN} Catalan 0
893 StrCmp $LANGUAGE ${LANG_BULGARIAN} Bulgarian 0
894 StrCmp $LANGUAGE ${LANG_SLOVAK} Slovak 0
895 StrCmp $LANGUAGE ${LANG_POLISH} Polish 0
896 StrCmp $LANGUAGE ${LANG_DUTCH} Dutch 0
897 StrCmp $LANGUAGE ${LANG_SIMPCHINESE} SChinese 0
898 StrCmp $LANGUAGE ${LANG_FINNISH} Finnish 0
899 StrCmp $LANGUAGE ${LANG_PORTUGUESEBR} Brazilian EndLanguageCmp
901 !include "languages\french.nsh"
904 !include "languages\italian.nsh"
907 !include "languages\hungarian.nsh"
910 !include "languages\romanian.nsh"
913 !include "languages\catalan.nsh"
916 !include "languages\bulgarian.nsh"
919 !include "languages\slovak.nsh"
922 !include "languages\polish.nsh"
925 !include "languages\dutch.nsh"
928 !include "languages\schinese.nsh"
931 !include "languages\finnish.nsh"
934 !include "languages\brazilian_portuguese.nsh"