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} ".wmv"
261 !macro MacroOtherExtensions _action
262 !insertmacro ${_action} ".asx"
263 !insertmacro ${_action} ".bin"
264 !insertmacro ${_action} ".cue"
265 !insertmacro ${_action} ".ifo"
266 !insertmacro ${_action} ".m3u"
267 !insertmacro ${_action} ".pls"
268 !insertmacro ${_action} ".sdp"
269 !insertmacro ${_action} ".vlc"
270 !insertmacro ${_action} ".xspf"
273 ; One macro to rule them all
274 !macro MacroAllExtensions _action
275 !insertmacro MacroAudioExtensions ${_action}
276 !insertmacro MacroVideoExtensions ${_action}
277 !insertmacro MacroOtherExtensions ${_action}
280 ;;;;;;;;;;;;;;;;;;;;;;;;;;;
281 ; 2. Context menu entries ;
282 ;;;;;;;;;;;;;;;;;;;;;;;;;;;
284 ; Generic function for adding the context menu for one ext.
285 !macro AddContextMenuExt EXT
286 WriteRegStr HKCR ${EXT}\shell\PlayWithVLC "" $ContextMenuEntry_PlayWith
287 WriteRegStr HKCR ${EXT}\shell\PlayWithVLC\command "" '"$INSTDIR\vlc.exe" --started-from-file --no-playlist-enqueue "%1"'
289 WriteRegStr HKCR ${EXT}\shell\AddToPlaylistVLC "" $ContextMenuEntry_AddToPlaylist
290 WriteRegStr HKCR ${EXT}\shell\AddToPlaylistVLC\command "" '"$INSTDIR\vlc.exe" --started-from-file --playlist-enqueue "%1"'
293 !macro AddContextMenu EXT
295 ReadRegStr $R0 HKCR ${EXT} ""
296 !insertmacro AddContextMenuExt $R0
300 !macro DeleteContextMenuExt EXT
301 DeleteRegKey HKCR ${EXT}\shell\PlayWithVLC
302 DeleteRegKey HKCR ${EXT}\shell\AddToPlaylistVLC
305 !macro DeleteContextMenu EXT
307 ReadRegStr $R0 HKCR ${EXT} ""
308 !insertmacro DeleteContextMenuExt $R0
312 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
313 ; 3. Delete prefs and cache ;
314 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
318 !define Index 'Line${__LINE__}'
321 ; this will loop through all the logged users and "virtual" windows users
322 ; (it looks like users are only present in HKEY_USERS when they are logged in)
324 EnumRegKey $1 HKU "" $0
325 StrCmp $1 "" "${Index}-End"
327 ReadRegStr $2 HKU "$1\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" AppData
328 StrCmp $2 "" "${Index}-Loop"
339 !macro OpenUninstallLog
340 FileOpen $UninstallLog "$INSTDIR\uninstall.log" a
341 FileSeek $UninstallLog 0 END
344 !macro CloseUninstallLog
345 FileClose $UninstallLog
346 SetFileAttributes "$INSTDIR\uninstall.log" HIDDEN
352 !macro InstallFile FILEREGEX
354 !define Index 'Line${__LINE__}'
355 FindFirst $0 $1 "$INSTDIR\${FILEREGEX}"
356 StrCmp $0 "" "${Index}-End"
358 StrCmp $1 "" "${Index}-End"
359 FileWrite $UninstallLog "$1$\r$\n"
366 !macro InstallFolder FOLDER
369 Call InstallFolderInternal
372 Function InstallFolderInternal
374 !define Index 'Line${__LINE__}'
375 FindFirst $0 $1 "$INSTDIR\$9\*"
376 StrCmp $0 "" "${Index}-End"
378 StrCmp $1 "" "${Index}-End"
379 StrCmp $1 "." "${Index}-Next"
380 StrCmp $1 ".." "${Index}-Next"
381 IfFileExists "$9\$1\*" 0 "${Index}-Write"
385 Call InstallFolderInternal
390 FileWrite $UninstallLog "$9\$1$\r$\n"
400 ;;;;;;;;;;;;;;;;;;;;;;
401 ; Installer sections ;
404 ;;;;;;;;;;;;;;;;;;;;;;
406 Section $Name_Section01 SEC01
408 SetShellVarContext all
409 SetOutPath "$INSTDIR"
411 !insertmacro OpenUninstallLog
413 ; VLC.exe, libvlc.dll
414 !insertmacro InstallFile vlc.exe
415 !insertmacro InstallFile vlc.exe.manifest
418 !insertmacro InstallFile *.dll
421 !insertmacro InstallFile *.txt
424 !insertmacro InstallFolder plugins
425 !insertmacro InstallFolder locale
426 @BUILD_OSDMENU_TRUE@ !insertmacro InstallFolder osdmenu
427 @BUILD_SKINS_TRUE@ !insertmacro InstallFolder skins
428 @BUILD_HTTPD_TRUE@ !insertmacro InstallFolder http
429 @BUILD_LUA_TRUE@ !insertmacro InstallFolder lua
433 WriteIniStr "$INSTDIR\${PRODUCT_GROUP} Website.url" "InternetShortcut" "URL" \
434 "${PRODUCT_WEB_SITE}"
435 FileWrite $UninstallLog "${PRODUCT_GROUP} Website.url$\r$\n"
436 WriteIniStr "$INSTDIR\Documentation.url" "InternetShortcut" "URL" \
437 "${PRODUCT_WEB_SITE}/doc/"
438 FileWrite $UninstallLog "Documentation.url$\r$\n"
439 WriteIniStr "$INSTDIR\New_Skins.url" "InternetShortcut" "URL" \
440 "${PRODUCT_WEB_SITE}/vlc/skins.php"
441 FileWrite $UninstallLog "New_Skins.url$\r$\n"
443 !insertmacro CloseUninstallLog
445 ; Add VLC to "recommended programs" for the following extensions
446 WriteRegStr HKCR Applications\vlc.exe "" ""
447 WriteRegStr HKCR Applications\vlc.exe "FriendlyAppName" "VLC media player"
448 WriteRegStr HKCR Applications\vlc.exe\shell\Open "" $ContextMenuEntry_PlayWith
449 WriteRegStr HKCR Applications\vlc.exe\shell\Open\command "" \
450 '"$INSTDIR\vlc.exe" --started-from-file "%1"'
451 !insertmacro MacroAllExtensions WriteRegStrSupportedTypes
453 ; Windows default programs Registration
454 ; Vista and above detection
455 ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion
457 StrCmp $R1 '6' lbl_vista lbl_done
460 WriteRegStr HKLM "Software\RegisteredApplications" "VLC" "Software\Clients\Media\VLC\Capabilities"
461 WriteRegStr HKLM "Software\Clients\Media\VLC\Capabilities" "ApplicationName" "VLC media player"
462 WriteRegStr HKLM "Software\Clients\Media\VLC\Capabilities" "ApplicationDescription" "VLC - The video swiss knife"
463 WriteRegStr HKLM "Software\Clients\Media\VLC" "" "VLC media player"
464 WriteRegStr HKLM "Software\Clients\Media\VLC\InstallInfo" "HideIconsCommand" "$\"$INSTDIR\spad-setup.exe$\" /HideIcons /S"
465 WriteRegStr HKLM "Software\Clients\Media\VLC\InstallInfo" "ShowIconsCommand" "$\"$INSTDIR\spad-setup.exe$\" /ShowIcons /S"
466 WriteRegStr HKLM "Software\Clients\Media\VLC\InstallInfo" "ReinstallCommand" "$\"$INSTDIR\spad-setup.exe$\" /Reinstall /S"
467 WriteRegDWORD HKLM "Software\Clients\Media\VLC\InstallInfo" "IconsVisible" 0x001
472 Section $Name_Section02a SEC02a
474 CreateDirectory "$SMPROGRAMS\VideoLAN"
475 CreateDirectory "$SMPROGRAMS\VideoLAN\Quick Settings"
476 CreateDirectory "$SMPROGRAMS\VideoLAN\Quick Settings\Audio"
477 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Audio\Set Audio mode to DirectX (default).lnk" \
478 "$INSTDIR\vlc.exe" "--aout aout_directx --save-config vlc://quit"
479 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Audio\Set Audio mode to Waveout.lnk" \
480 "$INSTDIR\vlc.exe" "--aout waveout --save-config vlc://quit"
481 CreateDirectory "$SMPROGRAMS\VideoLAN\Quick Settings\Interface"
482 @BUILD_SKINS_TRUE@ CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Interface\Set Main Interface to Skinnable.lnk" \
483 @BUILD_SKINS_TRUE@ "$INSTDIR\vlc.exe" "-I skins --save-config vlc://quit"
484 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Interface\Set Main Interface to Qt (default).lnk" \
485 "$INSTDIR\vlc.exe" "-I qt --save-config vlc://quit"
486 CreateDirectory "$SMPROGRAMS\VideoLAN\Quick Settings\Video"
487 ; FIXME add detection for Vista. Direct3D will be default there, for all others it's DirectX
488 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to Direct3D.lnk" \
489 "$INSTDIR\vlc.exe" "--vout direct3d --overlay --directx-hw-yuv --save-config vlc://quit"
490 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to Direct3D (no hardware acceleration).lnk" \
491 "$INSTDIR\vlc.exe" "--vout direct3d --overlay --no-directx-hw-yuv --save-config vlc://quit"
492 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to DirectX.lnk" \
493 "$INSTDIR\vlc.exe" "--vout directx --overlay --directx-hw-yuv --save-config vlc://quit"
494 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to DirectX (no hardware acceleration).lnk" \
495 "$INSTDIR\vlc.exe" "--vout directx --no-overlay --no-directx-hw-yuv --save-config vlc://quit"
496 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to DirectX (no video overlay).lnk" \
497 "$INSTDIR\vlc.exe" "--vout directx --no-overlay --directx-hw-yuv --save-config vlc://quit"
498 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to OpenGL.lnk" \
499 "$INSTDIR\vlc.exe" "--vout opengl --overlay --save-config vlc://quit"
500 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Reset VLC media player preferences and cache files.lnk" \
501 "$INSTDIR\vlc.exe" "--reset-config --reset-plugins-cache vlc://quit"
502 CreateShortCut "$SMPROGRAMS\VideoLAN\Documentation.lnk" \
503 "$INSTDIR\Documentation.url"
504 CreateShortCut "$SMPROGRAMS\VideoLAN\Release Notes.lnk" \
505 "$INSTDIR\NEWS.txt" ""
506 CreateShortCut "$SMPROGRAMS\VideoLAN\${PRODUCT_GROUP} Website.lnk" \
507 "$INSTDIR\${PRODUCT_GROUP} Website.url"
508 CreateShortCut "$SMPROGRAMS\VideoLAN\VLC media player.lnk" \
509 "$INSTDIR\vlc.exe" ""
512 Section $Name_Section02b SEC02b
514 CreateShortCut "$DESKTOP\VLC media player.lnk" \
515 "$INSTDIR\vlc.exe" ""
518 !ifdef INSTALL_MOZILLA
519 Section /o $Name_Section03 SEC03
522 SetOutPath "$INSTDIR"
523 !insertmacro OpenUninstallLog
524 !insertmacro InstallFile mozilla\npvlc.dll
525 !insertmacro InstallFile mozilla\npvlc.dll.manifest
526 !insertmacro CloseUninstallLog
528 !define Moz "SOFTWARE\MozillaPlugins\@videolan.org/vlc,version=${VERSION}"
529 WriteRegStr HKLM ${Moz} "Description" "VLC Multimedia Plugin"
530 WriteRegStr HKLM ${Moz} "Path" "$INSTDIR\npvlc.dll"
531 WriteRegStr HKLM ${Moz} "Product" "VLC media player"
532 WriteRegStr HKLM ${Moz} "Vendor" "VideoLAN"
533 WriteRegStr HKLM ${Moz} "Version" "${VERSION}"
535 ; for very old version of mozilla, these lines may be needed
540 ;!define Index 'Line${__LINE__}'
546 ; EnumRegKey $R0 HKLM "SOFTWARE\Mozilla" "$R1"
547 ; StrCmp $R0 "" "${Index}-End"
549 ; ReadRegStr $R2 HKLM "SOFTWARE\Mozilla\$R0\Extensions" "Plugins"
550 ; StrCmp $R2 "" "${Index}-Loop" ""
552 ; CopyFiles "$INSTDIR\npvlc.dll" "$R2"
554 ; CopyFiles ${LIBVLC_DLL} "$R2"
556 ; !ifdef LIBVLC_CONTROL_DLL
557 ; CopyFiles ${LIBVLC_CONTROL_DLL} "$R2"
559 ; Goto "${Index}-Loop"
567 !ifdef INSTALL_ACTIVEX
568 Section $Name_Section04 SEC04
570 SetOutPath "$INSTDIR"
571 !insertmacro OpenUninstallLog
572 !insertmacro InstallFile activex\axvlc.dll
573 !insertmacro InstallFile activex\axvlc.dll.manifest
574 !insertmacro CloseUninstallLog
575 RegDLL "$INSTDIR\axvlc.dll"
580 Section $Name_Section05 SEC05
582 WriteRegStr HKCR "AudioCD\shell\PlayWithVLC" "" $ContextMenuEntry_PlayWith
583 WriteRegStr HKCR "AudioCD\shell\PlayWithVLC\command" "" \
584 '"$INSTDIR\vlc.exe" --started-from-file cdda://%1'
585 WriteRegStr HKCR "DVD\shell\PlayWithVLC" "" $ContextMenuEntry_PlayWith
586 WriteRegStr HKCR "DVD\shell\PlayWithVLC\command" "" \
587 '"$INSTDIR\vlc.exe" --started-from-file dvd://%1'
589 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayDVDMovieOnArrival" "VLCPlayDVDMovieOnArrival" ""
590 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "Action" $Action_OnArrivalDVD
591 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "DefaultIcon" '"$INSTDIR\vlc.exe",0'
592 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "InvokeProgID" "VLC.DVDMovie"
593 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "InvokeVerb" "play"
594 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "Provider" "VideoLAN VLC media player"
596 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayCDAudioOnArrival" "VLCPlayCDAudioOnArrival" ""
597 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "Action" $Action_OnArrivalAudioCD
598 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "DefaultIcon" '"$INSTDIR\vlc.exe",0'
599 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "InvokeProgID" "VLC.CDAudio"
600 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "InvokeVerb" "play"
601 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "Provider" "VideoLAN VLC media player"
602 WriteRegStr HKCR "VLC.DVDMovie" "" "VLC DVD Movie"
603 WriteRegStr HKCR "VLC.DVDMovie\shell" "" "Open"
604 WriteRegStr HKCR "VLC.DVDMovie\shell\Open\command" "" \
605 '"$INSTDIR\vlc.exe" --started-from-file dvd://%1'
606 WriteRegStr HKCR "VLC.DVDMovie\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'
607 WriteRegStr HKCR "VLC.CDAudio" "" "VLC CD Audio"
608 WriteRegStr HKCR "VLC.CDAudio\shell" "" "Open"
609 WriteRegStr HKCR "VLC.CDAudio\shell\Open\command" "" \
610 '"$INSTDIR\vlc.exe" --started-from-file cdda://%1'
611 WriteRegStr HKCR "VLC.CDAudio\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'
616 SectionGroup /e !$Name_Section06 SEC06
617 SectionGroup $Name_SectionGroupAudio
618 !insertmacro MacroAudioExtensions RegisterExtensionSection
620 SectionGroup $Name_SectionGroupVideo
621 !insertmacro MacroVideoExtensions RegisterExtensionSection
623 SectionGroup $Name_SectionGroupOther
624 !insertmacro MacroOtherExtensions RegisterExtensionSection
628 Section $Name_Section07 SEC07
630 !insertmacro MacroAllExtensions AddContextMenu
631 !insertmacro AddContextMenuExt "Directory"
634 Section $Name_Section08 SEC08
635 !insertmacro delprefs
638 ; Installer section descriptions
639 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
640 !insertmacro MUI_DESCRIPTION_TEXT ${SEC01} $Desc_Section01
641 !insertmacro MUI_DESCRIPTION_TEXT ${SEC02a} $Desc_Section02a
642 !insertmacro MUI_DESCRIPTION_TEXT ${SEC02b} $Desc_Section02b
643 @BUILD_MOZILLA_TRUE@ !insertmacro MUI_DESCRIPTION_TEXT ${SEC03} $Desc_Section03
644 @BUILD_ACTIVEX_TRUE@ !insertmacro MUI_DESCRIPTION_TEXT ${SEC04} $Desc_Section04
645 !insertmacro MUI_DESCRIPTION_TEXT ${SEC05} $Desc_Section05
646 !insertmacro MUI_DESCRIPTION_TEXT ${SEC06} $Desc_Section06
647 !insertmacro MUI_DESCRIPTION_TEXT ${SEC07} $Desc_Section07
648 !insertmacro MUI_DESCRIPTION_TEXT ${SEC08} $Desc_Section08
649 !insertmacro MUI_FUNCTION_DESCRIPTION_END
653 !insertmacro MUI_LANGDLL_DISPLAY
655 !include "languages\english.nsh"
656 StrCmp $LANGUAGE ${LANG_FRENCH} French 0
657 StrCmp $LANGUAGE ${LANG_GERMAN} German 0
658 StrCmp $LANGUAGE ${LANG_ITALIAN} Italian 0
659 StrCmp $LANGUAGE ${LANG_HUNGARIAN} Hungarian 0
660 StrCmp $LANGUAGE ${LANG_ROMANIAN} Romanian 0
661 StrCmp $LANGUAGE ${LANG_CATALAN} Catalan 0
662 StrCmp $LANGUAGE ${LANG_BULGARIAN} Bulgarian 0
663 StrCmp $LANGUAGE ${LANG_SLOVAK} Slovak 0
664 StrCmp $LANGUAGE ${LANG_POLISH} Polish 0
665 StrCmp $LANGUAGE ${LANG_DUTCH} Dutch 0
666 StrCmp $LANGUAGE ${LANG_SIMPCHINESE} SChinese 0
667 StrCmp $LANGUAGE ${LANG_FINNISH} Finnish 0
668 StrCmp $LANGUAGE ${LANG_PORTUGUESEBR} Brazilian EndLanguageCmp
670 !include "languages\french.nsh"
673 !include "languages\german.nsh"
676 !include "languages\italian.nsh"
679 !include "languages\hungarian.nsh"
682 !include "languages\romanian.nsh"
685 !include "languages\catalan.nsh"
688 !include "languages\bulgarian.nsh"
691 !include "languages\slovak.nsh"
694 !include "languages\polish.nsh"
697 !include "languages\dutch.nsh"
700 !include "languages\schinese.nsh"
703 !include "languages\finnish.nsh"
706 !include "languages\brazilian_portuguese.nsh"
709 ReadRegStr $R0 ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
713 MessageBox MB_YESNO|MB_ICONEXCLAMATION $Message_AlreadyInstalled IDNO done
718 ExecWait '$R0 _?=$INSTDIR' ;Do not copy the uninstaller to a temp file
725 WriteUninstaller "$INSTDIR\uninstall.exe"
726 WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "InstallDir" $INSTDIR
727 WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "Version" "${VERSION}"
728 WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\vlc.exe"
730 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
731 "DisplayName" "$(^Name)"
732 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
733 "UninstallString" "$INSTDIR\uninstall.exe"
734 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
735 "InstallLocation" "$INSTDIR"
736 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
737 "DisplayIcon" "$INSTDIR\vlc.exe"
738 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
739 "DisplayVersion" "${PRODUCT_VERSION}"
740 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
741 "URLInfoAbout" "${PRODUCT_WEB_SITE}"
742 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
743 "Publisher" "${PRODUCT_PUBLISHER}"
744 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
745 "VersionMajor" "@VERSION_MAJOR@"
746 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
747 "VersionMinor" "@VERSION_MINOR@"
750 ;;;;;;;;;;;;;;;;;;;;;;;;
751 ; Uninstaller sections ;
752 ;;;;;;;;;;;;;;;;;;;;;;;;
754 ; TrimNewlines (copied from NSIS documentation)
755 ; input, top of stack (e.g. whatever$\r$\n)
756 ; output, top of stack (replaces, with e.g. whatever)
757 ; modifies no other variables.
759 Function un.TrimNewlines
768 StrCmp $R2 "$\r" loop
769 StrCmp $R2 "$\n" loop
771 IntCmp $R1 0 no_trim_needed
780 Function un.RemoveEmptyDirs
782 !define Index 'Line${__LINE__}'
783 FindFirst $0 $1 "$INSTDIR$9*"
784 StrCmp $0 "" "${Index}-End"
786 StrCmp $1 "" "${Index}-End"
787 StrCmp $1 "." "${Index}-Next"
788 StrCmp $1 ".." "${Index}-Next"
793 Call un.RemoveEmptyDirs
807 Section "un.$Name_Section91" SEC91
809 SetShellVarContext all
811 !insertmacro MacroAllExtensions DeleteContextMenu
812 !insertmacro MacroAllExtensions UnRegisterExtensionSection
813 !insertmacro DeleteContextMenuExt "Directory"
815 ;remove activex plugin
816 UnRegDLL "$INSTDIR\axvlc.dll"
817 Delete /REBOOTOK "$INSTDIR\axvlc.dll"
818 Delete /REBOOTOK "$INSTDIR\axvlc.dll.manifest"
820 ;remove mozilla plugin
825 !define Index 'Line${__LINE__}'
831 EnumRegKey $R0 HKLM "SOFTWARE\Mozilla" "$R1"
832 StrCmp $R0 "" "${Index}-End"
834 ReadRegStr $R2 HKLM "SOFTWARE\Mozilla\$R0\Extensions" "Plugins"
835 StrCmp $R2 "" "${Index}-Loop" ""
837 ; old files (0.8.5 and before) that may be lying around
838 Delete /REBOOTOK "$R2\npvlc.dll"
839 Delete /REBOOTOK "$R2\libvlc.dll"
840 Delete /REBOOTOK "$R2\vlcintf.xpt"
845 Delete /REBOOTOK "$INSTDIR\npvlc.dll"
846 Delete /REBOOTOK "$INSTDIR\npvlc.dll.manifest"
848 RMDir "$SMPROGRAMS\VideoLAN"
849 RMDir /r $SMPROGRAMS\VideoLAN
851 FileOpen $UninstallLog "$INSTDIR\uninstall.log" r
854 FileRead $UninstallLog $R0
855 IfErrors UninstallEnd
859 Delete "$INSTDIR\$R0"
862 FileClose $UninstallLog
863 Delete "$INSTDIR\uninstall.log"
864 Delete "$INSTDIR\uninstall.exe"
866 Call un.RemoveEmptyDirs
869 DeleteRegKey HKLM Software\VideoLAN
871 DeleteRegKey HKCR Applications\vlc.exe
872 DeleteRegKey HKCR AudioCD\shell\PlayWithVLC
873 DeleteRegKey HKCR DVD\shell\PlayWithVLC
874 DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayDVDMovieOnArrival" "VLCPlayDVDMovieOnArrival"
875 DeleteRegKey HKLM Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival
876 DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayCDAudioOnArrival" "VLCPlayCDAudioOnArrival"
877 DeleteRegKey HKLM Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival
878 DeleteRegKey HKLM Software\Clients\Media\VLC
879 DeleteRegValue HKLM "Software\RegisteredApplications" "VLC"
880 DeleteRegKey HKCR "VLC.MediaFile"
883 "SOFTWARE\MozillaPlugins\@videolan.org/vlc,version=${VERSION}"
886 "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
888 Delete "$DESKTOP\VLC media player.lnk"
890 DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
891 DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}"
895 Section /o "un.$Name_Section92" SEC92
896 !insertmacro delprefs
899 ; Uninstaller section descriptions
900 !insertmacro MUI_UNFUNCTION_DESCRIPTION_BEGIN
901 !insertmacro MUI_DESCRIPTION_TEXT ${SEC91} $Desc_Section91
902 !insertmacro MUI_DESCRIPTION_TEXT ${SEC92} $Desc_Section92
903 !insertmacro MUI_UNFUNCTION_DESCRIPTION_END
905 ;Function un.onUninstSuccess
907 ; MessageBox MB_ICONINFORMATION|MB_OK \
908 ; "$(^Name) was successfully removed from your computer."
912 !insertmacro MUI_UNGETLANGUAGE
914 !include "languages\english.nsh"
915 StrCmp $LANGUAGE ${LANG_FRENCH} French 0
916 StrCmp $LANGUAGE ${LANG_GERMAN} German 0
917 StrCmp $LANGUAGE ${LANG_ITALIAN} Italian 0
918 StrCmp $LANGUAGE ${LANG_HUNGARIAN} Hungarian 0
919 StrCmp $LANGUAGE ${LANG_ROMANIAN} Romanian 0
920 StrCmp $LANGUAGE ${LANG_CATALAN} Catalan 0
921 StrCmp $LANGUAGE ${LANG_BULGARIAN} Bulgarian 0
922 StrCmp $LANGUAGE ${LANG_SLOVAK} Slovak 0
923 StrCmp $LANGUAGE ${LANG_POLISH} Polish 0
924 StrCmp $LANGUAGE ${LANG_DUTCH} Dutch 0
925 StrCmp $LANGUAGE ${LANG_SIMPCHINESE} SChinese 0
926 StrCmp $LANGUAGE ${LANG_FINNISH} Finnish 0
927 StrCmp $LANGUAGE ${LANG_PORTUGUESEBR} Brazilian EndLanguageCmp
929 !include "languages\french.nsh"
932 !include "languages\german.nsh"
935 !include "languages\italian.nsh"
938 !include "languages\hungarian.nsh"
941 !include "languages\romanian.nsh"
944 !include "languages\catalan.nsh"
947 !include "languages\bulgarian.nsh"
950 !include "languages\slovak.nsh"
953 !include "languages\polish.nsh"
956 !include "languages\dutch.nsh"
959 !include "languages\schinese.nsh"
962 !include "languages\finnish.nsh"
965 !include "languages\brazilian_portuguese.nsh"