1 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
\r
2 ; NSIS installer script for vlc ;
\r
3 ; (http://nsis.sourceforge.net) ;
\r
4 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
\r
6 !define PRODUCT_NAME "VLC media player"
\r
7 !define PRODUCT_VERSION '${VERSION}'
\r
8 !define PRODUCT_GROUP "VideoLAN"
\r
9 !define PRODUCT_PUBLISHER "VideoLAN Team"
\r
10 !define PRODUCT_WEB_SITE "http://www.videolan.org"
\r
11 !define PRODUCT_DIR_REGKEY "Software\VideoLAN\VLC"
\r
12 !define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
\r
13 !define PRODUCT_UNINST_ROOT_KEY "HKLM"
\r
14 !define PRODUCT_ID "{ea92ef52-afe4-4212-bacb-dfe9fca94cd6}"
\r
16 ;;;;;;;;;;;;;;;;;;;;;;;;;
\r
17 ; General configuration ;
\r
18 ;;;;;;;;;;;;;;;;;;;;;;;;;
\r
20 Name "${PRODUCT_GROUP} ${PRODUCT_NAME} ${PRODUCT_VERSION}"
\r
21 OutFile ..\vlc-${VERSION}-win32.exe
\r
22 InstallDir "$PROGRAMFILES\VideoLAN\VLC"
\r
23 InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" ""
\r
24 !ifdef NSIS_LZMA_COMPRESS_WHOLE
\r
27 SetCompressor /SOLID lzma
\r
29 ;ShowInstDetails show
\r
30 ;ShowUnInstDetails show
\r
31 SetOverwrite ifnewer
\r
37 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
\r
38 ; NSIS Modern User Interface configuration ;
\r
39 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
\r
41 ; MUI 1.67 compatible ------
\r
45 !define MUI_ABORTWARNING
\r
46 !define MUI_ICON "vlc48x48.ico"
\r
47 !define MUI_UNICON "vlc48x48.ico"
\r
48 !define MUI_COMPONENTSPAGE_SMALLDESC
\r
52 !define MUI_WELCOMEPAGE_TITLE_3LINES
\r
53 !insertmacro MUI_PAGE_WELCOME
\r
55 !insertmacro MUI_PAGE_LICENSE "COPYING.txt"
\r
57 !insertmacro MUI_PAGE_COMPONENTS
\r
59 !insertmacro MUI_PAGE_DIRECTORY
\r
61 !insertmacro MUI_PAGE_INSTFILES
\r
63 !define MUI_FINISHPAGE_RUN "$INSTDIR\vlc.exe"
\r
64 !define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\README.txt"
\r
65 !define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED
\r
66 !define MUI_FINISHPAGE_LINK "Visit the VideoLAN VLC media player Website"
\r
67 !define MUI_FINISHPAGE_LINK_LOCATION "http://www.videolan.org/vlc/"
\r
68 !define MUI_FINISHPAGE_NOREBOOTSUPPORT
\r
69 !insertmacro MUI_PAGE_FINISH
\r
72 !insertmacro MUI_UNPAGE_CONFIRM
\r
73 !insertmacro MUI_UNPAGE_COMPONENTS
\r
74 !insertmacro MUI_UNPAGE_INSTFILES
\r
75 !insertmacro MUI_UNPAGE_FINISH
\r
78 !insertmacro MUI_LANGUAGE "English" # first language is the default language
\r
79 !insertmacro MUI_LANGUAGE "French"
\r
80 !insertmacro MUI_LANGUAGE "German"
\r
81 !insertmacro MUI_LANGUAGE "Spanish"
\r
82 !insertmacro MUI_LANGUAGE "SimpChinese"
\r
83 !insertmacro MUI_LANGUAGE "TradChinese"
\r
84 !insertmacro MUI_LANGUAGE "Japanese"
\r
85 !insertmacro MUI_LANGUAGE "Korean"
\r
86 !insertmacro MUI_LANGUAGE "Italian"
\r
87 !insertmacro MUI_LANGUAGE "Dutch"
\r
88 !insertmacro MUI_LANGUAGE "Danish"
\r
89 !insertmacro MUI_LANGUAGE "Swedish"
\r
90 !insertmacro MUI_LANGUAGE "Norwegian"
\r
91 !insertmacro MUI_LANGUAGE "Finnish"
\r
92 !insertmacro MUI_LANGUAGE "Greek"
\r
93 !insertmacro MUI_LANGUAGE "Russian"
\r
94 !insertmacro MUI_LANGUAGE "Portuguese"
\r
95 !insertmacro MUI_LANGUAGE "Arabic"
\r
97 !insertmacro MUI_RESERVEFILE_LANGDLL
\r
100 !insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
\r
104 ;;;;;;;;;;;;;;;;;;;
\r
105 ; Extension lists ;
\r
106 ;;;;;;;;;;;;;;;;;;;
\r
108 !macro MacroAudioExtensions _action
\r
109 !insertmacro ${_action} ".a52"
\r
110 !insertmacro ${_action} ".aac"
\r
111 !insertmacro ${_action} ".ac3"
\r
112 !insertmacro ${_action} ".dts"
\r
113 !insertmacro ${_action} ".flac"
\r
114 !insertmacro ${_action} ".mka"
\r
115 !insertmacro ${_action} ".mp1"
\r
116 !insertmacro ${_action} ".mp2"
\r
117 !insertmacro ${_action} ".mp3"
\r
118 !insertmacro ${_action} ".ogg"
\r
119 !insertmacro ${_action} ".spx"
\r
120 !insertmacro ${_action} ".wav"
\r
121 !insertmacro ${_action} ".wma"
\r
124 !macro MacroVideoExtensions _action
\r
125 !insertmacro ${_action} ".asf"
\r
126 !insertmacro ${_action} ".avi"
\r
127 !insertmacro ${_action} ".divx"
\r
128 !insertmacro ${_action} ".dv"
\r
129 !insertmacro ${_action} ".m1v"
\r
130 !insertmacro ${_action} ".m2v"
\r
131 !insertmacro ${_action} ".mkv"
\r
132 !insertmacro ${_action} ".mov"
\r
133 !insertmacro ${_action} ".mp4"
\r
134 !insertmacro ${_action} ".mpeg"
\r
135 !insertmacro ${_action} ".mpeg1"
\r
136 !insertmacro ${_action} ".mpeg2"
\r
137 !insertmacro ${_action} ".mpeg4"
\r
138 !insertmacro ${_action} ".mpg"
\r
139 !insertmacro ${_action} ".ps"
\r
140 !insertmacro ${_action} ".ts"
\r
141 !insertmacro ${_action} ".ogm"
\r
142 !insertmacro ${_action} ".vob"
\r
143 !insertmacro ${_action} ".wmv"
\r
146 !macro MacroOtherExtensions _action
\r
147 !insertmacro ${_action} ".asx"
\r
148 !insertmacro ${_action} ".bin"
\r
149 !insertmacro ${_action} ".cue"
\r
150 !insertmacro ${_action} ".m3u"
\r
151 !insertmacro ${_action} ".pls"
\r
152 !insertmacro ${_action} ".vlc"
\r
155 !macro MacroAllExtensions _action
\r
156 !insertmacro MacroAudioExtensions ${_action}
\r
157 !insertmacro MacroVideoExtensions ${_action}
\r
158 !insertmacro MacroOtherExtensions ${_action}
\r
161 ;;;;;;;;;;;;;;;;;;;;;;;;;;
\r
162 ; File type associations ;
\r
163 ;;;;;;;;;;;;;;;;;;;;;;;;;;
\r
165 Function RegisterExtension
\r
166 ; back up old value for extension $R0 (eg. ".opt")
\r
167 ReadRegStr $1 HKCR "$R0" ""
\r
168 StrCmp $1 "" NoBackup
\r
169 StrCmp $1 "VLC$R0" "NoBackup"
\r
170 WriteRegStr HKCR "$R0" "VLC.backup" $1
\r
172 WriteRegStr HKCR "$R0" "" "VLC$R0"
\r
173 ReadRegStr $0 HKCR "VLC$R0" ""
\r
174 WriteRegStr HKCR "VLC$R0" "" "VLC media file"
\r
175 WriteRegStr HKCR "VLC$R0\shell" "" "Play"
\r
176 WriteRegStr HKCR "VLC$R0\shell\Play\command" "" '"$INSTDIR\vlc.exe" --one-instance-when-started-from-file "%1"'
\r
177 WriteRegStr HKCR "VLC$R0\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'
\r
180 Function un.RegisterExtension
\r
181 ;start of restore script
\r
182 ReadRegStr $1 HKCR "$R0" ""
\r
183 StrCmp $1 "VLC$R0" 0 NoOwn ; only do this if we own it
\r
184 ReadRegStr $1 HKCR "$R0" "VLC.backup"
\r
185 StrCmp $1 "" 0 Restore ; if backup="" then delete the whole key
\r
186 DeleteRegKey HKCR "$R0"
\r
189 WriteRegStr HKCR "$R0" "" $1
\r
190 DeleteRegValue HKCR "$R0" "VLC.backup"
\r
192 DeleteRegKey HKCR "VLC$R0" ;Delete key with association settings
\r
195 !macro RegisterExtensionSection EXT
\r
200 Call RegisterExtension
\r
205 !macro UnRegisterExtensionSection EXT
\r
208 Call un.RegisterExtension
\r
212 !macro WriteRegStrSupportedTypes EXT
\r
213 WriteRegStr HKCR Applications\vlc.exe\SupportedTypes ${EXT} ""
\r
216 ;;;;;;;;;;;;;;;;;;;;;;;;
\r
217 ; Context menu entries ;
\r
218 ;;;;;;;;;;;;;;;;;;;;;;;;
\r
220 !macro AddContextMenu EXT
\r
221 WriteRegStr HKCR ${EXT}\shell\PlayWithVLC "" "Play with VLC media player"
\r
222 WriteRegStr HKCR ${EXT}\shell\PlayWithVLC\command "" '$INSTDIR\vlc.exe --one-instance-when-started-from-file --no-playlist-enqueue "%1"'
\r
224 WriteRegStr HKCR ${EXT}\shell\AddToPlaylistVLC "" "Add to VLC media player's Playlist"
\r
225 WriteRegStr HKCR ${EXT}\shell\AddToPlaylistVLC\command "" '$INSTDIR\vlc.exe --one-instance-when-started-from-file --playlist-enqueue "%1"'
\r
228 !macro DeleteContextMenu EXT
\r
229 DeleteRegKey HKCR ${EXT}\shell\PlayWithVLC
\r
230 DeleteRegKey HKCR ${EXT}\shell\AddToPlaylistVLC
\r
233 ;;;;;;;;;;;;;;;;;;;;;;;;;;
\r
234 ; Delete prefs and cache ;
\r
235 ;;;;;;;;;;;;;;;;;;;;;;;;;;
\r
240 !define Index 'Line${__LINE__}'
\r
243 ; this will loop through all the logged users and "virtual" windows users
\r
244 ; (it looks like users are only present in HKEY_USERS when they are logged in)
\r
246 EnumRegKey $1 HKU "" $0
\r
247 StrCmp $1 "" "${Index}-End"
\r
249 ReadRegStr $2 HKU "$1\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" AppData
\r
250 StrCmp $2 "" "${Index}-Loop"
\r
252 Goto "${Index}-Loop"
\r
259 !macro InstallFile FILEREGEX
\r
260 File "${FILEREGEX}"
\r
261 !define Index 'Line${__LINE__}'
\r
262 FindFirst $0 $1 "$INSTDIR\${FILEREGEX}"
\r
263 StrCmp $0 "" "${Index}-End"
\r
265 StrCmp $1 "" "${Index}-End"
\r
266 FileWrite $UninstallLog "$1$\r$\n"
\r
268 Goto "${Index}-Loop"
\r
273 !macro InstallFolder FOLDER
\r
274 File /r "${FOLDER}"
\r
276 Call InstallFolderInternal
\r
279 Function InstallFolderInternal
\r
281 !define Index 'Line${__LINE__}'
\r
282 FindFirst $0 $1 "$INSTDIR\$9\*"
\r
283 StrCmp $0 "" "${Index}-End"
\r
285 StrCmp $1 "" "${Index}-End"
\r
286 StrCmp $1 "." "${Index}-Next"
\r
287 StrCmp $1 ".." "${Index}-Next"
\r
288 IfFileExists "$9\$1\*" 0 "${Index}-Write"
\r
292 Call InstallFolderInternal
\r
295 Goto "${Index}-Next"
\r
297 FileWrite $UninstallLog "$9\$1$\r$\n"
\r
300 Goto "${Index}-Loop"
\r
306 ;;;;;;;;;;;;;;;;;;;;;;
\r
307 ; Installer sections ;
\r
308 ;;;;;;;;;;;;;;;;;;;;;;
\r
310 Section "Media player (required)" SEC01
\r
312 SetShellVarContext all
\r
313 SetOutPath "$INSTDIR"
\r
315 FileOpen $UninstallLog "$INSTDIR\uninstall.log" w
\r
316 FileSeek $UninstallLog 0 END
\r
318 !insertmacro InstallFile vlc.exe
\r
319 !insertmacro InstallFile vlc.exe.manifest
\r
321 !insertmacro InstallFile *.txt
\r
323 !insertmacro InstallFolder plugins
\r
324 !insertmacro InstallFolder locale
\r
325 !insertmacro InstallFolder osdmenu
\r
326 !insertmacro InstallFolder skins
\r
327 !insertmacro InstallFolder http
\r
329 WriteIniStr "$INSTDIR\${PRODUCT_NAME}.url" "InternetShortcut" "URL" \
\r
330 "${PRODUCT_WEB_SITE}"
\r
331 FileWrite $UninstallLog "${PRODUCT_NAME}.url$\r$\n"
\r
332 WriteIniStr "$INSTDIR\Documentation.url" "InternetShortcut" "URL" \
\r
333 "${PRODUCT_WEB_SITE}/doc/"
\r
334 FileWrite $UninstallLog "Documentation.url$\r$\n"
\r
336 FileClose $UninstallLog
\r
337 SetFileAttributes "$INSTDIR\uninstall.log" HIDDEN
\r
339 ; Add VLC to "recomended programs" for the following extensions
\r
340 WriteRegStr HKCR Applications\vlc.exe "" ""
\r
341 WriteRegStr HKCR Applications\vlc.exe "FriendlyAppName" "VLC media player"
\r
342 WriteRegStr HKCR Applications\vlc.exe\shell\Play "" "Play with VLC"
\r
343 WriteRegStr HKCR Applications\vlc.exe\shell\Play\command "" \
\r
344 '$INSTDIR\vlc.exe --one-instance-when-started-from-file "%1"'
\r
345 !insertmacro MacroAllExtensions WriteRegStrSupportedTypes
\r
347 WriteRegStr HKCR "AudioCD\shell\PlayWithVLC" "" "Play with VLC media player"
\r
348 WriteRegStr HKCR "AudioCD\shell\PlayWithVLC\command" "" \
\r
349 "$INSTDIR\vlc.exe --one-instance-when-started-from-file cdda:%1"
\r
350 WriteRegStr HKCR "DVD\shell\PlayWithVLC" "" "Play with VLC media player"
\r
351 WriteRegStr HKCR "DVD\shell\PlayWithVLC\command" "" \
\r
352 "$INSTDIR\vlc.exe --one-instance-when-started-from-file dvd:%1"
\r
354 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayDVDMovieOnArrival" "VLCPlayDVDMovieOnArrival" ""
\r
355 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "Action" "Play DVD movie"
\r
356 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "DefaultIcon" '"$INSTDIR\vlc.exe",0'
\r
357 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "InvokeProgID" "VLC.DVDMovie"
\r
358 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "InvokeVerb" "play"
\r
359 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "Provider" "VideoLAN VLC media player"
\r
361 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayCDAudioOnArrival" "VLCPlayCDAudioOnArrival" ""
\r
362 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "Action" "Play CD audio"
\r
363 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "DefaultIcon" '"$INSTDIR\vlc.exe --one-instance-when-started-from-file",0'
\r
364 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "InvokeProgID" "VLC.CDAudio"
\r
365 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "InvokeVerb" "play"
\r
366 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "Provider" "VideoLAN VLC media player"
\r
367 WriteRegStr HKCR "VLC.DVDMovie" "" "VLC DVD Movie"
\r
368 WriteRegStr HKCR "VLC.DVDMovie\shell" "" "Play"
\r
369 WriteRegStr HKCR "VLC.DVDMovie\shell\Play\command" "" \
\r
370 '$INSTDIR\vlc.exe --one-instance-when-started-from-file dvd:%1'
\r
371 WriteRegStr HKCR "VLC.DVDMovie\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'
\r
372 WriteRegStr HKCR "VLC.CDAudio" "" "VLC CD Audio"
\r
373 WriteRegStr HKCR "VLC.CDAudio\shell" "" "Play"
\r
374 WriteRegStr HKCR "VLC.CDAudio\shell\Play\command" "" \
\r
375 '$INSTDIR\vlc.exe --one-instance-when-started-from-file cdda:%1'
\r
376 WriteRegStr HKCR "VLC.CDAudio\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'
\r
380 Section "Start Menu Shortcut" SEC02a
\r
382 CreateDirectory "$SMPROGRAMS\VideoLAN"
\r
383 CreateShortCut "$SMPROGRAMS\VideoLAN\VLC media player.lnk" \
\r
384 "$INSTDIR\vlc.exe" "--intf wx --wx-embed"
\r
385 CreateShortCut "$SMPROGRAMS\VideoLAN\VLC media player (alt).lnk" \
\r
386 "$INSTDIR\vlc.exe" "--intf wx --no-wx-embed"
\r
387 CreateShortCut "$SMPROGRAMS\VideoLAN\VLC media player (skins).lnk" \
\r
388 "$INSTDIR\vlc.exe" "--intf skins"
\r
389 CreateShortCut "$SMPROGRAMS\VideoLAN\Reset VLC defaults and quit.lnk" \
\r
390 "$INSTDIR\vlc.exe" "--reset-config --reset-plugins-cache --save-config vlc:quit "
\r
391 CreateShortCut "$SMPROGRAMS\VideoLAN\${PRODUCT_NAME} Website.lnk" \
\r
392 "$INSTDIR\${PRODUCT_NAME}.url"
\r
393 CreateShortCut "$SMPROGRAMS\VideoLAN\Documentation.lnk" \
\r
394 "$INSTDIR\Documentation.url"
\r
397 Section "Desktop Shortcut" SEC02b
\r
399 CreateShortCut "$DESKTOP\VLC media player.lnk" \
\r
400 "$INSTDIR\vlc.exe" "--intf wx"
\r
403 Section /o "Mozilla plugin" SEC03
\r
407 ; doesn't work. bug in mozilla/mozilla firefox or moz documentation (xpt file isn't loaded)
\r
408 ; see mozilla bugs 184506 and 159445
\r
409 ;!define Moz "SOFTWARE\MozillaPlugins\@videolan.org/vlc,version=${VERSION}"
\r
410 ;WriteRegStr HKLM ${Moz} "Description" "VideoLAN VLC plugin for Mozilla"
\r
411 ;WriteRegStr HKLM ${Moz} "Path" "$INSTDIR\mozilla\npvlc.dll"
\r
412 ;WriteRegStr HKLM ${Moz} "Product" "VLC media player"
\r
413 ;WriteRegStr HKLM ${Moz} "Vendor" "VideoLAN"
\r
414 ;WriteRegStr HKLM ${Moz} "Version" "${VERSION}"
\r
415 ;WriteRegStr HKLM ${Moz} "XPTPath" "$INSTDIR\mozilla\vlcintf.xpt"
\r
421 !define Index 'Line${__LINE__}'
\r
427 EnumRegKey $R0 HKLM "SOFTWARE\Mozilla" "$R1"
\r
428 StrCmp $R0 "" "${Index}-End"
\r
430 ReadRegStr $R2 HKLM "SOFTWARE\Mozilla\$R0\Extensions" "Plugins"
\r
431 StrCmp $R2 "" "${Index}-Loop" ""
\r
433 CopyFiles "$INSTDIR\mozilla\*" "$R2"
\r
434 Goto "${Index}-Loop"
\r
441 Section "ActiveX plugin" SEC04
\r
443 SetOutPath "$INSTDIR"
\r
444 File activex\axvlc.dll
\r
445 RegDLL "$INSTDIR\axvlc.dll"
\r
448 Section "Context Menus" SEC05
\r
450 !insertmacro MacroAllExtensions AddContextMenu
\r
451 !insertmacro AddContextMenu "Directory"
\r
454 SectionGroup "File type associations" SEC06
\r
455 SectionGroup "Audio Files"
\r
456 !insertmacro MacroAudioExtensions RegisterExtensionSection
\r
458 SectionGroup "Video Files"
\r
459 !insertmacro MacroVideoExtensions RegisterExtensionSection
\r
461 SectionGroup "Other"
\r
462 !insertmacro MacroOtherExtensions RegisterExtensionSection
\r
466 Section /o "Delete preferences and cache" SEC07
\r
467 !insertmacro delprefs
\r
470 ; Installer section descriptions
\r
471 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
\r
472 !insertmacro MUI_DESCRIPTION_TEXT ${SEC01} \
\r
473 "The media player itself"
\r
474 !insertmacro MUI_DESCRIPTION_TEXT ${SEC02a} \
\r
475 "Adds icons to your start menu for easy access"
\r
476 !insertmacro MUI_DESCRIPTION_TEXT ${SEC02b} \
\r
477 "Adds icon to your desktop for easy access"
\r
478 !insertmacro MUI_DESCRIPTION_TEXT ${SEC03} \
\r
479 "The VLC Mozilla and Mozilla Firefox plugin"
\r
480 !insertmacro MUI_DESCRIPTION_TEXT ${SEC04} \
\r
481 "The VLC ActiveX plugin"
\r
482 !insertmacro MUI_DESCRIPTION_TEXT ${SEC05} \
\r
483 "Add context menu items ('Play With VLC' and 'Add To VLC's Playlist')"
\r
484 !insertmacro MUI_DESCRIPTION_TEXT ${SEC06} \
\r
485 "Sets VLC media player as the default application for the specified file type"
\r
486 !insertmacro MUI_DESCRIPTION_TEXT ${SEC07} \
\r
487 "Deletes VLC media player preferences and cache files leftover from previous installations"
\r
488 !insertmacro MUI_FUNCTION_DESCRIPTION_END
\r
491 ReadRegStr $R0 ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
\r
495 MessageBox MB_YESNO|MB_ICONEXCLAMATION \
\r
496 "VLC media player has already been installed. $\nDo you want to remove \
\r
497 the previous version before installing $(^Name) ?" \
\r
500 ;Run the uninstaller
\r
503 ExecWait '$R0 _?=$INSTDIR' ;Do not copy the uninstaller to a temp file
\r
505 !insertmacro MUI_LANGDLL_DISPLAY
\r
509 WriteUninstaller "$INSTDIR\uninstall.exe"
\r
510 WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "InstallDir" $INSTDIR
\r
511 WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "Version" "${VERSION}"
\r
512 WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\vlc.exe"
\r
514 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
\r
515 "DisplayName" "$(^Name)"
\r
516 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
\r
517 "UninstallString" "$INSTDIR\uninstall.exe"
\r
518 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
\r
519 "DisplayIcon" "$INSTDIR\vlc.exe"
\r
520 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
\r
521 "DisplayVersion" "${PRODUCT_VERSION}"
\r
522 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
\r
523 "URLInfoAbout" "${PRODUCT_WEB_SITE}"
\r
524 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
\r
525 "Publisher" "${PRODUCT_PUBLISHER}"
\r
528 ;;;;;;;;;;;;;;;;;;;;;;;;
\r
529 ; Uninstaller sections ;
\r
530 ;;;;;;;;;;;;;;;;;;;;;;;;
\r
532 ; TrimNewlines (copied from NSIS documentation)
\r
533 ; input, top of stack (e.g. whatever$\r$\n)
\r
534 ; output, top of stack (replaces, with e.g. whatever)
\r
535 ; modifies no other variables.
\r
537 Function un.TrimNewlines
\r
545 StrCpy $R2 $R0 1 $R1
\r
546 StrCmp $R2 "$\r" loop
\r
547 StrCmp $R2 "$\n" loop
\r
549 IntCmp $R1 0 no_trim_needed
\r
558 Function un.RemoveEmptyDirs
\r
560 !define Index 'Line${__LINE__}'
\r
561 FindFirst $0 $1 "$INSTDIR$9*"
\r
562 StrCmp $0 "" "${Index}-End"
\r
564 StrCmp $1 "" "${Index}-End"
\r
565 StrCmp $1 "." "${Index}-Next"
\r
566 StrCmp $1 ".." "${Index}-Next"
\r
571 Call un.RemoveEmptyDirs
\r
576 RMDir "$INSTDIR$9$1"
\r
579 Goto "${Index}-Loop"
\r
585 Section "Uninstall" SEC91
\r
587 SetShellVarContext all
\r
589 !insertmacro MacroAllExtensions DeleteContextMenu
\r
590 !insertmacro MacroAllExtensions UnRegisterExtensionSection
\r
591 !insertmacro DeleteContextMenu "Directory"
\r
593 UnRegDLL "$INSTDIR\axvlc.dll"
\r
594 Delete /REBOOTOK "$INSTDIR\axvlc.dll"
\r
596 ;remove mozilla plugin
\r
601 !define Index 'Line${__LINE__}'
\r
607 EnumRegKey $R0 HKLM "SOFTWARE\Mozilla" "$R1"
\r
608 StrCmp $R0 "" "${Index}-End"
\r
610 ReadRegStr $R2 HKLM "SOFTWARE\Mozilla\$R0\Extensions" "Plugins"
\r
611 StrCmp $R2 "" "${Index}-Loop" ""
\r
613 Delete "$R2\vlcintf.xpt"
\r
614 Delete "$R2\npvlc.dll"
\r
615 Goto "${Index}-Loop"
\r
620 RMDir "$SMPROGRAMS\VideoLAN"
\r
621 RMDir /r $SMPROGRAMS\VideoLAN
\r
623 FileOpen $UninstallLog "$INSTDIR\uninstall.log" r
\r
626 FileRead $UninstallLog $R0
\r
627 IfErrors UninstallEnd
\r
629 Call un.TrimNewLines
\r
631 Delete "$INSTDIR\$R0"
\r
634 FileClose $UninstallLog
\r
635 Delete "$INSTDIR\uninstall.log"
\r
636 Delete "$INSTDIR\uninstall.exe"
\r
638 Call un.RemoveEmptyDirs
\r
641 DeleteRegKey HKLM Software\VideoLAN
\r
643 DeleteRegKey HKCR Applications\vlc.exe
\r
644 DeleteRegKey HKCR AudioCD\shell\PlayWithVLC
\r
645 DeleteRegKey HKCR DVD\shell\PlayWithVLC
\r
646 DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayDVDMovieOnArrival" "VLCPlayDVDMovieOnArrival"
\r
647 DeleteRegKey HKLM Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival
\r
648 DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayCDAudioOnArrival" "VLCPlayCDAudioOnArrival"
\r
649 DeleteRegKey HKLM Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival
\r
650 DeleteRegKey HKCR "VLC.MediaFile"
\r
652 DeleteRegKey HKLM \
\r
653 "SOFTWARE\MozillaPlugins\@videolan.org/vlc,version=${VERSION}"
\r
655 DeleteRegKey HKLM \
\r
656 "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
\r
658 Delete "$DESKTOP\VLC media player.lnk"
\r
660 DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
\r
661 DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}"
\r
665 Section /o "un.Delete preferences and cache" SEC92
\r
667 !insertmacro delprefs
\r
670 ; Uninstaller section descriptions
\r
671 !insertmacro MUI_UNFUNCTION_DESCRIPTION_BEGIN
\r
672 !insertmacro MUI_DESCRIPTION_TEXT ${SEC91} \
\r
673 "Uninstall VLC media player and all its components"
\r
674 !insertmacro MUI_DESCRIPTION_TEXT ${SEC92} \
\r
675 "Deletes VLC media player preferences and cache files"
\r
676 !insertmacro MUI_UNFUNCTION_DESCRIPTION_END
\r
678 ;Function un.onUninstSuccess
\r
680 ; MessageBox MB_ICONINFORMATION|MB_OK \
\r
681 ; "$(^Name) was successfully removed from your computer."
\r
685 !insertmacro MUI_LANGDLL_DISPLAY
\r