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 !define MUI_LICENSEPAGE_BUTTON $(^NextBtn)
70 !insertmacro MUI_PAGE_LICENSE "COPYING.txt"
72 !insertmacro MUI_PAGE_COMPONENTS
74 !insertmacro MUI_PAGE_DIRECTORY
76 !insertmacro MUI_PAGE_INSTFILES
78 !define MUI_FINISHPAGE_RUN "$INSTDIR\vlc.exe"
79 !define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\README.txt"
80 !define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED
81 !define MUI_FINISHPAGE_LINK $Link_VisitWebsite
82 !define MUI_FINISHPAGE_LINK_LOCATION "http://www.videolan.org/vlc/"
83 !define MUI_FINISHPAGE_NOREBOOTSUPPORT
84 !insertmacro MUI_PAGE_FINISH
87 !insertmacro MUI_UNPAGE_CONFIRM
88 !insertmacro MUI_UNPAGE_COMPONENTS
89 !insertmacro MUI_UNPAGE_INSTFILES
90 !insertmacro MUI_UNPAGE_FINISH
93 !insertmacro MUI_LANGUAGE "English" # first language is the default language
94 !insertmacro MUI_LANGUAGE "French"
95 !insertmacro MUI_LANGUAGE "German"
96 !insertmacro MUI_LANGUAGE "Spanish"
97 !insertmacro MUI_LANGUAGE "SimpChinese"
98 !insertmacro MUI_LANGUAGE "TradChinese"
99 !insertmacro MUI_LANGUAGE "Japanese"
100 !insertmacro MUI_LANGUAGE "Korean"
101 !insertmacro MUI_LANGUAGE "Italian"
102 !insertmacro MUI_LANGUAGE "Dutch"
103 !insertmacro MUI_LANGUAGE "Danish"
104 !insertmacro MUI_LANGUAGE "Swedish"
105 !insertmacro MUI_LANGUAGE "Norwegian"
106 !insertmacro MUI_LANGUAGE "Finnish"
107 !insertmacro MUI_LANGUAGE "Greek"
108 !insertmacro MUI_LANGUAGE "Russian"
109 !insertmacro MUI_LANGUAGE "Portuguese"
110 !insertmacro MUI_LANGUAGE "PortugueseBR"
111 !insertmacro MUI_LANGUAGE "Arabic"
112 !insertmacro MUI_LANGUAGE "Polish"
113 !insertmacro MUI_LANGUAGE "Romanian"
114 !insertmacro MUI_LANGUAGE "Slovak"
115 !insertmacro MUI_LANGUAGE "Czech"
116 !insertmacro MUI_LANGUAGE "Hungarian"
117 !insertmacro MUI_LANGUAGE "Catalan"
118 !insertmacro MUI_LANGUAGE "Bulgarian"
120 ; Reserve files for solid compression
121 !insertmacro MUI_RESERVEFILE_LANGDLL
122 !insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
126 ;;;;;;;;;;;;;;;;;;;;;;;
127 ; Macro and Functions ;
128 ;;;;;;;;;;;;;;;;;;;;;;;
130 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
131 ; 1. File type associations ;
132 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
134 ;; Function that register one extension for VLC
135 Function RegisterExtension
136 ; back up old value for extension $R0 (eg. ".opt")
137 ReadRegStr $1 HKCR "$R0" ""
138 StrCmp $1 "" NoBackup
139 StrCmp $1 "VLC$R0" "NoBackup"
140 WriteRegStr HKCR "$R0" "VLC.backup" $1
142 WriteRegStr HKCR "$R0" "" "VLC$R0"
143 ReadRegStr $0 HKCR "VLC$R0" ""
144 WriteRegStr HKCR "VLC$R0" "" "VLC media file ($R0)"
145 WriteRegStr HKCR "VLC$R0\shell" "" "Open"
146 WriteRegStr HKCR "VLC$R0\shell\Open" "" $ShellAssociation_Play
147 WriteRegStr HKCR "VLC$R0\shell\Open\command" "" '"$INSTDIR\vlc.exe" --started-from-file "%1"'
148 WriteRegStr HKCR "VLC$R0\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'
151 ; Vista and above detection
152 ReadRegStr $R1 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion
154 StrCmp $R2 '6' ForVista ToEnd
156 WriteRegStr HKLM "Software\Clients\Media\VLC\Capabilities\FileAssociations" "$R0" "VLC$R0"
161 ;; Function that removes one extension that VLC owns.
162 Function un.RegisterExtension
163 ;start of restore script
164 ReadRegStr $1 HKCR "$R0" ""
165 StrCmp $1 "VLC$R0" 0 NoOwn ; only do this if we own it
166 ; Read the old value from Backup
167 ReadRegStr $1 HKCR "$R0" "VLC.backup"
168 StrCmp $1 "" 0 Restore ; if backup="" then delete the whole key
169 DeleteRegKey HKCR "$R0"
172 WriteRegStr HKCR "$R0" "" $1
173 DeleteRegValue HKCR "$R0" "VLC.backup"
175 DeleteRegKey HKCR "VLC$R0" ;Delete key with association settings
176 DeleteRegKey HKLM "Software\Clients\Media\VLC\Capabilities\FileAssociations\VLC$R0" ; for vista
179 !macro RegisterExtensionSection EXT
184 Call RegisterExtension
189 !macro UnRegisterExtensionSection EXT
192 Call un.RegisterExtension
196 !macro WriteRegStrSupportedTypes EXT
197 WriteRegStr HKCR Applications\vlc.exe\SupportedTypes ${EXT} ""
200 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
201 ; Extension lists Macros ;
202 ; Those macros calls the previous functions ;
203 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
205 !macro MacroAudioExtensions _action
206 !insertmacro ${_action} ".a52"
207 !insertmacro ${_action} ".aac"
208 !insertmacro ${_action} ".ac3"
209 !insertmacro ${_action} ".aob"
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} ".ifo"
265 !insertmacro ${_action} ".m3u"
266 !insertmacro ${_action} ".pls"
267 !insertmacro ${_action} ".sdp"
268 !insertmacro ${_action} ".vlc"
269 !insertmacro ${_action} ".xspf"
272 ; One macro to rule them all
273 !macro MacroAllExtensions _action
274 !insertmacro MacroAudioExtensions ${_action}
275 !insertmacro MacroVideoExtensions ${_action}
276 !insertmacro MacroOtherExtensions ${_action}
279 ;;;;;;;;;;;;;;;;;;;;;;;;;;;
280 ; 2. Context menu entries ;
281 ;;;;;;;;;;;;;;;;;;;;;;;;;;;
283 ; Generic function for adding the context menu for one ext.
284 !macro AddContextMenuExt EXT
285 WriteRegStr HKCR ${EXT}\shell\PlayWithVLC "" $ContextMenuEntry_PlayWith
286 WriteRegStr HKCR ${EXT}\shell\PlayWithVLC\command "" '"$INSTDIR\vlc.exe" --started-from-file --no-playlist-enqueue "%1"'
288 WriteRegStr HKCR ${EXT}\shell\AddToPlaylistVLC "" $ContextMenuEntry_AddToPlaylist
289 WriteRegStr HKCR ${EXT}\shell\AddToPlaylistVLC\command "" '"$INSTDIR\vlc.exe" --started-from-file --playlist-enqueue "%1"'
292 !macro AddContextMenu EXT
294 ReadRegStr $R0 HKCR ${EXT} ""
295 !insertmacro AddContextMenuExt $R0
299 !macro DeleteContextMenuExt EXT
300 DeleteRegKey HKCR ${EXT}\shell\PlayWithVLC
301 DeleteRegKey HKCR ${EXT}\shell\AddToPlaylistVLC
304 !macro DeleteContextMenu EXT
306 ReadRegStr $R0 HKCR ${EXT} ""
307 !insertmacro DeleteContextMenuExt $R0
311 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
312 ; 3. Delete prefs and cache ;
313 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
317 !define Index 'Line${__LINE__}'
320 ; this will loop through all the logged users and "virtual" windows users
321 ; (it looks like users are only present in HKEY_USERS when they are logged in)
323 EnumRegKey $1 HKU "" $0
324 StrCmp $1 "" "${Index}-End"
326 ReadRegStr $2 HKU "$1\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" AppData
327 StrCmp $2 "" "${Index}-Loop"
338 !macro OpenUninstallLog
339 FileOpen $UninstallLog "$INSTDIR\uninstall.log" a
340 FileSeek $UninstallLog 0 END
343 !macro CloseUninstallLog
344 FileClose $UninstallLog
345 SetFileAttributes "$INSTDIR\uninstall.log" HIDDEN
351 !macro InstallFile FILEREGEX
353 !define Index 'Line${__LINE__}'
354 FindFirst $0 $1 "$INSTDIR\${FILEREGEX}"
355 StrCmp $0 "" "${Index}-End"
357 StrCmp $1 "" "${Index}-End"
358 FileWrite $UninstallLog "$1$\r$\n"
365 !macro InstallFolder FOLDER
368 Call InstallFolderInternal
371 Function InstallFolderInternal
373 !define Index 'Line${__LINE__}'
374 FindFirst $0 $1 "$INSTDIR\$9\*"
375 StrCmp $0 "" "${Index}-End"
377 StrCmp $1 "" "${Index}-End"
378 StrCmp $1 "." "${Index}-Next"
379 StrCmp $1 ".." "${Index}-Next"
380 IfFileExists "$9\$1\*" 0 "${Index}-Write"
384 Call InstallFolderInternal
389 FileWrite $UninstallLog "$9\$1$\r$\n"
399 ;;;;;;;;;;;;;;;;;;;;;;
400 ; Installer sections ;
403 ;;;;;;;;;;;;;;;;;;;;;;
405 Section $Name_Section01 SEC01
407 SetShellVarContext all
408 SetOutPath "$INSTDIR"
410 !insertmacro OpenUninstallLog
412 ; VLC.exe, libvlc.dll
413 !insertmacro InstallFile vlc.exe
414 !insertmacro InstallFile vlc.exe.manifest
417 !insertmacro InstallFile *.dll
420 !insertmacro InstallFile *.txt
423 !insertmacro InstallFolder plugins
424 !insertmacro InstallFolder locale
425 @BUILD_OSDMENU_TRUE@ !insertmacro InstallFolder osdmenu
426 @BUILD_SKINS_TRUE@ !insertmacro InstallFolder skins
427 @BUILD_HTTPD_TRUE@ !insertmacro InstallFolder http
428 @BUILD_LUA_TRUE@ !insertmacro InstallFolder lua
432 WriteIniStr "$INSTDIR\${PRODUCT_GROUP} Website.url" "InternetShortcut" "URL" \
433 "${PRODUCT_WEB_SITE}"
434 FileWrite $UninstallLog "${PRODUCT_GROUP} Website.url$\r$\n"
435 WriteIniStr "$INSTDIR\Documentation.url" "InternetShortcut" "URL" \
436 "${PRODUCT_WEB_SITE}/doc/"
437 FileWrite $UninstallLog "Documentation.url$\r$\n"
438 WriteIniStr "$INSTDIR\New_Skins.url" "InternetShortcut" "URL" \
439 "${PRODUCT_WEB_SITE}/vlc/skins.php"
440 FileWrite $UninstallLog "New_Skins.url$\r$\n"
442 !insertmacro CloseUninstallLog
444 ; Add VLC to "recomended programs" for the following extensions
445 WriteRegStr HKCR Applications\vlc.exe "" ""
446 WriteRegStr HKCR Applications\vlc.exe "FriendlyAppName" "VLC media player"
447 WriteRegStr HKCR Applications\vlc.exe\shell\Open "" $ContextMenuEntry_PlayWith
448 WriteRegStr HKCR Applications\vlc.exe\shell\Open\command "" \
449 '"$INSTDIR\vlc.exe" --started-from-file "%1"'
450 !insertmacro MacroAllExtensions WriteRegStrSupportedTypes
452 ; Windows default programs Registration
453 ; Vista and above detection
454 ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion
456 StrCmp $R1 '6' lbl_vista lbl_done
459 WriteRegStr HKLM "Software\RegisteredApplications" "VLC" "Software\Clients\Media\VLC\Capabilities"
460 WriteRegStr HKLM "Software\Clients\Media\VLC\Capabilities" "ApplicationName" "VLC media player"
461 WriteRegStr HKLM "Software\Clients\Media\VLC\Capabilities" "ApplicationDescription" "VLC - The video swiss knife"
466 Section $Name_Section02a SEC02a
468 CreateDirectory "$SMPROGRAMS\VideoLAN"
469 CreateDirectory "$SMPROGRAMS\VideoLAN\Quick Settings"
470 CreateDirectory "$SMPROGRAMS\VideoLAN\Quick Settings\Audio"
471 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Audio\Set Audio mode to DirectX (default).lnk" \
472 "$INSTDIR\vlc.exe" "--aout aout_directx --save-config vlc://quit"
473 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Audio\Set Audio mode to Waveout.lnk" \
474 "$INSTDIR\vlc.exe" "--aout waveout --save-config vlc://quit"
475 CreateDirectory "$SMPROGRAMS\VideoLAN\Quick Settings\Interface"
476 @BUILD_SKINS_TRUE@ CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Interface\Set Main Interface to Skinnable.lnk" \
477 @BUILD_SKINS_TRUE@ "$INSTDIR\vlc.exe" "-I skins --save-config vlc://quit"
478 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Interface\Set Main Interface to Qt (default).lnk" \
479 "$INSTDIR\vlc.exe" "-I qt --save-config vlc://quit"
480 CreateDirectory "$SMPROGRAMS\VideoLAN\Quick Settings\Video"
481 ; FIXME add detection for Vista. Direct3D will be default there, for all others it's DirectX
482 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to Direct3D.lnk" \
483 "$INSTDIR\vlc.exe" "--vout direct3d --overlay --directx-hw-yuv --save-config vlc://quit"
484 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to Direct3D (no hardware acceleration).lnk" \
485 "$INSTDIR\vlc.exe" "--vout direct3d --overlay --no-directx-hw-yuv --save-config vlc://quit"
486 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to DirectX.lnk" \
487 "$INSTDIR\vlc.exe" "--vout directx --overlay --directx-hw-yuv --save-config vlc://quit"
488 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to DirectX (no hardware acceleration).lnk" \
489 "$INSTDIR\vlc.exe" "--vout directx --no-overlay --no-directx-hw-yuv --save-config vlc://quit"
490 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to DirectX (no video overlay).lnk" \
491 "$INSTDIR\vlc.exe" "--vout directx --no-overlay --directx-hw-yuv --save-config vlc://quit"
492 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to OpenGL.lnk" \
493 "$INSTDIR\vlc.exe" "--vout opengl --overlay --save-config vlc://quit"
494 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Reset VLC media player preferences and cache files.lnk" \
495 "$INSTDIR\vlc.exe" "--reset-config --reset-plugins-cache vlc://quit"
496 CreateShortCut "$SMPROGRAMS\VideoLAN\Documentation.lnk" \
497 "$INSTDIR\Documentation.url"
498 CreateShortCut "$SMPROGRAMS\VideoLAN\Release Notes.lnk" \
499 "$INSTDIR\NEWS.txt" ""
500 CreateShortCut "$SMPROGRAMS\VideoLAN\${PRODUCT_GROUP} Website.lnk" \
501 "$INSTDIR\${PRODUCT_GROUP} Website.url"
502 CreateShortCut "$SMPROGRAMS\VideoLAN\VLC media player.lnk" \
503 "$INSTDIR\vlc.exe" ""
506 Section $Name_Section02b SEC02b
508 CreateShortCut "$DESKTOP\VLC media player.lnk" \
509 "$INSTDIR\vlc.exe" ""
512 !ifdef INSTALL_MOZILLA
513 Section /o $Name_Section03 SEC03
516 SetOutPath "$INSTDIR"
517 !insertmacro OpenUninstallLog
518 !insertmacro InstallFile mozilla\npvlc.dll
519 !insertmacro InstallFile mozilla\npvlc.dll.manifest
520 !insertmacro CloseUninstallLog
522 !define Moz "SOFTWARE\MozillaPlugins\@videolan.org/vlc,version=${VERSION}"
523 WriteRegStr HKLM ${Moz} "Description" "VLC Multimedia Plugin"
524 WriteRegStr HKLM ${Moz} "Path" "$INSTDIR\npvlc.dll"
525 WriteRegStr HKLM ${Moz} "Product" "VLC media player"
526 WriteRegStr HKLM ${Moz} "Vendor" "VideoLAN"
527 WriteRegStr HKLM ${Moz} "Version" "${VERSION}"
529 ; for very old version of mozilla, these lines may be needed
534 ;!define Index 'Line${__LINE__}'
540 ; EnumRegKey $R0 HKLM "SOFTWARE\Mozilla" "$R1"
541 ; StrCmp $R0 "" "${Index}-End"
543 ; ReadRegStr $R2 HKLM "SOFTWARE\Mozilla\$R0\Extensions" "Plugins"
544 ; StrCmp $R2 "" "${Index}-Loop" ""
546 ; CopyFiles "$INSTDIR\npvlc.dll" "$R2"
548 ; CopyFiles ${LIBVLC_DLL} "$R2"
550 ; !ifdef LIBVLC_CONTROL_DLL
551 ; CopyFiles ${LIBVLC_CONTROL_DLL} "$R2"
553 ; Goto "${Index}-Loop"
561 !ifdef INSTALL_ACTIVEX
562 Section $Name_Section04 SEC04
564 SetOutPath "$INSTDIR"
565 !insertmacro OpenUninstallLog
566 !insertmacro InstallFile activex\axvlc.dll
567 !insertmacro InstallFile activex\axvlc.dll.manifest
568 !insertmacro CloseUninstallLog
569 RegDLL "$INSTDIR\axvlc.dll"
574 Section $Name_Section05 SEC05
576 WriteRegStr HKCR "AudioCD\shell\PlayWithVLC" "" $ContextMenuEntry_PlayWith
577 WriteRegStr HKCR "AudioCD\shell\PlayWithVLC\command" "" \
578 '"$INSTDIR\vlc.exe" --started-from-file cdda://%1'
579 WriteRegStr HKCR "DVD\shell\PlayWithVLC" "" $ContextMenuEntry_PlayWith
580 WriteRegStr HKCR "DVD\shell\PlayWithVLC\command" "" \
581 '"$INSTDIR\vlc.exe" --started-from-file dvd://%1'
583 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayDVDMovieOnArrival" "VLCPlayDVDMovieOnArrival" ""
584 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "Action" $Action_OnArrivalDVD
585 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "DefaultIcon" '"$INSTDIR\vlc.exe",0'
586 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "InvokeProgID" "VLC.DVDMovie"
587 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "InvokeVerb" "play"
588 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "Provider" "VideoLAN VLC media player"
590 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayCDAudioOnArrival" "VLCPlayCDAudioOnArrival" ""
591 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "Action" $Action_OnArrivalAudioCD
592 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "DefaultIcon" '"$INSTDIR\vlc.exe",0'
593 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "InvokeProgID" "VLC.CDAudio"
594 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "InvokeVerb" "play"
595 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "Provider" "VideoLAN VLC media player"
596 WriteRegStr HKCR "VLC.DVDMovie" "" "VLC DVD Movie"
597 WriteRegStr HKCR "VLC.DVDMovie\shell" "" "Open"
598 WriteRegStr HKCR "VLC.DVDMovie\shell\Open\command" "" \
599 '"$INSTDIR\vlc.exe" --started-from-file dvd://%1'
600 WriteRegStr HKCR "VLC.DVDMovie\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'
601 WriteRegStr HKCR "VLC.CDAudio" "" "VLC CD Audio"
602 WriteRegStr HKCR "VLC.CDAudio\shell" "" "Open"
603 WriteRegStr HKCR "VLC.CDAudio\shell\Open\command" "" \
604 '"$INSTDIR\vlc.exe" --started-from-file cdda://%1'
605 WriteRegStr HKCR "VLC.CDAudio\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'
610 SectionGroup /e !$Name_Section06 SEC06
611 SectionGroup $Name_SectionGroupAudio
612 !insertmacro MacroAudioExtensions RegisterExtensionSection
614 SectionGroup $Name_SectionGroupVideo
615 !insertmacro MacroVideoExtensions RegisterExtensionSection
617 SectionGroup $Name_SectionGroupOther
618 !insertmacro MacroOtherExtensions RegisterExtensionSection
622 Section $Name_Section07 SEC07
624 !insertmacro MacroAllExtensions AddContextMenu
625 !insertmacro AddContextMenuExt "Directory"
628 Section $Name_Section08 SEC08
629 !insertmacro delprefs
632 ; Installer section descriptions
633 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
634 !insertmacro MUI_DESCRIPTION_TEXT ${SEC01} $Desc_Section01
635 !insertmacro MUI_DESCRIPTION_TEXT ${SEC02a} $Desc_Section02a
636 !insertmacro MUI_DESCRIPTION_TEXT ${SEC02b} $Desc_Section02b
637 @BUILD_MOZILLA_TRUE@ !insertmacro MUI_DESCRIPTION_TEXT ${SEC03} $Desc_Section03
638 @BUILD_ACTIVEX_TRUE@ !insertmacro MUI_DESCRIPTION_TEXT ${SEC04} $Desc_Section04
639 !insertmacro MUI_DESCRIPTION_TEXT ${SEC05} $Desc_Section05
640 !insertmacro MUI_DESCRIPTION_TEXT ${SEC06} $Desc_Section06
641 !insertmacro MUI_DESCRIPTION_TEXT ${SEC07} $Desc_Section07
642 !insertmacro MUI_DESCRIPTION_TEXT ${SEC08} $Desc_Section08
643 !insertmacro MUI_FUNCTION_DESCRIPTION_END
647 !insertmacro MUI_LANGDLL_DISPLAY
649 !include "languages\english.nsh"
650 StrCmp $LANGUAGE ${LANG_FRENCH} French 0
651 StrCmp $LANGUAGE ${LANG_GERMAN} German 0
652 StrCmp $LANGUAGE ${LANG_ITALIAN} Italian 0
653 StrCmp $LANGUAGE ${LANG_HUNGARIAN} Hungarian 0
654 StrCmp $LANGUAGE ${LANG_ROMANIAN} Romanian 0
655 StrCmp $LANGUAGE ${LANG_CATALAN} Catalan 0
656 StrCmp $LANGUAGE ${LANG_BULGARIAN} Bulgarian 0
657 StrCmp $LANGUAGE ${LANG_SLOVAK} Slovak 0
658 StrCmp $LANGUAGE ${LANG_POLISH} Polish 0
659 StrCmp $LANGUAGE ${LANG_DUTCH} Dutch 0
660 StrCmp $LANGUAGE ${LANG_SIMPCHINESE} SChinese 0
661 StrCmp $LANGUAGE ${LANG_FINNISH} Finnish 0
662 StrCmp $LANGUAGE ${LANG_PORTUGUESEBR} Brazilian EndLanguageCmp
664 !include "languages\french.nsh"
667 !include "languages\german.nsh"
670 !include "languages\italian.nsh"
673 !include "languages\hungarian.nsh"
676 !include "languages\romanian.nsh"
679 !include "languages\catalan.nsh"
682 !include "languages\bulgarian.nsh"
685 !include "languages\slovak.nsh"
688 !include "languages\polish.nsh"
691 !include "languages\dutch.nsh"
694 !include "languages\schinese.nsh"
697 !include "languages\finnish.nsh"
700 !include "languages\brazilian_portuguese.nsh"
703 ReadRegStr $R0 ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
707 MessageBox MB_YESNO|MB_ICONEXCLAMATION $Message_AlreadyInstalled IDNO done
712 ExecWait '$R0 _?=$INSTDIR' ;Do not copy the uninstaller to a temp file
719 WriteUninstaller "$INSTDIR\uninstall.exe"
720 WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "InstallDir" $INSTDIR
721 WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "Version" "${VERSION}"
722 WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\vlc.exe"
724 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
725 "DisplayName" "$(^Name)"
726 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
727 "UninstallString" "$INSTDIR\uninstall.exe"
728 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
729 "InstallLocation" "$INSTDIR"
730 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
731 "DisplayIcon" "$INSTDIR\vlc.exe"
732 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
733 "DisplayVersion" "${PRODUCT_VERSION}"
734 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
735 "URLInfoAbout" "${PRODUCT_WEB_SITE}"
736 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
737 "Publisher" "${PRODUCT_PUBLISHER}"
738 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
739 "VersionMajor" "@VERSION_MAJOR@"
740 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
741 "VersionMinor" "@VERSION_MINOR@"
744 ;;;;;;;;;;;;;;;;;;;;;;;;
745 ; Uninstaller sections ;
746 ;;;;;;;;;;;;;;;;;;;;;;;;
748 ; TrimNewlines (copied from NSIS documentation)
749 ; input, top of stack (e.g. whatever$\r$\n)
750 ; output, top of stack (replaces, with e.g. whatever)
751 ; modifies no other variables.
753 Function un.TrimNewlines
762 StrCmp $R2 "$\r" loop
763 StrCmp $R2 "$\n" loop
765 IntCmp $R1 0 no_trim_needed
774 Function un.RemoveEmptyDirs
776 !define Index 'Line${__LINE__}'
777 FindFirst $0 $1 "$INSTDIR$9*"
778 StrCmp $0 "" "${Index}-End"
780 StrCmp $1 "" "${Index}-End"
781 StrCmp $1 "." "${Index}-Next"
782 StrCmp $1 ".." "${Index}-Next"
787 Call un.RemoveEmptyDirs
801 Section "un.$Name_Section91" SEC91
803 SetShellVarContext all
805 !insertmacro MacroAllExtensions DeleteContextMenu
806 !insertmacro MacroAllExtensions UnRegisterExtensionSection
807 !insertmacro DeleteContextMenuExt "Directory"
809 ;remove activex plugin
810 UnRegDLL "$INSTDIR\axvlc.dll"
811 Delete /REBOOTOK "$INSTDIR\axvlc.dll"
812 Delete /REBOOTOK "$INSTDIR\axvlc.dll.manifest"
814 ;remove mozilla plugin
819 !define Index 'Line${__LINE__}'
825 EnumRegKey $R0 HKLM "SOFTWARE\Mozilla" "$R1"
826 StrCmp $R0 "" "${Index}-End"
828 ReadRegStr $R2 HKLM "SOFTWARE\Mozilla\$R0\Extensions" "Plugins"
829 StrCmp $R2 "" "${Index}-Loop" ""
831 ; old files (0.8.5 and before) that may be lying around
832 Delete /REBOOTOK "$R2\npvlc.dll"
833 Delete /REBOOTOK "$R2\libvlc.dll"
834 Delete /REBOOTOK "$R2\vlcintf.xpt"
839 Delete /REBOOTOK "$INSTDIR\npvlc.dll"
840 Delete /REBOOTOK "$INSTDIR\npvlc.dll.manifest"
842 RMDir "$SMPROGRAMS\VideoLAN"
843 RMDir /r $SMPROGRAMS\VideoLAN
845 FileOpen $UninstallLog "$INSTDIR\uninstall.log" r
848 FileRead $UninstallLog $R0
849 IfErrors UninstallEnd
853 Delete "$INSTDIR\$R0"
856 FileClose $UninstallLog
857 Delete "$INSTDIR\uninstall.log"
858 Delete "$INSTDIR\uninstall.exe"
860 Call un.RemoveEmptyDirs
863 DeleteRegKey HKLM Software\VideoLAN
865 DeleteRegKey HKCR Applications\vlc.exe
866 DeleteRegKey HKCR AudioCD\shell\PlayWithVLC
867 DeleteRegKey HKCR DVD\shell\PlayWithVLC
868 DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayDVDMovieOnArrival" "VLCPlayDVDMovieOnArrival"
869 DeleteRegKey HKLM Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival
870 DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayCDAudioOnArrival" "VLCPlayCDAudioOnArrival"
871 DeleteRegKey HKLM Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival
872 DeleteRegKey HKLM Software\Clients\Media\VLC
873 DeleteRegKey HKCR "VLC.MediaFile"
876 "SOFTWARE\MozillaPlugins\@videolan.org/vlc,version=${VERSION}"
879 "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
881 Delete "$DESKTOP\VLC media player.lnk"
883 DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
884 DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}"
888 Section /o "un.$Name_Section92" SEC92
889 !insertmacro delprefs
892 ; Uninstaller section descriptions
893 !insertmacro MUI_UNFUNCTION_DESCRIPTION_BEGIN
894 !insertmacro MUI_DESCRIPTION_TEXT ${SEC91} $Desc_Section91
895 !insertmacro MUI_DESCRIPTION_TEXT ${SEC92} $Desc_Section92
896 !insertmacro MUI_UNFUNCTION_DESCRIPTION_END
898 ;Function un.onUninstSuccess
900 ; MessageBox MB_ICONINFORMATION|MB_OK \
901 ; "$(^Name) was successfully removed from your computer."
905 !insertmacro MUI_UNGETLANGUAGE
907 !include "languages\english.nsh"
908 StrCmp $LANGUAGE ${LANG_FRENCH} French 0
909 StrCmp $LANGUAGE ${LANG_GERMAN} German 0
910 StrCmp $LANGUAGE ${LANG_ITALIAN} Italian 0
911 StrCmp $LANGUAGE ${LANG_HUNGARIAN} Hungarian 0
912 StrCmp $LANGUAGE ${LANG_ROMANIAN} Romanian 0
913 StrCmp $LANGUAGE ${LANG_CATALAN} Catalan 0
914 StrCmp $LANGUAGE ${LANG_BULGARIAN} Bulgarian 0
915 StrCmp $LANGUAGE ${LANG_SLOVAK} Slovak 0
916 StrCmp $LANGUAGE ${LANG_POLISH} Polish 0
917 StrCmp $LANGUAGE ${LANG_DUTCH} Dutch 0
918 StrCmp $LANGUAGE ${LANG_SIMPCHINESE} SChinese 0
919 StrCmp $LANGUAGE ${LANG_FINNISH} Finnish 0
920 StrCmp $LANGUAGE ${LANG_PORTUGUESEBR} Brazilian EndLanguageCmp
922 !include "languages\french.nsh"
925 !include "languages\german.nsh"
928 !include "languages\italian.nsh"
931 !include "languages\hungarian.nsh"
934 !include "languages\romanian.nsh"
937 !include "languages\catalan.nsh"
940 !include "languages\bulgarian.nsh"
943 !include "languages\slovak.nsh"
946 !include "languages\polish.nsh"
949 !include "languages\dutch.nsh"
952 !include "languages\schinese.nsh"
955 !include "languages\finnish.nsh"
958 !include "languages\brazilian_portuguese.nsh"