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 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
318 SetShellVarContext all
319 CreateDirectory "$APPDATA\\VideoLAN"
320 CreateDirectory "$APPDATA\\VideoLAN\\VLC"
321 ExecWait "$INSTDIR\vlc-cache-gen.exe $APPDATA\\VideoLAN\\VLC"
322 SetShellVarContext current
327 !define Index 'Line${__LINE__}'
330 ; this will loop through all the logged users and "virtual" windows users
331 ; (it looks like users are only present in HKEY_USERS when they are logged in)
333 EnumRegKey $1 HKU "" $0
334 StrCmp $1 "" "${Index}-End"
336 ReadRegStr $2 HKU "$1\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" AppData
337 StrCmp $2 "" "${Index}-Loop"
342 SetShellVarContext all
343 RMDir /r "$APPDATA\\VideoLAN"
344 SetShellVarContext current
351 !macro OpenUninstallLog
352 FileOpen $UninstallLog "$INSTDIR\uninstall.log" a
353 FileSeek $UninstallLog 0 END
356 !macro CloseUninstallLog
357 FileClose $UninstallLog
358 SetFileAttributes "$INSTDIR\uninstall.log" HIDDEN
364 !macro InstallFile FILEREGEX
366 !define Index 'Line${__LINE__}'
367 FindFirst $0 $1 "$INSTDIR\${FILEREGEX}"
368 StrCmp $0 "" "${Index}-End"
370 StrCmp $1 "" "${Index}-End"
371 FileWrite $UninstallLog "$1$\r$\n"
378 !macro InstallFolder FOLDER
381 Call InstallFolderInternal
384 Function InstallFolderInternal
386 !define Index 'Line${__LINE__}'
387 FindFirst $0 $1 "$INSTDIR\$9\*"
388 StrCmp $0 "" "${Index}-End"
390 StrCmp $1 "" "${Index}-End"
391 StrCmp $1 "." "${Index}-Next"
392 StrCmp $1 ".." "${Index}-Next"
393 IfFileExists "$9\$1\*" 0 "${Index}-Write"
397 Call InstallFolderInternal
402 FileWrite $UninstallLog "$9\$1$\r$\n"
412 ;;;;;;;;;;;;;;;;;;;;;;
413 ; Installer sections ;
416 ;;;;;;;;;;;;;;;;;;;;;;
418 Section $Name_Section01 SEC01
420 SetShellVarContext all
421 SetOutPath "$INSTDIR"
423 !insertmacro OpenUninstallLog
425 ; VLC.exe, libvlc.dll
426 !insertmacro InstallFile vlc.exe
427 !insertmacro InstallFile vlc.exe.manifest
428 !insertmacro InstallFile vlc-cache-gen.exe
431 !insertmacro InstallFile *.dll
434 !insertmacro InstallFile *.txt
437 !insertmacro InstallFolder plugins
438 !insertmacro InstallFolder locale
439 @BUILD_OSDMENU_TRUE@ !insertmacro InstallFolder osdmenu
440 @BUILD_SKINS_TRUE@ !insertmacro InstallFolder skins
441 @BUILD_HTTPD_TRUE@ !insertmacro InstallFolder http
442 @BUILD_LUA_TRUE@ !insertmacro InstallFolder lua
443 !insertmacro gencache
447 WriteIniStr "$INSTDIR\${PRODUCT_GROUP} Website.url" "InternetShortcut" "URL" \
448 "${PRODUCT_WEB_SITE}"
449 FileWrite $UninstallLog "${PRODUCT_GROUP} Website.url$\r$\n"
450 WriteIniStr "$INSTDIR\Documentation.url" "InternetShortcut" "URL" \
451 "${PRODUCT_WEB_SITE}/doc/"
452 FileWrite $UninstallLog "Documentation.url$\r$\n"
453 WriteIniStr "$INSTDIR\New_Skins.url" "InternetShortcut" "URL" \
454 "${PRODUCT_WEB_SITE}/vlc/skins.php"
455 FileWrite $UninstallLog "New_Skins.url$\r$\n"
457 !insertmacro CloseUninstallLog
459 ; Add VLC to "recommended programs" for the following extensions
460 WriteRegStr HKCR Applications\vlc.exe "" ""
461 WriteRegStr HKCR Applications\vlc.exe "FriendlyAppName" "VLC media player"
462 WriteRegStr HKCR Applications\vlc.exe\shell\Open "" $ContextMenuEntry_PlayWith
463 WriteRegStr HKCR Applications\vlc.exe\shell\Open\command "" \
464 '"$INSTDIR\vlc.exe" --started-from-file "%1"'
465 !insertmacro MacroAllExtensions WriteRegStrSupportedTypes
467 ; Windows default programs Registration
468 ; Vista and above detection
469 ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion
471 StrCmp $R1 '6' lbl_vista lbl_done
474 WriteRegStr HKLM "Software\RegisteredApplications" "VLC" "Software\Clients\Media\VLC\Capabilities"
475 WriteRegStr HKLM "Software\Clients\Media\VLC\Capabilities" "ApplicationName" "VLC media player"
476 WriteRegStr HKLM "Software\Clients\Media\VLC\Capabilities" "ApplicationDescription" "VLC - The video swiss knife"
477 WriteRegStr HKLM "Software\Clients\Media\VLC" "" "VLC media player"
478 WriteRegStr HKLM "Software\Clients\Media\VLC\InstallInfo" "HideIconsCommand" "$\"$INSTDIR\spad-setup.exe$\" /HideIcons /S"
479 WriteRegStr HKLM "Software\Clients\Media\VLC\InstallInfo" "ShowIconsCommand" "$\"$INSTDIR\spad-setup.exe$\" /ShowIcons /S"
480 WriteRegStr HKLM "Software\Clients\Media\VLC\InstallInfo" "ReinstallCommand" "$\"$INSTDIR\spad-setup.exe$\" /Reinstall /S"
481 WriteRegDWORD HKLM "Software\Clients\Media\VLC\InstallInfo" "IconsVisible" 0x001
486 Section $Name_Section02a SEC02a
488 CreateDirectory "$SMPROGRAMS\VideoLAN"
489 CreateDirectory "$SMPROGRAMS\VideoLAN\Quick Settings"
490 CreateDirectory "$SMPROGRAMS\VideoLAN\Quick Settings\Audio"
491 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Audio\Set Audio mode to DirectX (default).lnk" \
492 "$INSTDIR\vlc.exe" "--aout aout_directx --save-config vlc://quit"
493 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Audio\Set Audio mode to Waveout.lnk" \
494 "$INSTDIR\vlc.exe" "--aout waveout --save-config vlc://quit"
495 CreateDirectory "$SMPROGRAMS\VideoLAN\Quick Settings\Interface"
496 @BUILD_SKINS_TRUE@ CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Interface\Set Main Interface to Skinnable.lnk" \
497 @BUILD_SKINS_TRUE@ "$INSTDIR\vlc.exe" "-I skins --save-config vlc://quit"
498 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Interface\Set Main Interface to Qt (default).lnk" \
499 "$INSTDIR\vlc.exe" "-I qt --save-config vlc://quit"
500 CreateDirectory "$SMPROGRAMS\VideoLAN\Quick Settings\Video"
501 ; FIXME add detection for Vista. Direct3D will be default there, for all others it's DirectX
502 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to Direct3D.lnk" \
503 "$INSTDIR\vlc.exe" "--vout direct3d --overlay --directx-hw-yuv --save-config vlc://quit"
504 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to Direct3D (no hardware acceleration).lnk" \
505 "$INSTDIR\vlc.exe" "--vout direct3d --overlay --no-directx-hw-yuv --save-config vlc://quit"
506 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to DirectX.lnk" \
507 "$INSTDIR\vlc.exe" "--vout directx --overlay --directx-hw-yuv --save-config vlc://quit"
508 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to DirectX (no hardware acceleration).lnk" \
509 "$INSTDIR\vlc.exe" "--vout directx --no-overlay --no-directx-hw-yuv --save-config vlc://quit"
510 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to DirectX (no video overlay).lnk" \
511 "$INSTDIR\vlc.exe" "--vout directx --no-overlay --directx-hw-yuv --save-config vlc://quit"
512 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to OpenGL.lnk" \
513 "$INSTDIR\vlc.exe" "--vout opengl --overlay --save-config vlc://quit"
514 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Reset VLC media player preferences and cache files.lnk" \
515 "$INSTDIR\vlc.exe" "--reset-config --reset-plugins-cache vlc://quit"
516 CreateShortCut "$SMPROGRAMS\VideoLAN\Documentation.lnk" \
517 "$INSTDIR\Documentation.url"
518 CreateShortCut "$SMPROGRAMS\VideoLAN\Release Notes.lnk" \
519 "$INSTDIR\NEWS.txt" ""
520 CreateShortCut "$SMPROGRAMS\VideoLAN\${PRODUCT_GROUP} Website.lnk" \
521 "$INSTDIR\${PRODUCT_GROUP} Website.url"
522 CreateShortCut "$SMPROGRAMS\VideoLAN\VLC media player.lnk" \
523 "$INSTDIR\vlc.exe" ""
526 Section $Name_Section02b SEC02b
528 CreateShortCut "$DESKTOP\VLC media player.lnk" \
529 "$INSTDIR\vlc.exe" ""
532 !ifdef INSTALL_MOZILLA
533 Section /o $Name_Section03 SEC03
536 SetOutPath "$INSTDIR"
537 !insertmacro OpenUninstallLog
538 !insertmacro InstallFile mozilla\npvlc.dll
539 !insertmacro InstallFile mozilla\npvlc.dll.manifest
540 !insertmacro CloseUninstallLog
542 !define Moz "SOFTWARE\MozillaPlugins\@videolan.org/vlc,version=${VERSION}"
543 WriteRegStr HKLM ${Moz} "Description" "VLC Multimedia Plugin"
544 WriteRegStr HKLM ${Moz} "Path" "$INSTDIR\npvlc.dll"
545 WriteRegStr HKLM ${Moz} "Product" "VLC media player"
546 WriteRegStr HKLM ${Moz} "Vendor" "VideoLAN"
547 WriteRegStr HKLM ${Moz} "Version" "${VERSION}"
549 ; for very old version of mozilla, these lines may be needed
554 ;!define Index 'Line${__LINE__}'
560 ; EnumRegKey $R0 HKLM "SOFTWARE\Mozilla" "$R1"
561 ; StrCmp $R0 "" "${Index}-End"
563 ; ReadRegStr $R2 HKLM "SOFTWARE\Mozilla\$R0\Extensions" "Plugins"
564 ; StrCmp $R2 "" "${Index}-Loop" ""
566 ; CopyFiles "$INSTDIR\npvlc.dll" "$R2"
568 ; CopyFiles ${LIBVLC_DLL} "$R2"
570 ; !ifdef LIBVLC_CONTROL_DLL
571 ; CopyFiles ${LIBVLC_CONTROL_DLL} "$R2"
573 ; Goto "${Index}-Loop"
581 !ifdef INSTALL_ACTIVEX
582 Section $Name_Section04 SEC04
584 SetOutPath "$INSTDIR"
585 !insertmacro OpenUninstallLog
586 !insertmacro InstallFile activex\axvlc.dll
587 !insertmacro InstallFile activex\axvlc.dll.manifest
588 !insertmacro CloseUninstallLog
589 RegDLL "$INSTDIR\axvlc.dll"
594 Section $Name_Section05 SEC05
596 WriteRegStr HKCR "AudioCD\shell\PlayWithVLC" "" $ContextMenuEntry_PlayWith
597 WriteRegStr HKCR "AudioCD\shell\PlayWithVLC\command" "" \
598 '"$INSTDIR\vlc.exe" --started-from-file cdda://%1'
599 WriteRegStr HKCR "DVD\shell\PlayWithVLC" "" $ContextMenuEntry_PlayWith
600 WriteRegStr HKCR "DVD\shell\PlayWithVLC\command" "" \
601 '"$INSTDIR\vlc.exe" --started-from-file dvd://%1'
603 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayDVDMovieOnArrival" "VLCPlayDVDMovieOnArrival" ""
604 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "Action" $Action_OnArrivalDVD
605 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "DefaultIcon" '"$INSTDIR\vlc.exe",0'
606 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "InvokeProgID" "VLC.DVDMovie"
607 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "InvokeVerb" "play"
608 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "Provider" "VideoLAN VLC media player"
610 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayCDAudioOnArrival" "VLCPlayCDAudioOnArrival" ""
611 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "Action" $Action_OnArrivalAudioCD
612 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "DefaultIcon" '"$INSTDIR\vlc.exe",0'
613 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "InvokeProgID" "VLC.CDAudio"
614 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "InvokeVerb" "play"
615 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "Provider" "VideoLAN VLC media player"
616 WriteRegStr HKCR "VLC.DVDMovie" "" "VLC DVD Movie"
617 WriteRegStr HKCR "VLC.DVDMovie\shell" "" "Open"
618 WriteRegStr HKCR "VLC.DVDMovie\shell\Open\command" "" \
619 '"$INSTDIR\vlc.exe" --started-from-file dvd://%1'
620 WriteRegStr HKCR "VLC.DVDMovie\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'
621 WriteRegStr HKCR "VLC.CDAudio" "" "VLC CD Audio"
622 WriteRegStr HKCR "VLC.CDAudio\shell" "" "Open"
623 WriteRegStr HKCR "VLC.CDAudio\shell\Open\command" "" \
624 '"$INSTDIR\vlc.exe" --started-from-file cdda://%1'
625 WriteRegStr HKCR "VLC.CDAudio\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'
630 SectionGroup /e !$Name_Section06 SEC06
631 SectionGroup $Name_SectionGroupAudio
632 !insertmacro MacroAudioExtensions RegisterExtensionSection
634 SectionGroup $Name_SectionGroupVideo
635 !insertmacro MacroVideoExtensions RegisterExtensionSection
637 SectionGroup $Name_SectionGroupOther
638 !insertmacro MacroOtherExtensions RegisterExtensionSection
642 Section $Name_Section07 SEC07
644 !insertmacro MacroAllExtensions AddContextMenu
645 !insertmacro AddContextMenuExt "Directory"
648 Section $Name_Section08 SEC08
649 !insertmacro delprefs
652 ; Installer section descriptions
653 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
654 !insertmacro MUI_DESCRIPTION_TEXT ${SEC01} $Desc_Section01
655 !insertmacro MUI_DESCRIPTION_TEXT ${SEC02a} $Desc_Section02a
656 !insertmacro MUI_DESCRIPTION_TEXT ${SEC02b} $Desc_Section02b
657 @BUILD_MOZILLA_TRUE@ !insertmacro MUI_DESCRIPTION_TEXT ${SEC03} $Desc_Section03
658 @BUILD_ACTIVEX_TRUE@ !insertmacro MUI_DESCRIPTION_TEXT ${SEC04} $Desc_Section04
659 !insertmacro MUI_DESCRIPTION_TEXT ${SEC05} $Desc_Section05
660 !insertmacro MUI_DESCRIPTION_TEXT ${SEC06} $Desc_Section06
661 !insertmacro MUI_DESCRIPTION_TEXT ${SEC07} $Desc_Section07
662 !insertmacro MUI_DESCRIPTION_TEXT ${SEC08} $Desc_Section08
663 !insertmacro MUI_FUNCTION_DESCRIPTION_END
667 !insertmacro MUI_LANGDLL_DISPLAY
669 !include "languages\english.nsh"
670 StrCmp $LANGUAGE ${LANG_FRENCH} French 0
671 StrCmp $LANGUAGE ${LANG_GERMAN} German 0
672 StrCmp $LANGUAGE ${LANG_ITALIAN} Italian 0
673 StrCmp $LANGUAGE ${LANG_HUNGARIAN} Hungarian 0
674 StrCmp $LANGUAGE ${LANG_ROMANIAN} Romanian 0
675 StrCmp $LANGUAGE ${LANG_CATALAN} Catalan 0
676 StrCmp $LANGUAGE ${LANG_BULGARIAN} Bulgarian 0
677 StrCmp $LANGUAGE ${LANG_SLOVAK} Slovak 0
678 StrCmp $LANGUAGE ${LANG_POLISH} Polish 0
679 StrCmp $LANGUAGE ${LANG_DUTCH} Dutch 0
680 StrCmp $LANGUAGE ${LANG_SIMPCHINESE} SChinese 0
681 StrCmp $LANGUAGE ${LANG_FINNISH} Finnish 0
682 StrCmp $LANGUAGE ${LANG_PORTUGUESEBR} Brazilian EndLanguageCmp
684 !include "languages\french.nsh"
687 !include "languages\german.nsh"
690 !include "languages\italian.nsh"
693 !include "languages\hungarian.nsh"
696 !include "languages\romanian.nsh"
699 !include "languages\catalan.nsh"
702 !include "languages\bulgarian.nsh"
705 !include "languages\slovak.nsh"
708 !include "languages\polish.nsh"
711 !include "languages\dutch.nsh"
714 !include "languages\schinese.nsh"
717 !include "languages\finnish.nsh"
720 !include "languages\brazilian_portuguese.nsh"
723 ReadRegStr $R0 ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
727 MessageBox MB_YESNO|MB_ICONEXCLAMATION $Message_AlreadyInstalled IDNO done
732 ExecWait '$R0 _?=$INSTDIR' ;Do not copy the uninstaller to a temp file
739 WriteUninstaller "$INSTDIR\uninstall.exe"
740 WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "InstallDir" $INSTDIR
741 WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "Version" "${VERSION}"
742 WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\vlc.exe"
744 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
745 "DisplayName" "$(^Name)"
746 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
747 "UninstallString" "$INSTDIR\uninstall.exe"
748 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
749 "InstallLocation" "$INSTDIR"
750 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
751 "DisplayIcon" "$INSTDIR\vlc.exe"
752 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
753 "DisplayVersion" "${PRODUCT_VERSION}"
754 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
755 "URLInfoAbout" "${PRODUCT_WEB_SITE}"
756 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
757 "Publisher" "${PRODUCT_PUBLISHER}"
758 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
759 "VersionMajor" "@VERSION_MAJOR@"
760 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
761 "VersionMinor" "@VERSION_MINOR@"
764 ;;;;;;;;;;;;;;;;;;;;;;;;
765 ; Uninstaller sections ;
766 ;;;;;;;;;;;;;;;;;;;;;;;;
768 ; TrimNewlines (copied from NSIS documentation)
769 ; input, top of stack (e.g. whatever$\r$\n)
770 ; output, top of stack (replaces, with e.g. whatever)
771 ; modifies no other variables.
773 Function un.TrimNewlines
782 StrCmp $R2 "$\r" loop
783 StrCmp $R2 "$\n" loop
785 IntCmp $R1 0 no_trim_needed
794 Function un.RemoveEmptyDirs
796 !define Index 'Line${__LINE__}'
797 FindFirst $0 $1 "$INSTDIR$9*"
798 StrCmp $0 "" "${Index}-End"
800 StrCmp $1 "" "${Index}-End"
801 StrCmp $1 "." "${Index}-Next"
802 StrCmp $1 ".." "${Index}-Next"
807 Call un.RemoveEmptyDirs
821 Section "un.$Name_Section91" SEC91
823 SetShellVarContext all
825 !insertmacro MacroAllExtensions DeleteContextMenu
826 !insertmacro MacroAllExtensions UnRegisterExtensionSection
827 !insertmacro DeleteContextMenuExt "Directory"
829 ;remove activex plugin
830 UnRegDLL "$INSTDIR\axvlc.dll"
831 Delete /REBOOTOK "$INSTDIR\axvlc.dll"
832 Delete /REBOOTOK "$INSTDIR\axvlc.dll.manifest"
834 ;remove mozilla plugin
839 !define Index 'Line${__LINE__}'
845 EnumRegKey $R0 HKLM "SOFTWARE\Mozilla" "$R1"
846 StrCmp $R0 "" "${Index}-End"
848 ReadRegStr $R2 HKLM "SOFTWARE\Mozilla\$R0\Extensions" "Plugins"
849 StrCmp $R2 "" "${Index}-Loop" ""
851 ; old files (0.8.5 and before) that may be lying around
852 Delete /REBOOTOK "$R2\npvlc.dll"
853 Delete /REBOOTOK "$R2\libvlc.dll"
854 Delete /REBOOTOK "$R2\vlcintf.xpt"
859 Delete /REBOOTOK "$INSTDIR\npvlc.dll"
860 Delete /REBOOTOK "$INSTDIR\npvlc.dll.manifest"
862 RMDir "$SMPROGRAMS\VideoLAN"
863 RMDir /r $SMPROGRAMS\VideoLAN
865 FileOpen $UninstallLog "$INSTDIR\uninstall.log" r
868 FileRead $UninstallLog $R0
869 IfErrors UninstallEnd
873 Delete "$INSTDIR\$R0"
876 FileClose $UninstallLog
877 Delete "$INSTDIR\uninstall.log"
878 Delete "$INSTDIR\uninstall.exe"
880 Call un.RemoveEmptyDirs
883 DeleteRegKey HKLM Software\VideoLAN
885 DeleteRegKey HKCR Applications\vlc.exe
886 DeleteRegKey HKCR AudioCD\shell\PlayWithVLC
887 DeleteRegKey HKCR DVD\shell\PlayWithVLC
888 DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayDVDMovieOnArrival" "VLCPlayDVDMovieOnArrival"
889 DeleteRegKey HKLM Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival
890 DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayCDAudioOnArrival" "VLCPlayCDAudioOnArrival"
891 DeleteRegKey HKLM Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival
892 DeleteRegKey HKLM Software\Clients\Media\VLC
893 DeleteRegValue HKLM "Software\RegisteredApplications" "VLC"
894 DeleteRegKey HKCR "VLC.MediaFile"
897 "SOFTWARE\MozillaPlugins\@videolan.org/vlc,version=${VERSION}"
900 "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
902 Delete "$DESKTOP\VLC media player.lnk"
904 DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
905 DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}"
909 Section /o "un.$Name_Section92" SEC92
910 !insertmacro delprefs
913 ; Uninstaller section descriptions
914 !insertmacro MUI_UNFUNCTION_DESCRIPTION_BEGIN
915 !insertmacro MUI_DESCRIPTION_TEXT ${SEC91} $Desc_Section91
916 !insertmacro MUI_DESCRIPTION_TEXT ${SEC92} $Desc_Section92
917 !insertmacro MUI_UNFUNCTION_DESCRIPTION_END
919 ;Function un.onUninstSuccess
921 ; MessageBox MB_ICONINFORMATION|MB_OK \
922 ; "$(^Name) was successfully removed from your computer."
926 !insertmacro MUI_UNGETLANGUAGE
928 !include "languages\english.nsh"
929 StrCmp $LANGUAGE ${LANG_FRENCH} French 0
930 StrCmp $LANGUAGE ${LANG_GERMAN} German 0
931 StrCmp $LANGUAGE ${LANG_ITALIAN} Italian 0
932 StrCmp $LANGUAGE ${LANG_HUNGARIAN} Hungarian 0
933 StrCmp $LANGUAGE ${LANG_ROMANIAN} Romanian 0
934 StrCmp $LANGUAGE ${LANG_CATALAN} Catalan 0
935 StrCmp $LANGUAGE ${LANG_BULGARIAN} Bulgarian 0
936 StrCmp $LANGUAGE ${LANG_SLOVAK} Slovak 0
937 StrCmp $LANGUAGE ${LANG_POLISH} Polish 0
938 StrCmp $LANGUAGE ${LANG_DUTCH} Dutch 0
939 StrCmp $LANGUAGE ${LANG_SIMPCHINESE} SChinese 0
940 StrCmp $LANGUAGE ${LANG_FINNISH} Finnish 0
941 StrCmp $LANGUAGE ${LANG_PORTUGUESEBR} Brazilian EndLanguageCmp
943 !include "languages\french.nsh"
946 !include "languages\german.nsh"
949 !include "languages\italian.nsh"
952 !include "languages\hungarian.nsh"
955 !include "languages\romanian.nsh"
958 !include "languages\catalan.nsh"
961 !include "languages\bulgarian.nsh"
964 !include "languages\slovak.nsh"
967 !include "languages\polish.nsh"
970 !include "languages\dutch.nsh"
973 !include "languages\schinese.nsh"
976 !include "languages\finnish.nsh"
979 !include "languages\brazilian_portuguese.nsh"