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 "recommended 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"
462 WriteRegStr HKLM "Software\Clients\Media\VLC" "" "VLC media player"
463 WriteRegStr HKLM "Software\Clients\Media\VLC\InstallInfo" "HideIconsCommand" "$\"$INSTDIR\spad-setup.exe$\" /HideIcons /S"
464 WriteRegStr HKLM "Software\Clients\Media\VLC\InstallInfo" "ShowIconsCommand" "$\"$INSTDIR\spad-setup.exe$\" /ShowIcons /S"
465 WriteRegStr HKLM "Software\Clients\Media\VLC\InstallInfo" "ReinstallCommand" "$\"$INSTDIR\spad-setup.exe$\" /Reinstall /S"
466 WriteRegDWORD HKLM "Software\Clients\Media\VLC\InstallInfo" "IconsVisible" 0x001
471 Section $Name_Section02a SEC02a
473 CreateDirectory "$SMPROGRAMS\VideoLAN"
474 CreateDirectory "$SMPROGRAMS\VideoLAN\Quick Settings"
475 CreateDirectory "$SMPROGRAMS\VideoLAN\Quick Settings\Audio"
476 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Audio\Set Audio mode to DirectX (default).lnk" \
477 "$INSTDIR\vlc.exe" "--aout aout_directx --save-config vlc://quit"
478 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Audio\Set Audio mode to Waveout.lnk" \
479 "$INSTDIR\vlc.exe" "--aout waveout --save-config vlc://quit"
480 CreateDirectory "$SMPROGRAMS\VideoLAN\Quick Settings\Interface"
481 @BUILD_SKINS_TRUE@ CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Interface\Set Main Interface to Skinnable.lnk" \
482 @BUILD_SKINS_TRUE@ "$INSTDIR\vlc.exe" "-I skins --save-config vlc://quit"
483 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Interface\Set Main Interface to Qt (default).lnk" \
484 "$INSTDIR\vlc.exe" "-I qt --save-config vlc://quit"
485 CreateDirectory "$SMPROGRAMS\VideoLAN\Quick Settings\Video"
486 ; FIXME add detection for Vista. Direct3D will be default there, for all others it's DirectX
487 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to Direct3D.lnk" \
488 "$INSTDIR\vlc.exe" "--vout direct3d --overlay --directx-hw-yuv --save-config vlc://quit"
489 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to Direct3D (no hardware acceleration).lnk" \
490 "$INSTDIR\vlc.exe" "--vout direct3d --overlay --no-directx-hw-yuv --save-config vlc://quit"
491 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to DirectX.lnk" \
492 "$INSTDIR\vlc.exe" "--vout directx --overlay --directx-hw-yuv --save-config vlc://quit"
493 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to DirectX (no hardware acceleration).lnk" \
494 "$INSTDIR\vlc.exe" "--vout directx --no-overlay --no-directx-hw-yuv --save-config vlc://quit"
495 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to DirectX (no video overlay).lnk" \
496 "$INSTDIR\vlc.exe" "--vout directx --no-overlay --directx-hw-yuv --save-config vlc://quit"
497 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to OpenGL.lnk" \
498 "$INSTDIR\vlc.exe" "--vout opengl --overlay --save-config vlc://quit"
499 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Reset VLC media player preferences and cache files.lnk" \
500 "$INSTDIR\vlc.exe" "--reset-config --reset-plugins-cache vlc://quit"
501 CreateShortCut "$SMPROGRAMS\VideoLAN\Documentation.lnk" \
502 "$INSTDIR\Documentation.url"
503 CreateShortCut "$SMPROGRAMS\VideoLAN\Release Notes.lnk" \
504 "$INSTDIR\NEWS.txt" ""
505 CreateShortCut "$SMPROGRAMS\VideoLAN\${PRODUCT_GROUP} Website.lnk" \
506 "$INSTDIR\${PRODUCT_GROUP} Website.url"
507 CreateShortCut "$SMPROGRAMS\VideoLAN\VLC media player.lnk" \
508 "$INSTDIR\vlc.exe" ""
511 Section $Name_Section02b SEC02b
513 CreateShortCut "$DESKTOP\VLC media player.lnk" \
514 "$INSTDIR\vlc.exe" ""
517 !ifdef INSTALL_MOZILLA
518 Section /o $Name_Section03 SEC03
521 SetOutPath "$INSTDIR"
522 !insertmacro OpenUninstallLog
523 !insertmacro InstallFile mozilla\npvlc.dll
524 !insertmacro InstallFile mozilla\npvlc.dll.manifest
525 !insertmacro CloseUninstallLog
527 !define Moz "SOFTWARE\MozillaPlugins\@videolan.org/vlc,version=${VERSION}"
528 WriteRegStr HKLM ${Moz} "Description" "VLC Multimedia Plugin"
529 WriteRegStr HKLM ${Moz} "Path" "$INSTDIR\npvlc.dll"
530 WriteRegStr HKLM ${Moz} "Product" "VLC media player"
531 WriteRegStr HKLM ${Moz} "Vendor" "VideoLAN"
532 WriteRegStr HKLM ${Moz} "Version" "${VERSION}"
534 ; for very old version of mozilla, these lines may be needed
539 ;!define Index 'Line${__LINE__}'
545 ; EnumRegKey $R0 HKLM "SOFTWARE\Mozilla" "$R1"
546 ; StrCmp $R0 "" "${Index}-End"
548 ; ReadRegStr $R2 HKLM "SOFTWARE\Mozilla\$R0\Extensions" "Plugins"
549 ; StrCmp $R2 "" "${Index}-Loop" ""
551 ; CopyFiles "$INSTDIR\npvlc.dll" "$R2"
553 ; CopyFiles ${LIBVLC_DLL} "$R2"
555 ; !ifdef LIBVLC_CONTROL_DLL
556 ; CopyFiles ${LIBVLC_CONTROL_DLL} "$R2"
558 ; Goto "${Index}-Loop"
566 !ifdef INSTALL_ACTIVEX
567 Section $Name_Section04 SEC04
569 SetOutPath "$INSTDIR"
570 !insertmacro OpenUninstallLog
571 !insertmacro InstallFile activex\axvlc.dll
572 !insertmacro InstallFile activex\axvlc.dll.manifest
573 !insertmacro CloseUninstallLog
574 RegDLL "$INSTDIR\axvlc.dll"
579 Section $Name_Section05 SEC05
581 WriteRegStr HKCR "AudioCD\shell\PlayWithVLC" "" $ContextMenuEntry_PlayWith
582 WriteRegStr HKCR "AudioCD\shell\PlayWithVLC\command" "" \
583 '"$INSTDIR\vlc.exe" --started-from-file cdda://%1'
584 WriteRegStr HKCR "DVD\shell\PlayWithVLC" "" $ContextMenuEntry_PlayWith
585 WriteRegStr HKCR "DVD\shell\PlayWithVLC\command" "" \
586 '"$INSTDIR\vlc.exe" --started-from-file dvd://%1'
588 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayDVDMovieOnArrival" "VLCPlayDVDMovieOnArrival" ""
589 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "Action" $Action_OnArrivalDVD
590 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "DefaultIcon" '"$INSTDIR\vlc.exe",0'
591 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "InvokeProgID" "VLC.DVDMovie"
592 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "InvokeVerb" "play"
593 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "Provider" "VideoLAN VLC media player"
595 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayCDAudioOnArrival" "VLCPlayCDAudioOnArrival" ""
596 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "Action" $Action_OnArrivalAudioCD
597 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "DefaultIcon" '"$INSTDIR\vlc.exe",0'
598 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "InvokeProgID" "VLC.CDAudio"
599 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "InvokeVerb" "play"
600 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "Provider" "VideoLAN VLC media player"
601 WriteRegStr HKCR "VLC.DVDMovie" "" "VLC DVD Movie"
602 WriteRegStr HKCR "VLC.DVDMovie\shell" "" "Open"
603 WriteRegStr HKCR "VLC.DVDMovie\shell\Open\command" "" \
604 '"$INSTDIR\vlc.exe" --started-from-file dvd://%1'
605 WriteRegStr HKCR "VLC.DVDMovie\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'
606 WriteRegStr HKCR "VLC.CDAudio" "" "VLC CD Audio"
607 WriteRegStr HKCR "VLC.CDAudio\shell" "" "Open"
608 WriteRegStr HKCR "VLC.CDAudio\shell\Open\command" "" \
609 '"$INSTDIR\vlc.exe" --started-from-file cdda://%1'
610 WriteRegStr HKCR "VLC.CDAudio\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'
615 SectionGroup /e !$Name_Section06 SEC06
616 SectionGroup $Name_SectionGroupAudio
617 !insertmacro MacroAudioExtensions RegisterExtensionSection
619 SectionGroup $Name_SectionGroupVideo
620 !insertmacro MacroVideoExtensions RegisterExtensionSection
622 SectionGroup $Name_SectionGroupOther
623 !insertmacro MacroOtherExtensions RegisterExtensionSection
627 Section $Name_Section07 SEC07
629 !insertmacro MacroAllExtensions AddContextMenu
630 !insertmacro AddContextMenuExt "Directory"
633 Section $Name_Section08 SEC08
634 !insertmacro delprefs
637 ; Installer section descriptions
638 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
639 !insertmacro MUI_DESCRIPTION_TEXT ${SEC01} $Desc_Section01
640 !insertmacro MUI_DESCRIPTION_TEXT ${SEC02a} $Desc_Section02a
641 !insertmacro MUI_DESCRIPTION_TEXT ${SEC02b} $Desc_Section02b
642 @BUILD_MOZILLA_TRUE@ !insertmacro MUI_DESCRIPTION_TEXT ${SEC03} $Desc_Section03
643 @BUILD_ACTIVEX_TRUE@ !insertmacro MUI_DESCRIPTION_TEXT ${SEC04} $Desc_Section04
644 !insertmacro MUI_DESCRIPTION_TEXT ${SEC05} $Desc_Section05
645 !insertmacro MUI_DESCRIPTION_TEXT ${SEC06} $Desc_Section06
646 !insertmacro MUI_DESCRIPTION_TEXT ${SEC07} $Desc_Section07
647 !insertmacro MUI_DESCRIPTION_TEXT ${SEC08} $Desc_Section08
648 !insertmacro MUI_FUNCTION_DESCRIPTION_END
652 !insertmacro MUI_LANGDLL_DISPLAY
654 !include "languages\english.nsh"
655 StrCmp $LANGUAGE ${LANG_FRENCH} French 0
656 StrCmp $LANGUAGE ${LANG_GERMAN} German 0
657 StrCmp $LANGUAGE ${LANG_ITALIAN} Italian 0
658 StrCmp $LANGUAGE ${LANG_HUNGARIAN} Hungarian 0
659 StrCmp $LANGUAGE ${LANG_ROMANIAN} Romanian 0
660 StrCmp $LANGUAGE ${LANG_CATALAN} Catalan 0
661 StrCmp $LANGUAGE ${LANG_BULGARIAN} Bulgarian 0
662 StrCmp $LANGUAGE ${LANG_SLOVAK} Slovak 0
663 StrCmp $LANGUAGE ${LANG_POLISH} Polish 0
664 StrCmp $LANGUAGE ${LANG_DUTCH} Dutch 0
665 StrCmp $LANGUAGE ${LANG_SIMPCHINESE} SChinese 0
666 StrCmp $LANGUAGE ${LANG_FINNISH} Finnish 0
667 StrCmp $LANGUAGE ${LANG_PORTUGUESEBR} Brazilian EndLanguageCmp
669 !include "languages\french.nsh"
672 !include "languages\german.nsh"
675 !include "languages\italian.nsh"
678 !include "languages\hungarian.nsh"
681 !include "languages\romanian.nsh"
684 !include "languages\catalan.nsh"
687 !include "languages\bulgarian.nsh"
690 !include "languages\slovak.nsh"
693 !include "languages\polish.nsh"
696 !include "languages\dutch.nsh"
699 !include "languages\schinese.nsh"
702 !include "languages\finnish.nsh"
705 !include "languages\brazilian_portuguese.nsh"
708 ReadRegStr $R0 ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
712 MessageBox MB_YESNO|MB_ICONEXCLAMATION $Message_AlreadyInstalled IDNO done
717 ExecWait '$R0 _?=$INSTDIR' ;Do not copy the uninstaller to a temp file
724 WriteUninstaller "$INSTDIR\uninstall.exe"
725 WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "InstallDir" $INSTDIR
726 WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "Version" "${VERSION}"
727 WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\vlc.exe"
729 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
730 "DisplayName" "$(^Name)"
731 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
732 "UninstallString" "$INSTDIR\uninstall.exe"
733 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
734 "InstallLocation" "$INSTDIR"
735 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
736 "DisplayIcon" "$INSTDIR\vlc.exe"
737 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
738 "DisplayVersion" "${PRODUCT_VERSION}"
739 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
740 "URLInfoAbout" "${PRODUCT_WEB_SITE}"
741 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
742 "Publisher" "${PRODUCT_PUBLISHER}"
743 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
744 "VersionMajor" "@VERSION_MAJOR@"
745 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
746 "VersionMinor" "@VERSION_MINOR@"
749 ;;;;;;;;;;;;;;;;;;;;;;;;
750 ; Uninstaller sections ;
751 ;;;;;;;;;;;;;;;;;;;;;;;;
753 ; TrimNewlines (copied from NSIS documentation)
754 ; input, top of stack (e.g. whatever$\r$\n)
755 ; output, top of stack (replaces, with e.g. whatever)
756 ; modifies no other variables.
758 Function un.TrimNewlines
767 StrCmp $R2 "$\r" loop
768 StrCmp $R2 "$\n" loop
770 IntCmp $R1 0 no_trim_needed
779 Function un.RemoveEmptyDirs
781 !define Index 'Line${__LINE__}'
782 FindFirst $0 $1 "$INSTDIR$9*"
783 StrCmp $0 "" "${Index}-End"
785 StrCmp $1 "" "${Index}-End"
786 StrCmp $1 "." "${Index}-Next"
787 StrCmp $1 ".." "${Index}-Next"
792 Call un.RemoveEmptyDirs
806 Section "un.$Name_Section91" SEC91
808 SetShellVarContext all
810 !insertmacro MacroAllExtensions DeleteContextMenu
811 !insertmacro MacroAllExtensions UnRegisterExtensionSection
812 !insertmacro DeleteContextMenuExt "Directory"
814 ;remove activex plugin
815 UnRegDLL "$INSTDIR\axvlc.dll"
816 Delete /REBOOTOK "$INSTDIR\axvlc.dll"
817 Delete /REBOOTOK "$INSTDIR\axvlc.dll.manifest"
819 ;remove mozilla plugin
824 !define Index 'Line${__LINE__}'
830 EnumRegKey $R0 HKLM "SOFTWARE\Mozilla" "$R1"
831 StrCmp $R0 "" "${Index}-End"
833 ReadRegStr $R2 HKLM "SOFTWARE\Mozilla\$R0\Extensions" "Plugins"
834 StrCmp $R2 "" "${Index}-Loop" ""
836 ; old files (0.8.5 and before) that may be lying around
837 Delete /REBOOTOK "$R2\npvlc.dll"
838 Delete /REBOOTOK "$R2\libvlc.dll"
839 Delete /REBOOTOK "$R2\vlcintf.xpt"
844 Delete /REBOOTOK "$INSTDIR\npvlc.dll"
845 Delete /REBOOTOK "$INSTDIR\npvlc.dll.manifest"
847 RMDir "$SMPROGRAMS\VideoLAN"
848 RMDir /r $SMPROGRAMS\VideoLAN
850 FileOpen $UninstallLog "$INSTDIR\uninstall.log" r
853 FileRead $UninstallLog $R0
854 IfErrors UninstallEnd
858 Delete "$INSTDIR\$R0"
861 FileClose $UninstallLog
862 Delete "$INSTDIR\uninstall.log"
863 Delete "$INSTDIR\uninstall.exe"
865 Call un.RemoveEmptyDirs
868 DeleteRegKey HKLM Software\VideoLAN
870 DeleteRegKey HKCR Applications\vlc.exe
871 DeleteRegKey HKCR AudioCD\shell\PlayWithVLC
872 DeleteRegKey HKCR DVD\shell\PlayWithVLC
873 DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayDVDMovieOnArrival" "VLCPlayDVDMovieOnArrival"
874 DeleteRegKey HKLM Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival
875 DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayCDAudioOnArrival" "VLCPlayCDAudioOnArrival"
876 DeleteRegKey HKLM Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival
877 DeleteRegKey HKLM Software\Clients\Media\VLC
878 DeleteRegValue HKLM "Software\RegisteredApplications" "VLC"
879 DeleteRegKey HKCR "VLC.MediaFile"
882 "SOFTWARE\MozillaPlugins\@videolan.org/vlc,version=${VERSION}"
885 "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
887 Delete "$DESKTOP\VLC media player.lnk"
889 DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
890 DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}"
894 Section /o "un.$Name_Section92" SEC92
895 !insertmacro delprefs
898 ; Uninstaller section descriptions
899 !insertmacro MUI_UNFUNCTION_DESCRIPTION_BEGIN
900 !insertmacro MUI_DESCRIPTION_TEXT ${SEC91} $Desc_Section91
901 !insertmacro MUI_DESCRIPTION_TEXT ${SEC92} $Desc_Section92
902 !insertmacro MUI_UNFUNCTION_DESCRIPTION_END
904 ;Function un.onUninstSuccess
906 ; MessageBox MB_ICONINFORMATION|MB_OK \
907 ; "$(^Name) was successfully removed from your computer."
911 !insertmacro MUI_UNGETLANGUAGE
913 !include "languages\english.nsh"
914 StrCmp $LANGUAGE ${LANG_FRENCH} French 0
915 StrCmp $LANGUAGE ${LANG_GERMAN} German 0
916 StrCmp $LANGUAGE ${LANG_ITALIAN} Italian 0
917 StrCmp $LANGUAGE ${LANG_HUNGARIAN} Hungarian 0
918 StrCmp $LANGUAGE ${LANG_ROMANIAN} Romanian 0
919 StrCmp $LANGUAGE ${LANG_CATALAN} Catalan 0
920 StrCmp $LANGUAGE ${LANG_BULGARIAN} Bulgarian 0
921 StrCmp $LANGUAGE ${LANG_SLOVAK} Slovak 0
922 StrCmp $LANGUAGE ${LANG_POLISH} Polish 0
923 StrCmp $LANGUAGE ${LANG_DUTCH} Dutch 0
924 StrCmp $LANGUAGE ${LANG_SIMPCHINESE} SChinese 0
925 StrCmp $LANGUAGE ${LANG_FINNISH} Finnish 0
926 StrCmp $LANGUAGE ${LANG_PORTUGUESEBR} Brazilian EndLanguageCmp
928 !include "languages\french.nsh"
931 !include "languages\german.nsh"
934 !include "languages\italian.nsh"
937 !include "languages\hungarian.nsh"
940 !include "languages\romanian.nsh"
943 !include "languages\catalan.nsh"
946 !include "languages\bulgarian.nsh"
949 !include "languages\slovak.nsh"
952 !include "languages\polish.nsh"
955 !include "languages\dutch.nsh"
958 !include "languages\schinese.nsh"
961 !include "languages\finnish.nsh"
964 !include "languages\brazilian_portuguese.nsh"