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} ".mxf"
149 !insertmacro ${_action} ".ps"
150 !insertmacro ${_action} ".ts"
151 !insertmacro ${_action} ".ogm"
152 !insertmacro ${_action} ".vob"
153 !insertmacro ${_action} ".wmv"
156 !macro MacroOtherExtensions _action
157 !insertmacro ${_action} ".asx"
158 !insertmacro ${_action} ".bin"
159 !insertmacro ${_action} ".cue"
160 !insertmacro ${_action} ".m3u"
161 !insertmacro ${_action} ".pls"
162 !insertmacro ${_action} ".vlc"
165 !macro MacroAllExtensions _action
166 !insertmacro MacroAudioExtensions
${_action}
167 !insertmacro MacroVideoExtensions
${_action}
168 !insertmacro MacroOtherExtensions
${_action}
171 ;;;;;;;;;;;;;;;;;;;;;;;;;;
172 ; File type associations ;
173 ;;;;;;;;;;;;;;;;;;;;;;;;;;
175 Function RegisterExtension
176 ; back up old value for extension $R0 (eg. ".opt")
177 ReadRegStr $1 HKCR "$R0" ""
178 StrCmp $1 "" NoBackup
179 StrCmp $1 "VLC$R0" "NoBackup"
180 WriteRegStr HKCR "$R0" "VLC.backup" $1
182 WriteRegStr HKCR "$R0" "" "VLC$R0"
183 ReadRegStr $0 HKCR "VLC$R0" ""
184 WriteRegStr HKCR "VLC$R0" "" "VLC media file ($R0)"
185 WriteRegStr HKCR "VLC$R0\shell" "" "Play"
186 WriteRegStr HKCR "VLC$R0\shell\Play\command" "" '"$INSTDIR\vlc.exe" --started-from-file "%1"'
187 WriteRegStr HKCR "VLC$R0\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'
190 Function un
.RegisterExtension
191 ;start of restore script
192 ReadRegStr $1 HKCR "$R0" ""
193 StrCmp $1 "VLC$R0" 0 NoOwn
; only do this if we own it
194 ReadRegStr $1 HKCR "$R0" "VLC.backup"
195 StrCmp $1 "" 0 Restore
; if backup="" then delete the whole key
196 DeleteRegKey HKCR "$R0"
199 WriteRegStr HKCR "$R0" "" $1
200 DeleteRegValue HKCR "$R0" "VLC.backup"
202 DeleteRegKey HKCR "VLC$R0" ;Delete key with association settings
205 !macro RegisterExtensionSection
EXT
210 Call RegisterExtension
215 !macro UnRegisterExtensionSection
EXT
218 Call un
.RegisterExtension
222 !macro WriteRegStrSupportedTypes
EXT
223 WriteRegStr HKCR Applications\vlc
.exe\SupportedTypes
${EXT} ""
226 ;;;;;;;;;;;;;;;;;;;;;;;;
227 ; Context menu entries ;
228 ;;;;;;;;;;;;;;;;;;;;;;;;
230 !macro AddContextMenuExt
EXT
231 WriteRegStr HKCR ${EXT}\shell\PlayWithVLC
"" "Play with VLC media player"
232 WriteRegStr HKCR ${EXT}\shell\PlayWithVLC\command
"" '$INSTDIR\vlc.exe --started-from-file --no-playlist-enqueue "%1"'
234 WriteRegStr HKCR ${EXT}\shell\AddToPlaylistVLC
"" "Add to VLC media player's Playlist"
235 WriteRegStr HKCR ${EXT}\shell\AddToPlaylistVLC\command
"" '$INSTDIR\vlc.exe --started-from-file --playlist-enqueue "%1"'
238 !macro AddContextMenu
EXT
240 ReadRegStr $R0 HKCR ${EXT} ""
241 !insertmacro AddContextMenuExt
$R0
245 !macro DeleteContextMenuExt
EXT
246 DeleteRegKey HKCR ${EXT}\shell\PlayWithVLC
247 DeleteRegKey HKCR ${EXT}\shell\AddToPlaylistVLC
250 !macro DeleteContextMenu
EXT
252 ReadRegStr $R0 HKCR ${EXT} ""
253 !insertmacro DeleteContextMenuExt
$R0
257 ;;;;;;;;;;;;;;;;;;;;;;;;;;
258 ; Delete prefs and cache ;
259 ;;;;;;;;;;;;;;;;;;;;;;;;;;
263 !define Index
'Line${__LINE__}'
266 ; this will loop through all the logged users and "virtual" windows users
267 ; (it looks like users are only present in HKEY_USERS when they are logged in)
269 EnumRegKey $1 HKU "" $0
270 StrCmp $1 "" "${Index}-End"
272 ReadRegStr $2 HKU "$1\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" AppData
273 StrCmp $2 "" "${Index}-Loop"
282 !macro OpenUninstallLog
283 FileOpen $UninstallLog "$INSTDIR\uninstall.log" a
284 FileSeek $UninstallLog 0 END
287 !macro CloseUninstallLog
288 FileClose $UninstallLog
289 SetFileAttributes "$INSTDIR\uninstall.log" HIDDEN
292 !macro InstallFile FILEREGEX
294 !define Index
'Line${__LINE__}'
295 FindFirst $0 $1 "$INSTDIR\${FILEREGEX}"
296 StrCmp $0 "" "${Index}-End"
298 StrCmp $1 "" "${Index}-End"
299 FileWrite $UninstallLog "$1$\r$\n"
306 !macro InstallFolder FOLDER
309 Call InstallFolderInternal
312 Function InstallFolderInternal
314 !define Index
'Line${__LINE__}'
315 FindFirst $0 $1 "$INSTDIR\$9\*"
316 StrCmp $0 "" "${Index}-End"
318 StrCmp $1 "" "${Index}-End"
319 StrCmp $1 "." "${Index}-Next"
320 StrCmp $1 ".." "${Index}-Next"
321 IfFileExists "$9\$1\*" 0 "${Index}-Write"
325 Call InstallFolderInternal
330 FileWrite $UninstallLog "$9\$1$\r$\n"
339 ;;;;;;;;;;;;;;;;;;;;;;
340 ; Installer sections ;
341 ;;;;;;;;;;;;;;;;;;;;;;
343 Section "Media player (required)" SEC01
345 SetShellVarContext all
346 SetOutPath "$INSTDIR"
348 !insertmacro OpenUninstallLog
350 !insertmacro InstallFile vlc
.exe
351 !insertmacro InstallFile vlc
.exe
.manifest
353 !insertmacro InstallFile
${LIBVLC_DLL}
355 !ifdef LIBVLC_CONTROL_DLL
356 !insertmacro InstallFile
${LIBVLC_CONTROL_DLL}
358 !insertmacro InstallFile
*.txt
360 !insertmacro InstallFolder plugins
361 !insertmacro InstallFolder locale
362 !insertmacro InstallFolder osdmenu
363 !insertmacro InstallFolder skins
364 !insertmacro InstallFolder http
366 WriteIniStr
"$INSTDIR\${PRODUCT_GROUP} Website.url" "InternetShortcut" "URL" \
367 "${PRODUCT_WEB_SITE}"
368 FileWrite $UninstallLog "${PRODUCT_GROUP} Website.url$\r$\n"
369 WriteIniStr
"$INSTDIR\Documentation.url" "InternetShortcut" "URL" \
370 "${PRODUCT_WEB_SITE}/doc/"
371 FileWrite $UninstallLog "Documentation.url$\r$\n"
373 !insertmacro CloseUninstallLog
375 ; Add VLC to "recomended programs" for the following extensions
376 WriteRegStr HKCR Applications\vlc
.exe
"" ""
377 WriteRegStr HKCR Applications\vlc
.exe
"FriendlyAppName" "VLC media player"
378 WriteRegStr HKCR Applications\vlc
.exe\shell\Play
"" "Play with VLC"
379 WriteRegStr HKCR Applications\vlc
.exe\shell\Play\command
"" \
380 '$INSTDIR\vlc.exe --started-from-file "%1"'
381 !insertmacro MacroAllExtensions WriteRegStrSupportedTypes
383 WriteRegStr HKCR "AudioCD\shell\PlayWithVLC" "" "Play with VLC media player"
384 WriteRegStr HKCR "AudioCD\shell\PlayWithVLC\command" "" \
385 "$INSTDIR\vlc.exe --started-from-file cdda:%1"
386 WriteRegStr HKCR "DVD\shell\PlayWithVLC" "" "Play with VLC media player"
387 WriteRegStr HKCR "DVD\shell\PlayWithVLC\command" "" \
388 "$INSTDIR\vlc.exe --started-from-file dvd:%1"
390 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayDVDMovieOnArrival" "VLCPlayDVDMovieOnArrival" ""
391 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "Action" "Play DVD movie"
392 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "DefaultIcon" '"$INSTDIR\vlc.exe",0'
393 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "InvokeProgID" "VLC.DVDMovie"
394 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "InvokeVerb" "play"
395 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "Provider" "VideoLAN VLC media player"
397 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayCDAudioOnArrival" "VLCPlayCDAudioOnArrival" ""
398 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "Action" "Play CD audio"
399 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "DefaultIcon" '"$INSTDIR\vlc.exe --started-from-file",0'
400 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "InvokeProgID" "VLC.CDAudio"
401 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "InvokeVerb" "play"
402 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "Provider" "VideoLAN VLC media player"
403 WriteRegStr HKCR "VLC.DVDMovie" "" "VLC DVD Movie"
404 WriteRegStr HKCR "VLC.DVDMovie\shell" "" "Play"
405 WriteRegStr HKCR "VLC.DVDMovie\shell\Play\command" "" \
406 '$INSTDIR\vlc.exe --started-from-file dvd:%1'
407 WriteRegStr HKCR "VLC.DVDMovie\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'
408 WriteRegStr HKCR "VLC.CDAudio" "" "VLC CD Audio"
409 WriteRegStr HKCR "VLC.CDAudio\shell" "" "Play"
410 WriteRegStr HKCR "VLC.CDAudio\shell\Play\command" "" \
411 '$INSTDIR\vlc.exe --started-from-file cdda:%1'
412 WriteRegStr HKCR "VLC.CDAudio\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'
416 Section "Start Menu Shortcut" SEC02a
418 CreateDirectory "$SMPROGRAMS\VideoLAN"
419 CreateDirectory "$SMPROGRAMS\VideoLAN\Quick Settings"
420 CreateDirectory "$SMPROGRAMS\VideoLAN\Quick Settings\Audio"
421 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Audio\Set Audio mode to DirectX (default).lnk" \
422 "$INSTDIR\vlc.exe" "--aout aout_directx --save-config vlc:quit"
423 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Audio\Set Audio mode to Waveout.lnk" \
424 "$INSTDIR\vlc.exe" "--aout waveout --save-config vlc:quit"
425 CreateDirectory "$SMPROGRAMS\VideoLAN\Quick Settings\Interface"
426 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Interface\Set Main Interface to Skinnable.lnk" \
427 "$INSTDIR\vlc.exe" "-I skins --save-config vlc:quit"
428 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Interface\Set Main Interface to wxWidgets (default).lnk" \
429 "$INSTDIR\vlc.exe" "-I wxwin --save-config vlc:quit"
430 CreateDirectory "$SMPROGRAMS\VideoLAN\Quick Settings\Video"
431 ; FIXME add detection for Vista. Direct3D will be default there, for all others it's DirectX
432 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to Direct3D.lnk" \
433 "$INSTDIR\vlc.exe" "--vout direct3d --overlay --directx-hw-yuv --save-config vlc:quit"
434 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to Direct3D (no hardware acceleration).lnk" \
435 "$INSTDIR\vlc.exe" "--vout direct3d --overlay --no-directx-hw-yuv --save-config vlc:quit"
436 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to DirectX.lnk" \
437 "$INSTDIR\vlc.exe" "--vout directx --overlay --directx-hw-yuv --save-config vlc:quit"
438 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to DirectX (no hardware acceleration).lnk" \
439 "$INSTDIR\vlc.exe" "--vout directx --no-overlay --no-directx-hw-yuv --save-config vlc:quit"
440 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to DirectX (no video overlay).lnk" \
441 "$INSTDIR\vlc.exe" "--vout directx --no-overlay --directx-hw-yuv --save-config vlc:quit"
442 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to OpenGL.lnk" \
443 "$INSTDIR\vlc.exe" "--vout opengl --overlay --save-config vlc:quit"
444 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Reset VLC media player preferences and cache files.lnk" \
445 "$INSTDIR\vlc.exe" "--reset-config --reset-plugins-cache --save-config vlc:quit"
446 CreateShortCut "$SMPROGRAMS\VideoLAN\Documentation.lnk" \
447 "$INSTDIR\Documentation.url"
448 CreateShortCut "$SMPROGRAMS\VideoLAN\Release Notes.lnk" \
449 "$INSTDIR\NEWS.txt" ""
450 CreateShortCut "$SMPROGRAMS\VideoLAN\${PRODUCT_GROUP} Website.lnk" \
451 "$INSTDIR\${PRODUCT_GROUP} Website.url"
452 CreateShortCut "$SMPROGRAMS\VideoLAN\VLC media player.lnk" \
453 "$INSTDIR\vlc.exe" ""
456 Section "Desktop Shortcut" SEC02b
458 CreateShortCut "$DESKTOP\VLC media player.lnk" \
459 "$INSTDIR\vlc.exe" ""
462 Section /o
"Mozilla plugin" SEC03
465 SetOutPath "$INSTDIR"
466 !insertmacro OpenUninstallLog
467 !insertmacro InstallFile mozilla\npvlc
.dll
468 !insertmacro CloseUninstallLog
470 !define Moz
"SOFTWARE\MozillaPlugins\@videolan.org/vlc,version=${VERSION}"
471 WriteRegStr HKLM ${Moz} "Description" "VLC Multimedia Plugin"
472 WriteRegStr HKLM ${Moz} "Path" "$INSTDIR\npvlc.dll"
473 WriteRegStr HKLM ${Moz} "Product" "VLC media player"
474 WriteRegStr HKLM ${Moz} "Vendor" "VideoLAN"
475 WriteRegStr HKLM ${Moz} "Version" "${VERSION}"
477 ; for very old version of mozilla, these lines may be needed
482 ;!define Index 'Line${__LINE__}'
488 ; EnumRegKey $R0 HKLM "SOFTWARE\Mozilla" "$R1"
489 ; StrCmp $R0 "" "${Index}-End"
491 ; ReadRegStr $R2 HKLM "SOFTWARE\Mozilla\$R0\Extensions" "Plugins"
492 ; StrCmp $R2 "" "${Index}-Loop" ""
494 ; CopyFiles "$INSTDIR\npvlc.dll" "$R2"
496 ; CopyFiles ${LIBVLC_DLL} "$R2"
498 ; !ifdef LIBVLC_CONTROL_DLL
499 ; CopyFiles ${LIBVLC_CONTROL_DLL} "$R2"
501 ; Goto "${Index}-Loop"
508 Section "ActiveX plugin" SEC04
510 SetOutPath "$INSTDIR"
511 !insertmacro OpenUninstallLog
512 !insertmacro InstallFile activex\axvlc
.dll
513 !insertmacro CloseUninstallLog
514 RegDLL "$INSTDIR\axvlc.dll"
517 SectionGroup
"File type associations" SEC06
518 SectionGroup
"Audio Files"
519 !insertmacro MacroAudioExtensions RegisterExtensionSection
521 SectionGroup
"Video Files"
522 !insertmacro MacroVideoExtensions RegisterExtensionSection
525 !insertmacro MacroOtherExtensions RegisterExtensionSection
529 Section /o
"Context Menus" SEC05
531 !insertmacro MacroAllExtensions AddContextMenu
532 !insertmacro AddContextMenuExt
"Directory"
535 Section /o
"Delete preferences and cache" SEC07
536 !insertmacro delprefs
539 ; Installer section descriptions
540 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
541 !insertmacro MUI_DESCRIPTION_TEXT
${SEC01} \
542 "The media player itself"
543 !insertmacro MUI_DESCRIPTION_TEXT
${SEC02a} \
544 "Adds icons to your start menu for easy access"
545 !insertmacro MUI_DESCRIPTION_TEXT
${SEC02b} \
546 "Adds icon to your desktop for easy access"
547 !insertmacro MUI_DESCRIPTION_TEXT
${SEC03} \
548 "The VLC Mozilla and Mozilla Firefox plugin"
549 !insertmacro MUI_DESCRIPTION_TEXT
${SEC04} \
550 "The VLC ActiveX plugin"
551 !insertmacro MUI_DESCRIPTION_TEXT
${SEC05} \
552 "Add context menu items ('Play With VLC' and 'Add To VLC's Playlist')"
553 !insertmacro MUI_DESCRIPTION_TEXT
${SEC06} \
554 "Sets VLC media player as the default application for the specified file type"
555 !insertmacro MUI_DESCRIPTION_TEXT
${SEC07} \
556 "Deletes VLC media player preferences and cache files leftover from previous installations"
557 !insertmacro MUI_FUNCTION_DESCRIPTION_END
560 ReadRegStr $R0 ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
564 MessageBox MB_YESNO|
MB_ICONEXCLAMATION \
565 "VLC media player has already been installed. $\nDo you want to remove \
566 the previous version before installing $(^Name) ?" \
572 ExecWait '$R0 _?=$INSTDIR' ;Do not copy the uninstaller to a temp file
574 !insertmacro MUI_LANGDLL_DISPLAY
578 WriteUninstaller "$INSTDIR\uninstall.exe"
579 WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "InstallDir" $INSTDIR
580 WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "Version" "${VERSION}"
581 WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\vlc.exe"
583 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
584 "DisplayName" "$(^Name)"
585 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
586 "UninstallString" "$INSTDIR\uninstall.exe"
587 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
588 "DisplayIcon" "$INSTDIR\vlc.exe"
589 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
590 "DisplayVersion" "${PRODUCT_VERSION}"
591 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
592 "URLInfoAbout" "${PRODUCT_WEB_SITE}"
593 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
594 "Publisher" "${PRODUCT_PUBLISHER}"
597 ;;;;;;;;;;;;;;;;;;;;;;;;
598 ; Uninstaller sections ;
599 ;;;;;;;;;;;;;;;;;;;;;;;;
601 ; TrimNewlines (copied from NSIS documentation)
602 ; input, top of stack (e.g. whatever$\r$\n)
603 ; output, top of stack (replaces, with e.g. whatever)
604 ; modifies no other variables.
606 Function un
.TrimNewlines
615 StrCmp $R2 "$\r" loop
616 StrCmp $R2 "$\n" loop
618 IntCmp $R1 0 no_trim_needed
627 Function un
.RemoveEmptyDirs
629 !define Index
'Line${__LINE__}'
630 FindFirst $0 $1 "$INSTDIR$9*"
631 StrCmp $0 "" "${Index}-End"
633 StrCmp $1 "" "${Index}-End"
634 StrCmp $1 "." "${Index}-Next"
635 StrCmp $1 ".." "${Index}-Next"
640 Call un
.RemoveEmptyDirs
654 Section "Uninstall" SEC91
656 SetShellVarContext all
658 !insertmacro MacroAllExtensions DeleteContextMenu
659 !insertmacro MacroAllExtensions UnRegisterExtensionSection
660 !insertmacro DeleteContextMenuExt
"Directory"
662 ;remove activex plugin
663 UnRegDLL "$INSTDIR\axvlc.dll"
664 Delete /REBOOTOK
"$INSTDIR\axvlc.dll"
666 ;remove mozilla plugin
671 !define Index
'Line${__LINE__}'
677 EnumRegKey $R0 HKLM "SOFTWARE\Mozilla" "$R1"
678 StrCmp $R0 "" "${Index}-End"
680 ReadRegStr $R2 HKLM "SOFTWARE\Mozilla\$R0\Extensions" "Plugins"
681 StrCmp $R2 "" "${Index}-Loop" ""
683 ; old files (0.8.5 and before) that may be lying around
684 Delete /REBOOTOK
"$R2\npvlc.dll"
685 Delete /REBOOTOK
"$R2\libvlc.dll"
686 Delete /REBOOTOK
"$R2\vlcintf.xpt"
691 Delete /REBOOTOK
"$INSTDIR\npvlc.dll"
693 RMDir "$SMPROGRAMS\VideoLAN"
694 RMDir /r
$SMPROGRAMS\VideoLAN
696 FileOpen $UninstallLog "$INSTDIR\uninstall.log" r
699 FileRead $UninstallLog $R0
700 IfErrors UninstallEnd
704 Delete "$INSTDIR\$R0"
707 FileClose $UninstallLog
708 Delete "$INSTDIR\uninstall.log"
709 Delete "$INSTDIR\uninstall.exe"
711 Call un
.RemoveEmptyDirs
714 DeleteRegKey HKLM Software\VideoLAN
716 DeleteRegKey HKCR Applications\vlc
.exe
717 DeleteRegKey HKCR AudioCD\shell\PlayWithVLC
718 DeleteRegKey HKCR DVD\shell\PlayWithVLC
719 DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayDVDMovieOnArrival" "VLCPlayDVDMovieOnArrival"
720 DeleteRegKey HKLM Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival
721 DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayCDAudioOnArrival" "VLCPlayCDAudioOnArrival"
722 DeleteRegKey HKLM Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival
723 DeleteRegKey HKCR "VLC.MediaFile"
726 "SOFTWARE\MozillaPlugins\@videolan.org/vlc,version=${VERSION}"
729 "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
731 Delete "$DESKTOP\VLC media player.lnk"
733 DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
734 DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}"
738 Section /o
"un.Delete preferences and cache" SEC92
739 !insertmacro delprefs
742 ; Uninstaller section descriptions
743 !insertmacro MUI_UNFUNCTION_DESCRIPTION_BEGIN
744 !insertmacro MUI_DESCRIPTION_TEXT
${SEC91} \
745 "Uninstall VLC media player and all its components"
746 !insertmacro MUI_DESCRIPTION_TEXT
${SEC92} \
747 "Deletes VLC media player preferences and cache files"
748 !insertmacro MUI_UNFUNCTION_DESCRIPTION_END
750 ;Function un.onUninstSuccess
752 ; MessageBox MB_ICONINFORMATION|MB_OK \
753 ; "$(^Name) was successfully removed from your computer."
757 !insertmacro MUI_UNGETLANGUAGE