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