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} ".tta"
223 !insertmacro ${_action} ".wav"
224 !insertmacro ${_action} ".wma"
225 !insertmacro ${_action} ".wv"
226 !insertmacro ${_action} ".xm"
229 !macro MacroVideoExtensions _action
230 !insertmacro ${_action} ".asf"
231 !insertmacro ${_action} ".avi"
232 !insertmacro ${_action} ".divx"
233 !insertmacro ${_action} ".dv"
234 !insertmacro ${_action} ".flv"
235 !insertmacro ${_action} ".gxf"
236 !insertmacro ${_action} ".m1v"
237 !insertmacro ${_action} ".m2v"
238 !insertmacro ${_action} ".m2ts"
239 !insertmacro ${_action} ".m4v"
240 !insertmacro ${_action} ".mkv"
241 !insertmacro ${_action} ".mov"
242 !insertmacro ${_action} ".mp4"
243 !insertmacro ${_action} ".mpeg"
244 !insertmacro ${_action} ".mpeg1"
245 !insertmacro ${_action} ".mpeg2"
246 !insertmacro ${_action} ".mpeg4"
247 !insertmacro ${_action} ".mpg"
248 !insertmacro ${_action} ".mts"
249 !insertmacro ${_action} ".mxf"
250 !insertmacro ${_action} ".nuv"
251 !insertmacro ${_action} ".ogg"
252 !insertmacro ${_action} ".ogm"
253 !insertmacro ${_action} ".ogx"
254 !insertmacro ${_action} ".ogv"
255 !insertmacro ${_action} ".rmvb"
256 !insertmacro ${_action} ".ts"
257 !insertmacro ${_action} ".vob"
258 !insertmacro ${_action} ".vro"
259 !insertmacro ${_action} ".wmv"
262 !macro MacroOtherExtensions _action
263 !insertmacro ${_action} ".asx"
264 !insertmacro ${_action} ".bin"
265 !insertmacro ${_action} ".cue"
266 !insertmacro ${_action} ".ifo"
267 !insertmacro ${_action} ".m3u"
268 !insertmacro ${_action} ".pls"
269 !insertmacro ${_action} ".sdp"
270 !insertmacro ${_action} ".vlc"
271 !insertmacro ${_action} ".xspf"
274 ; One macro to rule them all
275 !macro MacroAllExtensions _action
276 !insertmacro MacroAudioExtensions ${_action}
277 !insertmacro MacroVideoExtensions ${_action}
278 !insertmacro MacroOtherExtensions ${_action}
281 ;;;;;;;;;;;;;;;;;;;;;;;;;;;
282 ; 2. Context menu entries ;
283 ;;;;;;;;;;;;;;;;;;;;;;;;;;;
285 ; Generic function for adding the context menu for one ext.
286 !macro AddContextMenuExt EXT
287 WriteRegStr HKCR ${EXT}\shell\PlayWithVLC "" $ContextMenuEntry_PlayWith
288 WriteRegStr HKCR ${EXT}\shell\PlayWithVLC\command "" '"$INSTDIR\vlc.exe" --started-from-file --no-playlist-enqueue "%1"'
290 WriteRegStr HKCR ${EXT}\shell\AddToPlaylistVLC "" $ContextMenuEntry_AddToPlaylist
291 WriteRegStr HKCR ${EXT}\shell\AddToPlaylistVLC\command "" '"$INSTDIR\vlc.exe" --started-from-file --playlist-enqueue "%1"'
294 !macro AddContextMenu EXT
296 ReadRegStr $R0 HKCR ${EXT} ""
297 !insertmacro AddContextMenuExt $R0
301 !macro DeleteContextMenuExt EXT
302 DeleteRegKey HKCR ${EXT}\shell\PlayWithVLC
303 DeleteRegKey HKCR ${EXT}\shell\AddToPlaylistVLC
306 !macro DeleteContextMenu EXT
308 ReadRegStr $R0 HKCR ${EXT} ""
309 !insertmacro DeleteContextMenuExt $R0
313 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
314 ; 3. Delete prefs and cache ;
315 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
319 !define Index 'Line${__LINE__}'
322 ; this will loop through all the logged users and "virtual" windows users
323 ; (it looks like users are only present in HKEY_USERS when they are logged in)
325 EnumRegKey $1 HKU "" $0
326 StrCmp $1 "" "${Index}-End"
328 ReadRegStr $2 HKU "$1\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" AppData
329 StrCmp $2 "" "${Index}-Loop"
340 !macro OpenUninstallLog
341 FileOpen $UninstallLog "$INSTDIR\uninstall.log" a
342 FileSeek $UninstallLog 0 END
345 !macro CloseUninstallLog
346 FileClose $UninstallLog
347 SetFileAttributes "$INSTDIR\uninstall.log" HIDDEN
353 !macro InstallFile FILEREGEX
355 !define Index 'Line${__LINE__}'
356 FindFirst $0 $1 "$INSTDIR\${FILEREGEX}"
357 StrCmp $0 "" "${Index}-End"
359 StrCmp $1 "" "${Index}-End"
360 FileWrite $UninstallLog "$1$\r$\n"
367 !macro InstallFolder FOLDER
370 Call InstallFolderInternal
373 Function InstallFolderInternal
375 !define Index 'Line${__LINE__}'
376 FindFirst $0 $1 "$INSTDIR\$9\*"
377 StrCmp $0 "" "${Index}-End"
379 StrCmp $1 "" "${Index}-End"
380 StrCmp $1 "." "${Index}-Next"
381 StrCmp $1 ".." "${Index}-Next"
382 IfFileExists "$9\$1\*" 0 "${Index}-Write"
386 Call InstallFolderInternal
391 FileWrite $UninstallLog "$9\$1$\r$\n"
401 ;;;;;;;;;;;;;;;;;;;;;;
402 ; Installer sections ;
405 ;;;;;;;;;;;;;;;;;;;;;;
407 Section $Name_Section01 SEC01
409 SetShellVarContext all
410 SetOutPath "$INSTDIR"
412 !insertmacro OpenUninstallLog
414 ; VLC.exe, libvlc.dll
415 !insertmacro InstallFile vlc.exe
416 !insertmacro InstallFile vlc.exe.manifest
419 !insertmacro InstallFile *.dll
422 !insertmacro InstallFile *.txt
425 !insertmacro InstallFolder plugins
426 !insertmacro InstallFolder locale
427 @BUILD_OSDMENU_TRUE@ !insertmacro InstallFolder osdmenu
428 @BUILD_SKINS_TRUE@ !insertmacro InstallFolder skins
429 @BUILD_HTTPD_TRUE@ !insertmacro InstallFolder http
430 @BUILD_LUA_TRUE@ !insertmacro InstallFolder lua
434 WriteIniStr "$INSTDIR\${PRODUCT_GROUP} Website.url" "InternetShortcut" "URL" \
435 "${PRODUCT_WEB_SITE}"
436 FileWrite $UninstallLog "${PRODUCT_GROUP} Website.url$\r$\n"
437 WriteIniStr "$INSTDIR\Documentation.url" "InternetShortcut" "URL" \
438 "${PRODUCT_WEB_SITE}/doc/"
439 FileWrite $UninstallLog "Documentation.url$\r$\n"
440 WriteIniStr "$INSTDIR\New_Skins.url" "InternetShortcut" "URL" \
441 "${PRODUCT_WEB_SITE}/vlc/skins.php"
442 FileWrite $UninstallLog "New_Skins.url$\r$\n"
444 !insertmacro CloseUninstallLog
446 ; Add VLC to "recommended programs" for the following extensions
447 WriteRegStr HKCR Applications\vlc.exe "" ""
448 WriteRegStr HKCR Applications\vlc.exe "FriendlyAppName" "VLC media player"
449 WriteRegStr HKCR Applications\vlc.exe\shell\Open "" $ContextMenuEntry_PlayWith
450 WriteRegStr HKCR Applications\vlc.exe\shell\Open\command "" \
451 '"$INSTDIR\vlc.exe" --started-from-file "%1"'
452 !insertmacro MacroAllExtensions WriteRegStrSupportedTypes
454 ; Windows default programs Registration
455 ; Vista and above detection
456 ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion
458 StrCmp $R1 '6' lbl_vista lbl_done
461 WriteRegStr HKLM "Software\RegisteredApplications" "VLC" "Software\Clients\Media\VLC\Capabilities"
462 WriteRegStr HKLM "Software\Clients\Media\VLC\Capabilities" "ApplicationName" "VLC media player"
463 WriteRegStr HKLM "Software\Clients\Media\VLC\Capabilities" "ApplicationDescription" "VLC - The video swiss knife"
464 WriteRegStr HKLM "Software\Clients\Media\VLC" "" "VLC media player"
465 WriteRegStr HKLM "Software\Clients\Media\VLC\InstallInfo" "HideIconsCommand" "$\"$INSTDIR\spad-setup.exe$\" /HideIcons /S"
466 WriteRegStr HKLM "Software\Clients\Media\VLC\InstallInfo" "ShowIconsCommand" "$\"$INSTDIR\spad-setup.exe$\" /ShowIcons /S"
467 WriteRegStr HKLM "Software\Clients\Media\VLC\InstallInfo" "ReinstallCommand" "$\"$INSTDIR\spad-setup.exe$\" /Reinstall /S"
468 WriteRegDWORD HKLM "Software\Clients\Media\VLC\InstallInfo" "IconsVisible" 0x001
473 Section $Name_Section02a SEC02a
475 CreateDirectory "$SMPROGRAMS\VideoLAN"
476 CreateDirectory "$SMPROGRAMS\VideoLAN\Quick Settings"
477 CreateDirectory "$SMPROGRAMS\VideoLAN\Quick Settings\Audio"
478 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Audio\Set Audio mode to DirectX (default).lnk" \
479 "$INSTDIR\vlc.exe" "--aout aout_directx --save-config vlc://quit"
480 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Audio\Set Audio mode to Waveout.lnk" \
481 "$INSTDIR\vlc.exe" "--aout waveout --save-config vlc://quit"
482 CreateDirectory "$SMPROGRAMS\VideoLAN\Quick Settings\Interface"
483 @BUILD_SKINS_TRUE@ CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Interface\Set Main Interface to Skinnable.lnk" \
484 @BUILD_SKINS_TRUE@ "$INSTDIR\vlc.exe" "-I skins --save-config vlc://quit"
485 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Interface\Set Main Interface to Qt (default).lnk" \
486 "$INSTDIR\vlc.exe" "-I qt --save-config vlc://quit"
487 CreateDirectory "$SMPROGRAMS\VideoLAN\Quick Settings\Video"
488 ; FIXME add detection for Vista. Direct3D will be default there, for all others it's DirectX
489 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to Direct3D.lnk" \
490 "$INSTDIR\vlc.exe" "--vout direct3d --overlay --directx-hw-yuv --save-config vlc://quit"
491 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to Direct3D (no hardware acceleration).lnk" \
492 "$INSTDIR\vlc.exe" "--vout direct3d --overlay --no-directx-hw-yuv --save-config vlc://quit"
493 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to DirectX.lnk" \
494 "$INSTDIR\vlc.exe" "--vout directx --overlay --directx-hw-yuv --save-config vlc://quit"
495 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to DirectX (no hardware acceleration).lnk" \
496 "$INSTDIR\vlc.exe" "--vout directx --no-overlay --no-directx-hw-yuv --save-config vlc://quit"
497 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to DirectX (no video overlay).lnk" \
498 "$INSTDIR\vlc.exe" "--vout directx --no-overlay --directx-hw-yuv --save-config vlc://quit"
499 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to OpenGL.lnk" \
500 "$INSTDIR\vlc.exe" "--vout opengl --overlay --save-config vlc://quit"
501 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Reset VLC media player preferences and cache files.lnk" \
502 "$INSTDIR\vlc.exe" "--reset-config --reset-plugins-cache vlc://quit"
503 CreateShortCut "$SMPROGRAMS\VideoLAN\Documentation.lnk" \
504 "$INSTDIR\Documentation.url"
505 CreateShortCut "$SMPROGRAMS\VideoLAN\Release Notes.lnk" \
506 "$INSTDIR\NEWS.txt" ""
507 CreateShortCut "$SMPROGRAMS\VideoLAN\${PRODUCT_GROUP} Website.lnk" \
508 "$INSTDIR\${PRODUCT_GROUP} Website.url"
509 CreateShortCut "$SMPROGRAMS\VideoLAN\VLC media player.lnk" \
510 "$INSTDIR\vlc.exe" ""
513 Section $Name_Section02b SEC02b
515 CreateShortCut "$DESKTOP\VLC media player.lnk" \
516 "$INSTDIR\vlc.exe" ""
519 !ifdef INSTALL_MOZILLA
520 Section /o $Name_Section03 SEC03
523 SetOutPath "$INSTDIR"
524 !insertmacro OpenUninstallLog
525 !insertmacro InstallFile mozilla\npvlc.dll
526 !insertmacro InstallFile mozilla\npvlc.dll.manifest
527 !insertmacro CloseUninstallLog
529 !define Moz "SOFTWARE\MozillaPlugins\@videolan.org/vlc,version=${VERSION}"
530 WriteRegStr HKLM ${Moz} "Description" "VLC Multimedia Plugin"
531 WriteRegStr HKLM ${Moz} "Path" "$INSTDIR\npvlc.dll"
532 WriteRegStr HKLM ${Moz} "Product" "VLC media player"
533 WriteRegStr HKLM ${Moz} "Vendor" "VideoLAN"
534 WriteRegStr HKLM ${Moz} "Version" "${VERSION}"
536 ; for very old version of mozilla, these lines may be needed
541 ;!define Index 'Line${__LINE__}'
547 ; EnumRegKey $R0 HKLM "SOFTWARE\Mozilla" "$R1"
548 ; StrCmp $R0 "" "${Index}-End"
550 ; ReadRegStr $R2 HKLM "SOFTWARE\Mozilla\$R0\Extensions" "Plugins"
551 ; StrCmp $R2 "" "${Index}-Loop" ""
553 ; CopyFiles "$INSTDIR\npvlc.dll" "$R2"
555 ; CopyFiles ${LIBVLC_DLL} "$R2"
557 ; !ifdef LIBVLC_CONTROL_DLL
558 ; CopyFiles ${LIBVLC_CONTROL_DLL} "$R2"
560 ; Goto "${Index}-Loop"
568 !ifdef INSTALL_ACTIVEX
569 Section $Name_Section04 SEC04
571 SetOutPath "$INSTDIR"
572 !insertmacro OpenUninstallLog
573 !insertmacro InstallFile activex\axvlc.dll
574 !insertmacro InstallFile activex\axvlc.dll.manifest
575 !insertmacro CloseUninstallLog
576 RegDLL "$INSTDIR\axvlc.dll"
581 Section $Name_Section05 SEC05
583 WriteRegStr HKCR "AudioCD\shell\PlayWithVLC" "" $ContextMenuEntry_PlayWith
584 WriteRegStr HKCR "AudioCD\shell\PlayWithVLC\command" "" \
585 '"$INSTDIR\vlc.exe" --started-from-file cdda://%1'
586 WriteRegStr HKCR "DVD\shell\PlayWithVLC" "" $ContextMenuEntry_PlayWith
587 WriteRegStr HKCR "DVD\shell\PlayWithVLC\command" "" \
588 '"$INSTDIR\vlc.exe" --started-from-file dvd://%1'
590 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayDVDMovieOnArrival" "VLCPlayDVDMovieOnArrival" ""
591 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "Action" $Action_OnArrivalDVD
592 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "DefaultIcon" '"$INSTDIR\vlc.exe",0'
593 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "InvokeProgID" "VLC.DVDMovie"
594 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "InvokeVerb" "play"
595 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "Provider" "VideoLAN VLC media player"
597 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayCDAudioOnArrival" "VLCPlayCDAudioOnArrival" ""
598 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "Action" $Action_OnArrivalAudioCD
599 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "DefaultIcon" '"$INSTDIR\vlc.exe",0'
600 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "InvokeProgID" "VLC.CDAudio"
601 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "InvokeVerb" "play"
602 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "Provider" "VideoLAN VLC media player"
603 WriteRegStr HKCR "VLC.DVDMovie" "" "VLC DVD Movie"
604 WriteRegStr HKCR "VLC.DVDMovie\shell" "" "Open"
605 WriteRegStr HKCR "VLC.DVDMovie\shell\Open\command" "" \
606 '"$INSTDIR\vlc.exe" --started-from-file dvd://%1'
607 WriteRegStr HKCR "VLC.DVDMovie\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'
608 WriteRegStr HKCR "VLC.CDAudio" "" "VLC CD Audio"
609 WriteRegStr HKCR "VLC.CDAudio\shell" "" "Open"
610 WriteRegStr HKCR "VLC.CDAudio\shell\Open\command" "" \
611 '"$INSTDIR\vlc.exe" --started-from-file cdda://%1'
612 WriteRegStr HKCR "VLC.CDAudio\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'
617 SectionGroup /e !$Name_Section06 SEC06
618 SectionGroup $Name_SectionGroupAudio
619 !insertmacro MacroAudioExtensions RegisterExtensionSection
621 SectionGroup $Name_SectionGroupVideo
622 !insertmacro MacroVideoExtensions RegisterExtensionSection
624 SectionGroup $Name_SectionGroupOther
625 !insertmacro MacroOtherExtensions RegisterExtensionSection
629 Section $Name_Section07 SEC07
631 !insertmacro MacroAllExtensions AddContextMenu
632 !insertmacro AddContextMenuExt "Directory"
635 Section $Name_Section08 SEC08
636 !insertmacro delprefs
639 ; Installer section descriptions
640 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
641 !insertmacro MUI_DESCRIPTION_TEXT ${SEC01} $Desc_Section01
642 !insertmacro MUI_DESCRIPTION_TEXT ${SEC02a} $Desc_Section02a
643 !insertmacro MUI_DESCRIPTION_TEXT ${SEC02b} $Desc_Section02b
644 @BUILD_MOZILLA_TRUE@ !insertmacro MUI_DESCRIPTION_TEXT ${SEC03} $Desc_Section03
645 @BUILD_ACTIVEX_TRUE@ !insertmacro MUI_DESCRIPTION_TEXT ${SEC04} $Desc_Section04
646 !insertmacro MUI_DESCRIPTION_TEXT ${SEC05} $Desc_Section05
647 !insertmacro MUI_DESCRIPTION_TEXT ${SEC06} $Desc_Section06
648 !insertmacro MUI_DESCRIPTION_TEXT ${SEC07} $Desc_Section07
649 !insertmacro MUI_DESCRIPTION_TEXT ${SEC08} $Desc_Section08
650 !insertmacro MUI_FUNCTION_DESCRIPTION_END
654 !insertmacro MUI_LANGDLL_DISPLAY
656 !include "languages\english.nsh"
657 StrCmp $LANGUAGE ${LANG_FRENCH} French 0
658 StrCmp $LANGUAGE ${LANG_GERMAN} German 0
659 StrCmp $LANGUAGE ${LANG_ITALIAN} Italian 0
660 StrCmp $LANGUAGE ${LANG_HUNGARIAN} Hungarian 0
661 StrCmp $LANGUAGE ${LANG_ROMANIAN} Romanian 0
662 StrCmp $LANGUAGE ${LANG_CATALAN} Catalan 0
663 StrCmp $LANGUAGE ${LANG_BULGARIAN} Bulgarian 0
664 StrCmp $LANGUAGE ${LANG_SLOVAK} Slovak 0
665 StrCmp $LANGUAGE ${LANG_POLISH} Polish 0
666 StrCmp $LANGUAGE ${LANG_DUTCH} Dutch 0
667 StrCmp $LANGUAGE ${LANG_SIMPCHINESE} SChinese 0
668 StrCmp $LANGUAGE ${LANG_FINNISH} Finnish 0
669 StrCmp $LANGUAGE ${LANG_PORTUGUESEBR} Brazilian EndLanguageCmp
671 !include "languages\french.nsh"
674 !include "languages\german.nsh"
677 !include "languages\italian.nsh"
680 !include "languages\hungarian.nsh"
683 !include "languages\romanian.nsh"
686 !include "languages\catalan.nsh"
689 !include "languages\bulgarian.nsh"
692 !include "languages\slovak.nsh"
695 !include "languages\polish.nsh"
698 !include "languages\dutch.nsh"
701 !include "languages\schinese.nsh"
704 !include "languages\finnish.nsh"
707 !include "languages\brazilian_portuguese.nsh"
710 ReadRegStr $R0 ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
714 MessageBox MB_YESNO|MB_ICONEXCLAMATION $Message_AlreadyInstalled IDNO done
719 ExecWait '$R0 _?=$INSTDIR' ;Do not copy the uninstaller to a temp file
726 WriteUninstaller "$INSTDIR\uninstall.exe"
727 WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "InstallDir" $INSTDIR
728 WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "Version" "${VERSION}"
729 WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\vlc.exe"
731 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
732 "DisplayName" "$(^Name)"
733 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
734 "UninstallString" "$INSTDIR\uninstall.exe"
735 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
736 "InstallLocation" "$INSTDIR"
737 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
738 "DisplayIcon" "$INSTDIR\vlc.exe"
739 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
740 "DisplayVersion" "${PRODUCT_VERSION}"
741 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
742 "URLInfoAbout" "${PRODUCT_WEB_SITE}"
743 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
744 "Publisher" "${PRODUCT_PUBLISHER}"
745 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
746 "VersionMajor" "@VERSION_MAJOR@"
747 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
748 "VersionMinor" "@VERSION_MINOR@"
751 ;;;;;;;;;;;;;;;;;;;;;;;;
752 ; Uninstaller sections ;
753 ;;;;;;;;;;;;;;;;;;;;;;;;
755 ; TrimNewlines (copied from NSIS documentation)
756 ; input, top of stack (e.g. whatever$\r$\n)
757 ; output, top of stack (replaces, with e.g. whatever)
758 ; modifies no other variables.
760 Function un.TrimNewlines
769 StrCmp $R2 "$\r" loop
770 StrCmp $R2 "$\n" loop
772 IntCmp $R1 0 no_trim_needed
781 Function un.RemoveEmptyDirs
783 !define Index 'Line${__LINE__}'
784 FindFirst $0 $1 "$INSTDIR$9*"
785 StrCmp $0 "" "${Index}-End"
787 StrCmp $1 "" "${Index}-End"
788 StrCmp $1 "." "${Index}-Next"
789 StrCmp $1 ".." "${Index}-Next"
794 Call un.RemoveEmptyDirs
808 Section "un.$Name_Section91" SEC91
810 SetShellVarContext all
812 !insertmacro MacroAllExtensions DeleteContextMenu
813 !insertmacro MacroAllExtensions UnRegisterExtensionSection
814 !insertmacro DeleteContextMenuExt "Directory"
816 ;remove activex plugin
817 UnRegDLL "$INSTDIR\axvlc.dll"
818 Delete /REBOOTOK "$INSTDIR\axvlc.dll"
819 Delete /REBOOTOK "$INSTDIR\axvlc.dll.manifest"
821 ;remove mozilla plugin
826 !define Index 'Line${__LINE__}'
832 EnumRegKey $R0 HKLM "SOFTWARE\Mozilla" "$R1"
833 StrCmp $R0 "" "${Index}-End"
835 ReadRegStr $R2 HKLM "SOFTWARE\Mozilla\$R0\Extensions" "Plugins"
836 StrCmp $R2 "" "${Index}-Loop" ""
838 ; old files (0.8.5 and before) that may be lying around
839 Delete /REBOOTOK "$R2\npvlc.dll"
840 Delete /REBOOTOK "$R2\libvlc.dll"
841 Delete /REBOOTOK "$R2\vlcintf.xpt"
846 Delete /REBOOTOK "$INSTDIR\npvlc.dll"
847 Delete /REBOOTOK "$INSTDIR\npvlc.dll.manifest"
849 RMDir "$SMPROGRAMS\VideoLAN"
850 RMDir /r $SMPROGRAMS\VideoLAN
852 FileOpen $UninstallLog "$INSTDIR\uninstall.log" r
855 FileRead $UninstallLog $R0
856 IfErrors UninstallEnd
860 Delete "$INSTDIR\$R0"
863 FileClose $UninstallLog
864 Delete "$INSTDIR\uninstall.log"
865 Delete "$INSTDIR\uninstall.exe"
867 Call un.RemoveEmptyDirs
870 DeleteRegKey HKLM Software\VideoLAN
872 DeleteRegKey HKCR Applications\vlc.exe
873 DeleteRegKey HKCR AudioCD\shell\PlayWithVLC
874 DeleteRegKey HKCR DVD\shell\PlayWithVLC
875 DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayDVDMovieOnArrival" "VLCPlayDVDMovieOnArrival"
876 DeleteRegKey HKLM Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival
877 DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayCDAudioOnArrival" "VLCPlayCDAudioOnArrival"
878 DeleteRegKey HKLM Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival
879 DeleteRegKey HKLM Software\Clients\Media\VLC
880 DeleteRegValue HKLM "Software\RegisteredApplications" "VLC"
881 DeleteRegKey HKCR "VLC.MediaFile"
884 "SOFTWARE\MozillaPlugins\@videolan.org/vlc,version=${VERSION}"
887 "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
889 Delete "$DESKTOP\VLC media player.lnk"
891 DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
892 DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}"
896 Section /o "un.$Name_Section92" SEC92
897 !insertmacro delprefs
900 ; Uninstaller section descriptions
901 !insertmacro MUI_UNFUNCTION_DESCRIPTION_BEGIN
902 !insertmacro MUI_DESCRIPTION_TEXT ${SEC91} $Desc_Section91
903 !insertmacro MUI_DESCRIPTION_TEXT ${SEC92} $Desc_Section92
904 !insertmacro MUI_UNFUNCTION_DESCRIPTION_END
906 ;Function un.onUninstSuccess
908 ; MessageBox MB_ICONINFORMATION|MB_OK \
909 ; "$(^Name) was successfully removed from your computer."
913 !insertmacro MUI_UNGETLANGUAGE
915 !include "languages\english.nsh"
916 StrCmp $LANGUAGE ${LANG_FRENCH} French 0
917 StrCmp $LANGUAGE ${LANG_GERMAN} German 0
918 StrCmp $LANGUAGE ${LANG_ITALIAN} Italian 0
919 StrCmp $LANGUAGE ${LANG_HUNGARIAN} Hungarian 0
920 StrCmp $LANGUAGE ${LANG_ROMANIAN} Romanian 0
921 StrCmp $LANGUAGE ${LANG_CATALAN} Catalan 0
922 StrCmp $LANGUAGE ${LANG_BULGARIAN} Bulgarian 0
923 StrCmp $LANGUAGE ${LANG_SLOVAK} Slovak 0
924 StrCmp $LANGUAGE ${LANG_POLISH} Polish 0
925 StrCmp $LANGUAGE ${LANG_DUTCH} Dutch 0
926 StrCmp $LANGUAGE ${LANG_SIMPCHINESE} SChinese 0
927 StrCmp $LANGUAGE ${LANG_FINNISH} Finnish 0
928 StrCmp $LANGUAGE ${LANG_PORTUGUESEBR} Brazilian EndLanguageCmp
930 !include "languages\french.nsh"
933 !include "languages\german.nsh"
936 !include "languages\italian.nsh"
939 !include "languages\hungarian.nsh"
942 !include "languages\romanian.nsh"
945 !include "languages\catalan.nsh"
948 !include "languages\bulgarian.nsh"
951 !include "languages\slovak.nsh"
954 !include "languages\polish.nsh"
957 !include "languages\dutch.nsh"
960 !include "languages\schinese.nsh"
963 !include "languages\finnish.nsh"
966 !include "languages\brazilian_portuguese.nsh"