1 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2 ; NSIS installer script for vlc ;
3 ; (http://nsis.sourceforge.net) ;
4 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
6 !define PRODUCT_NAME
"VLC media player"
7 !define PRODUCT_VERSION
'${VERSION}'
8 !define PRODUCT_GROUP
"VideoLAN"
9 !define PRODUCT_PUBLISHER
"VideoLAN Team"
10 !define PRODUCT_WEB_SITE
"http://www.videolan.org"
11 !define PRODUCT_DIR_REGKEY
"Software\VideoLAN\VLC"
12 !define PRODUCT_UNINST_KEY
"Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
13 !define PRODUCT_UNINST_ROOT_KEY
"HKLM"
14 !define PRODUCT_ID
"{ea92ef52-afe4-4212-bacb-dfe9fca94cd6}"
16 !define MUI_LANGDLL_REGISTRY_ROOT
"HKLM"
17 !define MUI_LANGDLL_REGISTRY_KEY
"${PRODUCT_DIR_REGKEY}"
18 !define MUI_LANGDLL_REGISTRY_VALUENAME
"Language"
21 @FILE_LIBVLC_CONTROL_DLL@
23 ;;;;;;;;;;;;;;;;;;;;;;;;;
24 ; General configuration ;
25 ;;;;;;;;;;;;;;;;;;;;;;;;;
27 Name "${PRODUCT_GROUP} ${PRODUCT_NAME} ${PRODUCT_VERSION}"
28 OutFile ..\vlc
-${VERSION}-win32
.exe
29 InstallDir "$PROGRAMFILES\VideoLAN\VLC"
30 InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" ""
31 !ifdef NSIS_LZMA_COMPRESS_WHOLE
34 SetCompressor
/SOLID lzma
37 ;ShowUnInstDetails show
41 InstType "Recommended"
45 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
46 ; NSIS Modern User Interface configuration ;
47 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
49 ; MUI 1.67 compatible ------
53 !define MUI_ABORTWARNING
54 !define MUI_ICON
"vlc48x48.ico"
55 !define MUI_UNICON
"vlc48x48.ico"
56 !define MUI_COMPONENTSPAGE_SMALLDESC
60 !define MUI_WELCOMEPAGE_TITLE_3LINES
61 !insertmacro MUI_PAGE_WELCOME
63 !insertmacro MUI_PAGE_LICENSE
"COPYING.txt"
65 !insertmacro MUI_PAGE_COMPONENTS
67 !insertmacro MUI_PAGE_DIRECTORY
69 !insertmacro MUI_PAGE_INSTFILES
71 !define MUI_FINISHPAGE_RUN
"$INSTDIR\vlc.exe"
72 !define MUI_FINISHPAGE_SHOWREADME
"$INSTDIR\README.txt"
73 !define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED
74 !define MUI_FINISHPAGE_LINK
"Visit the VideoLAN VLC media player Website"
75 !define MUI_FINISHPAGE_LINK_LOCATION
"http://www.videolan.org/vlc/"
76 !define MUI_FINISHPAGE_NOREBOOTSUPPORT
77 !insertmacro MUI_PAGE_FINISH
80 !insertmacro MUI_UNPAGE_CONFIRM
81 !insertmacro MUI_UNPAGE_COMPONENTS
82 !insertmacro MUI_UNPAGE_INSTFILES
83 !insertmacro MUI_UNPAGE_FINISH
86 !insertmacro MUI_LANGUAGE
"English" # first language is the default language
87 !insertmacro MUI_LANGUAGE
"French"
88 !insertmacro MUI_LANGUAGE
"German"
89 !insertmacro MUI_LANGUAGE
"Spanish"
90 !insertmacro MUI_LANGUAGE
"SimpChinese"
91 !insertmacro MUI_LANGUAGE
"TradChinese"
92 !insertmacro MUI_LANGUAGE
"Japanese"
93 !insertmacro MUI_LANGUAGE
"Korean"
94 !insertmacro MUI_LANGUAGE
"Italian"
95 !insertmacro MUI_LANGUAGE
"Dutch"
96 !insertmacro MUI_LANGUAGE
"Danish"
97 !insertmacro MUI_LANGUAGE
"Swedish"
98 !insertmacro MUI_LANGUAGE
"Norwegian"
99 !insertmacro MUI_LANGUAGE
"Finnish"
100 !insertmacro MUI_LANGUAGE
"Greek"
101 !insertmacro MUI_LANGUAGE
"Russian"
102 !insertmacro MUI_LANGUAGE
"Portuguese"
103 !insertmacro MUI_LANGUAGE
"Arabic"
104 !insertmacro MUI_LANGUAGE
"Polish"
106 !insertmacro MUI_RESERVEFILE_LANGDLL
109 !insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
117 !macro MacroAudioExtensions _action
118 !insertmacro ${_action} ".a52"
119 !insertmacro ${_action} ".aac"
120 !insertmacro ${_action} ".ac3"
121 !insertmacro ${_action} ".dts"
122 !insertmacro ${_action} ".flac"
123 !insertmacro ${_action} ".mka"
124 !insertmacro ${_action} ".mp1"
125 !insertmacro ${_action} ".mp2"
126 !insertmacro ${_action} ".mp3"
127 !insertmacro ${_action} ".ogg"
128 !insertmacro ${_action} ".spx"
129 !insertmacro ${_action} ".wav"
130 !insertmacro ${_action} ".wma"
133 !macro MacroVideoExtensions _action
134 !insertmacro ${_action} ".asf"
135 !insertmacro ${_action} ".avi"
136 !insertmacro ${_action} ".divx"
137 !insertmacro ${_action} ".dv"
138 !insertmacro ${_action} ".m1v"
139 !insertmacro ${_action} ".m2v"
140 !insertmacro ${_action} ".mkv"
141 !insertmacro ${_action} ".mov"
142 !insertmacro ${_action} ".mp4"
143 !insertmacro ${_action} ".mpeg"
144 !insertmacro ${_action} ".mpeg1"
145 !insertmacro ${_action} ".mpeg2"
146 !insertmacro ${_action} ".mpeg4"
147 !insertmacro ${_action} ".mpg"
148 !insertmacro ${_action} ".ps"
149 !insertmacro ${_action} ".ts"
150 !insertmacro ${_action} ".ogm"
151 !insertmacro ${_action} ".vob"
152 !insertmacro ${_action} ".wmv"
155 !macro MacroOtherExtensions _action
156 !insertmacro ${_action} ".asx"
157 !insertmacro ${_action} ".bin"
158 !insertmacro ${_action} ".cue"
159 !insertmacro ${_action} ".m3u"
160 !insertmacro ${_action} ".pls"
161 !insertmacro ${_action} ".vlc"
164 !macro MacroAllExtensions _action
165 !insertmacro MacroAudioExtensions
${_action}
166 !insertmacro MacroVideoExtensions
${_action}
167 !insertmacro MacroOtherExtensions
${_action}
170 ;;;;;;;;;;;;;;;;;;;;;;;;;;
171 ; File type associations ;
172 ;;;;;;;;;;;;;;;;;;;;;;;;;;
174 Function RegisterExtension
175 ; back up old value for extension $R0 (eg. ".opt")
176 ReadRegStr $1 HKCR "$R0" ""
177 StrCmp $1 "" NoBackup
178 StrCmp $1 "VLC$R0" "NoBackup"
179 WriteRegStr HKCR "$R0" "VLC.backup" $1
181 WriteRegStr HKCR "$R0" "" "VLC$R0"
182 ReadRegStr $0 HKCR "VLC$R0" ""
183 WriteRegStr HKCR "VLC$R0" "" "VLC media file ($R0)"
184 WriteRegStr HKCR "VLC$R0\shell" "" "Play"
185 WriteRegStr HKCR "VLC$R0\shell\Play\command" "" '"$INSTDIR\vlc.exe" --started-from-file "%1"'
186 WriteRegStr HKCR "VLC$R0\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'
189 Function un
.RegisterExtension
190 ;start of restore script
191 ReadRegStr $1 HKCR "$R0" ""
192 StrCmp $1 "VLC$R0" 0 NoOwn
; only do this if we own it
193 ReadRegStr $1 HKCR "$R0" "VLC.backup"
194 StrCmp $1 "" 0 Restore
; if backup="" then delete the whole key
195 DeleteRegKey HKCR "$R0"
198 WriteRegStr HKCR "$R0" "" $1
199 DeleteRegValue HKCR "$R0" "VLC.backup"
201 DeleteRegKey HKCR "VLC$R0" ;Delete key with association settings
204 !macro RegisterExtensionSection
EXT
209 Call RegisterExtension
214 !macro UnRegisterExtensionSection
EXT
217 Call un
.RegisterExtension
221 !macro WriteRegStrSupportedTypes
EXT
222 WriteRegStr HKCR Applications\vlc
.exe\SupportedTypes
${EXT} ""
225 ;;;;;;;;;;;;;;;;;;;;;;;;
226 ; Context menu entries ;
227 ;;;;;;;;;;;;;;;;;;;;;;;;
229 !macro AddContextMenuExt
EXT
230 WriteRegStr HKCR ${EXT}\shell\PlayWithVLC
"" "Play with VLC media player"
231 WriteRegStr HKCR ${EXT}\shell\PlayWithVLC\command
"" '$INSTDIR\vlc.exe --started-from-file --no-playlist-enqueue "%1"'
233 WriteRegStr HKCR ${EXT}\shell\AddToPlaylistVLC
"" "Add to VLC media player's Playlist"
234 WriteRegStr HKCR ${EXT}\shell\AddToPlaylistVLC\command
"" '$INSTDIR\vlc.exe --started-from-file --playlist-enqueue "%1"'
237 !macro AddContextMenu
EXT
239 ReadRegStr $R0 HKCR ${EXT} ""
240 !insertmacro AddContextMenuExt
$R0
244 !macro DeleteContextMenuExt
EXT
245 DeleteRegKey HKCR ${EXT}\shell\PlayWithVLC
246 DeleteRegKey HKCR ${EXT}\shell\AddToPlaylistVLC
249 !macro DeleteContextMenu
EXT
251 ReadRegStr $R0 HKCR ${EXT} ""
252 !insertmacro DeleteContextMenuExt
$R0
256 ;;;;;;;;;;;;;;;;;;;;;;;;;;
257 ; Delete prefs and cache ;
258 ;;;;;;;;;;;;;;;;;;;;;;;;;;
262 !define Index
'Line${__LINE__}'
265 ; this will loop through all the logged users and "virtual" windows users
266 ; (it looks like users are only present in HKEY_USERS when they are logged in)
268 EnumRegKey $1 HKU "" $0
269 StrCmp $1 "" "${Index}-End"
271 ReadRegStr $2 HKU "$1\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" AppData
272 StrCmp $2 "" "${Index}-Loop"
281 !macro OpenUninstallLog
282 FileOpen $UninstallLog "$INSTDIR\uninstall.log" a
283 FileSeek $UninstallLog 0 END
286 !macro CloseUninstallLog
287 FileClose $UninstallLog
288 SetFileAttributes "$INSTDIR\uninstall.log" HIDDEN
291 !macro InstallFile FILEREGEX
293 !define Index
'Line${__LINE__}'
294 FindFirst $0 $1 "$INSTDIR\${FILEREGEX}"
295 StrCmp $0 "" "${Index}-End"
297 StrCmp $1 "" "${Index}-End"
298 FileWrite $UninstallLog "$1$\r$\n"
305 !macro InstallFolder FOLDER
308 Call InstallFolderInternal
311 Function InstallFolderInternal
313 !define Index
'Line${__LINE__}'
314 FindFirst $0 $1 "$INSTDIR\$9\*"
315 StrCmp $0 "" "${Index}-End"
317 StrCmp $1 "" "${Index}-End"
318 StrCmp $1 "." "${Index}-Next"
319 StrCmp $1 ".." "${Index}-Next"
320 IfFileExists "$9\$1\*" 0 "${Index}-Write"
324 Call InstallFolderInternal
329 FileWrite $UninstallLog "$9\$1$\r$\n"
338 ;;;;;;;;;;;;;;;;;;;;;;
339 ; Installer sections ;
340 ;;;;;;;;;;;;;;;;;;;;;;
342 Section "Media player (required)" SEC01
344 SetShellVarContext all
345 SetOutPath "$INSTDIR"
347 !insertmacro OpenUninstallLog
349 !insertmacro InstallFile vlc
.exe
350 !insertmacro InstallFile vlc
.exe
.manifest
352 !insertmacro InstallFile
${LIBVLC_DLL}
354 !ifdef LIBVLC_CONTROL_DLL
355 !insertmacro InstallFile
${LIBVLC_CONTROL_DLL}
357 !insertmacro InstallFile
*.txt
359 !insertmacro InstallFolder plugins
360 !insertmacro InstallFolder locale
361 !insertmacro InstallFolder osdmenu
362 !insertmacro InstallFolder skins
363 !insertmacro InstallFolder http
365 WriteIniStr
"$INSTDIR\${PRODUCT_GROUP} Website.url" "InternetShortcut" "URL" \
366 "${PRODUCT_WEB_SITE}"
367 FileWrite $UninstallLog "${PRODUCT_GROUP} Website.url$\r$\n"
368 WriteIniStr
"$INSTDIR\Documentation.url" "InternetShortcut" "URL" \
369 "${PRODUCT_WEB_SITE}/doc/"
370 FileWrite $UninstallLog "Documentation.url$\r$\n"
372 !insertmacro CloseUninstallLog
374 ; Add VLC to "recomended programs" for the following extensions
375 WriteRegStr HKCR Applications\vlc
.exe
"" ""
376 WriteRegStr HKCR Applications\vlc
.exe
"FriendlyAppName" "VLC media player"
377 WriteRegStr HKCR Applications\vlc
.exe\shell\Play
"" "Play with VLC"
378 WriteRegStr HKCR Applications\vlc
.exe\shell\Play\command
"" \
379 '$INSTDIR\vlc.exe --started-from-file "%1"'
380 !insertmacro MacroAllExtensions WriteRegStrSupportedTypes
382 WriteRegStr HKCR "AudioCD\shell\PlayWithVLC" "" "Play with VLC media player"
383 WriteRegStr HKCR "AudioCD\shell\PlayWithVLC\command" "" \
384 "$INSTDIR\vlc.exe --started-from-file cdda:%1"
385 WriteRegStr HKCR "DVD\shell\PlayWithVLC" "" "Play with VLC media player"
386 WriteRegStr HKCR "DVD\shell\PlayWithVLC\command" "" \
387 "$INSTDIR\vlc.exe --started-from-file dvd:%1"
389 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayDVDMovieOnArrival" "VLCPlayDVDMovieOnArrival" ""
390 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "Action" "Play DVD movie"
391 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "DefaultIcon" '"$INSTDIR\vlc.exe",0'
392 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "InvokeProgID" "VLC.DVDMovie"
393 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "InvokeVerb" "play"
394 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "Provider" "VideoLAN VLC media player"
396 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayCDAudioOnArrival" "VLCPlayCDAudioOnArrival" ""
397 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "Action" "Play CD audio"
398 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "DefaultIcon" '"$INSTDIR\vlc.exe --started-from-file",0'
399 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "InvokeProgID" "VLC.CDAudio"
400 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "InvokeVerb" "play"
401 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "Provider" "VideoLAN VLC media player"
402 WriteRegStr HKCR "VLC.DVDMovie" "" "VLC DVD Movie"
403 WriteRegStr HKCR "VLC.DVDMovie\shell" "" "Play"
404 WriteRegStr HKCR "VLC.DVDMovie\shell\Play\command" "" \
405 '$INSTDIR\vlc.exe --started-from-file dvd:%1'
406 WriteRegStr HKCR "VLC.DVDMovie\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'
407 WriteRegStr HKCR "VLC.CDAudio" "" "VLC CD Audio"
408 WriteRegStr HKCR "VLC.CDAudio\shell" "" "Play"
409 WriteRegStr HKCR "VLC.CDAudio\shell\Play\command" "" \
410 '$INSTDIR\vlc.exe --started-from-file cdda:%1'
411 WriteRegStr HKCR "VLC.CDAudio\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'
415 Section "Start Menu Shortcut" SEC02a
417 CreateDirectory "$SMPROGRAMS\VideoLAN"
418 CreateDirectory "$SMPROGRAMS\VideoLAN\Quick Settings"
419 CreateDirectory "$SMPROGRAMS\VideoLAN\Quick Settings\Audio"
420 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Audio\Set Audio mode to DirectX (default).lnk" \
421 "$INSTDIR\vlc.exe" "--aout aout_directx --save-config vlc:quit"
422 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Audio\Set Audio mode to Waveout.lnk" \
423 "$INSTDIR\vlc.exe" "--aout waveout --save-config vlc:quit"
424 CreateDirectory "$SMPROGRAMS\VideoLAN\Quick Settings\Interface"
425 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Interface\Set Main Interface to Skinnable.lnk" \
426 "$INSTDIR\vlc.exe" "-I skins --save-config vlc:quit"
427 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Interface\Set Main Interface to wxWidgets (default).lnk" \
428 "$INSTDIR\vlc.exe" "-I wxwin --save-config vlc:quit"
429 CreateDirectory "$SMPROGRAMS\VideoLAN\Quick Settings\Video"
430 ; FIXME add detection for Vista. Direct3D will be default there, for all others it's DirectX
431 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to Direct3D.lnk" \
432 "$INSTDIR\vlc.exe" "--vout direct3d --overlay --directx-hw-yuv --save-config vlc:quit"
433 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to Direct3D (no hardware acceleration).lnk" \
434 "$INSTDIR\vlc.exe" "--vout direct3d --overlay --no-directx-hw-yuv --save-config vlc:quit"
435 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to DirectX.lnk" \
436 "$INSTDIR\vlc.exe" "--vout directx --overlay --directx-hw-yuv --save-config vlc:quit"
437 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to DirectX (no hardware acceleration).lnk" \
438 "$INSTDIR\vlc.exe" "--vout directx --no-overlay --no-directx-hw-yuv --save-config vlc:quit"
439 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to DirectX (no video overlay).lnk" \
440 "$INSTDIR\vlc.exe" "--vout directx --no-overlay --directx-hw-yuv --save-config vlc:quit"
441 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to OpenGL.lnk" \
442 "$INSTDIR\vlc.exe" "--vout opengl --overlay --save-config vlc:quit"
443 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Reset VLC media player preferences and cache files.lnk" \
444 "$INSTDIR\vlc.exe" "--reset-config --reset-plugins-cache --save-config vlc:quit"
445 CreateShortCut "$SMPROGRAMS\VideoLAN\Documentation.lnk" \
446 "$INSTDIR\Documentation.url"
447 CreateShortCut "$SMPROGRAMS\VideoLAN\Release Notes.lnk" \
448 "$INSTDIR\NEWS.txt" ""
449 CreateShortCut "$SMPROGRAMS\VideoLAN\${PRODUCT_GROUP} Website.lnk" \
450 "$INSTDIR\${PRODUCT_GROUP} Website.url"
451 CreateShortCut "$SMPROGRAMS\VideoLAN\VLC media player.lnk" \
452 "$INSTDIR\vlc.exe" ""
455 Section "Desktop Shortcut" SEC02b
457 CreateShortCut "$DESKTOP\VLC media player.lnk" \
458 "$INSTDIR\vlc.exe" ""
461 Section /o
"Mozilla plugin" SEC03
464 SetOutPath "$INSTDIR"
465 !insertmacro OpenUninstallLog
466 !insertmacro InstallFile mozilla\npvlc
.dll
467 !insertmacro CloseUninstallLog
469 !define Moz
"SOFTWARE\MozillaPlugins\@videolan.org/vlc,version=${VERSION}"
470 WriteRegStr HKLM ${Moz} "Description" "VLC Multimedia Plugin"
471 WriteRegStr HKLM ${Moz} "Path" "$INSTDIR\npvlc.dll"
472 WriteRegStr HKLM ${Moz} "Product" "VLC media player"
473 WriteRegStr HKLM ${Moz} "Vendor" "VideoLAN"
474 WriteRegStr HKLM ${Moz} "Version" "${VERSION}"
476 ; for very old version of mozilla, these lines may be needed
481 ;!define Index 'Line${__LINE__}'
487 ; EnumRegKey $R0 HKLM "SOFTWARE\Mozilla" "$R1"
488 ; StrCmp $R0 "" "${Index}-End"
490 ; ReadRegStr $R2 HKLM "SOFTWARE\Mozilla\$R0\Extensions" "Plugins"
491 ; StrCmp $R2 "" "${Index}-Loop" ""
493 ; CopyFiles "$INSTDIR\npvlc.dll" "$R2"
495 ; CopyFiles ${LIBVLC_DLL} "$R2"
497 ; !ifdef LIBVLC_CONTROL_DLL
498 ; CopyFiles ${LIBVLC_CONTROL_DLL} "$R2"
500 ; Goto "${Index}-Loop"
507 Section "ActiveX plugin" SEC04
509 SetOutPath "$INSTDIR"
510 !insertmacro OpenUninstallLog
511 !insertmacro InstallFile activex\axvlc
.dll
512 !insertmacro CloseUninstallLog
513 RegDLL "$INSTDIR\axvlc.dll"
516 SectionGroup
"File type associations" SEC06
517 SectionGroup
"Audio Files"
518 !insertmacro MacroAudioExtensions RegisterExtensionSection
520 SectionGroup
"Video Files"
521 !insertmacro MacroVideoExtensions RegisterExtensionSection
524 !insertmacro MacroOtherExtensions RegisterExtensionSection
528 Section /o
"Context Menus" SEC05
530 !insertmacro MacroAllExtensions AddContextMenu
531 !insertmacro AddContextMenuExt
"Directory"
534 Section /o
"Delete preferences and cache" SEC07
535 !insertmacro delprefs
538 ; Installer section descriptions
539 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
540 !insertmacro MUI_DESCRIPTION_TEXT
${SEC01} \
541 "The media player itself"
542 !insertmacro MUI_DESCRIPTION_TEXT
${SEC02a} \
543 "Adds icons to your start menu for easy access"
544 !insertmacro MUI_DESCRIPTION_TEXT
${SEC02b} \
545 "Adds icon to your desktop for easy access"
546 !insertmacro MUI_DESCRIPTION_TEXT
${SEC03} \
547 "The VLC Mozilla and Mozilla Firefox plugin"
548 !insertmacro MUI_DESCRIPTION_TEXT
${SEC04} \
549 "The VLC ActiveX plugin"
550 !insertmacro MUI_DESCRIPTION_TEXT
${SEC05} \
551 "Add context menu items ('Play With VLC' and 'Add To VLC's Playlist')"
552 !insertmacro MUI_DESCRIPTION_TEXT
${SEC06} \
553 "Sets VLC media player as the default application for the specified file type"
554 !insertmacro MUI_DESCRIPTION_TEXT
${SEC07} \
555 "Deletes VLC media player preferences and cache files leftover from previous installations"
556 !insertmacro MUI_FUNCTION_DESCRIPTION_END
559 ReadRegStr $R0 ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
563 MessageBox MB_YESNO|
MB_ICONEXCLAMATION \
564 "VLC media player has already been installed. $\nDo you want to remove \
565 the previous version before installing $(^Name) ?" \
571 ExecWait '$R0 _?=$INSTDIR' ;Do not copy the uninstaller to a temp file
573 !insertmacro MUI_LANGDLL_DISPLAY
577 WriteUninstaller "$INSTDIR\uninstall.exe"
578 WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "InstallDir" $INSTDIR
579 WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "Version" "${VERSION}"
580 WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\vlc.exe"
582 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
583 "DisplayName" "$(^Name)"
584 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
585 "UninstallString" "$INSTDIR\uninstall.exe"
586 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
587 "DisplayIcon" "$INSTDIR\vlc.exe"
588 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
589 "DisplayVersion" "${PRODUCT_VERSION}"
590 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
591 "URLInfoAbout" "${PRODUCT_WEB_SITE}"
592 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
593 "Publisher" "${PRODUCT_PUBLISHER}"
596 ;;;;;;;;;;;;;;;;;;;;;;;;
597 ; Uninstaller sections ;
598 ;;;;;;;;;;;;;;;;;;;;;;;;
600 ; TrimNewlines (copied from NSIS documentation)
601 ; input, top of stack (e.g. whatever$\r$\n)
602 ; output, top of stack (replaces, with e.g. whatever)
603 ; modifies no other variables.
605 Function un
.TrimNewlines
614 StrCmp $R2 "$\r" loop
615 StrCmp $R2 "$\n" loop
617 IntCmp $R1 0 no_trim_needed
626 Function un
.RemoveEmptyDirs
628 !define Index
'Line${__LINE__}'
629 FindFirst $0 $1 "$INSTDIR$9*"
630 StrCmp $0 "" "${Index}-End"
632 StrCmp $1 "" "${Index}-End"
633 StrCmp $1 "." "${Index}-Next"
634 StrCmp $1 ".." "${Index}-Next"
639 Call un
.RemoveEmptyDirs
653 Section "Uninstall" SEC91
655 SetShellVarContext all
657 !insertmacro MacroAllExtensions DeleteContextMenu
658 !insertmacro MacroAllExtensions UnRegisterExtensionSection
659 !insertmacro DeleteContextMenuExt
"Directory"
661 ;remove activex plugin
662 UnRegDLL "$INSTDIR\axvlc.dll"
663 Delete /REBOOTOK
"$INSTDIR\axvlc.dll"
665 ;remove mozilla plugin
670 !define Index
'Line${__LINE__}'
676 EnumRegKey $R0 HKLM "SOFTWARE\Mozilla" "$R1"
677 StrCmp $R0 "" "${Index}-End"
679 ReadRegStr $R2 HKLM "SOFTWARE\Mozilla\$R0\Extensions" "Plugins"
680 StrCmp $R2 "" "${Index}-Loop" ""
682 ; old files (0.8.5 and before) that may be lying around
683 Delete /REBOOTOK
"$R2\npvlc.dll"
684 Delete /REBOOTOK
"$R2\libvlc.dll"
685 Delete /REBOOTOK
"$R2\vlcintf.xpt"
690 Delete /REBOOTOK
"$INSTDIR\npvlc.dll"
692 RMDir "$SMPROGRAMS\VideoLAN"
693 RMDir /r
$SMPROGRAMS\VideoLAN
695 FileOpen $UninstallLog "$INSTDIR\uninstall.log" r
698 FileRead $UninstallLog $R0
699 IfErrors UninstallEnd
703 Delete "$INSTDIR\$R0"
706 FileClose $UninstallLog
707 Delete "$INSTDIR\uninstall.log"
708 Delete "$INSTDIR\uninstall.exe"
710 Call un
.RemoveEmptyDirs
713 DeleteRegKey HKLM Software\VideoLAN
715 DeleteRegKey HKCR Applications\vlc
.exe
716 DeleteRegKey HKCR AudioCD\shell\PlayWithVLC
717 DeleteRegKey HKCR DVD\shell\PlayWithVLC
718 DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayDVDMovieOnArrival" "VLCPlayDVDMovieOnArrival"
719 DeleteRegKey HKLM Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival
720 DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayCDAudioOnArrival" "VLCPlayCDAudioOnArrival"
721 DeleteRegKey HKLM Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival
722 DeleteRegKey HKCR "VLC.MediaFile"
725 "SOFTWARE\MozillaPlugins\@videolan.org/vlc,version=${VERSION}"
728 "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
730 Delete "$DESKTOP\VLC media player.lnk"
732 DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
733 DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}"
737 Section /o
"un.Delete preferences and cache" SEC92
738 !insertmacro delprefs
741 ; Uninstaller section descriptions
742 !insertmacro MUI_UNFUNCTION_DESCRIPTION_BEGIN
743 !insertmacro MUI_DESCRIPTION_TEXT
${SEC91} \
744 "Uninstall VLC media player and all its components"
745 !insertmacro MUI_DESCRIPTION_TEXT
${SEC92} \
746 "Deletes VLC media player preferences and cache files"
747 !insertmacro MUI_UNFUNCTION_DESCRIPTION_END
749 ;Function un.onUninstSuccess
751 ; MessageBox MB_ICONINFORMATION|MB_OK \
752 ; "$(^Name) was successfully removed from your computer."
756 !insertmacro MUI_UNGETLANGUAGE