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"
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_LINK $Link_VisitWebsite
95 !define MUI_FINISHPAGE_LINK_LOCATION "http://www.videolan.org/vlc/"
96 !define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\README.txt"
97 !define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED
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 registers 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 registers one skin extension for VLC
177 Function RegisterSkinExtension
178 ; back up old value for extension $R0 (eg. ".opt")
179 ReadRegStr $1 HKCR "$R0" ""
180 StrCmp $1 "" NoBackup
181 StrCmp $1 "VLC$R0" "NoBackup"
182 WriteRegStr HKCR "$R0" "VLC.backup" $1
184 WriteRegStr HKCR "$R0" "" "VLC$R0"
185 ReadRegStr $0 HKCR "VLC$R0" ""
186 WriteRegStr HKCR "VLC$R0" "" "VLC skin file ($R0)"
187 WriteRegStr HKCR "VLC$R0\shell" "" "Open"
188 WriteRegStr HKCR "VLC$R0\shell\Open" "" ""
189 WriteRegStr HKCR "VLC$R0\shell\Open\command" "" '"$INSTDIR\vlc.exe" -Iskins --skins2-last "%1"'
190 WriteRegStr HKCR "VLC$R0\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'
193 ; Vista and above detection
194 ReadRegStr $R1 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion
196 StrCmp $R2 '6' ForVista ToEnd
198 WriteRegStr HKLM "Software\Clients\Media\VLC\Capabilities\FileAssociations" "$R0" "VLC$R0"
203 ;; Function that removes one extension that VLC owns.
204 Function un.RegisterExtension
205 ;start of restore script
206 ReadRegStr $1 HKCR "$R0" ""
207 StrCmp $1 "VLC$R0" 0 NoOwn ; only do this if we own it
208 ; Read the old value from Backup
209 ReadRegStr $1 HKCR "$R0" "VLC.backup"
210 StrCmp $1 "" 0 Restore ; if backup="" then delete the whole key
211 DeleteRegKey HKCR "$R0"
214 WriteRegStr HKCR "$R0" "" $1
215 DeleteRegValue HKCR "$R0" "VLC.backup"
217 DeleteRegKey HKCR "VLC$R0" ;Delete key with association settings
218 DeleteRegKey HKLM "Software\Clients\Media\VLC\Capabilities\FileAssociations\VLC$R0" ; for vista
221 !macro RegisterExtensionSection EXT
226 Call RegisterExtension
231 !macro RegisterSkinExtensionSection EXT
236 Call RegisterSkinExtension
241 !macro UnRegisterExtensionSection EXT
244 Call un.RegisterExtension
248 !macro WriteRegStrSupportedTypes EXT
249 WriteRegStr HKCR Applications\vlc.exe\SupportedTypes ${EXT} ""
252 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
253 ; Extension lists Macros ;
254 ; Those macros calls the previous functions ;
255 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
257 !macro MacroAudioExtensions _action
258 !insertmacro ${_action} ".a52"
259 !insertmacro ${_action} ".aac"
260 !insertmacro ${_action} ".ac3"
261 !insertmacro ${_action} ".aob"
262 !insertmacro ${_action} ".dts"
263 !insertmacro ${_action} ".flac"
264 !insertmacro ${_action} ".m4a"
265 !insertmacro ${_action} ".m4p"
266 !insertmacro ${_action} ".mka"
267 !insertmacro ${_action} ".mod"
268 !insertmacro ${_action} ".mp1"
269 !insertmacro ${_action} ".mp2"
270 !insertmacro ${_action} ".mp3"
271 !insertmacro ${_action} ".oma"
272 !insertmacro ${_action} ".oga"
273 !insertmacro ${_action} ".spx"
274 !insertmacro ${_action} ".tta"
275 !insertmacro ${_action} ".wav"
276 !insertmacro ${_action} ".wma"
277 !insertmacro ${_action} ".wv"
278 !insertmacro ${_action} ".xm"
281 !macro MacroVideoExtensions _action
282 !insertmacro ${_action} ".asf"
283 !insertmacro ${_action} ".avi"
284 !insertmacro ${_action} ".divx"
285 !insertmacro ${_action} ".dv"
286 !insertmacro ${_action} ".flv"
287 !insertmacro ${_action} ".gxf"
288 !insertmacro ${_action} ".m1v"
289 !insertmacro ${_action} ".m2v"
290 !insertmacro ${_action} ".m2ts"
291 !insertmacro ${_action} ".m4v"
292 !insertmacro ${_action} ".mkv"
293 !insertmacro ${_action} ".mov"
294 !insertmacro ${_action} ".mp4"
295 !insertmacro ${_action} ".mpeg"
296 !insertmacro ${_action} ".mpeg1"
297 !insertmacro ${_action} ".mpeg2"
298 !insertmacro ${_action} ".mpeg4"
299 !insertmacro ${_action} ".mpg"
300 !insertmacro ${_action} ".mts"
301 !insertmacro ${_action} ".mxf"
302 !insertmacro ${_action} ".nuv"
303 !insertmacro ${_action} ".ogg"
304 !insertmacro ${_action} ".ogm"
305 !insertmacro ${_action} ".ogx"
306 !insertmacro ${_action} ".ogv"
307 !insertmacro ${_action} ".rmvb"
308 !insertmacro ${_action} ".ts"
309 !insertmacro ${_action} ".vob"
310 !insertmacro ${_action} ".vro"
311 !insertmacro ${_action} ".webm"
312 !insertmacro ${_action} ".wmv"
315 !macro MacroOtherExtensions _action
316 !insertmacro ${_action} ".asx"
317 !insertmacro ${_action} ".bin"
318 !insertmacro ${_action} ".cue"
319 !insertmacro ${_action} ".ifo"
320 !insertmacro ${_action} ".m3u"
321 !insertmacro ${_action} ".pls"
322 !insertmacro ${_action} ".sdp"
323 !insertmacro ${_action} ".vlc"
324 !insertmacro ${_action} ".xspf"
327 !macro MacroSkinExtensions _action
328 !insertmacro ${_action} ".vlt"
329 !insertmacro ${_action} ".wsz"
332 ; One macro to rule them all
333 !macro MacroAllExtensions _action
334 !insertmacro MacroAudioExtensions ${_action}
335 !insertmacro MacroVideoExtensions ${_action}
336 !insertmacro MacroOtherExtensions ${_action}
339 ;;;;;;;;;;;;;;;;;;;;;;;;;;;
340 ; 2. Context menu entries ;
341 ;;;;;;;;;;;;;;;;;;;;;;;;;;;
343 ; Generic function for adding the context menu for one ext.
344 !macro AddContextMenuExt EXT
345 WriteRegStr HKCR ${EXT}\shell\PlayWithVLC "" $ContextMenuEntry_PlayWith
346 WriteRegStr HKCR ${EXT}\shell\PlayWithVLC\command "" '"$INSTDIR\vlc.exe" --started-from-file --no-playlist-enqueue "%1"'
348 WriteRegStr HKCR ${EXT}\shell\AddToPlaylistVLC "" $ContextMenuEntry_AddToPlaylist
349 WriteRegStr HKCR ${EXT}\shell\AddToPlaylistVLC\command "" '"$INSTDIR\vlc.exe" --started-from-file --playlist-enqueue "%1"'
352 !macro AddContextMenu EXT
354 ReadRegStr $R0 HKCR ${EXT} ""
355 !insertmacro AddContextMenuExt $R0
359 !macro DeleteContextMenuExt EXT
360 DeleteRegKey HKCR ${EXT}\shell\PlayWithVLC
361 DeleteRegKey HKCR ${EXT}\shell\AddToPlaylistVLC
364 !macro DeleteContextMenu EXT
366 ReadRegStr $R0 HKCR ${EXT} ""
367 !insertmacro DeleteContextMenuExt $R0
371 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
373 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
377 !define Index 'Line${__LINE__}'
380 ; this will loop through all the logged users and "virtual" windows users
381 ; (it looks like users are only present in HKEY_USERS when they are logged in)
383 EnumRegKey $1 HKU "" $0
384 StrCmp $1 "" "${Index}-End"
386 ReadRegStr $2 HKU "$1\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" AppData
387 StrCmp $2 "" "${Index}-Loop"
398 !macro OpenUninstallLog
399 FileOpen $UninstallLog "$INSTDIR\uninstall.log" a
400 FileSeek $UninstallLog 0 END
403 !macro CloseUninstallLog
404 FileClose $UninstallLog
405 SetFileAttributes "$INSTDIR\uninstall.log" HIDDEN
411 !macro InstallFile FILEREGEX
413 !define Index 'Line${__LINE__}'
414 FindFirst $0 $1 "$INSTDIR\${FILEREGEX}"
415 StrCmp $0 "" "${Index}-End"
417 StrCmp $1 "" "${Index}-End"
418 FileWrite $UninstallLog "$1$\r$\n"
425 !macro InstallFolder FOLDER
428 Call InstallFolderInternal
431 Function InstallFolderInternal
433 !define Index 'Line${__LINE__}'
434 FindFirst $0 $1 "$INSTDIR\$9\*"
435 StrCmp $0 "" "${Index}-End"
437 StrCmp $1 "" "${Index}-End"
438 StrCmp $1 "." "${Index}-Next"
439 StrCmp $1 ".." "${Index}-Next"
440 IfFileExists "$9\$1\*" 0 "${Index}-Write"
444 Call InstallFolderInternal
449 FileWrite $UninstallLog "$9\$1$\r$\n"
459 ;;;;;;;;;;;;;;;;;;;;;;
460 ; Installer sections ;
463 ;;;;;;;;;;;;;;;;;;;;;;
465 Section $Name_Section01 SEC01
467 SetShellVarContext all
468 SetOutPath "$INSTDIR"
470 !insertmacro OpenUninstallLog
472 ; VLC.exe, libvlc.dll
473 !insertmacro InstallFile vlc.exe
474 !insertmacro InstallFile vlc.exe.manifest
475 !insertmacro InstallFile vlc-cache-gen.exe
478 !insertmacro InstallFile *.dll
481 !insertmacro InstallFile *.txt
484 !insertmacro InstallFolder plugins
485 !insertmacro InstallFolder locale
486 @BUILD_OSDMENU_TRUE@ !insertmacro InstallFolder osdmenu
487 @BUILD_SKINS_TRUE@ !insertmacro InstallFolder skins
488 @BUILD_HTTPD_TRUE@ !insertmacro InstallFolder http
489 @BUILD_LUA_TRUE@ !insertmacro InstallFolder lua
491 ; Generate the cache and add it to uninstall.log
492 ExecWait "$INSTDIR\vlc-cache-gen.exe $INSTDIR\plugins"
493 FindFirst $0 $1 "$INSTDIR\plugins\*.dat"
494 FileWrite $UninstallLog "plugins\$1$\r$\n"
500 WriteIniStr "$INSTDIR\${PRODUCT_GROUP} Website.url" "InternetShortcut" "URL" \
501 "${PRODUCT_WEB_SITE}"
502 FileWrite $UninstallLog "${PRODUCT_GROUP} Website.url$\r$\n"
503 WriteIniStr "$INSTDIR\Documentation.url" "InternetShortcut" "URL" \
504 "${PRODUCT_WEB_SITE}/doc/"
505 FileWrite $UninstallLog "Documentation.url$\r$\n"
506 WriteIniStr "$INSTDIR\New_Skins.url" "InternetShortcut" "URL" \
507 "${PRODUCT_WEB_SITE}/vlc/skins.php"
508 FileWrite $UninstallLog "New_Skins.url$\r$\n"
510 !insertmacro CloseUninstallLog
512 ; Add VLC to "recommended programs" for the following extensions
513 WriteRegStr HKCR Applications\vlc.exe "" ""
514 WriteRegStr HKCR Applications\vlc.exe "FriendlyAppName" "VLC media player"
515 WriteRegStr HKCR Applications\vlc.exe\shell\Open "" $ContextMenuEntry_PlayWith
516 WriteRegStr HKCR Applications\vlc.exe\shell\Open\command "" \
517 '"$INSTDIR\vlc.exe" --started-from-file "%1"'
518 !insertmacro MacroAllExtensions WriteRegStrSupportedTypes
520 ; Windows default programs Registration
521 ; Vista and above detection
522 ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion
524 StrCmp $R1 '6' lbl_vista lbl_done
527 WriteRegStr HKLM "Software\RegisteredApplications" "VLC" "Software\Clients\Media\VLC\Capabilities"
528 WriteRegStr HKLM "Software\Clients\Media\VLC\Capabilities" "ApplicationName" "VLC media player"
529 WriteRegStr HKLM "Software\Clients\Media\VLC\Capabilities" "ApplicationDescription" "VLC - The video swiss knife"
530 WriteRegStr HKLM "Software\Clients\Media\VLC" "" "VLC media player"
531 WriteRegStr HKLM "Software\Clients\Media\VLC\InstallInfo" "HideIconsCommand" "$\"$INSTDIR\spad-setup.exe$\" /HideIcons /S"
532 WriteRegStr HKLM "Software\Clients\Media\VLC\InstallInfo" "ShowIconsCommand" "$\"$INSTDIR\spad-setup.exe$\" /ShowIcons /S"
533 WriteRegStr HKLM "Software\Clients\Media\VLC\InstallInfo" "ReinstallCommand" "$\"$INSTDIR\spad-setup.exe$\" /Reinstall /S"
534 WriteRegDWORD HKLM "Software\Clients\Media\VLC\InstallInfo" "IconsVisible" 0x001
539 Section $Name_Section02a SEC02a
541 CreateDirectory "$SMPROGRAMS\VideoLAN"
542 CreateShortCut "$SMPROGRAMS\VideoLAN\Reset VLC media player preferences and cache files.lnk" \
543 "$INSTDIR\vlc.exe" "--reset-config --reset-plugins-cache vlc://quit"
544 CreateShortCut "$SMPROGRAMS\VideoLAN\VLC media player.lnk" \
545 "$INSTDIR\vlc.exe" ""
546 CreateShortCut "$SMPROGRAMS\VideoLAN\VLC media player skinned.lnk" \
547 "$INSTDIR\vlc.exe" "-Iskins"
548 CreateShortCut "$SMPROGRAMS\VideoLAN\Documentation.lnk" \
549 "$INSTDIR\Documentation.url"
550 CreateShortCut "$SMPROGRAMS\VideoLAN\Release Notes.lnk" \
551 "$INSTDIR\NEWS.txt" ""
552 CreateShortCut "$SMPROGRAMS\VideoLAN\${PRODUCT_GROUP} Website.lnk" \
553 "$INSTDIR\${PRODUCT_GROUP} Website.url"
556 Section $Name_Section02b SEC02b
558 CreateShortCut "$DESKTOP\VLC media player.lnk" \
559 "$INSTDIR\vlc.exe" ""
562 !ifdef INSTALL_MOZILLA
563 Section /o $Name_Section03 SEC03
566 SetOutPath "$INSTDIR"
567 !insertmacro OpenUninstallLog
568 !insertmacro InstallFile mozilla\npvlc.dll
569 !insertmacro InstallFile mozilla\npvlc.dll.manifest
570 !insertmacro CloseUninstallLog
572 !define Moz "SOFTWARE\MozillaPlugins\@videolan.org/vlc,version=${VERSION}"
573 WriteRegStr HKLM ${Moz} "Description" "VLC Multimedia Plugin"
574 WriteRegStr HKLM ${Moz} "Path" "$INSTDIR\npvlc.dll"
575 WriteRegStr HKLM ${Moz} "Product" "VLC media player"
576 WriteRegStr HKLM ${Moz} "Vendor" "VideoLAN"
577 WriteRegStr HKLM ${Moz} "Version" "${VERSION}"
581 !ifdef INSTALL_ACTIVEX
582 Section $Name_Section04 SEC04
585 SetOutPath "$INSTDIR"
586 !insertmacro OpenUninstallLog
587 !insertmacro InstallFile activex\axvlc.dll
588 !insertmacro InstallFile activex\axvlc.dll.manifest
589 !insertmacro CloseUninstallLog
590 RegDLL "$INSTDIR\axvlc.dll"
595 Section $Name_Section05 SEC05
597 WriteRegStr HKCR "AudioCD\shell\PlayWithVLC" "" $ContextMenuEntry_PlayWith
598 WriteRegStr HKCR "AudioCD\shell\PlayWithVLC\command" "" \
599 '"$INSTDIR\vlc.exe" --started-from-file cdda://%1'
600 WriteRegStr HKCR "DVD\shell\PlayWithVLC" "" $ContextMenuEntry_PlayWith
601 WriteRegStr HKCR "DVD\shell\PlayWithVLC\command" "" \
602 '"$INSTDIR\vlc.exe" --started-from-file dvd://%1'
604 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayDVDMovieOnArrival" "VLCPlayDVDMovieOnArrival" ""
605 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "Action" $Action_OnArrivalDVD
606 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "DefaultIcon" '"$INSTDIR\vlc.exe",0'
607 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "InvokeProgID" "VLC.DVDMovie"
608 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "InvokeVerb" "Open"
609 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "Provider" "VideoLAN VLC media player"
611 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayCDAudioOnArrival" "VLCPlayCDAudioOnArrival" ""
612 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "Action" $Action_OnArrivalAudioCD
613 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "DefaultIcon" '"$INSTDIR\vlc.exe",0'
614 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "InvokeProgID" "VLC.CDAudio"
615 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "InvokeVerb" "Open"
616 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "Provider" "VideoLAN VLC media player"
617 WriteRegStr HKCR "VLC.DVDMovie" "" "VLC DVD Movie"
618 WriteRegStr HKCR "VLC.DVDMovie\shell" "" "Open"
619 WriteRegStr HKCR "VLC.DVDMovie\shell\Open\command" "" \
620 '"$INSTDIR\vlc.exe" --started-from-file dvd://%1'
621 WriteRegStr HKCR "VLC.DVDMovie\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'
622 WriteRegStr HKCR "VLC.CDAudio" "" "VLC CD Audio"
623 WriteRegStr HKCR "VLC.CDAudio\shell" "" "Open"
624 WriteRegStr HKCR "VLC.CDAudio\shell\Open\command" "" \
625 '"$INSTDIR\vlc.exe" --started-from-file cdda://%1'
626 WriteRegStr HKCR "VLC.CDAudio\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'
631 SectionGroup /e !$Name_Section06 SEC06
632 SectionGroup $Name_SectionGroupAudio
633 !insertmacro MacroAudioExtensions RegisterExtensionSection
635 SectionGroup $Name_SectionGroupVideo
636 !insertmacro MacroVideoExtensions RegisterExtensionSection
638 SectionGroup $Name_SectionGroupOther
639 !insertmacro MacroOtherExtensions RegisterExtensionSection
640 !insertmacro MacroSkinExtensions RegisterSkinExtensionSection
644 Section $Name_Section07 SEC07
646 !insertmacro MacroAllExtensions AddContextMenu
647 !insertmacro AddContextMenuExt "Directory"
650 Section $Name_Section08 SEC08
651 !insertmacro delprefs
654 ; Installer section descriptions
655 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
656 !insertmacro MUI_DESCRIPTION_TEXT ${SEC01} $Desc_Section01
657 !insertmacro MUI_DESCRIPTION_TEXT ${SEC02a} $Desc_Section02a
658 !insertmacro MUI_DESCRIPTION_TEXT ${SEC02b} $Desc_Section02b
659 @BUILD_MOZILLA_TRUE@ !insertmacro MUI_DESCRIPTION_TEXT ${SEC03} $Desc_Section03
660 @BUILD_ACTIVEX_TRUE@ !insertmacro MUI_DESCRIPTION_TEXT ${SEC04} $Desc_Section04
661 !insertmacro MUI_DESCRIPTION_TEXT ${SEC05} $Desc_Section05
662 !insertmacro MUI_DESCRIPTION_TEXT ${SEC06} $Desc_Section06
663 !insertmacro MUI_DESCRIPTION_TEXT ${SEC07} $Desc_Section07
664 !insertmacro MUI_DESCRIPTION_TEXT ${SEC08} $Desc_Section08
665 !insertmacro MUI_FUNCTION_DESCRIPTION_END
672 StrCmp 1223 $0 UAC_ElevationAborted
673 StrCmp 0 $0 0 UAC_Err
674 StrCmp 1 $1 0 UAC_Success
678 MessageBox mb_iconstop "Unable to elevate, error $0"
681 UAC_ElevationAborted:
682 MessageBox mb_iconstop "This installer requires admin access, aborting!"
687 StrCmp 3 $1 0 UAC_ElevationAborted
688 MessageBox mb_iconstop "This installer requires admin access, try again"
690 !insertmacro MUI_LANGDLL_DISPLAY
692 !include "languages\english.nsh"
693 StrCmp $LANGUAGE ${LANG_FRENCH} French 0
694 StrCmp $LANGUAGE ${LANG_GERMAN} German 0
695 StrCmp $LANGUAGE ${LANG_ITALIAN} Italian 0
696 StrCmp $LANGUAGE ${LANG_HUNGARIAN} Hungarian 0
697 StrCmp $LANGUAGE ${LANG_ROMANIAN} Romanian 0
698 StrCmp $LANGUAGE ${LANG_CATALAN} Catalan 0
699 StrCmp $LANGUAGE ${LANG_BULGARIAN} Bulgarian 0
700 StrCmp $LANGUAGE ${LANG_SLOVAK} Slovak 0
701 StrCmp $LANGUAGE ${LANG_POLISH} Polish 0
702 StrCmp $LANGUAGE ${LANG_DUTCH} Dutch 0
703 StrCmp $LANGUAGE ${LANG_SIMPCHINESE} SChinese 0
704 StrCmp $LANGUAGE ${LANG_FINNISH} Finnish 0
705 StrCmp $LANGUAGE ${LANG_JAPANESE} Japanese 0
706 ; StrCmp $LANGUAGE ${LANG_BENGALI} Bengali 0
707 ; StrCmp $LANGUAGE ${LANG_PUNJABI} Punjabi 0
708 ; StrCmp $LANGUAGE ${LANG_SLOVENIAN} Slovenian 0
709 StrCmp $LANGUAGE ${LANG_SPANISH} Spanish 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\japanese.nsh"
751 !include "languages\bengali.nsh"
754 !include "languages\punjabi.nsh"
757 !include "languages\slovenian.nsh"
760 !include "languages\spanish.nsh"
763 !include "languages\brazilian_portuguese.nsh"
766 ReadRegStr $R0 ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
770 MessageBox MB_YESNO|MB_ICONEXCLAMATION $Message_AlreadyInstalled IDNO done
775 ExecWait '$R0 _?=$INSTDIR' ;Do not copy the uninstaller to a temp file
780 Function .OnInstFailed
784 Function .OnInstSuccess
790 WriteUninstaller "$INSTDIR\uninstall.exe"
791 WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "InstallDir" $INSTDIR
792 WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "Version" "${VERSION}"
793 WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\vlc.exe"
795 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
796 "DisplayName" "$(^Name)"
797 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
798 "UninstallString" "$INSTDIR\uninstall.exe"
799 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
800 "InstallLocation" "$INSTDIR"
801 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
802 "DisplayIcon" "$INSTDIR\vlc.exe"
803 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
804 "DisplayVersion" "${PRODUCT_VERSION}"
805 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
806 "URLInfoAbout" "${PRODUCT_WEB_SITE}"
807 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
808 "Publisher" "${PRODUCT_PUBLISHER}"
809 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
810 "VersionMajor" "@VERSION_MAJOR@"
811 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
812 "VersionMinor" "@VERSION_MINOR@"
815 ;;;;;;;;;;;;;;;;;;;;;;;;
816 ; Uninstaller sections ;
817 ;;;;;;;;;;;;;;;;;;;;;;;;
819 ; TrimNewlines (copied from NSIS documentation)
820 ; input, top of stack (e.g. whatever$\r$\n)
821 ; output, top of stack (replaces, with e.g. whatever)
822 ; modifies no other variables.
824 Function un.TrimNewlines
833 StrCmp $R2 "$\r" loop
834 StrCmp $R2 "$\n" loop
836 IntCmp $R1 0 no_trim_needed
845 Function un.RemoveEmptyDirs
847 !define Index 'Line${__LINE__}'
848 FindFirst $0 $1 "$INSTDIR$9*"
849 StrCmp $0 "" "${Index}-End"
851 StrCmp $1 "" "${Index}-End"
852 StrCmp $1 "." "${Index}-Next"
853 StrCmp $1 ".." "${Index}-Next"
858 Call un.RemoveEmptyDirs
872 Section "un.$Name_Section91" SEC91
874 SetShellVarContext all
876 !insertmacro MacroAllExtensions DeleteContextMenu
877 !insertmacro MacroAllExtensions UnRegisterExtensionSection
878 !insertmacro MacroSkinExtensions UnRegisterExtensionSection
879 !insertmacro DeleteContextMenuExt "Directory"
881 ;remove activex plugin
882 UnRegDLL "$INSTDIR\axvlc.dll"
883 Delete /REBOOTOK "$INSTDIR\axvlc.dll"
884 Delete /REBOOTOK "$INSTDIR\axvlc.dll.manifest"
886 ;remove mozilla plugin
891 !define Index 'Line${__LINE__}'
897 EnumRegKey $R0 HKLM "SOFTWARE\Mozilla" "$R1"
898 StrCmp $R0 "" "${Index}-End"
900 ReadRegStr $R2 HKLM "SOFTWARE\Mozilla\$R0\Extensions" "Plugins"
901 StrCmp $R2 "" "${Index}-Loop" ""
903 ; old files (0.8.5 and before) that may be lying around
904 Delete /REBOOTOK "$R2\npvlc.dll"
905 Delete /REBOOTOK "$R2\libvlc.dll"
906 Delete /REBOOTOK "$R2\vlcintf.xpt"
911 Delete /REBOOTOK "$INSTDIR\npvlc.dll"
912 Delete /REBOOTOK "$INSTDIR\npvlc.dll.manifest"
914 RMDir "$SMPROGRAMS\VideoLAN"
915 RMDir /r $SMPROGRAMS\VideoLAN
917 FileOpen $UninstallLog "$INSTDIR\uninstall.log" r
920 FileRead $UninstallLog $R0
921 IfErrors UninstallEnd
925 Delete "$INSTDIR\$R0"
928 FileClose $UninstallLog
929 Delete "$INSTDIR\uninstall.log"
930 Delete "$INSTDIR\uninstall.exe"
932 Call un.RemoveEmptyDirs
935 DeleteRegKey HKLM Software\VideoLAN
937 DeleteRegKey HKCR Applications\vlc.exe
938 DeleteRegKey HKCR AudioCD\shell\PlayWithVLC
939 DeleteRegKey HKCR DVD\shell\PlayWithVLC
940 DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayDVDMovieOnArrival" "VLCPlayDVDMovieOnArrival"
941 DeleteRegKey HKLM Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival
942 DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayCDAudioOnArrival" "VLCPlayCDAudioOnArrival"
943 DeleteRegKey HKLM Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival
944 DeleteRegKey HKLM Software\Clients\Media\VLC
945 DeleteRegValue HKLM "Software\RegisteredApplications" "VLC"
946 DeleteRegKey HKCR "VLC.MediaFile"
949 "SOFTWARE\MozillaPlugins\@videolan.org/vlc,version=${VERSION}"
952 "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
954 Delete "$DESKTOP\VLC media player.lnk"
956 DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
957 DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}"
961 Section /o "un.$Name_Section92" SEC92
962 !insertmacro delprefs
965 ; Uninstaller section descriptions
966 !insertmacro MUI_UNFUNCTION_DESCRIPTION_BEGIN
967 !insertmacro MUI_DESCRIPTION_TEXT ${SEC91} $Desc_Section91
968 !insertmacro MUI_DESCRIPTION_TEXT ${SEC92} $Desc_Section92
969 !insertmacro MUI_UNFUNCTION_DESCRIPTION_END
971 Function un.OnUnInstFailed
975 Function un.OnUnInstSuccess
977 Delete "$INSTDIR\UAC.dll"
984 StrCmp 1223 $0 UAC_ElevationAborted
985 StrCmp 0 $0 0 UAC_Err
986 StrCmp 1 $1 0 UAC_Success
990 MessageBox mb_iconstop "Unable to elevate, error $0"
993 UAC_ElevationAborted:
994 MessageBox mb_iconstop "This installer requires admin access, aborting!"
999 StrCmp 3 $1 0 UAC_ElevationAborted
1000 MessageBox mb_iconstop "This installer requires admin access, try again"
1003 !insertmacro MUI_UNGETLANGUAGE
1005 !include "languages\english.nsh"
1006 StrCmp $LANGUAGE ${LANG_FRENCH} French 0
1007 StrCmp $LANGUAGE ${LANG_GERMAN} German 0
1008 StrCmp $LANGUAGE ${LANG_ITALIAN} Italian 0
1009 StrCmp $LANGUAGE ${LANG_HUNGARIAN} Hungarian 0
1010 StrCmp $LANGUAGE ${LANG_ROMANIAN} Romanian 0
1011 StrCmp $LANGUAGE ${LANG_CATALAN} Catalan 0
1012 StrCmp $LANGUAGE ${LANG_BULGARIAN} Bulgarian 0
1013 StrCmp $LANGUAGE ${LANG_SLOVAK} Slovak 0
1014 StrCmp $LANGUAGE ${LANG_POLISH} Polish 0
1015 StrCmp $LANGUAGE ${LANG_DUTCH} Dutch 0
1016 StrCmp $LANGUAGE ${LANG_SIMPCHINESE} SChinese 0
1017 StrCmp $LANGUAGE ${LANG_FINNISH} Finnish 0
1018 StrCmp $LANGUAGE ${LANG_JAPANESE} Japanese 0
1019 ; StrCmp $LANGUAGE ${LANG_BENGALI} Bengali 0
1020 ; StrCmp $LANGUAGE ${LANG_PUNJABI} Punjabi 0
1021 ; StrCmp $LANGUAGE ${LANG_SLOVENIAN} Slovenian 0
1022 StrCmp $LANGUAGE ${LANG_SPANISH} Spanish 0
1023 StrCmp $LANGUAGE ${LANG_PORTUGUESEBR} Brazilian EndLanguageCmp
1025 !include "languages\french.nsh"
1028 !include "languages\german.nsh"
1031 !include "languages\italian.nsh"
1034 !include "languages\hungarian.nsh"
1037 !include "languages\romanian.nsh"
1040 !include "languages\catalan.nsh"
1043 !include "languages\bulgarian.nsh"
1046 !include "languages\slovak.nsh"
1049 !include "languages\polish.nsh"
1052 !include "languages\dutch.nsh"
1055 !include "languages\schinese.nsh"
1058 !include "languages\finnish.nsh"
1061 !include "languages\japanese.nsh"
1064 !include "languages\bengali.nsh"
1067 !include "languages\punjabi.nsh"
1070 !include "languages\slovenian.nsh"
1073 !include "languages\spanish.nsh"
1076 !include "languages\brazilian_portuguese.nsh"