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"
355 !macro OpenUninstallLog
356 FileOpen $UninstallLog "$INSTDIR\uninstall.log" a
357 FileSeek $UninstallLog 0 END
360 !macro CloseUninstallLog
361 FileClose $UninstallLog
362 SetFileAttributes "$INSTDIR\uninstall.log" HIDDEN
368 !macro InstallFile FILEREGEX
370 !define Index 'Line${__LINE__}'
371 FindFirst $0 $1 "$INSTDIR\${FILEREGEX}"
372 StrCmp $0 "" "${Index}-End"
374 StrCmp $1 "" "${Index}-End"
375 FileWrite $UninstallLog "$1$\r$\n"
382 !macro InstallFolder FOLDER
385 Call InstallFolderInternal
388 Function InstallFolderInternal
390 !define Index 'Line${__LINE__}'
391 FindFirst $0 $1 "$INSTDIR\$9\*"
392 StrCmp $0 "" "${Index}-End"
394 StrCmp $1 "" "${Index}-End"
395 StrCmp $1 "." "${Index}-Next"
396 StrCmp $1 ".." "${Index}-Next"
397 IfFileExists "$9\$1\*" 0 "${Index}-Write"
401 Call InstallFolderInternal
406 FileWrite $UninstallLog "$9\$1$\r$\n"
416 ;;;;;;;;;;;;;;;;;;;;;;
417 ; Installer sections ;
420 ;;;;;;;;;;;;;;;;;;;;;;
422 Section $Name_Section01 SEC01
424 SetShellVarContext all
425 SetOutPath "$INSTDIR"
427 !insertmacro OpenUninstallLog
429 ; VLC.exe, libvlc.dll
430 !insertmacro InstallFile vlc.exe
431 !insertmacro InstallFile vlc.exe.manifest
432 !insertmacro InstallFile vlc-cache-gen.exe
435 !insertmacro InstallFile *.dll
438 !insertmacro InstallFile *.txt
441 !insertmacro InstallFolder plugins
442 !insertmacro InstallFolder locale
443 @BUILD_OSDMENU_TRUE@ !insertmacro InstallFolder osdmenu
444 @BUILD_SKINS_TRUE@ !insertmacro InstallFolder skins
445 @BUILD_HTTPD_TRUE@ !insertmacro InstallFolder http
446 @BUILD_LUA_TRUE@ !insertmacro InstallFolder lua
448 ; Generate the cache and add it to uninstall.log
449 ExecWait "$INSTDIR\vlc-cache-gen.exe $INSTDIR\plugins"
450 FindFirst $0 $1 "$INSTDIR\plugins\*.dat"
451 FileWrite $UninstallLog "plugins\$1$\r$\n"
457 WriteIniStr "$INSTDIR\${PRODUCT_GROUP} Website.url" "InternetShortcut" "URL" \
458 "${PRODUCT_WEB_SITE}"
459 FileWrite $UninstallLog "${PRODUCT_GROUP} Website.url$\r$\n"
460 WriteIniStr "$INSTDIR\Documentation.url" "InternetShortcut" "URL" \
461 "${PRODUCT_WEB_SITE}/doc/"
462 FileWrite $UninstallLog "Documentation.url$\r$\n"
463 WriteIniStr "$INSTDIR\New_Skins.url" "InternetShortcut" "URL" \
464 "${PRODUCT_WEB_SITE}/vlc/skins.php"
465 FileWrite $UninstallLog "New_Skins.url$\r$\n"
467 !insertmacro CloseUninstallLog
469 ; Add VLC to "recommended programs" for the following extensions
470 WriteRegStr HKCR Applications\vlc.exe "" ""
471 WriteRegStr HKCR Applications\vlc.exe "FriendlyAppName" "VLC media player"
472 WriteRegStr HKCR Applications\vlc.exe\shell\Open "" $ContextMenuEntry_PlayWith
473 WriteRegStr HKCR Applications\vlc.exe\shell\Open\command "" \
474 '"$INSTDIR\vlc.exe" --started-from-file "%1"'
475 !insertmacro MacroAllExtensions WriteRegStrSupportedTypes
477 ; Windows default programs Registration
478 ; Vista and above detection
479 ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion
481 StrCmp $R1 '6' lbl_vista lbl_done
484 WriteRegStr HKLM "Software\RegisteredApplications" "VLC" "Software\Clients\Media\VLC\Capabilities"
485 WriteRegStr HKLM "Software\Clients\Media\VLC\Capabilities" "ApplicationName" "VLC media player"
486 WriteRegStr HKLM "Software\Clients\Media\VLC\Capabilities" "ApplicationDescription" "VLC - The video swiss knife"
487 WriteRegStr HKLM "Software\Clients\Media\VLC" "" "VLC media player"
488 WriteRegStr HKLM "Software\Clients\Media\VLC\InstallInfo" "HideIconsCommand" "$\"$INSTDIR\spad-setup.exe$\" /HideIcons /S"
489 WriteRegStr HKLM "Software\Clients\Media\VLC\InstallInfo" "ShowIconsCommand" "$\"$INSTDIR\spad-setup.exe$\" /ShowIcons /S"
490 WriteRegStr HKLM "Software\Clients\Media\VLC\InstallInfo" "ReinstallCommand" "$\"$INSTDIR\spad-setup.exe$\" /Reinstall /S"
491 WriteRegDWORD HKLM "Software\Clients\Media\VLC\InstallInfo" "IconsVisible" 0x001
496 Section $Name_Section02a SEC02a
498 CreateDirectory "$SMPROGRAMS\VideoLAN"
499 CreateDirectory "$SMPROGRAMS\VideoLAN\Quick Settings"
500 CreateDirectory "$SMPROGRAMS\VideoLAN\Quick Settings\Audio"
501 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Audio\Set Audio mode to DirectX (default).lnk" \
502 "$INSTDIR\vlc.exe" "--aout aout_directx --save-config vlc://quit"
503 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Audio\Set Audio mode to Waveout.lnk" \
504 "$INSTDIR\vlc.exe" "--aout waveout --save-config vlc://quit"
505 CreateDirectory "$SMPROGRAMS\VideoLAN\Quick Settings\Interface"
506 @BUILD_SKINS_TRUE@ CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Interface\Set Main Interface to Skinnable.lnk" \
507 @BUILD_SKINS_TRUE@ "$INSTDIR\vlc.exe" "-I skins --save-config vlc://quit"
508 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Interface\Set Main Interface to Qt (default).lnk" \
509 "$INSTDIR\vlc.exe" "-I qt --save-config vlc://quit"
510 CreateDirectory "$SMPROGRAMS\VideoLAN\Quick Settings\Video"
511 ; FIXME add detection for Vista. Direct3D will be default there, for all others it's DirectX
512 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to Direct3D.lnk" \
513 "$INSTDIR\vlc.exe" "--vout direct3d --overlay --directx-hw-yuv --save-config vlc://quit"
514 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to Direct3D (no hardware acceleration).lnk" \
515 "$INSTDIR\vlc.exe" "--vout direct3d --overlay --no-directx-hw-yuv --save-config vlc://quit"
516 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to DirectX.lnk" \
517 "$INSTDIR\vlc.exe" "--vout directx --overlay --directx-hw-yuv --save-config vlc://quit"
518 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to DirectX (no hardware acceleration).lnk" \
519 "$INSTDIR\vlc.exe" "--vout directx --no-overlay --no-directx-hw-yuv --save-config vlc://quit"
520 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to DirectX (no video overlay).lnk" \
521 "$INSTDIR\vlc.exe" "--vout directx --no-overlay --directx-hw-yuv --save-config vlc://quit"
522 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to OpenGL.lnk" \
523 "$INSTDIR\vlc.exe" "--vout opengl --overlay --save-config vlc://quit"
524 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Reset VLC media player preferences and cache files.lnk" \
525 "$INSTDIR\vlc.exe" "--reset-config --reset-plugins-cache vlc://quit"
526 CreateShortCut "$SMPROGRAMS\VideoLAN\Documentation.lnk" \
527 "$INSTDIR\Documentation.url"
528 CreateShortCut "$SMPROGRAMS\VideoLAN\Release Notes.lnk" \
529 "$INSTDIR\NEWS.txt" ""
530 CreateShortCut "$SMPROGRAMS\VideoLAN\${PRODUCT_GROUP} Website.lnk" \
531 "$INSTDIR\${PRODUCT_GROUP} Website.url"
532 CreateShortCut "$SMPROGRAMS\VideoLAN\VLC media player.lnk" \
533 "$INSTDIR\vlc.exe" ""
536 Section $Name_Section02b SEC02b
538 CreateShortCut "$DESKTOP\VLC media player.lnk" \
539 "$INSTDIR\vlc.exe" ""
542 !ifdef INSTALL_MOZILLA
543 Section /o $Name_Section03 SEC03
546 SetOutPath "$INSTDIR"
547 !insertmacro OpenUninstallLog
548 !insertmacro InstallFile mozilla\npvlc.dll
549 !insertmacro InstallFile mozilla\npvlc.dll.manifest
550 !insertmacro CloseUninstallLog
552 !define Moz "SOFTWARE\MozillaPlugins\@videolan.org/vlc,version=${VERSION}"
553 WriteRegStr HKLM ${Moz} "Description" "VLC Multimedia Plugin"
554 WriteRegStr HKLM ${Moz} "Path" "$INSTDIR\npvlc.dll"
555 WriteRegStr HKLM ${Moz} "Product" "VLC media player"
556 WriteRegStr HKLM ${Moz} "Vendor" "VideoLAN"
557 WriteRegStr HKLM ${Moz} "Version" "${VERSION}"
559 ; for very old version of mozilla, these lines may be needed
564 ;!define Index 'Line${__LINE__}'
570 ; EnumRegKey $R0 HKLM "SOFTWARE\Mozilla" "$R1"
571 ; StrCmp $R0 "" "${Index}-End"
573 ; ReadRegStr $R2 HKLM "SOFTWARE\Mozilla\$R0\Extensions" "Plugins"
574 ; StrCmp $R2 "" "${Index}-Loop" ""
576 ; CopyFiles "$INSTDIR\npvlc.dll" "$R2"
578 ; CopyFiles ${LIBVLC_DLL} "$R2"
580 ; !ifdef LIBVLC_CONTROL_DLL
581 ; CopyFiles ${LIBVLC_CONTROL_DLL} "$R2"
583 ; Goto "${Index}-Loop"
591 !ifdef INSTALL_ACTIVEX
592 Section $Name_Section04 SEC04
594 SetOutPath "$INSTDIR"
595 !insertmacro OpenUninstallLog
596 !insertmacro InstallFile activex\axvlc.dll
597 !insertmacro InstallFile activex\axvlc.dll.manifest
598 !insertmacro CloseUninstallLog
599 RegDLL "$INSTDIR\axvlc.dll"
604 Section $Name_Section05 SEC05
606 WriteRegStr HKCR "AudioCD\shell\PlayWithVLC" "" $ContextMenuEntry_PlayWith
607 WriteRegStr HKCR "AudioCD\shell\PlayWithVLC\command" "" \
608 '"$INSTDIR\vlc.exe" --started-from-file cdda://%1'
609 WriteRegStr HKCR "DVD\shell\PlayWithVLC" "" $ContextMenuEntry_PlayWith
610 WriteRegStr HKCR "DVD\shell\PlayWithVLC\command" "" \
611 '"$INSTDIR\vlc.exe" --started-from-file dvd://%1'
613 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayDVDMovieOnArrival" "VLCPlayDVDMovieOnArrival" ""
614 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "Action" $Action_OnArrivalDVD
615 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "DefaultIcon" '"$INSTDIR\vlc.exe",0'
616 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "InvokeProgID" "VLC.DVDMovie"
617 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "InvokeVerb" "Open"
618 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "Provider" "VideoLAN VLC media player"
620 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayCDAudioOnArrival" "VLCPlayCDAudioOnArrival" ""
621 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "Action" $Action_OnArrivalAudioCD
622 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "DefaultIcon" '"$INSTDIR\vlc.exe",0'
623 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "InvokeProgID" "VLC.CDAudio"
624 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "InvokeVerb" "Open"
625 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "Provider" "VideoLAN VLC media player"
626 WriteRegStr HKCR "VLC.DVDMovie" "" "VLC DVD Movie"
627 WriteRegStr HKCR "VLC.DVDMovie\shell" "" "Open"
628 WriteRegStr HKCR "VLC.DVDMovie\shell\Open\command" "" \
629 '"$INSTDIR\vlc.exe" --started-from-file dvd://%1'
630 WriteRegStr HKCR "VLC.DVDMovie\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'
631 WriteRegStr HKCR "VLC.CDAudio" "" "VLC CD Audio"
632 WriteRegStr HKCR "VLC.CDAudio\shell" "" "Open"
633 WriteRegStr HKCR "VLC.CDAudio\shell\Open\command" "" \
634 '"$INSTDIR\vlc.exe" --started-from-file cdda://%1'
635 WriteRegStr HKCR "VLC.CDAudio\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'
640 SectionGroup /e !$Name_Section06 SEC06
641 SectionGroup $Name_SectionGroupAudio
642 !insertmacro MacroAudioExtensions RegisterExtensionSection
644 SectionGroup $Name_SectionGroupVideo
645 !insertmacro MacroVideoExtensions RegisterExtensionSection
647 SectionGroup $Name_SectionGroupOther
648 !insertmacro MacroOtherExtensions RegisterExtensionSection
652 Section $Name_Section07 SEC07
654 !insertmacro MacroAllExtensions AddContextMenu
655 !insertmacro AddContextMenuExt "Directory"
658 Section $Name_Section08 SEC08
659 !insertmacro delprefs
662 ; Installer section descriptions
663 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
664 !insertmacro MUI_DESCRIPTION_TEXT ${SEC01} $Desc_Section01
665 !insertmacro MUI_DESCRIPTION_TEXT ${SEC02a} $Desc_Section02a
666 !insertmacro MUI_DESCRIPTION_TEXT ${SEC02b} $Desc_Section02b
667 @BUILD_MOZILLA_TRUE@ !insertmacro MUI_DESCRIPTION_TEXT ${SEC03} $Desc_Section03
668 @BUILD_ACTIVEX_TRUE@ !insertmacro MUI_DESCRIPTION_TEXT ${SEC04} $Desc_Section04
669 !insertmacro MUI_DESCRIPTION_TEXT ${SEC05} $Desc_Section05
670 !insertmacro MUI_DESCRIPTION_TEXT ${SEC06} $Desc_Section06
671 !insertmacro MUI_DESCRIPTION_TEXT ${SEC07} $Desc_Section07
672 !insertmacro MUI_DESCRIPTION_TEXT ${SEC08} $Desc_Section08
673 !insertmacro MUI_FUNCTION_DESCRIPTION_END
680 StrCmp 1223 $0 UAC_ElevationAborted
681 StrCmp 0 $0 0 UAC_Err
682 StrCmp 1 $1 0 UAC_Success
686 MessageBox mb_iconstop "Unable to elevate, error $0"
689 UAC_ElevationAborted:
690 MessageBox mb_iconstop "This installer requires admin access, aborting!"
695 StrCmp 3 $1 0 UAC_ElevationAborted
696 MessageBox mb_iconstop "This installer requires admin access, try again"
698 !insertmacro MUI_LANGDLL_DISPLAY
700 !include "languages\english.nsh"
701 StrCmp $LANGUAGE ${LANG_FRENCH} French 0
702 StrCmp $LANGUAGE ${LANG_GERMAN} German 0
703 StrCmp $LANGUAGE ${LANG_ITALIAN} Italian 0
704 StrCmp $LANGUAGE ${LANG_HUNGARIAN} Hungarian 0
705 StrCmp $LANGUAGE ${LANG_ROMANIAN} Romanian 0
706 StrCmp $LANGUAGE ${LANG_CATALAN} Catalan 0
707 StrCmp $LANGUAGE ${LANG_BULGARIAN} Bulgarian 0
708 StrCmp $LANGUAGE ${LANG_SLOVAK} Slovak 0
709 StrCmp $LANGUAGE ${LANG_POLISH} Polish 0
710 StrCmp $LANGUAGE ${LANG_DUTCH} Dutch 0
711 StrCmp $LANGUAGE ${LANG_SIMPCHINESE} SChinese 0
712 StrCmp $LANGUAGE ${LANG_FINNISH} Finnish 0
713 StrCmp $LANGUAGE ${LANG_PORTUGUESEBR} Brazilian EndLanguageCmp
715 !include "languages\french.nsh"
718 !include "languages\german.nsh"
721 !include "languages\italian.nsh"
724 !include "languages\hungarian.nsh"
727 !include "languages\romanian.nsh"
730 !include "languages\catalan.nsh"
733 !include "languages\bulgarian.nsh"
736 !include "languages\slovak.nsh"
739 !include "languages\polish.nsh"
742 !include "languages\dutch.nsh"
745 !include "languages\schinese.nsh"
748 !include "languages\finnish.nsh"
751 !include "languages\brazilian_portuguese.nsh"
754 ReadRegStr $R0 ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
758 MessageBox MB_YESNO|MB_ICONEXCLAMATION $Message_AlreadyInstalled IDNO done
763 ExecWait '$R0 _?=$INSTDIR' ;Do not copy the uninstaller to a temp file
768 Function .OnInstFailed
772 Function .OnInstSuccess
777 WriteUninstaller "$INSTDIR\uninstall.exe"
778 WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "InstallDir" $INSTDIR
779 WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "Version" "${VERSION}"
780 WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\vlc.exe"
782 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
783 "DisplayName" "$(^Name)"
784 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
785 "UninstallString" "$INSTDIR\uninstall.exe"
786 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
787 "InstallLocation" "$INSTDIR"
788 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
789 "DisplayIcon" "$INSTDIR\vlc.exe"
790 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
791 "DisplayVersion" "${PRODUCT_VERSION}"
792 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
793 "URLInfoAbout" "${PRODUCT_WEB_SITE}"
794 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
795 "Publisher" "${PRODUCT_PUBLISHER}"
796 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
797 "VersionMajor" "@VERSION_MAJOR@"
798 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
799 "VersionMinor" "@VERSION_MINOR@"
802 ;;;;;;;;;;;;;;;;;;;;;;;;
803 ; Uninstaller sections ;
804 ;;;;;;;;;;;;;;;;;;;;;;;;
806 ; TrimNewlines (copied from NSIS documentation)
807 ; input, top of stack (e.g. whatever$\r$\n)
808 ; output, top of stack (replaces, with e.g. whatever)
809 ; modifies no other variables.
811 Function un.TrimNewlines
820 StrCmp $R2 "$\r" loop
821 StrCmp $R2 "$\n" loop
823 IntCmp $R1 0 no_trim_needed
832 Function un.RemoveEmptyDirs
834 !define Index 'Line${__LINE__}'
835 FindFirst $0 $1 "$INSTDIR$9*"
836 StrCmp $0 "" "${Index}-End"
838 StrCmp $1 "" "${Index}-End"
839 StrCmp $1 "." "${Index}-Next"
840 StrCmp $1 ".." "${Index}-Next"
845 Call un.RemoveEmptyDirs
859 Section "un.$Name_Section91" SEC91
861 SetShellVarContext all
863 !insertmacro MacroAllExtensions DeleteContextMenu
864 !insertmacro MacroAllExtensions UnRegisterExtensionSection
865 !insertmacro DeleteContextMenuExt "Directory"
867 ;remove activex plugin
868 UnRegDLL "$INSTDIR\axvlc.dll"
869 Delete /REBOOTOK "$INSTDIR\axvlc.dll"
870 Delete /REBOOTOK "$INSTDIR\axvlc.dll.manifest"
872 ;remove mozilla plugin
877 !define Index 'Line${__LINE__}'
883 EnumRegKey $R0 HKLM "SOFTWARE\Mozilla" "$R1"
884 StrCmp $R0 "" "${Index}-End"
886 ReadRegStr $R2 HKLM "SOFTWARE\Mozilla\$R0\Extensions" "Plugins"
887 StrCmp $R2 "" "${Index}-Loop" ""
889 ; old files (0.8.5 and before) that may be lying around
890 Delete /REBOOTOK "$R2\npvlc.dll"
891 Delete /REBOOTOK "$R2\libvlc.dll"
892 Delete /REBOOTOK "$R2\vlcintf.xpt"
897 Delete /REBOOTOK "$INSTDIR\npvlc.dll"
898 Delete /REBOOTOK "$INSTDIR\npvlc.dll.manifest"
900 RMDir "$SMPROGRAMS\VideoLAN"
901 RMDir /r $SMPROGRAMS\VideoLAN
903 FileOpen $UninstallLog "$INSTDIR\uninstall.log" r
906 FileRead $UninstallLog $R0
907 IfErrors UninstallEnd
911 Delete "$INSTDIR\$R0"
914 FileClose $UninstallLog
915 Delete "$INSTDIR\uninstall.log"
916 Delete "$INSTDIR\uninstall.exe"
918 Call un.RemoveEmptyDirs
921 DeleteRegKey HKLM Software\VideoLAN
923 DeleteRegKey HKCR Applications\vlc.exe
924 DeleteRegKey HKCR AudioCD\shell\PlayWithVLC
925 DeleteRegKey HKCR DVD\shell\PlayWithVLC
926 DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayDVDMovieOnArrival" "VLCPlayDVDMovieOnArrival"
927 DeleteRegKey HKLM Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival
928 DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayCDAudioOnArrival" "VLCPlayCDAudioOnArrival"
929 DeleteRegKey HKLM Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival
930 DeleteRegKey HKLM Software\Clients\Media\VLC
931 DeleteRegValue HKLM "Software\RegisteredApplications" "VLC"
932 DeleteRegKey HKCR "VLC.MediaFile"
935 "SOFTWARE\MozillaPlugins\@videolan.org/vlc,version=${VERSION}"
938 "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
940 Delete "$DESKTOP\VLC media player.lnk"
942 DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
943 DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}"
947 Section /o "un.$Name_Section92" SEC92
948 !insertmacro delprefs
951 ; Uninstaller section descriptions
952 !insertmacro MUI_UNFUNCTION_DESCRIPTION_BEGIN
953 !insertmacro MUI_DESCRIPTION_TEXT ${SEC91} $Desc_Section91
954 !insertmacro MUI_DESCRIPTION_TEXT ${SEC92} $Desc_Section92
955 !insertmacro MUI_UNFUNCTION_DESCRIPTION_END
957 Function un.OnUnInstFailed
961 Function un.OnUnInstSuccess
963 Delete "$INSTDIR\UAC.dll"
970 StrCmp 1223 $0 UAC_ElevationAborted
971 StrCmp 0 $0 0 UAC_Err
972 StrCmp 1 $1 0 UAC_Success
976 MessageBox mb_iconstop "Unable to elevate, error $0"
979 UAC_ElevationAborted:
980 MessageBox mb_iconstop "This installer requires admin access, aborting!"
985 StrCmp 3 $1 0 UAC_ElevationAborted
986 MessageBox mb_iconstop "This installer requires admin access, try again"
989 !insertmacro MUI_UNGETLANGUAGE
991 !include "languages\english.nsh"
992 StrCmp $LANGUAGE ${LANG_FRENCH} French 0
993 StrCmp $LANGUAGE ${LANG_GERMAN} German 0
994 StrCmp $LANGUAGE ${LANG_ITALIAN} Italian 0
995 StrCmp $LANGUAGE ${LANG_HUNGARIAN} Hungarian 0
996 StrCmp $LANGUAGE ${LANG_ROMANIAN} Romanian 0
997 StrCmp $LANGUAGE ${LANG_CATALAN} Catalan 0
998 StrCmp $LANGUAGE ${LANG_BULGARIAN} Bulgarian 0
999 StrCmp $LANGUAGE ${LANG_SLOVAK} Slovak 0
1000 StrCmp $LANGUAGE ${LANG_POLISH} Polish 0
1001 StrCmp $LANGUAGE ${LANG_DUTCH} Dutch 0
1002 StrCmp $LANGUAGE ${LANG_SIMPCHINESE} SChinese 0
1003 StrCmp $LANGUAGE ${LANG_FINNISH} Finnish 0
1004 StrCmp $LANGUAGE ${LANG_PORTUGUESEBR} Brazilian EndLanguageCmp
1006 !include "languages\french.nsh"
1009 !include "languages\german.nsh"
1012 !include "languages\italian.nsh"
1015 !include "languages\hungarian.nsh"
1018 !include "languages\romanian.nsh"
1021 !include "languages\catalan.nsh"
1024 !include "languages\bulgarian.nsh"
1027 !include "languages\slovak.nsh"
1030 !include "languages\polish.nsh"
1033 !include "languages\dutch.nsh"
1036 !include "languages\schinese.nsh"
1039 !include "languages\finnish.nsh"
1042 !include "languages\brazilian_portuguese.nsh"