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 RequestExecutionLevel user
56 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
57 ; NSIS Modern User Interface configuration ;
58 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
60 ; MUI 1.67 compatible ------
64 !define MUI_ABORTWARNING
65 !define MUI_ICON "vlc.ico"
66 !define MUI_UNICON "vlc.ico"
67 !define MUI_COMPONENTSPAGE_SMALLDESC
71 !define MUI_WELCOMEPAGE_TITLE_3LINES
72 !insertmacro MUI_PAGE_WELCOME
74 !define MUI_LICENSEPAGE_BUTTON $(^NextBtn)
75 !insertmacro MUI_PAGE_LICENSE "COPYING.txt"
77 !insertmacro MUI_PAGE_COMPONENTS
79 !insertmacro MUI_PAGE_DIRECTORY
81 !insertmacro MUI_PAGE_INSTFILES
85 Exec '$INSTDIR\vlc.exe'
89 !insertmacro UAC.CallFunctionAsUser ExecAppFile
92 !define MUI_FINISHPAGE_RUN
93 !define MUI_FINISHPAGE_RUN_FUNCTION AppRunAs
94 !define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\README.txt"
95 !define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED
96 !define MUI_FINISHPAGE_LINK $Link_VisitWebsite
97 !define MUI_FINISHPAGE_LINK_LOCATION "http://www.videolan.org/vlc/"
98 !define MUI_FINISHPAGE_NOREBOOTSUPPORT
99 !insertmacro MUI_PAGE_FINISH
102 !insertmacro MUI_UNPAGE_CONFIRM
103 !insertmacro MUI_UNPAGE_COMPONENTS
104 !insertmacro MUI_UNPAGE_INSTFILES
105 !insertmacro MUI_UNPAGE_FINISH
108 !insertmacro MUI_LANGUAGE "English" # first language is the default language
109 !insertmacro MUI_LANGUAGE "French"
110 !insertmacro MUI_LANGUAGE "German"
111 !insertmacro MUI_LANGUAGE "Spanish"
112 !insertmacro MUI_LANGUAGE "SimpChinese"
113 !insertmacro MUI_LANGUAGE "TradChinese"
114 !insertmacro MUI_LANGUAGE "Japanese"
115 !insertmacro MUI_LANGUAGE "Korean"
116 !insertmacro MUI_LANGUAGE "Italian"
117 !insertmacro MUI_LANGUAGE "Dutch"
118 !insertmacro MUI_LANGUAGE "Danish"
119 !insertmacro MUI_LANGUAGE "Swedish"
120 !insertmacro MUI_LANGUAGE "Norwegian"
121 !insertmacro MUI_LANGUAGE "Finnish"
122 !insertmacro MUI_LANGUAGE "Greek"
123 !insertmacro MUI_LANGUAGE "Russian"
124 !insertmacro MUI_LANGUAGE "Portuguese"
125 !insertmacro MUI_LANGUAGE "PortugueseBR"
126 !insertmacro MUI_LANGUAGE "Arabic"
127 !insertmacro MUI_LANGUAGE "Polish"
128 !insertmacro MUI_LANGUAGE "Romanian"
129 !insertmacro MUI_LANGUAGE "Slovak"
130 !insertmacro MUI_LANGUAGE "Czech"
131 !insertmacro MUI_LANGUAGE "Hungarian"
132 !insertmacro MUI_LANGUAGE "Catalan"
133 !insertmacro MUI_LANGUAGE "Bulgarian"
135 ; Reserve files for solid compression
136 !insertmacro MUI_RESERVEFILE_LANGDLL
137 !insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
141 ;;;;;;;;;;;;;;;;;;;;;;;
142 ; Macro and Functions ;
143 ;;;;;;;;;;;;;;;;;;;;;;;
145 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
146 ; 1. File type associations ;
147 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
149 ;; Function that register one extension for VLC
150 Function RegisterExtension
151 ; back up old value for extension $R0 (eg. ".opt")
152 ReadRegStr $1 HKCR "$R0" ""
153 StrCmp $1 "" NoBackup
154 StrCmp $1 "VLC$R0" "NoBackup"
155 WriteRegStr HKCR "$R0" "VLC.backup" $1
157 WriteRegStr HKCR "$R0" "" "VLC$R0"
158 ReadRegStr $0 HKCR "VLC$R0" ""
159 WriteRegStr HKCR "VLC$R0" "" "VLC media file ($R0)"
160 WriteRegStr HKCR "VLC$R0\shell" "" "Open"
161 WriteRegStr HKCR "VLC$R0\shell\Open" "" $ShellAssociation_Play
162 WriteRegStr HKCR "VLC$R0\shell\Open\command" "" '"$INSTDIR\vlc.exe" --started-from-file "%1"'
163 WriteRegStr HKCR "VLC$R0\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'
166 ; Vista and above detection
167 ReadRegStr $R1 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion
169 StrCmp $R2 '6' ForVista ToEnd
171 WriteRegStr HKLM "Software\Clients\Media\VLC\Capabilities\FileAssociations" "$R0" "VLC$R0"
176 ;; Function that removes one extension that VLC owns.
177 Function un.RegisterExtension
178 ;start of restore script
179 ReadRegStr $1 HKCR "$R0" ""
180 StrCmp $1 "VLC$R0" 0 NoOwn ; only do this if we own it
181 ; Read the old value from Backup
182 ReadRegStr $1 HKCR "$R0" "VLC.backup"
183 StrCmp $1 "" 0 Restore ; if backup="" then delete the whole key
184 DeleteRegKey HKCR "$R0"
187 WriteRegStr HKCR "$R0" "" $1
188 DeleteRegValue HKCR "$R0" "VLC.backup"
190 DeleteRegKey HKCR "VLC$R0" ;Delete key with association settings
191 DeleteRegKey HKLM "Software\Clients\Media\VLC\Capabilities\FileAssociations\VLC$R0" ; for vista
194 !macro RegisterExtensionSection EXT
199 Call RegisterExtension
204 !macro UnRegisterExtensionSection EXT
207 Call un.RegisterExtension
211 !macro WriteRegStrSupportedTypes EXT
212 WriteRegStr HKCR Applications\vlc.exe\SupportedTypes ${EXT} ""
215 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
216 ; Extension lists Macros ;
217 ; Those macros calls the previous functions ;
218 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
220 !macro MacroAudioExtensions _action
221 !insertmacro ${_action} ".a52"
222 !insertmacro ${_action} ".aac"
223 !insertmacro ${_action} ".ac3"
224 !insertmacro ${_action} ".aob"
225 !insertmacro ${_action} ".dts"
226 !insertmacro ${_action} ".flac"
227 !insertmacro ${_action} ".m4a"
228 !insertmacro ${_action} ".m4p"
229 !insertmacro ${_action} ".mka"
230 !insertmacro ${_action} ".mod"
231 !insertmacro ${_action} ".mp1"
232 !insertmacro ${_action} ".mp2"
233 !insertmacro ${_action} ".mp3"
234 !insertmacro ${_action} ".oma"
235 !insertmacro ${_action} ".oga"
236 !insertmacro ${_action} ".spx"
237 !insertmacro ${_action} ".tta"
238 !insertmacro ${_action} ".wav"
239 !insertmacro ${_action} ".wma"
240 !insertmacro ${_action} ".wv"
241 !insertmacro ${_action} ".xm"
244 !macro MacroVideoExtensions _action
245 !insertmacro ${_action} ".asf"
246 !insertmacro ${_action} ".avi"
247 !insertmacro ${_action} ".divx"
248 !insertmacro ${_action} ".dv"
249 !insertmacro ${_action} ".flv"
250 !insertmacro ${_action} ".gxf"
251 !insertmacro ${_action} ".m1v"
252 !insertmacro ${_action} ".m2v"
253 !insertmacro ${_action} ".m2ts"
254 !insertmacro ${_action} ".m4v"
255 !insertmacro ${_action} ".mkv"
256 !insertmacro ${_action} ".mov"
257 !insertmacro ${_action} ".mp4"
258 !insertmacro ${_action} ".mpeg"
259 !insertmacro ${_action} ".mpeg1"
260 !insertmacro ${_action} ".mpeg2"
261 !insertmacro ${_action} ".mpeg4"
262 !insertmacro ${_action} ".mpg"
263 !insertmacro ${_action} ".mts"
264 !insertmacro ${_action} ".mxf"
265 !insertmacro ${_action} ".nuv"
266 !insertmacro ${_action} ".ogg"
267 !insertmacro ${_action} ".ogm"
268 !insertmacro ${_action} ".ogx"
269 !insertmacro ${_action} ".ogv"
270 !insertmacro ${_action} ".rmvb"
271 !insertmacro ${_action} ".ts"
272 !insertmacro ${_action} ".vob"
273 !insertmacro ${_action} ".vro"
274 !insertmacro ${_action} ".wmv"
277 !macro MacroOtherExtensions _action
278 !insertmacro ${_action} ".asx"
279 !insertmacro ${_action} ".bin"
280 !insertmacro ${_action} ".cue"
281 !insertmacro ${_action} ".ifo"
282 !insertmacro ${_action} ".m3u"
283 !insertmacro ${_action} ".pls"
284 !insertmacro ${_action} ".sdp"
285 !insertmacro ${_action} ".vlc"
286 !insertmacro ${_action} ".xspf"
289 ; One macro to rule them all
290 !macro MacroAllExtensions _action
291 !insertmacro MacroAudioExtensions ${_action}
292 !insertmacro MacroVideoExtensions ${_action}
293 !insertmacro MacroOtherExtensions ${_action}
296 ;;;;;;;;;;;;;;;;;;;;;;;;;;;
297 ; 2. Context menu entries ;
298 ;;;;;;;;;;;;;;;;;;;;;;;;;;;
300 ; Generic function for adding the context menu for one ext.
301 !macro AddContextMenuExt EXT
302 WriteRegStr HKCR ${EXT}\shell\PlayWithVLC "" $ContextMenuEntry_PlayWith
303 WriteRegStr HKCR ${EXT}\shell\PlayWithVLC\command "" '"$INSTDIR\vlc.exe" --started-from-file --no-playlist-enqueue "%1"'
305 WriteRegStr HKCR ${EXT}\shell\AddToPlaylistVLC "" $ContextMenuEntry_AddToPlaylist
306 WriteRegStr HKCR ${EXT}\shell\AddToPlaylistVLC\command "" '"$INSTDIR\vlc.exe" --started-from-file --playlist-enqueue "%1"'
309 !macro AddContextMenu EXT
311 ReadRegStr $R0 HKCR ${EXT} ""
312 !insertmacro AddContextMenuExt $R0
316 !macro DeleteContextMenuExt EXT
317 DeleteRegKey HKCR ${EXT}\shell\PlayWithVLC
318 DeleteRegKey HKCR ${EXT}\shell\AddToPlaylistVLC
321 !macro DeleteContextMenu EXT
323 ReadRegStr $R0 HKCR ${EXT} ""
324 !insertmacro DeleteContextMenuExt $R0
328 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
330 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
334 !define Index 'Line${__LINE__}'
337 ; this will loop through all the logged users and "virtual" windows users
338 ; (it looks like users are only present in HKEY_USERS when they are logged in)
340 EnumRegKey $1 HKU "" $0
341 StrCmp $1 "" "${Index}-End"
343 ReadRegStr $2 HKU "$1\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" AppData
344 StrCmp $2 "" "${Index}-Loop"
349 SetShellVarContext all
350 RMDir /r "$APPDATA\\VideoLAN"
351 SetShellVarContext current
358 !macro OpenUninstallLog
359 FileOpen $UninstallLog "$INSTDIR\uninstall.log" a
360 FileSeek $UninstallLog 0 END
363 !macro CloseUninstallLog
364 FileClose $UninstallLog
365 SetFileAttributes "$INSTDIR\uninstall.log" HIDDEN
371 !macro InstallFile FILEREGEX
373 !define Index 'Line${__LINE__}'
374 FindFirst $0 $1 "$INSTDIR\${FILEREGEX}"
375 StrCmp $0 "" "${Index}-End"
377 StrCmp $1 "" "${Index}-End"
378 FileWrite $UninstallLog "$1$\r$\n"
385 !macro InstallFolder FOLDER
388 Call InstallFolderInternal
391 Function InstallFolderInternal
393 !define Index 'Line${__LINE__}'
394 FindFirst $0 $1 "$INSTDIR\$9\*"
395 StrCmp $0 "" "${Index}-End"
397 StrCmp $1 "" "${Index}-End"
398 StrCmp $1 "." "${Index}-Next"
399 StrCmp $1 ".." "${Index}-Next"
400 IfFileExists "$9\$1\*" 0 "${Index}-Write"
404 Call InstallFolderInternal
409 FileWrite $UninstallLog "$9\$1$\r$\n"
419 ;;;;;;;;;;;;;;;;;;;;;;
420 ; Installer sections ;
423 ;;;;;;;;;;;;;;;;;;;;;;
425 Section $Name_Section01 SEC01
427 SetShellVarContext all
428 SetOutPath "$INSTDIR"
430 !insertmacro OpenUninstallLog
432 ; VLC.exe, libvlc.dll
433 !insertmacro InstallFile vlc.exe
434 !insertmacro InstallFile vlc.exe.manifest
435 !insertmacro InstallFile vlc-cache-gen.exe
438 !insertmacro InstallFile *.dll
441 !insertmacro InstallFile *.txt
444 !insertmacro InstallFolder plugins
445 !insertmacro InstallFolder locale
446 @BUILD_OSDMENU_TRUE@ !insertmacro InstallFolder osdmenu
447 @BUILD_SKINS_TRUE@ !insertmacro InstallFolder skins
448 @BUILD_HTTPD_TRUE@ !insertmacro InstallFolder http
449 @BUILD_LUA_TRUE@ !insertmacro InstallFolder lua
450 ExecWait "$INSTDIR\vlc-cache-gen.exe $INSTDIR\plugins"
454 WriteIniStr "$INSTDIR\${PRODUCT_GROUP} Website.url" "InternetShortcut" "URL" \
455 "${PRODUCT_WEB_SITE}"
456 FileWrite $UninstallLog "${PRODUCT_GROUP} Website.url$\r$\n"
457 WriteIniStr "$INSTDIR\Documentation.url" "InternetShortcut" "URL" \
458 "${PRODUCT_WEB_SITE}/doc/"
459 FileWrite $UninstallLog "Documentation.url$\r$\n"
460 WriteIniStr "$INSTDIR\New_Skins.url" "InternetShortcut" "URL" \
461 "${PRODUCT_WEB_SITE}/vlc/skins.php"
462 FileWrite $UninstallLog "New_Skins.url$\r$\n"
464 !insertmacro CloseUninstallLog
466 ; Add VLC to "recommended programs" for the following extensions
467 WriteRegStr HKCR Applications\vlc.exe "" ""
468 WriteRegStr HKCR Applications\vlc.exe "FriendlyAppName" "VLC media player"
469 WriteRegStr HKCR Applications\vlc.exe\shell\Open "" $ContextMenuEntry_PlayWith
470 WriteRegStr HKCR Applications\vlc.exe\shell\Open\command "" \
471 '"$INSTDIR\vlc.exe" --started-from-file "%1"'
472 !insertmacro MacroAllExtensions WriteRegStrSupportedTypes
474 ; Windows default programs Registration
475 ; Vista and above detection
476 ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion
478 StrCmp $R1 '6' lbl_vista lbl_done
481 WriteRegStr HKLM "Software\RegisteredApplications" "VLC" "Software\Clients\Media\VLC\Capabilities"
482 WriteRegStr HKLM "Software\Clients\Media\VLC\Capabilities" "ApplicationName" "VLC media player"
483 WriteRegStr HKLM "Software\Clients\Media\VLC\Capabilities" "ApplicationDescription" "VLC - The video swiss knife"
484 WriteRegStr HKLM "Software\Clients\Media\VLC" "" "VLC media player"
485 WriteRegStr HKLM "Software\Clients\Media\VLC\InstallInfo" "HideIconsCommand" "$\"$INSTDIR\spad-setup.exe$\" /HideIcons /S"
486 WriteRegStr HKLM "Software\Clients\Media\VLC\InstallInfo" "ShowIconsCommand" "$\"$INSTDIR\spad-setup.exe$\" /ShowIcons /S"
487 WriteRegStr HKLM "Software\Clients\Media\VLC\InstallInfo" "ReinstallCommand" "$\"$INSTDIR\spad-setup.exe$\" /Reinstall /S"
488 WriteRegDWORD HKLM "Software\Clients\Media\VLC\InstallInfo" "IconsVisible" 0x001
493 Section $Name_Section02a SEC02a
495 CreateDirectory "$SMPROGRAMS\VideoLAN"
496 CreateDirectory "$SMPROGRAMS\VideoLAN\Quick Settings"
497 CreateDirectory "$SMPROGRAMS\VideoLAN\Quick Settings\Audio"
498 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Audio\Set Audio mode to DirectX (default).lnk" \
499 "$INSTDIR\vlc.exe" "--aout aout_directx --save-config vlc://quit"
500 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Audio\Set Audio mode to Waveout.lnk" \
501 "$INSTDIR\vlc.exe" "--aout waveout --save-config vlc://quit"
502 CreateDirectory "$SMPROGRAMS\VideoLAN\Quick Settings\Interface"
503 @BUILD_SKINS_TRUE@ CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Interface\Set Main Interface to Skinnable.lnk" \
504 @BUILD_SKINS_TRUE@ "$INSTDIR\vlc.exe" "-I skins --save-config vlc://quit"
505 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Interface\Set Main Interface to Qt (default).lnk" \
506 "$INSTDIR\vlc.exe" "-I qt --save-config vlc://quit"
507 CreateDirectory "$SMPROGRAMS\VideoLAN\Quick Settings\Video"
508 ; FIXME add detection for Vista. Direct3D will be default there, for all others it's DirectX
509 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to Direct3D.lnk" \
510 "$INSTDIR\vlc.exe" "--vout direct3d --overlay --directx-hw-yuv --save-config vlc://quit"
511 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to Direct3D (no hardware acceleration).lnk" \
512 "$INSTDIR\vlc.exe" "--vout direct3d --overlay --no-directx-hw-yuv --save-config vlc://quit"
513 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to DirectX.lnk" \
514 "$INSTDIR\vlc.exe" "--vout directx --overlay --directx-hw-yuv --save-config vlc://quit"
515 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to DirectX (no hardware acceleration).lnk" \
516 "$INSTDIR\vlc.exe" "--vout directx --no-overlay --no-directx-hw-yuv --save-config vlc://quit"
517 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to DirectX (no video overlay).lnk" \
518 "$INSTDIR\vlc.exe" "--vout directx --no-overlay --directx-hw-yuv --save-config vlc://quit"
519 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to OpenGL.lnk" \
520 "$INSTDIR\vlc.exe" "--vout opengl --overlay --save-config vlc://quit"
521 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Reset VLC media player preferences and cache files.lnk" \
522 "$INSTDIR\vlc.exe" "--reset-config --reset-plugins-cache vlc://quit"
523 CreateShortCut "$SMPROGRAMS\VideoLAN\Documentation.lnk" \
524 "$INSTDIR\Documentation.url"
525 CreateShortCut "$SMPROGRAMS\VideoLAN\Release Notes.lnk" \
526 "$INSTDIR\NEWS.txt" ""
527 CreateShortCut "$SMPROGRAMS\VideoLAN\${PRODUCT_GROUP} Website.lnk" \
528 "$INSTDIR\${PRODUCT_GROUP} Website.url"
529 CreateShortCut "$SMPROGRAMS\VideoLAN\VLC media player.lnk" \
530 "$INSTDIR\vlc.exe" ""
533 Section $Name_Section02b SEC02b
535 CreateShortCut "$DESKTOP\VLC media player.lnk" \
536 "$INSTDIR\vlc.exe" ""
539 !ifdef INSTALL_MOZILLA
540 Section /o $Name_Section03 SEC03
543 SetOutPath "$INSTDIR"
544 !insertmacro OpenUninstallLog
545 !insertmacro InstallFile mozilla\npvlc.dll
546 !insertmacro InstallFile mozilla\npvlc.dll.manifest
547 !insertmacro CloseUninstallLog
549 !define Moz "SOFTWARE\MozillaPlugins\@videolan.org/vlc,version=${VERSION}"
550 WriteRegStr HKLM ${Moz} "Description" "VLC Multimedia Plugin"
551 WriteRegStr HKLM ${Moz} "Path" "$INSTDIR\npvlc.dll"
552 WriteRegStr HKLM ${Moz} "Product" "VLC media player"
553 WriteRegStr HKLM ${Moz} "Vendor" "VideoLAN"
554 WriteRegStr HKLM ${Moz} "Version" "${VERSION}"
556 ; for very old version of mozilla, these lines may be needed
561 ;!define Index 'Line${__LINE__}'
567 ; EnumRegKey $R0 HKLM "SOFTWARE\Mozilla" "$R1"
568 ; StrCmp $R0 "" "${Index}-End"
570 ; ReadRegStr $R2 HKLM "SOFTWARE\Mozilla\$R0\Extensions" "Plugins"
571 ; StrCmp $R2 "" "${Index}-Loop" ""
573 ; CopyFiles "$INSTDIR\npvlc.dll" "$R2"
575 ; CopyFiles ${LIBVLC_DLL} "$R2"
577 ; !ifdef LIBVLC_CONTROL_DLL
578 ; CopyFiles ${LIBVLC_CONTROL_DLL} "$R2"
580 ; Goto "${Index}-Loop"
588 !ifdef INSTALL_ACTIVEX
589 Section $Name_Section04 SEC04
591 SetOutPath "$INSTDIR"
592 !insertmacro OpenUninstallLog
593 !insertmacro InstallFile activex\axvlc.dll
594 !insertmacro InstallFile activex\axvlc.dll.manifest
595 !insertmacro CloseUninstallLog
596 RegDLL "$INSTDIR\axvlc.dll"
601 Section $Name_Section05 SEC05
603 WriteRegStr HKCR "AudioCD\shell\PlayWithVLC" "" $ContextMenuEntry_PlayWith
604 WriteRegStr HKCR "AudioCD\shell\PlayWithVLC\command" "" \
605 '"$INSTDIR\vlc.exe" --started-from-file cdda://%1'
606 WriteRegStr HKCR "DVD\shell\PlayWithVLC" "" $ContextMenuEntry_PlayWith
607 WriteRegStr HKCR "DVD\shell\PlayWithVLC\command" "" \
608 '"$INSTDIR\vlc.exe" --started-from-file dvd://%1'
610 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayDVDMovieOnArrival" "VLCPlayDVDMovieOnArrival" ""
611 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "Action" $Action_OnArrivalDVD
612 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "DefaultIcon" '"$INSTDIR\vlc.exe",0'
613 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "InvokeProgID" "VLC.DVDMovie"
614 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "InvokeVerb" "Open"
615 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "Provider" "VideoLAN VLC media player"
617 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayCDAudioOnArrival" "VLCPlayCDAudioOnArrival" ""
618 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "Action" $Action_OnArrivalAudioCD
619 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "DefaultIcon" '"$INSTDIR\vlc.exe",0'
620 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "InvokeProgID" "VLC.CDAudio"
621 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "InvokeVerb" "Open"
622 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "Provider" "VideoLAN VLC media player"
623 WriteRegStr HKCR "VLC.DVDMovie" "" "VLC DVD Movie"
624 WriteRegStr HKCR "VLC.DVDMovie\shell" "" "Open"
625 WriteRegStr HKCR "VLC.DVDMovie\shell\Open\command" "" \
626 '"$INSTDIR\vlc.exe" --started-from-file dvd://%1'
627 WriteRegStr HKCR "VLC.DVDMovie\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'
628 WriteRegStr HKCR "VLC.CDAudio" "" "VLC CD Audio"
629 WriteRegStr HKCR "VLC.CDAudio\shell" "" "Open"
630 WriteRegStr HKCR "VLC.CDAudio\shell\Open\command" "" \
631 '"$INSTDIR\vlc.exe" --started-from-file cdda://%1'
632 WriteRegStr HKCR "VLC.CDAudio\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'
637 SectionGroup /e !$Name_Section06 SEC06
638 SectionGroup $Name_SectionGroupAudio
639 !insertmacro MacroAudioExtensions RegisterExtensionSection
641 SectionGroup $Name_SectionGroupVideo
642 !insertmacro MacroVideoExtensions RegisterExtensionSection
644 SectionGroup $Name_SectionGroupOther
645 !insertmacro MacroOtherExtensions RegisterExtensionSection
649 Section $Name_Section07 SEC07
651 !insertmacro MacroAllExtensions AddContextMenu
652 !insertmacro AddContextMenuExt "Directory"
655 Section $Name_Section08 SEC08
656 !insertmacro delprefs
659 ; Installer section descriptions
660 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
661 !insertmacro MUI_DESCRIPTION_TEXT ${SEC01} $Desc_Section01
662 !insertmacro MUI_DESCRIPTION_TEXT ${SEC02a} $Desc_Section02a
663 !insertmacro MUI_DESCRIPTION_TEXT ${SEC02b} $Desc_Section02b
664 @BUILD_MOZILLA_TRUE@ !insertmacro MUI_DESCRIPTION_TEXT ${SEC03} $Desc_Section03
665 @BUILD_ACTIVEX_TRUE@ !insertmacro MUI_DESCRIPTION_TEXT ${SEC04} $Desc_Section04
666 !insertmacro MUI_DESCRIPTION_TEXT ${SEC05} $Desc_Section05
667 !insertmacro MUI_DESCRIPTION_TEXT ${SEC06} $Desc_Section06
668 !insertmacro MUI_DESCRIPTION_TEXT ${SEC07} $Desc_Section07
669 !insertmacro MUI_DESCRIPTION_TEXT ${SEC08} $Desc_Section08
670 !insertmacro MUI_FUNCTION_DESCRIPTION_END
677 StrCmp 1223 $0 UAC_ElevationAborted
678 StrCmp 0 $0 0 UAC_Err
679 StrCmp 1 $1 0 UAC_Success
683 MessageBox mb_iconstop "Unable to elevate, error $0"
686 UAC_ElevationAborted:
687 MessageBox mb_iconstop "This installer requires admin access, aborting!"
692 StrCmp 3 $1 0 UAC_ElevationAborted
693 MessageBox mb_iconstop "This installer requires admin access, try again"
695 !insertmacro MUI_LANGDLL_DISPLAY
697 !include "languages\english.nsh"
698 StrCmp $LANGUAGE ${LANG_FRENCH} French 0
699 StrCmp $LANGUAGE ${LANG_GERMAN} German 0
700 StrCmp $LANGUAGE ${LANG_ITALIAN} Italian 0
701 StrCmp $LANGUAGE ${LANG_HUNGARIAN} Hungarian 0
702 StrCmp $LANGUAGE ${LANG_ROMANIAN} Romanian 0
703 StrCmp $LANGUAGE ${LANG_CATALAN} Catalan 0
704 StrCmp $LANGUAGE ${LANG_BULGARIAN} Bulgarian 0
705 StrCmp $LANGUAGE ${LANG_SLOVAK} Slovak 0
706 StrCmp $LANGUAGE ${LANG_POLISH} Polish 0
707 StrCmp $LANGUAGE ${LANG_DUTCH} Dutch 0
708 StrCmp $LANGUAGE ${LANG_SIMPCHINESE} SChinese 0
709 StrCmp $LANGUAGE ${LANG_FINNISH} Finnish 0
710 StrCmp $LANGUAGE ${LANG_PORTUGUESEBR} Brazilian EndLanguageCmp
712 !include "languages\french.nsh"
715 !include "languages\german.nsh"
718 !include "languages\italian.nsh"
721 !include "languages\hungarian.nsh"
724 !include "languages\romanian.nsh"
727 !include "languages\catalan.nsh"
730 !include "languages\bulgarian.nsh"
733 !include "languages\slovak.nsh"
736 !include "languages\polish.nsh"
739 !include "languages\dutch.nsh"
742 !include "languages\schinese.nsh"
745 !include "languages\finnish.nsh"
748 !include "languages\brazilian_portuguese.nsh"
751 ReadRegStr $R0 ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
755 MessageBox MB_YESNO|MB_ICONEXCLAMATION $Message_AlreadyInstalled IDNO done
760 ExecWait '$R0 _?=$INSTDIR' ;Do not copy the uninstaller to a temp file
765 Function .OnInstFailed
769 Function .OnInstSuccess
774 WriteUninstaller "$INSTDIR\uninstall.exe"
775 WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "InstallDir" $INSTDIR
776 WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "Version" "${VERSION}"
777 WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\vlc.exe"
779 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
780 "DisplayName" "$(^Name)"
781 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
782 "UninstallString" "$INSTDIR\uninstall.exe"
783 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
784 "InstallLocation" "$INSTDIR"
785 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
786 "DisplayIcon" "$INSTDIR\vlc.exe"
787 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
788 "DisplayVersion" "${PRODUCT_VERSION}"
789 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
790 "URLInfoAbout" "${PRODUCT_WEB_SITE}"
791 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
792 "Publisher" "${PRODUCT_PUBLISHER}"
793 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
794 "VersionMajor" "@VERSION_MAJOR@"
795 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
796 "VersionMinor" "@VERSION_MINOR@"
799 ;;;;;;;;;;;;;;;;;;;;;;;;
800 ; Uninstaller sections ;
801 ;;;;;;;;;;;;;;;;;;;;;;;;
803 ; TrimNewlines (copied from NSIS documentation)
804 ; input, top of stack (e.g. whatever$\r$\n)
805 ; output, top of stack (replaces, with e.g. whatever)
806 ; modifies no other variables.
808 Function un.TrimNewlines
817 StrCmp $R2 "$\r" loop
818 StrCmp $R2 "$\n" loop
820 IntCmp $R1 0 no_trim_needed
829 Function un.RemoveEmptyDirs
831 !define Index 'Line${__LINE__}'
832 FindFirst $0 $1 "$INSTDIR$9*"
833 StrCmp $0 "" "${Index}-End"
835 StrCmp $1 "" "${Index}-End"
836 StrCmp $1 "." "${Index}-Next"
837 StrCmp $1 ".." "${Index}-Next"
842 Call un.RemoveEmptyDirs
856 Section "un.$Name_Section91" SEC91
858 SetShellVarContext all
860 !insertmacro MacroAllExtensions DeleteContextMenu
861 !insertmacro MacroAllExtensions UnRegisterExtensionSection
862 !insertmacro DeleteContextMenuExt "Directory"
864 ;remove activex plugin
865 UnRegDLL "$INSTDIR\axvlc.dll"
866 Delete /REBOOTOK "$INSTDIR\axvlc.dll"
867 Delete /REBOOTOK "$INSTDIR\axvlc.dll.manifest"
869 ;remove mozilla plugin
874 !define Index 'Line${__LINE__}'
880 EnumRegKey $R0 HKLM "SOFTWARE\Mozilla" "$R1"
881 StrCmp $R0 "" "${Index}-End"
883 ReadRegStr $R2 HKLM "SOFTWARE\Mozilla\$R0\Extensions" "Plugins"
884 StrCmp $R2 "" "${Index}-Loop" ""
886 ; old files (0.8.5 and before) that may be lying around
887 Delete /REBOOTOK "$R2\npvlc.dll"
888 Delete /REBOOTOK "$R2\libvlc.dll"
889 Delete /REBOOTOK "$R2\vlcintf.xpt"
894 Delete /REBOOTOK "$INSTDIR\npvlc.dll"
895 Delete /REBOOTOK "$INSTDIR\npvlc.dll.manifest"
897 RMDir "$SMPROGRAMS\VideoLAN"
898 RMDir /r $SMPROGRAMS\VideoLAN
900 FileOpen $UninstallLog "$INSTDIR\uninstall.log" r
903 FileRead $UninstallLog $R0
904 IfErrors UninstallEnd
908 Delete "$INSTDIR\$R0"
911 FileClose $UninstallLog
912 Delete "$INSTDIR\uninstall.log"
913 Delete "$INSTDIR\uninstall.exe"
915 Call un.RemoveEmptyDirs
918 DeleteRegKey HKLM Software\VideoLAN
920 DeleteRegKey HKCR Applications\vlc.exe
921 DeleteRegKey HKCR AudioCD\shell\PlayWithVLC
922 DeleteRegKey HKCR DVD\shell\PlayWithVLC
923 DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayDVDMovieOnArrival" "VLCPlayDVDMovieOnArrival"
924 DeleteRegKey HKLM Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival
925 DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayCDAudioOnArrival" "VLCPlayCDAudioOnArrival"
926 DeleteRegKey HKLM Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival
927 DeleteRegKey HKLM Software\Clients\Media\VLC
928 DeleteRegValue HKLM "Software\RegisteredApplications" "VLC"
929 DeleteRegKey HKCR "VLC.MediaFile"
932 "SOFTWARE\MozillaPlugins\@videolan.org/vlc,version=${VERSION}"
935 "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
937 Delete "$DESKTOP\VLC media player.lnk"
939 DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
940 DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}"
944 Section /o "un.$Name_Section92" SEC92
945 !insertmacro delprefs
948 ; Uninstaller section descriptions
949 !insertmacro MUI_UNFUNCTION_DESCRIPTION_BEGIN
950 !insertmacro MUI_DESCRIPTION_TEXT ${SEC91} $Desc_Section91
951 !insertmacro MUI_DESCRIPTION_TEXT ${SEC92} $Desc_Section92
952 !insertmacro MUI_UNFUNCTION_DESCRIPTION_END
954 Function un.OnUnInstFailed
958 Function un.OnUnInstSuccess
960 Delete "$INSTDIR\UAC.dll"
967 StrCmp 1223 $0 UAC_ElevationAborted
968 StrCmp 0 $0 0 UAC_Err
969 StrCmp 1 $1 0 UAC_Success
973 MessageBox mb_iconstop "Unable to elevate, error $0"
976 UAC_ElevationAborted:
977 MessageBox mb_iconstop "This installer requires admin access, aborting!"
982 StrCmp 3 $1 0 UAC_ElevationAborted
983 MessageBox mb_iconstop "This installer requires admin access, try again"
986 !insertmacro MUI_UNGETLANGUAGE
988 !include "languages\english.nsh"
989 StrCmp $LANGUAGE ${LANG_FRENCH} French 0
990 StrCmp $LANGUAGE ${LANG_GERMAN} German 0
991 StrCmp $LANGUAGE ${LANG_ITALIAN} Italian 0
992 StrCmp $LANGUAGE ${LANG_HUNGARIAN} Hungarian 0
993 StrCmp $LANGUAGE ${LANG_ROMANIAN} Romanian 0
994 StrCmp $LANGUAGE ${LANG_CATALAN} Catalan 0
995 StrCmp $LANGUAGE ${LANG_BULGARIAN} Bulgarian 0
996 StrCmp $LANGUAGE ${LANG_SLOVAK} Slovak 0
997 StrCmp $LANGUAGE ${LANG_POLISH} Polish 0
998 StrCmp $LANGUAGE ${LANG_DUTCH} Dutch 0
999 StrCmp $LANGUAGE ${LANG_SIMPCHINESE} SChinese 0
1000 StrCmp $LANGUAGE ${LANG_FINNISH} Finnish 0
1001 StrCmp $LANGUAGE ${LANG_PORTUGUESEBR} Brazilian EndLanguageCmp
1003 !include "languages\french.nsh"
1006 !include "languages\german.nsh"
1009 !include "languages\italian.nsh"
1012 !include "languages\hungarian.nsh"
1015 !include "languages\romanian.nsh"
1018 !include "languages\catalan.nsh"
1021 !include "languages\bulgarian.nsh"
1024 !include "languages\slovak.nsh"
1027 !include "languages\polish.nsh"
1030 !include "languages\dutch.nsh"
1033 !include "languages\schinese.nsh"
1036 !include "languages\finnish.nsh"
1039 !include "languages\brazilian_portuguese.nsh"