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"
105 !insertmacro MUI_LANGUAGE
"Romanian"
107 !insertmacro MUI_RESERVEFILE_LANGDLL
110 !insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
118 !macro MacroAudioExtensions _action
119 !insertmacro ${_action} ".a52"
120 !insertmacro ${_action} ".aac"
121 !insertmacro ${_action} ".ac3"
122 !insertmacro ${_action} ".dts"
123 !insertmacro ${_action} ".flac"
124 !insertmacro ${_action} ".mka"
125 !insertmacro ${_action} ".mp1"
126 !insertmacro ${_action} ".mp2"
127 !insertmacro ${_action} ".mp3"
128 !insertmacro ${_action} ".ogg"
129 !insertmacro ${_action} ".spx"
130 !insertmacro ${_action} ".wav"
131 !insertmacro ${_action} ".wma"
134 !macro MacroVideoExtensions _action
135 !insertmacro ${_action} ".asf"
136 !insertmacro ${_action} ".avi"
137 !insertmacro ${_action} ".divx"
138 !insertmacro ${_action} ".dv"
139 !insertmacro ${_action} ".m1v"
140 !insertmacro ${_action} ".m2v"
141 !insertmacro ${_action} ".mkv"
142 !insertmacro ${_action} ".mov"
143 !insertmacro ${_action} ".mp4"
144 !insertmacro ${_action} ".mpeg"
145 !insertmacro ${_action} ".mpeg1"
146 !insertmacro ${_action} ".mpeg2"
147 !insertmacro ${_action} ".mpeg4"
148 !insertmacro ${_action} ".mpg"
149 !insertmacro ${_action} ".mxf"
150 !insertmacro ${_action} ".ps"
151 !insertmacro ${_action} ".ts"
152 !insertmacro ${_action} ".ogm"
153 !insertmacro ${_action} ".vob"
154 !insertmacro ${_action} ".wmv"
157 !macro MacroOtherExtensions _action
158 !insertmacro ${_action} ".asx"
159 !insertmacro ${_action} ".bin"
160 !insertmacro ${_action} ".cue"
161 !insertmacro ${_action} ".m3u"
162 !insertmacro ${_action} ".pls"
163 !insertmacro ${_action} ".vlc"
166 !macro MacroAllExtensions _action
167 !insertmacro MacroAudioExtensions
${_action}
168 !insertmacro MacroVideoExtensions
${_action}
169 !insertmacro MacroOtherExtensions
${_action}
172 ;;;;;;;;;;;;;;;;;;;;;;;;;;
173 ; File type associations ;
174 ;;;;;;;;;;;;;;;;;;;;;;;;;;
176 Function RegisterExtension
177 ; back up old value for extension $R0 (eg. ".opt")
178 ReadRegStr $1 HKCR "$R0" ""
179 StrCmp $1 "" NoBackup
180 StrCmp $1 "VLC$R0" "NoBackup"
181 WriteRegStr HKCR "$R0" "VLC.backup" $1
183 WriteRegStr HKCR "$R0" "" "VLC$R0"
184 ReadRegStr $0 HKCR "VLC$R0" ""
185 WriteRegStr HKCR "VLC$R0" "" "VLC media file ($R0)"
186 WriteRegStr HKCR "VLC$R0\shell" "" "Play"
187 WriteRegStr HKCR "VLC$R0\shell\Play\command" "" '"$INSTDIR\vlc.exe" --started-from-file "%1"'
188 WriteRegStr HKCR "VLC$R0\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'
191 Function un
.RegisterExtension
192 ;start of restore script
193 ReadRegStr $1 HKCR "$R0" ""
194 StrCmp $1 "VLC$R0" 0 NoOwn
; only do this if we own it
195 ReadRegStr $1 HKCR "$R0" "VLC.backup"
196 StrCmp $1 "" 0 Restore
; if backup="" then delete the whole key
197 DeleteRegKey HKCR "$R0"
200 WriteRegStr HKCR "$R0" "" $1
201 DeleteRegValue HKCR "$R0" "VLC.backup"
203 DeleteRegKey HKCR "VLC$R0" ;Delete key with association settings
206 !macro RegisterExtensionSection
EXT
211 Call RegisterExtension
216 !macro UnRegisterExtensionSection
EXT
219 Call un
.RegisterExtension
223 !macro WriteRegStrSupportedTypes
EXT
224 WriteRegStr HKCR Applications\vlc
.exe\SupportedTypes
${EXT} ""
227 ;;;;;;;;;;;;;;;;;;;;;;;;
228 ; Context menu entries ;
229 ;;;;;;;;;;;;;;;;;;;;;;;;
231 !macro AddContextMenuExt
EXT
232 WriteRegStr HKCR ${EXT}\shell\PlayWithVLC
"" "Play with VLC media player"
233 WriteRegStr HKCR ${EXT}\shell\PlayWithVLC\command
"" '$INSTDIR\vlc.exe --started-from-file --no-playlist-enqueue "%1"'
235 WriteRegStr HKCR ${EXT}\shell\AddToPlaylistVLC
"" "Add to VLC media player's Playlist"
236 WriteRegStr HKCR ${EXT}\shell\AddToPlaylistVLC\command
"" '$INSTDIR\vlc.exe --started-from-file --playlist-enqueue "%1"'
239 !macro AddContextMenu
EXT
241 ReadRegStr $R0 HKCR ${EXT} ""
242 !insertmacro AddContextMenuExt
$R0
246 !macro DeleteContextMenuExt
EXT
247 DeleteRegKey HKCR ${EXT}\shell\PlayWithVLC
248 DeleteRegKey HKCR ${EXT}\shell\AddToPlaylistVLC
251 !macro DeleteContextMenu
EXT
253 ReadRegStr $R0 HKCR ${EXT} ""
254 !insertmacro DeleteContextMenuExt
$R0
258 ;;;;;;;;;;;;;;;;;;;;;;;;;;
259 ; Delete prefs and cache ;
260 ;;;;;;;;;;;;;;;;;;;;;;;;;;
264 !define Index
'Line${__LINE__}'
267 ; this will loop through all the logged users and "virtual" windows users
268 ; (it looks like users are only present in HKEY_USERS when they are logged in)
270 EnumRegKey $1 HKU "" $0
271 StrCmp $1 "" "${Index}-End"
273 ReadRegStr $2 HKU "$1\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" AppData
274 StrCmp $2 "" "${Index}-Loop"
283 !macro OpenUninstallLog
284 FileOpen $UninstallLog "$INSTDIR\uninstall.log" a
285 FileSeek $UninstallLog 0 END
288 !macro CloseUninstallLog
289 FileClose $UninstallLog
290 SetFileAttributes "$INSTDIR\uninstall.log" HIDDEN
293 !macro InstallFile FILEREGEX
295 !define Index
'Line${__LINE__}'
296 FindFirst $0 $1 "$INSTDIR\${FILEREGEX}"
297 StrCmp $0 "" "${Index}-End"
299 StrCmp $1 "" "${Index}-End"
300 FileWrite $UninstallLog "$1$\r$\n"
307 !macro InstallFolder FOLDER
310 Call InstallFolderInternal
313 Function InstallFolderInternal
315 !define Index
'Line${__LINE__}'
316 FindFirst $0 $1 "$INSTDIR\$9\*"
317 StrCmp $0 "" "${Index}-End"
319 StrCmp $1 "" "${Index}-End"
320 StrCmp $1 "." "${Index}-Next"
321 StrCmp $1 ".." "${Index}-Next"
322 IfFileExists "$9\$1\*" 0 "${Index}-Write"
326 Call InstallFolderInternal
331 FileWrite $UninstallLog "$9\$1$\r$\n"
340 ;;;;;;;;;;;;;;;;;;;;;;
341 ; Installer sections ;
342 ;;;;;;;;;;;;;;;;;;;;;;
344 Section "Media player (required)" SEC01
346 SetShellVarContext all
347 SetOutPath "$INSTDIR"
349 !insertmacro OpenUninstallLog
351 !insertmacro InstallFile vlc
.exe
352 !insertmacro InstallFile vlc
.exe
.manifest
354 !insertmacro InstallFile
${LIBVLC_DLL}
356 !ifdef LIBVLC_CONTROL_DLL
357 !insertmacro InstallFile
${LIBVLC_CONTROL_DLL}
359 !insertmacro InstallFile
*.txt
361 !insertmacro InstallFolder plugins
362 !insertmacro InstallFolder locale
363 !insertmacro InstallFolder osdmenu
364 !insertmacro InstallFolder skins
365 !insertmacro InstallFolder http
366 !insertmacro InstallFolder share
368 WriteIniStr
"$INSTDIR\${PRODUCT_GROUP} Website.url" "InternetShortcut" "URL" \
369 "${PRODUCT_WEB_SITE}"
370 FileWrite $UninstallLog "${PRODUCT_GROUP} Website.url$\r$\n"
371 WriteIniStr
"$INSTDIR\Documentation.url" "InternetShortcut" "URL" \
372 "${PRODUCT_WEB_SITE}/doc/"
373 FileWrite $UninstallLog "Documentation.url$\r$\n"
375 !insertmacro CloseUninstallLog
377 ; Add VLC to "recomended programs" for the following extensions
378 WriteRegStr HKCR Applications\vlc
.exe
"" ""
379 WriteRegStr HKCR Applications\vlc
.exe
"FriendlyAppName" "VLC media player"
380 WriteRegStr HKCR Applications\vlc
.exe\shell\Play
"" "Play with VLC"
381 WriteRegStr HKCR Applications\vlc
.exe\shell\Play\command
"" \
382 '$INSTDIR\vlc.exe --started-from-file "%1"'
383 !insertmacro MacroAllExtensions WriteRegStrSupportedTypes
385 WriteRegStr HKCR "AudioCD\shell\PlayWithVLC" "" "Play with VLC media player"
386 WriteRegStr HKCR "AudioCD\shell\PlayWithVLC\command" "" \
387 "$INSTDIR\vlc.exe --started-from-file cdda:%1"
388 WriteRegStr HKCR "DVD\shell\PlayWithVLC" "" "Play with VLC media player"
389 WriteRegStr HKCR "DVD\shell\PlayWithVLC\command" "" \
390 "$INSTDIR\vlc.exe --started-from-file dvd:%1"
392 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayDVDMovieOnArrival" "VLCPlayDVDMovieOnArrival" ""
393 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "Action" "Play DVD movie"
394 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "DefaultIcon" '"$INSTDIR\vlc.exe",0'
395 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "InvokeProgID" "VLC.DVDMovie"
396 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "InvokeVerb" "play"
397 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "Provider" "VideoLAN VLC media player"
399 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayCDAudioOnArrival" "VLCPlayCDAudioOnArrival" ""
400 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "Action" "Play CD audio"
401 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "DefaultIcon" '"$INSTDIR\vlc.exe --started-from-file",0'
402 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "InvokeProgID" "VLC.CDAudio"
403 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "InvokeVerb" "play"
404 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "Provider" "VideoLAN VLC media player"
405 WriteRegStr HKCR "VLC.DVDMovie" "" "VLC DVD Movie"
406 WriteRegStr HKCR "VLC.DVDMovie\shell" "" "Play"
407 WriteRegStr HKCR "VLC.DVDMovie\shell\Play\command" "" \
408 '$INSTDIR\vlc.exe --started-from-file dvd:%1'
409 WriteRegStr HKCR "VLC.DVDMovie\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'
410 WriteRegStr HKCR "VLC.CDAudio" "" "VLC CD Audio"
411 WriteRegStr HKCR "VLC.CDAudio\shell" "" "Play"
412 WriteRegStr HKCR "VLC.CDAudio\shell\Play\command" "" \
413 '$INSTDIR\vlc.exe --started-from-file cdda:%1'
414 WriteRegStr HKCR "VLC.CDAudio\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'
418 Section "Start Menu Shortcut" SEC02a
420 CreateDirectory "$SMPROGRAMS\VideoLAN"
421 CreateDirectory "$SMPROGRAMS\VideoLAN\Quick Settings"
422 CreateDirectory "$SMPROGRAMS\VideoLAN\Quick Settings\Audio"
423 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Audio\Set Audio mode to DirectX (default).lnk" \
424 "$INSTDIR\vlc.exe" "--aout aout_directx --save-config vlc:quit"
425 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Audio\Set Audio mode to Waveout.lnk" \
426 "$INSTDIR\vlc.exe" "--aout waveout --save-config vlc:quit"
427 CreateDirectory "$SMPROGRAMS\VideoLAN\Quick Settings\Interface"
428 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Interface\Set Main Interface to Skinnable.lnk" \
429 "$INSTDIR\vlc.exe" "-I skins --save-config vlc:quit"
430 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Interface\Set Main Interface to wxWidgets (default).lnk" \
431 "$INSTDIR\vlc.exe" "-I wxwin --save-config vlc:quit"
432 CreateDirectory "$SMPROGRAMS\VideoLAN\Quick Settings\Video"
433 ; FIXME add detection for Vista. Direct3D will be default there, for all others it's DirectX
434 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to Direct3D.lnk" \
435 "$INSTDIR\vlc.exe" "--vout direct3d --overlay --directx-hw-yuv --save-config vlc:quit"
436 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to Direct3D (no hardware acceleration).lnk" \
437 "$INSTDIR\vlc.exe" "--vout direct3d --overlay --no-directx-hw-yuv --save-config vlc:quit"
438 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to DirectX.lnk" \
439 "$INSTDIR\vlc.exe" "--vout directx --overlay --directx-hw-yuv --save-config vlc:quit"
440 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to DirectX (no hardware acceleration).lnk" \
441 "$INSTDIR\vlc.exe" "--vout directx --no-overlay --no-directx-hw-yuv --save-config vlc:quit"
442 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to DirectX (no video overlay).lnk" \
443 "$INSTDIR\vlc.exe" "--vout directx --no-overlay --directx-hw-yuv --save-config vlc:quit"
444 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to OpenGL.lnk" \
445 "$INSTDIR\vlc.exe" "--vout opengl --overlay --save-config vlc:quit"
446 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Reset VLC media player preferences and cache files.lnk" \
447 "$INSTDIR\vlc.exe" "--reset-config --reset-plugins-cache --save-config vlc:quit"
448 CreateShortCut "$SMPROGRAMS\VideoLAN\Documentation.lnk" \
449 "$INSTDIR\Documentation.url"
450 CreateShortCut "$SMPROGRAMS\VideoLAN\Release Notes.lnk" \
451 "$INSTDIR\NEWS.txt" ""
452 CreateShortCut "$SMPROGRAMS\VideoLAN\${PRODUCT_GROUP} Website.lnk" \
453 "$INSTDIR\${PRODUCT_GROUP} Website.url"
454 CreateShortCut "$SMPROGRAMS\VideoLAN\VLC media player.lnk" \
455 "$INSTDIR\vlc.exe" ""
458 Section "Desktop Shortcut" SEC02b
460 CreateShortCut "$DESKTOP\VLC media player.lnk" \
461 "$INSTDIR\vlc.exe" ""
464 Section /o
"Mozilla plugin" SEC03
467 SetOutPath "$INSTDIR"
468 !insertmacro OpenUninstallLog
469 !insertmacro InstallFile mozilla\npvlc
.dll
470 !insertmacro CloseUninstallLog
472 !define Moz
"SOFTWARE\MozillaPlugins\@videolan.org/vlc,version=${VERSION}"
473 WriteRegStr HKLM ${Moz} "Description" "VLC Multimedia Plugin"
474 WriteRegStr HKLM ${Moz} "Path" "$INSTDIR\npvlc.dll"
475 WriteRegStr HKLM ${Moz} "Product" "VLC media player"
476 WriteRegStr HKLM ${Moz} "Vendor" "VideoLAN"
477 WriteRegStr HKLM ${Moz} "Version" "${VERSION}"
479 ; for very old version of mozilla, these lines may be needed
484 ;!define Index 'Line${__LINE__}'
490 ; EnumRegKey $R0 HKLM "SOFTWARE\Mozilla" "$R1"
491 ; StrCmp $R0 "" "${Index}-End"
493 ; ReadRegStr $R2 HKLM "SOFTWARE\Mozilla\$R0\Extensions" "Plugins"
494 ; StrCmp $R2 "" "${Index}-Loop" ""
496 ; CopyFiles "$INSTDIR\npvlc.dll" "$R2"
498 ; CopyFiles ${LIBVLC_DLL} "$R2"
500 ; !ifdef LIBVLC_CONTROL_DLL
501 ; CopyFiles ${LIBVLC_CONTROL_DLL} "$R2"
503 ; Goto "${Index}-Loop"
510 Section "ActiveX plugin" SEC04
512 SetOutPath "$INSTDIR"
513 !insertmacro OpenUninstallLog
514 !insertmacro InstallFile activex\axvlc
.dll
515 !insertmacro CloseUninstallLog
516 RegDLL "$INSTDIR\axvlc.dll"
519 SectionGroup
"File type associations" SEC06
520 SectionGroup
"Audio Files"
521 !insertmacro MacroAudioExtensions RegisterExtensionSection
523 SectionGroup
"Video Files"
524 !insertmacro MacroVideoExtensions RegisterExtensionSection
527 !insertmacro MacroOtherExtensions RegisterExtensionSection
531 Section /o
"Context Menus" SEC05
533 !insertmacro MacroAllExtensions AddContextMenu
534 !insertmacro AddContextMenuExt
"Directory"
537 Section /o
"Delete preferences and cache" SEC07
538 !insertmacro delprefs
541 ; Installer section descriptions
542 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
543 !insertmacro MUI_DESCRIPTION_TEXT
${SEC01} \
544 "The media player itself"
545 !insertmacro MUI_DESCRIPTION_TEXT
${SEC02a} \
546 "Adds icons to your start menu for easy access"
547 !insertmacro MUI_DESCRIPTION_TEXT
${SEC02b} \
548 "Adds icon to your desktop for easy access"
549 !insertmacro MUI_DESCRIPTION_TEXT
${SEC03} \
550 "The VLC Mozilla and Mozilla Firefox plugin"
551 !insertmacro MUI_DESCRIPTION_TEXT
${SEC04} \
552 "The VLC ActiveX plugin"
553 !insertmacro MUI_DESCRIPTION_TEXT
${SEC05} \
554 "Add context menu items ('Play With VLC' and 'Add To VLC's Playlist')"
555 !insertmacro MUI_DESCRIPTION_TEXT
${SEC06} \
556 "Sets VLC media player as the default application for the specified file type"
557 !insertmacro MUI_DESCRIPTION_TEXT
${SEC07} \
558 "Deletes VLC media player preferences and cache files leftover from previous installations"
559 !insertmacro MUI_FUNCTION_DESCRIPTION_END
562 ReadRegStr $R0 ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
566 MessageBox MB_YESNO|
MB_ICONEXCLAMATION \
567 "VLC media player has already been installed. $\nDo you want to remove \
568 the previous version before installing $(^Name) ?" \
574 ExecWait '$R0 _?=$INSTDIR' ;Do not copy the uninstaller to a temp file
576 !insertmacro MUI_LANGDLL_DISPLAY
580 WriteUninstaller "$INSTDIR\uninstall.exe"
581 WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "InstallDir" $INSTDIR
582 WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "Version" "${VERSION}"
583 WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\vlc.exe"
585 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
586 "DisplayName" "$(^Name)"
587 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
588 "UninstallString" "$INSTDIR\uninstall.exe"
589 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
590 "DisplayIcon" "$INSTDIR\vlc.exe"
591 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
592 "DisplayVersion" "${PRODUCT_VERSION}"
593 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
594 "URLInfoAbout" "${PRODUCT_WEB_SITE}"
595 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
596 "Publisher" "${PRODUCT_PUBLISHER}"
599 ;;;;;;;;;;;;;;;;;;;;;;;;
600 ; Uninstaller sections ;
601 ;;;;;;;;;;;;;;;;;;;;;;;;
603 ; TrimNewlines (copied from NSIS documentation)
604 ; input, top of stack (e.g. whatever$\r$\n)
605 ; output, top of stack (replaces, with e.g. whatever)
606 ; modifies no other variables.
608 Function un
.TrimNewlines
617 StrCmp $R2 "$\r" loop
618 StrCmp $R2 "$\n" loop
620 IntCmp $R1 0 no_trim_needed
629 Function un
.RemoveEmptyDirs
631 !define Index
'Line${__LINE__}'
632 FindFirst $0 $1 "$INSTDIR$9*"
633 StrCmp $0 "" "${Index}-End"
635 StrCmp $1 "" "${Index}-End"
636 StrCmp $1 "." "${Index}-Next"
637 StrCmp $1 ".." "${Index}-Next"
642 Call un
.RemoveEmptyDirs
656 Section "Uninstall" SEC91
658 SetShellVarContext all
660 !insertmacro MacroAllExtensions DeleteContextMenu
661 !insertmacro MacroAllExtensions UnRegisterExtensionSection
662 !insertmacro DeleteContextMenuExt
"Directory"
664 ;remove activex plugin
665 UnRegDLL "$INSTDIR\axvlc.dll"
666 Delete /REBOOTOK
"$INSTDIR\axvlc.dll"
668 ;remove mozilla plugin
673 !define Index
'Line${__LINE__}'
679 EnumRegKey $R0 HKLM "SOFTWARE\Mozilla" "$R1"
680 StrCmp $R0 "" "${Index}-End"
682 ReadRegStr $R2 HKLM "SOFTWARE\Mozilla\$R0\Extensions" "Plugins"
683 StrCmp $R2 "" "${Index}-Loop" ""
685 ; old files (0.8.5 and before) that may be lying around
686 Delete /REBOOTOK
"$R2\npvlc.dll"
687 Delete /REBOOTOK
"$R2\libvlc.dll"
688 Delete /REBOOTOK
"$R2\vlcintf.xpt"
693 Delete /REBOOTOK
"$INSTDIR\npvlc.dll"
695 RMDir "$SMPROGRAMS\VideoLAN"
696 RMDir /r
$SMPROGRAMS\VideoLAN
698 FileOpen $UninstallLog "$INSTDIR\uninstall.log" r
701 FileRead $UninstallLog $R0
702 IfErrors UninstallEnd
706 Delete "$INSTDIR\$R0"
709 FileClose $UninstallLog
710 Delete "$INSTDIR\uninstall.log"
711 Delete "$INSTDIR\uninstall.exe"
713 Call un
.RemoveEmptyDirs
716 DeleteRegKey HKLM Software\VideoLAN
718 DeleteRegKey HKCR Applications\vlc
.exe
719 DeleteRegKey HKCR AudioCD\shell\PlayWithVLC
720 DeleteRegKey HKCR DVD\shell\PlayWithVLC
721 DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayDVDMovieOnArrival" "VLCPlayDVDMovieOnArrival"
722 DeleteRegKey HKLM Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival
723 DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayCDAudioOnArrival" "VLCPlayCDAudioOnArrival"
724 DeleteRegKey HKLM Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival
725 DeleteRegKey HKCR "VLC.MediaFile"
728 "SOFTWARE\MozillaPlugins\@videolan.org/vlc,version=${VERSION}"
731 "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
733 Delete "$DESKTOP\VLC media player.lnk"
735 DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
736 DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}"
740 Section /o
"un.Delete preferences and cache" SEC92
741 !insertmacro delprefs
744 ; Uninstaller section descriptions
745 !insertmacro MUI_UNFUNCTION_DESCRIPTION_BEGIN
746 !insertmacro MUI_DESCRIPTION_TEXT
${SEC91} \
747 "Uninstall VLC media player and all its components"
748 !insertmacro MUI_DESCRIPTION_TEXT
${SEC92} \
749 "Deletes VLC media player preferences and cache files"
750 !insertmacro MUI_UNFUNCTION_DESCRIPTION_END
752 ;Function un.onUninstSuccess
754 ; MessageBox MB_ICONINFORMATION|MB_OK \
755 ; "$(^Name) was successfully removed from your computer."
759 !insertmacro MUI_UNGETLANGUAGE