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}"
18 ;;;;;;;;;;;;;;;;;;;;;;;;;
19 ; General configuration ;
20 ;;;;;;;;;;;;;;;;;;;;;;;;;
22 Name "${PRODUCT_GROUP} ${PRODUCT_NAME} ${PRODUCT_VERSION}"
23 OutFile ..\vlc
-${VERSION}-win32
.exe
24 InstallDir "$PROGRAMFILES\VideoLAN\VLC"
25 InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" ""
26 !ifdef NSIS_LZMA_COMPRESS_WHOLE
29 SetCompressor
/SOLID lzma
32 ;ShowUnInstDetails show
39 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
40 ; NSIS Modern User Interface configuration ;
41 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
43 ; MUI 1.67 compatible ------
47 !define MUI_ABORTWARNING
48 !define MUI_ICON
"vlc48x48.ico"
49 !define MUI_UNICON
"vlc48x48.ico"
50 !define MUI_COMPONENTSPAGE_SMALLDESC
54 !define MUI_WELCOMEPAGE_TITLE_3LINES
55 !insertmacro MUI_PAGE_WELCOME
57 !insertmacro MUI_PAGE_LICENSE
"COPYING.txt"
59 !insertmacro MUI_PAGE_COMPONENTS
61 !insertmacro MUI_PAGE_DIRECTORY
63 !insertmacro MUI_PAGE_INSTFILES
65 !define MUI_FINISHPAGE_RUN
"$INSTDIR\vlc.exe"
66 !define MUI_FINISHPAGE_SHOWREADME
"$INSTDIR\README.txt"
67 !define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED
68 !define MUI_FINISHPAGE_LINK
"Visit the VideoLAN VLC media player Website"
69 !define MUI_FINISHPAGE_LINK_LOCATION
"http://www.videolan.org/vlc/"
70 !define MUI_FINISHPAGE_NOREBOOTSUPPORT
71 !insertmacro MUI_PAGE_FINISH
74 !insertmacro MUI_UNPAGE_CONFIRM
75 !insertmacro MUI_UNPAGE_COMPONENTS
76 !insertmacro MUI_UNPAGE_INSTFILES
77 !insertmacro MUI_UNPAGE_FINISH
80 !insertmacro MUI_LANGUAGE
"English" # first language is the default language
81 !insertmacro MUI_LANGUAGE
"French"
82 !insertmacro MUI_LANGUAGE
"German"
83 !insertmacro MUI_LANGUAGE
"Spanish"
84 !insertmacro MUI_LANGUAGE
"SimpChinese"
85 !insertmacro MUI_LANGUAGE
"TradChinese"
86 !insertmacro MUI_LANGUAGE
"Japanese"
87 !insertmacro MUI_LANGUAGE
"Korean"
88 !insertmacro MUI_LANGUAGE
"Italian"
89 !insertmacro MUI_LANGUAGE
"Dutch"
90 !insertmacro MUI_LANGUAGE
"Danish"
91 !insertmacro MUI_LANGUAGE
"Swedish"
92 !insertmacro MUI_LANGUAGE
"Norwegian"
93 !insertmacro MUI_LANGUAGE
"Finnish"
94 !insertmacro MUI_LANGUAGE
"Greek"
95 !insertmacro MUI_LANGUAGE
"Russian"
96 !insertmacro MUI_LANGUAGE
"Portuguese"
97 !insertmacro MUI_LANGUAGE
"Arabic"
99 !insertmacro MUI_RESERVEFILE_LANGDLL
102 !insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
110 !macro MacroAudioExtensions _action
111 !insertmacro ${_action} ".a52"
112 !insertmacro ${_action} ".aac"
113 !insertmacro ${_action} ".ac3"
114 !insertmacro ${_action} ".dts"
115 !insertmacro ${_action} ".flac"
116 !insertmacro ${_action} ".mka"
117 !insertmacro ${_action} ".mp1"
118 !insertmacro ${_action} ".mp2"
119 !insertmacro ${_action} ".mp3"
120 !insertmacro ${_action} ".ogg"
121 !insertmacro ${_action} ".spx"
122 !insertmacro ${_action} ".wav"
123 !insertmacro ${_action} ".wma"
126 !macro MacroVideoExtensions _action
127 !insertmacro ${_action} ".asf"
128 !insertmacro ${_action} ".avi"
129 !insertmacro ${_action} ".divx"
130 !insertmacro ${_action} ".dv"
131 !insertmacro ${_action} ".m1v"
132 !insertmacro ${_action} ".m2v"
133 !insertmacro ${_action} ".mkv"
134 !insertmacro ${_action} ".mov"
135 !insertmacro ${_action} ".mp4"
136 !insertmacro ${_action} ".mpeg"
137 !insertmacro ${_action} ".mpeg1"
138 !insertmacro ${_action} ".mpeg2"
139 !insertmacro ${_action} ".mpeg4"
140 !insertmacro ${_action} ".mpg"
141 !insertmacro ${_action} ".ps"
142 !insertmacro ${_action} ".ts"
143 !insertmacro ${_action} ".ogm"
144 !insertmacro ${_action} ".vob"
145 !insertmacro ${_action} ".wmv"
148 !macro MacroOtherExtensions _action
149 !insertmacro ${_action} ".asx"
150 !insertmacro ${_action} ".bin"
151 !insertmacro ${_action} ".cue"
152 !insertmacro ${_action} ".m3u"
153 !insertmacro ${_action} ".pls"
154 !insertmacro ${_action} ".vlc"
157 !macro MacroAllExtensions _action
158 !insertmacro MacroAudioExtensions
${_action}
159 !insertmacro MacroVideoExtensions
${_action}
160 !insertmacro MacroOtherExtensions
${_action}
163 ;;;;;;;;;;;;;;;;;;;;;;;;;;
164 ; File type associations ;
165 ;;;;;;;;;;;;;;;;;;;;;;;;;;
167 Function RegisterExtension
168 ; back up old value for extension $R0 (eg. ".opt")
169 ReadRegStr $1 HKCR "$R0" ""
170 StrCmp $1 "" NoBackup
171 StrCmp $1 "VLC$R0" "NoBackup"
172 WriteRegStr HKCR "$R0" "VLC.backup" $1
174 WriteRegStr HKCR "$R0" "" "VLC$R0"
175 ReadRegStr $0 HKCR "VLC$R0" ""
176 WriteRegStr HKCR "VLC$R0" "" "VLC media file"
177 WriteRegStr HKCR "VLC$R0\shell" "" "Play"
178 WriteRegStr HKCR "VLC$R0\shell\Play\command" "" '"$INSTDIR\vlc.exe" --one-instance-when-started-from-file "%1"'
179 WriteRegStr HKCR "VLC$R0\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'
182 Function un
.RegisterExtension
183 ;start of restore script
184 ReadRegStr $1 HKCR "$R0" ""
185 StrCmp $1 "VLC$R0" 0 NoOwn
; only do this if we own it
186 ReadRegStr $1 HKCR "$R0" "VLC.backup"
187 StrCmp $1 "" 0 Restore
; if backup="" then delete the whole key
188 DeleteRegKey HKCR "$R0"
191 WriteRegStr HKCR "$R0" "" $1
192 DeleteRegValue HKCR "$R0" "VLC.backup"
194 DeleteRegKey HKCR "VLC$R0" ;Delete key with association settings
197 !macro RegisterExtensionSection
EXT
202 Call RegisterExtension
207 !macro UnRegisterExtensionSection
EXT
210 Call un
.RegisterExtension
214 !macro WriteRegStrSupportedTypes
EXT
215 WriteRegStr HKCR Applications\vlc
.exe\SupportedTypes
${EXT} ""
218 ;;;;;;;;;;;;;;;;;;;;;;;;
219 ; Context menu entries ;
220 ;;;;;;;;;;;;;;;;;;;;;;;;
222 !macro AddContextMenu
EXT
223 WriteRegStr HKCR ${EXT}\shell\PlayWithVLC
"" "Play with VLC media player"
224 WriteRegStr HKCR ${EXT}\shell\PlayWithVLC\command
"" '$INSTDIR\vlc.exe --one-instance-when-started-from-file --no-playlist-enqueue "%1"'
226 WriteRegStr HKCR ${EXT}\shell\AddToPlaylistVLC
"" "Add to VLC media player's Playlist"
227 WriteRegStr HKCR ${EXT}\shell\AddToPlaylistVLC\command
"" '$INSTDIR\vlc.exe --one-instance-when-started-from-file --playlist-enqueue "%1"'
230 !macro DeleteContextMenu
EXT
231 DeleteRegKey HKCR ${EXT}\shell\PlayWithVLC
232 DeleteRegKey HKCR ${EXT}\shell\AddToPlaylistVLC
235 ;;;;;;;;;;;;;;;;;;;;;;;;;;
236 ; Delete prefs and cache ;
237 ;;;;;;;;;;;;;;;;;;;;;;;;;;
242 !define Index
'Line${__LINE__}'
245 ; this will loop through all the logged users and "virtual" windows users
246 ; (it looks like users are only present in HKEY_USERS when they are logged in)
248 EnumRegKey $1 HKU "" $0
249 StrCmp $1 "" "${Index}-End"
251 ReadRegStr $2 HKU "$1\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" AppData
252 StrCmp $2 "" "${Index}-Loop"
261 !macro OpenUninstallLog
262 FileOpen $UninstallLog "$INSTDIR\uninstall.log" w
263 FileSeek $UninstallLog 0 END
266 !macro CloseUninstallLog
267 FileClose $UninstallLog
268 SetFileAttributes "$INSTDIR\uninstall.log" HIDDEN
271 !macro InstallFile FILEREGEX
273 !define Index
'Line${__LINE__}'
274 FindFirst $0 $1 "$INSTDIR\${FILEREGEX}"
275 StrCmp $0 "" "${Index}-End"
277 StrCmp $1 "" "${Index}-End"
278 FileWrite $UninstallLog "$1$\r$\n"
285 !macro InstallFolder FOLDER
288 Call InstallFolderInternal
291 Function InstallFolderInternal
293 !define Index
'Line${__LINE__}'
294 FindFirst $0 $1 "$INSTDIR\$9\*"
295 StrCmp $0 "" "${Index}-End"
297 StrCmp $1 "" "${Index}-End"
298 StrCmp $1 "." "${Index}-Next"
299 StrCmp $1 ".." "${Index}-Next"
300 IfFileExists "$9\$1\*" 0 "${Index}-Write"
304 Call InstallFolderInternal
309 FileWrite $UninstallLog "$9\$1$\r$\n"
318 ;;;;;;;;;;;;;;;;;;;;;;
319 ; Installer sections ;
320 ;;;;;;;;;;;;;;;;;;;;;;
322 Section "Media player (required)" SEC01
324 SetShellVarContext all
325 SetOutPath "$INSTDIR"
327 !insertmacro OpenUninstallLog
329 !insertmacro InstallFile vlc
.exe
330 !insertmacro InstallFile vlc
.exe
.manifest
332 !insertmacro InstallFile
${LIBVLC_DLL}
334 !insertmacro InstallFile
*.txt
336 !insertmacro InstallFolder plugins
337 !insertmacro InstallFolder locale
338 !insertmacro InstallFolder osdmenu
339 !insertmacro InstallFolder skins
340 !insertmacro InstallFolder http
342 WriteIniStr
"$INSTDIR\${PRODUCT_NAME}.url" "InternetShortcut" "URL" \
343 "${PRODUCT_WEB_SITE}"
344 FileWrite $UninstallLog "${PRODUCT_NAME}.url$\r$\n"
345 WriteIniStr
"$INSTDIR\Documentation.url" "InternetShortcut" "URL" \
346 "${PRODUCT_WEB_SITE}/doc/"
347 FileWrite $UninstallLog "Documentation.url$\r$\n"
349 !insertmacro CloseUninstallLog
351 ; Add VLC to "recomended programs" for the following extensions
352 WriteRegStr HKCR Applications\vlc
.exe
"" ""
353 WriteRegStr HKCR Applications\vlc
.exe
"FriendlyAppName" "VLC media player"
354 WriteRegStr HKCR Applications\vlc
.exe\shell\Play
"" "Play with VLC"
355 WriteRegStr HKCR Applications\vlc
.exe\shell\Play\command
"" \
356 '$INSTDIR\vlc.exe --one-instance-when-started-from-file "%1"'
357 !insertmacro MacroAllExtensions WriteRegStrSupportedTypes
359 WriteRegStr HKCR "AudioCD\shell\PlayWithVLC" "" "Play with VLC media player"
360 WriteRegStr HKCR "AudioCD\shell\PlayWithVLC\command" "" \
361 "$INSTDIR\vlc.exe --one-instance-when-started-from-file cdda:%1"
362 WriteRegStr HKCR "DVD\shell\PlayWithVLC" "" "Play with VLC media player"
363 WriteRegStr HKCR "DVD\shell\PlayWithVLC\command" "" \
364 "$INSTDIR\vlc.exe --one-instance-when-started-from-file dvd:%1"
366 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayDVDMovieOnArrival" "VLCPlayDVDMovieOnArrival" ""
367 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "Action" "Play DVD movie"
368 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "DefaultIcon" '"$INSTDIR\vlc.exe",0'
369 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "InvokeProgID" "VLC.DVDMovie"
370 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "InvokeVerb" "play"
371 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "Provider" "VideoLAN VLC media player"
373 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayCDAudioOnArrival" "VLCPlayCDAudioOnArrival" ""
374 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "Action" "Play CD audio"
375 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "DefaultIcon" '"$INSTDIR\vlc.exe --one-instance-when-started-from-file",0'
376 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "InvokeProgID" "VLC.CDAudio"
377 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "InvokeVerb" "play"
378 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "Provider" "VideoLAN VLC media player"
379 WriteRegStr HKCR "VLC.DVDMovie" "" "VLC DVD Movie"
380 WriteRegStr HKCR "VLC.DVDMovie\shell" "" "Play"
381 WriteRegStr HKCR "VLC.DVDMovie\shell\Play\command" "" \
382 '$INSTDIR\vlc.exe --one-instance-when-started-from-file dvd:%1'
383 WriteRegStr HKCR "VLC.DVDMovie\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'
384 WriteRegStr HKCR "VLC.CDAudio" "" "VLC CD Audio"
385 WriteRegStr HKCR "VLC.CDAudio\shell" "" "Play"
386 WriteRegStr HKCR "VLC.CDAudio\shell\Play\command" "" \
387 '$INSTDIR\vlc.exe --one-instance-when-started-from-file cdda:%1'
388 WriteRegStr HKCR "VLC.CDAudio\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'
392 Section "Start Menu Shortcut" SEC02a
394 CreateDirectory "$SMPROGRAMS\VideoLAN"
395 CreateShortCut "$SMPROGRAMS\VideoLAN\VLC media player.lnk" \
396 "$INSTDIR\vlc.exe" "--intf wx --wx-embed"
397 CreateShortCut "$SMPROGRAMS\VideoLAN\VLC media player (alt).lnk" \
398 "$INSTDIR\vlc.exe" "--intf wx --no-wx-embed"
399 CreateShortCut "$SMPROGRAMS\VideoLAN\VLC media player (skins).lnk" \
400 "$INSTDIR\vlc.exe" "--intf skins"
401 CreateShortCut "$SMPROGRAMS\VideoLAN\Reset VLC defaults and quit.lnk" \
402 "$INSTDIR\vlc.exe" "--reset-config --reset-plugins-cache --save-config vlc:quit "
403 CreateShortCut "$SMPROGRAMS\VideoLAN\${PRODUCT_NAME} Website.lnk" \
404 "$INSTDIR\${PRODUCT_NAME}.url"
405 CreateShortCut "$SMPROGRAMS\VideoLAN\Documentation.lnk" \
406 "$INSTDIR\Documentation.url"
409 Section "Desktop Shortcut" SEC02b
411 CreateShortCut "$DESKTOP\VLC media player.lnk" \
412 "$INSTDIR\vlc.exe" ""
415 Section /o
"Mozilla plugin" SEC03
418 !insertmacro OpenUninstallLog
419 !insertmacro InstallFolder mozilla
420 !insertmacro CloseUninstallLog
422 ; doesn't work. bug in mozilla/mozilla firefox or moz documentation (xpt file isn't loaded)
423 ; see mozilla bugs 184506 and 159445
424 ;!define Moz "SOFTWARE\MozillaPlugins\@videolan.org/vlc,version=${VERSION}"
425 ;WriteRegStr HKLM ${Moz} "Description" "VideoLAN VLC plugin for Mozilla"
426 ;WriteRegStr HKLM ${Moz} "Path" "$INSTDIR\mozilla\npvlc.dll"
427 ;WriteRegStr HKLM ${Moz} "Product" "VLC media player"
428 ;WriteRegStr HKLM ${Moz} "Vendor" "VideoLAN"
429 ;WriteRegStr HKLM ${Moz} "Version" "${VERSION}"
430 ;WriteRegStr HKLM ${Moz} "XPTPath" "$INSTDIR\mozilla\vlcintf.xpt"
436 !define Index
'Line${__LINE__}'
442 EnumRegKey $R0 HKLM "SOFTWARE\Mozilla" "$R1"
443 StrCmp $R0 "" "${Index}-End"
445 ReadRegStr $R2 HKLM "SOFTWARE\Mozilla\$R0\Extensions" "Plugins"
446 StrCmp $R2 "" "${Index}-Loop" ""
448 CopyFiles "$INSTDIR\mozilla\*" "$R2"
450 CopyFiles ${LIBVLC_DLL} "$R2"
459 Section "ActiveX plugin" SEC04
461 SetOutPath "$INSTDIR"
462 !insertmacro OpenUninstallLog
463 !insertmacro InstallFile activex\axvlc
.dll
464 !insertmacro CloseUninstallLog
465 RegDLL "$INSTDIR\axvlc.dll"
468 Section "Context Menus" SEC05
470 !insertmacro MacroAllExtensions AddContextMenu
471 !insertmacro AddContextMenu
"Directory"
474 SectionGroup
"File type associations" SEC06
475 SectionGroup
"Audio Files"
476 !insertmacro MacroAudioExtensions RegisterExtensionSection
478 SectionGroup
"Video Files"
479 !insertmacro MacroVideoExtensions RegisterExtensionSection
482 !insertmacro MacroOtherExtensions RegisterExtensionSection
486 Section /o
"Delete preferences and cache" SEC07
487 !insertmacro delprefs
490 ; Installer section descriptions
491 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
492 !insertmacro MUI_DESCRIPTION_TEXT
${SEC01} \
493 "The media player itself"
494 !insertmacro MUI_DESCRIPTION_TEXT
${SEC02a} \
495 "Adds icons to your start menu for easy access"
496 !insertmacro MUI_DESCRIPTION_TEXT
${SEC02b} \
497 "Adds icon to your desktop for easy access"
498 !insertmacro MUI_DESCRIPTION_TEXT
${SEC03} \
499 "The VLC Mozilla and Mozilla Firefox plugin"
500 !insertmacro MUI_DESCRIPTION_TEXT
${SEC04} \
501 "The VLC ActiveX plugin"
502 !insertmacro MUI_DESCRIPTION_TEXT
${SEC05} \
503 "Add context menu items ('Play With VLC' and 'Add To VLC's Playlist')"
504 !insertmacro MUI_DESCRIPTION_TEXT
${SEC06} \
505 "Sets VLC media player as the default application for the specified file type"
506 !insertmacro MUI_DESCRIPTION_TEXT
${SEC07} \
507 "Deletes VLC media player preferences and cache files leftover from previous installations"
508 !insertmacro MUI_FUNCTION_DESCRIPTION_END
511 ReadRegStr $R0 ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
515 MessageBox MB_YESNO|
MB_ICONEXCLAMATION \
516 "VLC media player has already been installed. $\nDo you want to remove \
517 the previous version before installing $(^Name) ?" \
523 ExecWait '$R0 _?=$INSTDIR' ;Do not copy the uninstaller to a temp file
525 !insertmacro MUI_LANGDLL_DISPLAY
529 WriteUninstaller "$INSTDIR\uninstall.exe"
530 WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "InstallDir" $INSTDIR
531 WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "Version" "${VERSION}"
532 WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\vlc.exe"
534 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
535 "DisplayName" "$(^Name)"
536 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
537 "UninstallString" "$INSTDIR\uninstall.exe"
538 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
539 "DisplayIcon" "$INSTDIR\vlc.exe"
540 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
541 "DisplayVersion" "${PRODUCT_VERSION}"
542 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
543 "URLInfoAbout" "${PRODUCT_WEB_SITE}"
544 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
545 "Publisher" "${PRODUCT_PUBLISHER}"
548 ;;;;;;;;;;;;;;;;;;;;;;;;
549 ; Uninstaller sections ;
550 ;;;;;;;;;;;;;;;;;;;;;;;;
552 ; TrimNewlines (copied from NSIS documentation)
553 ; input, top of stack (e.g. whatever$\r$\n)
554 ; output, top of stack (replaces, with e.g. whatever)
555 ; modifies no other variables.
557 Function un
.TrimNewlines
566 StrCmp $R2 "$\r" loop
567 StrCmp $R2 "$\n" loop
569 IntCmp $R1 0 no_trim_needed
578 Function un
.RemoveEmptyDirs
580 !define Index
'Line${__LINE__}'
581 FindFirst $0 $1 "$INSTDIR$9*"
582 StrCmp $0 "" "${Index}-End"
584 StrCmp $1 "" "${Index}-End"
585 StrCmp $1 "." "${Index}-Next"
586 StrCmp $1 ".." "${Index}-Next"
591 Call un
.RemoveEmptyDirs
605 Section "Uninstall" SEC91
607 SetShellVarContext all
609 !insertmacro MacroAllExtensions DeleteContextMenu
610 !insertmacro MacroAllExtensions UnRegisterExtensionSection
611 !insertmacro DeleteContextMenu
"Directory"
613 UnRegDLL "$INSTDIR\axvlc.dll"
614 Delete /REBOOTOK
"$INSTDIR\axvlc.dll"
616 ;remove mozilla plugin
621 !define Index
'Line${__LINE__}'
627 EnumRegKey $R0 HKLM "SOFTWARE\Mozilla" "$R1"
628 StrCmp $R0 "" "${Index}-End"
630 ReadRegStr $R2 HKLM "SOFTWARE\Mozilla\$R0\Extensions" "Plugins"
631 StrCmp $R2 "" "${Index}-Loop" ""
633 Delete "$R2\vlcintf.xpt"
634 Delete "$R2\npvlc.dll"
640 RMDir "$SMPROGRAMS\VideoLAN"
641 RMDir /r
$SMPROGRAMS\VideoLAN
643 FileOpen $UninstallLog "$INSTDIR\uninstall.log" r
646 FileRead $UninstallLog $R0
647 IfErrors UninstallEnd
651 Delete "$INSTDIR\$R0"
654 FileClose $UninstallLog
655 Delete "$INSTDIR\uninstall.log"
656 Delete "$INSTDIR\uninstall.exe"
658 Call un
.RemoveEmptyDirs
661 DeleteRegKey HKLM Software\VideoLAN
663 DeleteRegKey HKCR Applications\vlc
.exe
664 DeleteRegKey HKCR AudioCD\shell\PlayWithVLC
665 DeleteRegKey HKCR DVD\shell\PlayWithVLC
666 DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayDVDMovieOnArrival" "VLCPlayDVDMovieOnArrival"
667 DeleteRegKey HKLM Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival
668 DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayCDAudioOnArrival" "VLCPlayCDAudioOnArrival"
669 DeleteRegKey HKLM Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival
670 DeleteRegKey HKCR "VLC.MediaFile"
673 "SOFTWARE\MozillaPlugins\@videolan.org/vlc,version=${VERSION}"
676 "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
678 Delete "$DESKTOP\VLC media player.lnk"
680 DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
681 DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}"
685 Section /o
"un.Delete preferences and cache" SEC92
687 !insertmacro delprefs
690 ; Uninstaller section descriptions
691 !insertmacro MUI_UNFUNCTION_DESCRIPTION_BEGIN
692 !insertmacro MUI_DESCRIPTION_TEXT
${SEC91} \
693 "Uninstall VLC media player and all its components"
694 !insertmacro MUI_DESCRIPTION_TEXT
${SEC92} \
695 "Deletes VLC media player preferences and cache files"
696 !insertmacro MUI_UNFUNCTION_DESCRIPTION_END
698 ;Function un.onUninstSuccess
700 ; MessageBox MB_ICONINFORMATION|MB_OK \
701 ; "$(^Name) was successfully removed from your computer."
705 !insertmacro MUI_LANGDLL_DISPLAY