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 "Arabic"
109 !insertmacro MUI_LANGUAGE "Polish"
110 !insertmacro MUI_LANGUAGE "Romanian"
111 !insertmacro MUI_LANGUAGE "Slovak"
112 !insertmacro MUI_LANGUAGE "Czech"
113 !insertmacro MUI_LANGUAGE "Hungarian"
115 ; Reserve files for solid compression
116 !insertmacro MUI_RESERVEFILE_LANGDLL
117 !insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
121 ;;;;;;;;;;;;;;;;;;;;;;;
122 ; Macro and Functions ;
123 ;;;;;;;;;;;;;;;;;;;;;;;
125 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
126 ; 1. File type associations ;
127 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
129 ;; Function that register one extension for VLC
130 Function RegisterExtension
131 ; back up old value for extension $R0 (eg. ".opt")
132 ReadRegStr $1 HKCR "$R0" ""
133 StrCmp $1 "" NoBackup
134 StrCmp $1 "VLC$R0" "NoBackup"
135 WriteRegStr HKCR "$R0" "VLC.backup" $1
137 WriteRegStr HKCR "$R0" "" "VLC$R0"
138 ReadRegStr $0 HKCR "VLC$R0" ""
139 WriteRegStr HKCR "VLC$R0" "" "VLC media file ($R0)"
140 WriteRegStr HKCR "VLC$R0\shell" "" "Play"
141 WriteRegStr HKCR "VLC$R0\shell\Play" "" $ShellAssociation_Play
142 WriteRegStr HKCR "VLC$R0\shell\Play\command" "" '"$INSTDIR\vlc.exe" --started-from-file "%1"'
143 WriteRegStr HKCR "VLC$R0\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'
147 ReadRegStr $R1 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion
149 StrCmp $R2 '6.0' ForVista ToEnd
151 WriteRegStr HKLM "Software\Clients\Media\VLC\Capabilities\FileAssociations" "$R0" "VLC$R0"
156 ;; Function that removes one extension that VLC owns.
157 Function un.RegisterExtension
158 ;start of restore script
159 ReadRegStr $1 HKCR "$R0" ""
160 StrCmp $1 "VLC$R0" 0 NoOwn ; only do this if we own it
161 ; Read the old value from Backup
162 ReadRegStr $1 HKCR "$R0" "VLC.backup"
163 StrCmp $1 "" 0 Restore ; if backup="" then delete the whole key
164 DeleteRegKey HKCR "$R0"
167 WriteRegStr HKCR "$R0" "" $1
168 DeleteRegValue HKCR "$R0" "VLC.backup"
170 DeleteRegKey HKCR "VLC$R0" ;Delete key with association settings
171 DeleteRegKey HKLM "Software\Clients\Media\VLC\Capabilities\FileAssociations\VLC$R0" ; for vista
174 !macro RegisterExtensionSection EXT
179 Call RegisterExtension
184 !macro UnRegisterExtensionSection EXT
187 Call un.RegisterExtension
191 !macro WriteRegStrSupportedTypes EXT
192 WriteRegStr HKCR Applications\vlc.exe\SupportedTypes ${EXT} ""
195 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
196 ; Extension lists Macros ;
197 ; Those macros calls the previous functions ;
198 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
200 !macro MacroAudioExtensions _action
201 !insertmacro ${_action} ".a52"
202 !insertmacro ${_action} ".aac"
203 !insertmacro ${_action} ".ac3"
204 !insertmacro ${_action} ".dts"
205 !insertmacro ${_action} ".flac"
206 !insertmacro ${_action} ".m4a"
207 !insertmacro ${_action} ".m4p"
208 !insertmacro ${_action} ".mka"
209 !insertmacro ${_action} ".mod"
210 !insertmacro ${_action} ".mp1"
211 !insertmacro ${_action} ".mp2"
212 !insertmacro ${_action} ".mp3"
213 !insertmacro ${_action} ".oma"
214 !insertmacro ${_action} ".oga"
215 !insertmacro ${_action} ".spx"
216 !insertmacro ${_action} ".wav"
217 !insertmacro ${_action} ".wma"
218 !insertmacro ${_action} ".wv"
219 !insertmacro ${_action} ".xm"
222 !macro MacroVideoExtensions _action
223 !insertmacro ${_action} ".asf"
224 !insertmacro ${_action} ".avi"
225 !insertmacro ${_action} ".divx"
226 !insertmacro ${_action} ".dv"
227 !insertmacro ${_action} ".flv"
228 !insertmacro ${_action} ".gxf"
229 !insertmacro ${_action} ".m1v"
230 !insertmacro ${_action} ".m2v"
231 !insertmacro ${_action} ".m2ts"
232 !insertmacro ${_action} ".m4v"
233 !insertmacro ${_action} ".mkv"
234 !insertmacro ${_action} ".mov"
235 !insertmacro ${_action} ".mp4"
236 !insertmacro ${_action} ".mpeg"
237 !insertmacro ${_action} ".mpeg1"
238 !insertmacro ${_action} ".mpeg2"
239 !insertmacro ${_action} ".mpeg4"
240 !insertmacro ${_action} ".mpg"
241 !insertmacro ${_action} ".mts"
242 !insertmacro ${_action} ".mxf"
243 !insertmacro ${_action} ".nuv"
244 !insertmacro ${_action} ".ogg"
245 !insertmacro ${_action} ".ogm"
246 !insertmacro ${_action} ".ogx"
247 !insertmacro ${_action} ".ogv"
248 !insertmacro ${_action} ".rmvb"
249 !insertmacro ${_action} ".ts"
250 !insertmacro ${_action} ".vob"
251 !insertmacro ${_action} ".wmv"
254 !macro MacroOtherExtensions _action
255 !insertmacro ${_action} ".asx"
256 !insertmacro ${_action} ".bin"
257 !insertmacro ${_action} ".cue"
258 !insertmacro ${_action} ".m3u"
259 !insertmacro ${_action} ".pls"
260 !insertmacro ${_action} ".vlc"
261 !insertmacro ${_action} ".xspf"
264 ; One macro to rule them all
265 !macro MacroAllExtensions _action
266 !insertmacro MacroAudioExtensions ${_action}
267 !insertmacro MacroVideoExtensions ${_action}
268 !insertmacro MacroOtherExtensions ${_action}
271 ;;;;;;;;;;;;;;;;;;;;;;;;;;;
272 ; 2. Context menu entries ;
273 ;;;;;;;;;;;;;;;;;;;;;;;;;;;
275 ; Generic function for adding the context menu for one ext.
276 !macro AddContextMenuExt EXT
277 WriteRegStr HKCR ${EXT}\shell\PlayWithVLC "" $ContextMenuEntry_PlayWith
278 WriteRegStr HKCR ${EXT}\shell\PlayWithVLC\command "" '"$INSTDIR\vlc.exe" --started-from-file --no-playlist-enqueue "%1"'
280 WriteRegStr HKCR ${EXT}\shell\AddToPlaylistVLC "" $ContextMenuEntry_AddToPlaylist
281 WriteRegStr HKCR ${EXT}\shell\AddToPlaylistVLC\command "" '"$INSTDIR\vlc.exe" --started-from-file --playlist-enqueue "%1"'
284 !macro AddContextMenu EXT
286 ReadRegStr $R0 HKCR ${EXT} ""
287 !insertmacro AddContextMenuExt $R0
291 !macro DeleteContextMenuExt EXT
292 DeleteRegKey HKCR ${EXT}\shell\PlayWithVLC
293 DeleteRegKey HKCR ${EXT}\shell\AddToPlaylistVLC
296 !macro DeleteContextMenu EXT
298 ReadRegStr $R0 HKCR ${EXT} ""
299 !insertmacro DeleteContextMenuExt $R0
303 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
304 ; 3. Delete prefs and cache ;
305 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
309 !define Index 'Line${__LINE__}'
312 ; this will loop through all the logged users and "virtual" windows users
313 ; (it looks like users are only present in HKEY_USERS when they are logged in)
315 EnumRegKey $1 HKU "" $0
316 StrCmp $1 "" "${Index}-End"
318 ReadRegStr $2 HKU "$1\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" AppData
319 StrCmp $2 "" "${Index}-Loop"
330 !macro OpenUninstallLog
331 FileOpen $UninstallLog "$INSTDIR\uninstall.log" a
332 FileSeek $UninstallLog 0 END
335 !macro CloseUninstallLog
336 FileClose $UninstallLog
337 SetFileAttributes "$INSTDIR\uninstall.log" HIDDEN
343 !macro InstallFile FILEREGEX
345 !define Index 'Line${__LINE__}'
346 FindFirst $0 $1 "$INSTDIR\${FILEREGEX}"
347 StrCmp $0 "" "${Index}-End"
349 StrCmp $1 "" "${Index}-End"
350 FileWrite $UninstallLog "$1$\r$\n"
357 !macro InstallFolder FOLDER
360 Call InstallFolderInternal
363 Function InstallFolderInternal
365 !define Index 'Line${__LINE__}'
366 FindFirst $0 $1 "$INSTDIR\$9\*"
367 StrCmp $0 "" "${Index}-End"
369 StrCmp $1 "" "${Index}-End"
370 StrCmp $1 "." "${Index}-Next"
371 StrCmp $1 ".." "${Index}-Next"
372 IfFileExists "$9\$1\*" 0 "${Index}-Write"
376 Call InstallFolderInternal
381 FileWrite $UninstallLog "$9\$1$\r$\n"
391 ;;;;;;;;;;;;;;;;;;;;;;
392 ; Installer sections ;
395 ;;;;;;;;;;;;;;;;;;;;;;
397 Section $Name_Section01 SEC01
399 SetShellVarContext all
400 SetOutPath "$INSTDIR"
402 !insertmacro OpenUninstallLog
404 ; VLC.exe, libvlc.dll
405 !insertmacro InstallFile vlc.exe
406 !insertmacro InstallFile vlc.exe.manifest
409 !insertmacro InstallFile *.dll
412 !insertmacro InstallFile *.txt
415 !insertmacro InstallFolder plugins
416 !insertmacro InstallFolder locale
417 !insertmacro InstallFolder osdmenu
418 !insertmacro InstallFolder skins
419 !insertmacro InstallFolder http
420 !insertmacro InstallFolder lua
423 WriteIniStr "$INSTDIR\${PRODUCT_GROUP} Website.url" "InternetShortcut" "URL" \
424 "${PRODUCT_WEB_SITE}"
425 FileWrite $UninstallLog "${PRODUCT_GROUP} Website.url$\r$\n"
426 WriteIniStr "$INSTDIR\Documentation.url" "InternetShortcut" "URL" \
427 "${PRODUCT_WEB_SITE}/doc/"
428 FileWrite $UninstallLog "Documentation.url$\r$\n"
429 WriteIniStr "$INSTDIR\New_Skins.url" "InternetShortcut" "URL" \
430 "${PRODUCT_WEB_SITE}/vlc/skins.php"
431 FileWrite $UninstallLog "New_Skins.url$\r$\n"
433 !insertmacro CloseUninstallLog
435 ; Add VLC to "recomended programs" for the following extensions
436 WriteRegStr HKCR Applications\vlc.exe "" ""
437 WriteRegStr HKCR Applications\vlc.exe "FriendlyAppName" "VLC media player"
438 WriteRegStr HKCR Applications\vlc.exe\shell\Play "" $ContextMenuEntry_PlayWith
439 WriteRegStr HKCR Applications\vlc.exe\shell\Play\command "" \
440 '"$INSTDIR\vlc.exe" --started-from-file "%1"'
441 !insertmacro MacroAllExtensions WriteRegStrSupportedTypes
445 ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion
447 StrCmp $R1 '6.0' lbl_vista lbl_done
450 WriteRegStr HKLM "Software\RegisteredApplications" "VLC" "Software\Clients\Media\VLC\Capabilities"
451 WriteRegStr HKLM "Software\Clients\Media\VLC\Capabilities" "ApplicationName" "VLC media player"
452 WriteRegStr HKLM "Software\Clients\Media\VLC\Capabilities" "ApplicationDescription" "VLC - The video swiss knife"
457 Section $Name_Section02a SEC02a
459 CreateDirectory "$SMPROGRAMS\VideoLAN"
460 CreateDirectory "$SMPROGRAMS\VideoLAN\Quick Settings"
461 CreateDirectory "$SMPROGRAMS\VideoLAN\Quick Settings\Audio"
462 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Audio\Set Audio mode to DirectX (default).lnk" \
463 "$INSTDIR\vlc.exe" "--aout aout_directx --save-config vlc://quit"
464 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Audio\Set Audio mode to Waveout.lnk" \
465 "$INSTDIR\vlc.exe" "--aout waveout --save-config vlc://quit"
466 CreateDirectory "$SMPROGRAMS\VideoLAN\Quick Settings\Interface"
467 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Interface\Set Main Interface to Skinnable.lnk" \
468 "$INSTDIR\vlc.exe" "-I skins --save-config vlc://quit"
469 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Interface\Set Main Interface to Qt (default).lnk" \
470 "$INSTDIR\vlc.exe" "-I qt --save-config vlc://quit"
471 CreateDirectory "$SMPROGRAMS\VideoLAN\Quick Settings\Video"
472 ; FIXME add detection for Vista. Direct3D will be default there, for all others it's DirectX
473 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to Direct3D.lnk" \
474 "$INSTDIR\vlc.exe" "--vout direct3d --overlay --directx-hw-yuv --save-config vlc://quit"
475 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to Direct3D (no hardware acceleration).lnk" \
476 "$INSTDIR\vlc.exe" "--vout direct3d --overlay --no-directx-hw-yuv --save-config vlc://quit"
477 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to DirectX.lnk" \
478 "$INSTDIR\vlc.exe" "--vout directx --overlay --directx-hw-yuv --save-config vlc://quit"
479 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to DirectX (no hardware acceleration).lnk" \
480 "$INSTDIR\vlc.exe" "--vout directx --no-overlay --no-directx-hw-yuv --save-config vlc://quit"
481 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to DirectX (no video overlay).lnk" \
482 "$INSTDIR\vlc.exe" "--vout directx --no-overlay --directx-hw-yuv --save-config vlc://quit"
483 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to OpenGL.lnk" \
484 "$INSTDIR\vlc.exe" "--vout opengl --overlay --save-config vlc://quit"
485 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Reset VLC media player preferences and cache files.lnk" \
486 "$INSTDIR\vlc.exe" "--reset-config --reset-plugins-cache vlc://quit"
487 CreateShortCut "$SMPROGRAMS\VideoLAN\Documentation.lnk" \
488 "$INSTDIR\Documentation.url"
489 CreateShortCut "$SMPROGRAMS\VideoLAN\Release Notes.lnk" \
490 "$INSTDIR\NEWS.txt" ""
491 CreateShortCut "$SMPROGRAMS\VideoLAN\${PRODUCT_GROUP} Website.lnk" \
492 "$INSTDIR\${PRODUCT_GROUP} Website.url"
493 CreateShortCut "$SMPROGRAMS\VideoLAN\VLC media player.lnk" \
494 "$INSTDIR\vlc.exe" ""
497 Section $Name_Section02b SEC02b
499 CreateShortCut "$DESKTOP\VLC media player.lnk" \
500 "$INSTDIR\vlc.exe" ""
503 Section /o $Name_Section03 SEC03
506 SetOutPath "$INSTDIR"
507 !insertmacro OpenUninstallLog
508 !insertmacro InstallFile mozilla\npvlc.dll
509 !insertmacro InstallFile mozilla\npvlc.dll.manifest
510 !insertmacro CloseUninstallLog
512 !define Moz "SOFTWARE\MozillaPlugins\@videolan.org/vlc,version=${VERSION}"
513 WriteRegStr HKLM ${Moz} "Description" "VLC Multimedia Plugin"
514 WriteRegStr HKLM ${Moz} "Path" "$INSTDIR\npvlc.dll"
515 WriteRegStr HKLM ${Moz} "Product" "VLC media player"
516 WriteRegStr HKLM ${Moz} "Vendor" "VideoLAN"
517 WriteRegStr HKLM ${Moz} "Version" "${VERSION}"
519 ; for very old version of mozilla, these lines may be needed
524 ;!define Index 'Line${__LINE__}'
530 ; EnumRegKey $R0 HKLM "SOFTWARE\Mozilla" "$R1"
531 ; StrCmp $R0 "" "${Index}-End"
533 ; ReadRegStr $R2 HKLM "SOFTWARE\Mozilla\$R0\Extensions" "Plugins"
534 ; StrCmp $R2 "" "${Index}-Loop" ""
536 ; CopyFiles "$INSTDIR\npvlc.dll" "$R2"
538 ; CopyFiles ${LIBVLC_DLL} "$R2"
540 ; !ifdef LIBVLC_CONTROL_DLL
541 ; CopyFiles ${LIBVLC_CONTROL_DLL} "$R2"
543 ; Goto "${Index}-Loop"
550 Section $Name_Section04 SEC04
552 SetOutPath "$INSTDIR"
553 !insertmacro OpenUninstallLog
554 !insertmacro InstallFile activex\axvlc.dll
555 !insertmacro InstallFile activex\axvlc.dll.manifest
556 !insertmacro CloseUninstallLog
557 RegDLL "$INSTDIR\axvlc.dll"
560 SectionGroup /e !$Name_Section06 SEC05
561 SectionGroup $Name_SectionGroupAudio
562 !insertmacro MacroAudioExtensions RegisterExtensionSection
564 SectionGroup $Name_SectionGroupVideo
565 !insertmacro MacroVideoExtensions RegisterExtensionSection
567 SectionGroup $Name_SectionGroupOther
568 !insertmacro MacroOtherExtensions RegisterExtensionSection
573 Section $Name_Section05 SEC06
575 WriteRegStr HKCR "AudioCD\shell\PlayWithVLC" "" $ContextMenuEntry_PlayWith
576 WriteRegStr HKCR "AudioCD\shell\PlayWithVLC\command" "" \
577 '"$INSTDIR\vlc.exe" --started-from-file "cdda://%1"'
578 WriteRegStr HKCR "DVD\shell\PlayWithVLC" "" $ContextMenuEntry_PlayWith
579 WriteRegStr HKCR "DVD\shell\PlayWithVLC\command" "" \
580 '"$INSTDIR\vlc.exe" --started-from-file "dvd://%1"'
582 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayDVDMovieOnArrival" "VLCPlayDVDMovieOnArrival" ""
583 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "Action" $Action_OnArrivalDVD
584 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "DefaultIcon" '"$INSTDIR\vlc.exe",0'
585 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "InvokeProgID" "VLC.DVDMovie"
586 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "InvokeVerb" "play"
587 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "Provider" "VideoLAN VLC media player"
589 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayCDAudioOnArrival" "VLCPlayCDAudioOnArrival" ""
590 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "Action" $Action_OnArrivalAudioCD
591 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "DefaultIcon" '"$INSTDIR\vlc.exe",0'
592 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "InvokeProgID" "VLC.CDAudio"
593 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "InvokeVerb" "play"
594 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "Provider" "VideoLAN VLC media player"
595 WriteRegStr HKCR "VLC.DVDMovie" "" "VLC DVD Movie"
596 WriteRegStr HKCR "VLC.DVDMovie\shell" "" "Play"
597 WriteRegStr HKCR "VLC.DVDMovie\shell\Play\command" "" \
598 '"$INSTDIR\vlc.exe" --started-from-file "dvd://%1"'
599 WriteRegStr HKCR "VLC.DVDMovie\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'
600 WriteRegStr HKCR "VLC.CDAudio" "" "VLC CD Audio"
601 WriteRegStr HKCR "VLC.CDAudio\shell" "" "Play"
602 WriteRegStr HKCR "VLC.CDAudio\shell\Play\command" "" \
603 '"$INSTDIR\vlc.exe" --started-from-file "cdda://%1"'
604 WriteRegStr HKCR "VLC.CDAudio\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'
608 Section $Name_Section07 SEC07
610 !insertmacro MacroAllExtensions AddContextMenu
611 !insertmacro AddContextMenuExt "Directory"
614 Section $Name_Section08 SEC08
615 !insertmacro delprefs
618 ; Installer section descriptions
619 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
620 !insertmacro MUI_DESCRIPTION_TEXT ${SEC01} $Desc_Section01
621 !insertmacro MUI_DESCRIPTION_TEXT ${SEC02a} $Desc_Section02a
622 !insertmacro MUI_DESCRIPTION_TEXT ${SEC02b} $Desc_Section02b
623 !insertmacro MUI_DESCRIPTION_TEXT ${SEC03} $Desc_Section03
624 !insertmacro MUI_DESCRIPTION_TEXT ${SEC04} $Desc_Section04
625 !insertmacro MUI_DESCRIPTION_TEXT ${SEC05} $Desc_Section05
626 !insertmacro MUI_DESCRIPTION_TEXT ${SEC06} $Desc_Section06
627 !insertmacro MUI_DESCRIPTION_TEXT ${SEC07} $Desc_Section07
628 !insertmacro MUI_DESCRIPTION_TEXT ${SEC08} $Desc_Section08
629 !insertmacro MUI_FUNCTION_DESCRIPTION_END
633 !insertmacro MUI_LANGDLL_DISPLAY
635 !include "languages\english.nsh"
636 StrCmp $LANGUAGE ${LANG_FRENCH} French 0
637 StrCmp $LANGUAGE ${LANG_ITALIAN} Italian 0
638 StrCmp $LANGUAGE ${LANG_HUNGARIAN} Hungarian 0
639 StrCmp $LANGUAGE ${LANG_ROMANIAN} Romanian 0
640 StrCmp $LANGUAGE ${LANG_FINNISH} Finnish EndLanguageCmp
642 !include "languages\french.nsh"
645 !include "languages\italian.nsh"
648 !include "languages\hungarian.nsh"
651 !include "languages\romanian.nsh"
654 !include "languages\finnish.nsh"
657 ReadRegStr $R0 ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
661 MessageBox MB_YESNO|MB_ICONEXCLAMATION $Message_AlreadyInstalled IDNO done
666 ExecWait '$R0 _?=$INSTDIR' ;Do not copy the uninstaller to a temp file
673 WriteUninstaller "$INSTDIR\uninstall.exe"
674 WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "InstallDir" $INSTDIR
675 WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "Version" "${VERSION}"
676 WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\vlc.exe"
678 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
679 "DisplayName" "$(^Name)"
680 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
681 "UninstallString" "$INSTDIR\uninstall.exe"
682 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
683 "DisplayIcon" "$INSTDIR\vlc.exe"
684 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
685 "DisplayVersion" "${PRODUCT_VERSION}"
686 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
687 "URLInfoAbout" "${PRODUCT_WEB_SITE}"
688 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
689 "Publisher" "${PRODUCT_PUBLISHER}"
692 ;;;;;;;;;;;;;;;;;;;;;;;;
693 ; Uninstaller sections ;
694 ;;;;;;;;;;;;;;;;;;;;;;;;
696 ; TrimNewlines (copied from NSIS documentation)
697 ; input, top of stack (e.g. whatever$\r$\n)
698 ; output, top of stack (replaces, with e.g. whatever)
699 ; modifies no other variables.
701 Function un.TrimNewlines
710 StrCmp $R2 "$\r" loop
711 StrCmp $R2 "$\n" loop
713 IntCmp $R1 0 no_trim_needed
722 Function un.RemoveEmptyDirs
724 !define Index 'Line${__LINE__}'
725 FindFirst $0 $1 "$INSTDIR$9*"
726 StrCmp $0 "" "${Index}-End"
728 StrCmp $1 "" "${Index}-End"
729 StrCmp $1 "." "${Index}-Next"
730 StrCmp $1 ".." "${Index}-Next"
735 Call un.RemoveEmptyDirs
749 Section "un.$Name_Section91" SEC91
751 SetShellVarContext all
753 !insertmacro MacroAllExtensions DeleteContextMenu
754 !insertmacro MacroAllExtensions UnRegisterExtensionSection
755 !insertmacro DeleteContextMenuExt "Directory"
757 ;remove activex plugin
758 UnRegDLL "$INSTDIR\axvlc.dll"
759 Delete /REBOOTOK "$INSTDIR\axvlc.dll"
760 Delete /REBOOTOK "$INSTDIR\axvlc.dll.manifest"
762 ;remove mozilla plugin
767 !define Index 'Line${__LINE__}'
773 EnumRegKey $R0 HKLM "SOFTWARE\Mozilla" "$R1"
774 StrCmp $R0 "" "${Index}-End"
776 ReadRegStr $R2 HKLM "SOFTWARE\Mozilla\$R0\Extensions" "Plugins"
777 StrCmp $R2 "" "${Index}-Loop" ""
779 ; old files (0.8.5 and before) that may be lying around
780 Delete /REBOOTOK "$R2\npvlc.dll"
781 Delete /REBOOTOK "$R2\libvlc.dll"
782 Delete /REBOOTOK "$R2\vlcintf.xpt"
787 Delete /REBOOTOK "$INSTDIR\npvlc.dll"
788 Delete /REBOOTOK "$INSTDIR\npvlc.dll.manifest"
790 RMDir "$SMPROGRAMS\VideoLAN"
791 RMDir /r $SMPROGRAMS\VideoLAN
793 FileOpen $UninstallLog "$INSTDIR\uninstall.log" r
796 FileRead $UninstallLog $R0
797 IfErrors UninstallEnd
801 Delete "$INSTDIR\$R0"
804 FileClose $UninstallLog
805 Delete "$INSTDIR\uninstall.log"
806 Delete "$INSTDIR\uninstall.exe"
808 Call un.RemoveEmptyDirs
811 DeleteRegKey HKLM Software\VideoLAN
813 DeleteRegKey HKCR Applications\vlc.exe
814 DeleteRegKey HKCR AudioCD\shell\PlayWithVLC
815 DeleteRegKey HKCR DVD\shell\PlayWithVLC
816 DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayDVDMovieOnArrival" "VLCPlayDVDMovieOnArrival"
817 DeleteRegKey HKLM Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival
818 DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayCDAudioOnArrival" "VLCPlayCDAudioOnArrival"
819 DeleteRegKey HKLM Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival
820 DeleteRegKey HKLM Software\Clients\Media\VLC
821 DeleteRegKey HKCR "VLC.MediaFile"
824 "SOFTWARE\MozillaPlugins\@videolan.org/vlc,version=${VERSION}"
827 "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
829 Delete "$DESKTOP\VLC media player.lnk"
831 DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
832 DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}"
836 Section /o "un.$Name_Section92" SEC92
837 !insertmacro delprefs
840 ; Uninstaller section descriptions
841 !insertmacro MUI_UNFUNCTION_DESCRIPTION_BEGIN
842 !insertmacro MUI_DESCRIPTION_TEXT ${SEC91} $Desc_Section91
843 !insertmacro MUI_DESCRIPTION_TEXT ${SEC92} $Desc_Section92
844 !insertmacro MUI_UNFUNCTION_DESCRIPTION_END
846 ;Function un.onUninstSuccess
848 ; MessageBox MB_ICONINFORMATION|MB_OK \
849 ; "$(^Name) was successfully removed from your computer."
853 !insertmacro MUI_UNGETLANGUAGE
855 !include "languages\english.nsh"
856 StrCmp $LANGUAGE ${LANG_FRENCH} French 0
857 StrCmp $LANGUAGE ${LANG_ITALIAN} Italian 0
858 StrCmp $LANGUAGE ${LANG_HUNGARIAN} Hungarian 0
859 StrCmp $LANGUAGE ${LANG_ROMANIAN} Romanian 0
860 StrCmp $LANGUAGE ${LANG_FINNISH} Finnish EndLanguageCmp
862 !include "languages\french.nsh"
865 !include "languages\italian.nsh"
868 !include "languages\hungarian.nsh"
871 !include "languages\romanian.nsh"
874 !include "languages\finnish.nsh"