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"
106 !insertmacro MUI_LANGUAGE
"Slovak"
107 !insertmacro MUI_LANGUAGE
"Czech"
109 !insertmacro MUI_RESERVEFILE_LANGDLL
112 !insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
120 !macro MacroAudioExtensions _action
121 !insertmacro ${_action} ".a52"
122 !insertmacro ${_action} ".aac"
123 !insertmacro ${_action} ".ac3"
124 !insertmacro ${_action} ".dts"
125 !insertmacro ${_action} ".flac"
126 !insertmacro ${_action} ".mka"
127 !insertmacro ${_action} ".mp1"
128 !insertmacro ${_action} ".mp2"
129 !insertmacro ${_action} ".mp3"
130 !insertmacro ${_action} ".ogg"
131 !insertmacro ${_action} ".spx"
132 !insertmacro ${_action} ".wav"
133 !insertmacro ${_action} ".wma"
136 !macro MacroVideoExtensions _action
137 !insertmacro ${_action} ".asf"
138 !insertmacro ${_action} ".avi"
139 !insertmacro ${_action} ".divx"
140 !insertmacro ${_action} ".dv"
141 !insertmacro ${_action} ".m1v"
142 !insertmacro ${_action} ".m2v"
143 !insertmacro ${_action} ".mkv"
144 !insertmacro ${_action} ".mov"
145 !insertmacro ${_action} ".mp4"
146 !insertmacro ${_action} ".mpeg"
147 !insertmacro ${_action} ".mpeg1"
148 !insertmacro ${_action} ".mpeg2"
149 !insertmacro ${_action} ".mpeg4"
150 !insertmacro ${_action} ".mpg"
151 !insertmacro ${_action} ".mxf"
152 !insertmacro ${_action} ".ps"
153 !insertmacro ${_action} ".ts"
154 !insertmacro ${_action} ".ogm"
155 !insertmacro ${_action} ".vob"
156 !insertmacro ${_action} ".wmv"
159 !macro MacroOtherExtensions _action
160 !insertmacro ${_action} ".asx"
161 !insertmacro ${_action} ".bin"
162 !insertmacro ${_action} ".cue"
163 !insertmacro ${_action} ".m3u"
164 !insertmacro ${_action} ".pls"
165 !insertmacro ${_action} ".vlc"
168 !macro MacroAllExtensions _action
169 !insertmacro MacroAudioExtensions
${_action}
170 !insertmacro MacroVideoExtensions
${_action}
171 !insertmacro MacroOtherExtensions
${_action}
174 ;;;;;;;;;;;;;;;;;;;;;;;;;;
175 ; File type associations ;
176 ;;;;;;;;;;;;;;;;;;;;;;;;;;
178 Function RegisterExtension
179 ; back up old value for extension $R0 (eg. ".opt")
180 ReadRegStr $1 HKCR "$R0" ""
181 StrCmp $1 "" NoBackup
182 StrCmp $1 "VLC$R0" "NoBackup"
183 WriteRegStr HKCR "$R0" "VLC.backup" $1
185 WriteRegStr HKCR "$R0" "" "VLC$R0"
186 ReadRegStr $0 HKCR "VLC$R0" ""
187 WriteRegStr HKCR "VLC$R0" "" "VLC media file ($R0)"
188 WriteRegStr HKCR "VLC$R0\shell" "" "Play"
189 WriteRegStr HKCR "VLC$R0\shell\Play\command" "" '"$INSTDIR\vlc.exe" --started-from-file "%1"'
190 WriteRegStr HKCR "VLC$R0\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'
193 ReadRegStr $R1 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion
195 StrCmp $R2 '6.0' ForVista ToEnd
197 WriteRegStr HKLM "Software\Clients\Media\VLC\Capabilities\FileAssociations" "$R0" "VLC$R0"
202 Function un
.RegisterExtension
203 ;start of restore script
204 ReadRegStr $1 HKCR "$R0" ""
205 StrCmp $1 "VLC$R0" 0 NoOwn
; only do this if we own it
206 ReadRegStr $1 HKCR "$R0" "VLC.backup"
207 StrCmp $1 "" 0 Restore
; if backup="" then delete the whole key
208 DeleteRegKey HKCR "$R0"
211 WriteRegStr HKCR "$R0" "" $1
212 DeleteRegValue HKCR "$R0" "VLC.backup"
214 DeleteRegKey HKCR "VLC$R0" ;Delete key with association settings
217 !macro RegisterExtensionSection
EXT
222 Call RegisterExtension
227 !macro UnRegisterExtensionSection
EXT
230 Call un
.RegisterExtension
234 !macro WriteRegStrSupportedTypes
EXT
235 WriteRegStr HKCR Applications\vlc
.exe\SupportedTypes
${EXT} ""
238 ;;;;;;;;;;;;;;;;;;;;;;;;
239 ; Context menu entries ;
240 ;;;;;;;;;;;;;;;;;;;;;;;;
242 !macro AddContextMenuExt
EXT
243 WriteRegStr HKCR ${EXT}\shell\PlayWithVLC
"" "Play with VLC media player"
244 WriteRegStr HKCR ${EXT}\shell\PlayWithVLC\command
"" '$INSTDIR\vlc.exe --started-from-file --no-playlist-enqueue "%1"'
246 WriteRegStr HKCR ${EXT}\shell\AddToPlaylistVLC
"" "Add to VLC media player's Playlist"
247 WriteRegStr HKCR ${EXT}\shell\AddToPlaylistVLC\command
"" '$INSTDIR\vlc.exe --started-from-file --playlist-enqueue "%1"'
250 !macro AddContextMenu
EXT
252 ReadRegStr $R0 HKCR ${EXT} ""
253 !insertmacro AddContextMenuExt
$R0
257 !macro DeleteContextMenuExt
EXT
258 DeleteRegKey HKCR ${EXT}\shell\PlayWithVLC
259 DeleteRegKey HKCR ${EXT}\shell\AddToPlaylistVLC
262 !macro DeleteContextMenu
EXT
264 ReadRegStr $R0 HKCR ${EXT} ""
265 !insertmacro DeleteContextMenuExt
$R0
269 ;;;;;;;;;;;;;;;;;;;;;;;;;;
270 ; Delete prefs and cache ;
271 ;;;;;;;;;;;;;;;;;;;;;;;;;;
275 !define Index
'Line${__LINE__}'
278 ; this will loop through all the logged users and "virtual" windows users
279 ; (it looks like users are only present in HKEY_USERS when they are logged in)
281 EnumRegKey $1 HKU "" $0
282 StrCmp $1 "" "${Index}-End"
284 ReadRegStr $2 HKU "$1\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" AppData
285 StrCmp $2 "" "${Index}-Loop"
294 !macro OpenUninstallLog
295 FileOpen $UninstallLog "$INSTDIR\uninstall.log" a
296 FileSeek $UninstallLog 0 END
299 !macro CloseUninstallLog
300 FileClose $UninstallLog
301 SetFileAttributes "$INSTDIR\uninstall.log" HIDDEN
304 !macro InstallFile FILEREGEX
306 !define Index
'Line${__LINE__}'
307 FindFirst $0 $1 "$INSTDIR\${FILEREGEX}"
308 StrCmp $0 "" "${Index}-End"
310 StrCmp $1 "" "${Index}-End"
311 FileWrite $UninstallLog "$1$\r$\n"
318 !macro InstallFolder FOLDER
321 Call InstallFolderInternal
324 Function InstallFolderInternal
326 !define Index
'Line${__LINE__}'
327 FindFirst $0 $1 "$INSTDIR\$9\*"
328 StrCmp $0 "" "${Index}-End"
330 StrCmp $1 "" "${Index}-End"
331 StrCmp $1 "." "${Index}-Next"
332 StrCmp $1 ".." "${Index}-Next"
333 IfFileExists "$9\$1\*" 0 "${Index}-Write"
337 Call InstallFolderInternal
342 FileWrite $UninstallLog "$9\$1$\r$\n"
351 ;;;;;;;;;;;;;;;;;;;;;;
352 ; Installer sections ;
353 ;;;;;;;;;;;;;;;;;;;;;;
355 Section "Media player (required)" SEC01
357 SetShellVarContext all
358 SetOutPath "$INSTDIR"
360 !insertmacro OpenUninstallLog
362 !insertmacro InstallFile vlc
.exe
363 !insertmacro InstallFile vlc
.exe
.manifest
365 !insertmacro InstallFile
${LIBVLC_DLL}
367 !ifdef LIBVLC_CONTROL_DLL
368 !insertmacro InstallFile
${LIBVLC_CONTROL_DLL}
370 !insertmacro InstallFile
*.txt
372 !insertmacro InstallFolder plugins
373 !insertmacro InstallFolder locale
374 !insertmacro InstallFolder osdmenu
375 !insertmacro InstallFolder skins
376 !insertmacro InstallFolder http
377 !insertmacro InstallFolder share
379 WriteIniStr
"$INSTDIR\${PRODUCT_GROUP} Website.url" "InternetShortcut" "URL" \
380 "${PRODUCT_WEB_SITE}"
381 FileWrite $UninstallLog "${PRODUCT_GROUP} Website.url$\r$\n"
382 WriteIniStr
"$INSTDIR\Documentation.url" "InternetShortcut" "URL" \
383 "${PRODUCT_WEB_SITE}/doc/"
384 FileWrite $UninstallLog "Documentation.url$\r$\n"
386 !insertmacro CloseUninstallLog
388 ; Add VLC to "recomended programs" for the following extensions
389 WriteRegStr HKCR Applications\vlc
.exe
"" ""
390 WriteRegStr HKCR Applications\vlc
.exe
"FriendlyAppName" "VLC media player"
391 WriteRegStr HKCR Applications\vlc
.exe\shell\Play
"" "Play with VLC"
392 WriteRegStr HKCR Applications\vlc
.exe\shell\Play\command
"" \
393 '$INSTDIR\vlc.exe --started-from-file "%1"'
394 !insertmacro MacroAllExtensions WriteRegStrSupportedTypes
396 WriteRegStr HKCR "AudioCD\shell\PlayWithVLC" "" "Play with VLC media player"
397 WriteRegStr HKCR "AudioCD\shell\PlayWithVLC\command" "" \
398 "$INSTDIR\vlc.exe --started-from-file cdda:%1"
399 WriteRegStr HKCR "DVD\shell\PlayWithVLC" "" "Play with VLC media player"
400 WriteRegStr HKCR "DVD\shell\PlayWithVLC\command" "" \
401 "$INSTDIR\vlc.exe --started-from-file dvd:%1"
403 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayDVDMovieOnArrival" "VLCPlayDVDMovieOnArrival" ""
404 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "Action" "Play DVD movie"
405 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "DefaultIcon" '"$INSTDIR\vlc.exe",0'
406 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "InvokeProgID" "VLC.DVDMovie"
407 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "InvokeVerb" "play"
408 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "Provider" "VideoLAN VLC media player"
410 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayCDAudioOnArrival" "VLCPlayCDAudioOnArrival" ""
411 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "Action" "Play CD audio"
412 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "DefaultIcon" '"$INSTDIR\vlc.exe --started-from-file",0'
413 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "InvokeProgID" "VLC.CDAudio"
414 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "InvokeVerb" "play"
415 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "Provider" "VideoLAN VLC media player"
416 WriteRegStr HKCR "VLC.DVDMovie" "" "VLC DVD Movie"
417 WriteRegStr HKCR "VLC.DVDMovie\shell" "" "Play"
418 WriteRegStr HKCR "VLC.DVDMovie\shell\Play\command" "" \
419 '$INSTDIR\vlc.exe --started-from-file dvd:%1'
420 WriteRegStr HKCR "VLC.DVDMovie\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'
421 WriteRegStr HKCR "VLC.CDAudio" "" "VLC CD Audio"
422 WriteRegStr HKCR "VLC.CDAudio\shell" "" "Play"
423 WriteRegStr HKCR "VLC.CDAudio\shell\Play\command" "" \
424 '$INSTDIR\vlc.exe --started-from-file cdda:%1'
425 WriteRegStr HKCR "VLC.CDAudio\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'
428 ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion
430 StrCmp $R1 '6.0' lbl_vista lbl_done
433 WriteRegStr HKLM "Software\RegisteredApplications" "VLC" "Software\Clients\Media\VLC\Capabilities"
434 WriteRegStr HKLM "Software\Clients\Media\VLC\Capabilities" "ApplicationName" "VLC media player"
435 WriteRegStr HKLM "Software\Clients\Media\VLC\Capabilities" "ApplicationDescription" "VLC - The video swiss knife"
441 Section "Start Menu Shortcut" SEC02a
443 CreateDirectory "$SMPROGRAMS\VideoLAN"
444 CreateDirectory "$SMPROGRAMS\VideoLAN\Quick Settings"
445 CreateDirectory "$SMPROGRAMS\VideoLAN\Quick Settings\Audio"
446 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Audio\Set Audio mode to DirectX (default).lnk" \
447 "$INSTDIR\vlc.exe" "--aout aout_directx --save-config vlc:quit"
448 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Audio\Set Audio mode to Waveout.lnk" \
449 "$INSTDIR\vlc.exe" "--aout waveout --save-config vlc:quit"
450 CreateDirectory "$SMPROGRAMS\VideoLAN\Quick Settings\Interface"
451 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Interface\Set Main Interface to Skinnable.lnk" \
452 "$INSTDIR\vlc.exe" "-I skins --save-config vlc:quit"
453 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Interface\Set Main Interface to wxWidgets (default).lnk" \
454 "$INSTDIR\vlc.exe" "-I wxwin --save-config vlc:quit"
455 CreateDirectory "$SMPROGRAMS\VideoLAN\Quick Settings\Video"
456 ; FIXME add detection for Vista. Direct3D will be default there, for all others it's DirectX
457 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to Direct3D.lnk" \
458 "$INSTDIR\vlc.exe" "--vout direct3d --overlay --directx-hw-yuv --save-config vlc:quit"
459 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to Direct3D (no hardware acceleration).lnk" \
460 "$INSTDIR\vlc.exe" "--vout direct3d --overlay --no-directx-hw-yuv --save-config vlc:quit"
461 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to DirectX.lnk" \
462 "$INSTDIR\vlc.exe" "--vout directx --overlay --directx-hw-yuv --save-config vlc:quit"
463 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to DirectX (no hardware acceleration).lnk" \
464 "$INSTDIR\vlc.exe" "--vout directx --no-overlay --no-directx-hw-yuv --save-config vlc:quit"
465 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to DirectX (no video overlay).lnk" \
466 "$INSTDIR\vlc.exe" "--vout directx --no-overlay --directx-hw-yuv --save-config vlc:quit"
467 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to OpenGL.lnk" \
468 "$INSTDIR\vlc.exe" "--vout opengl --overlay --save-config vlc:quit"
469 CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Reset VLC media player preferences and cache files.lnk" \
470 "$INSTDIR\vlc.exe" "--reset-config --reset-plugins-cache --save-config vlc:quit"
471 CreateShortCut "$SMPROGRAMS\VideoLAN\Documentation.lnk" \
472 "$INSTDIR\Documentation.url"
473 CreateShortCut "$SMPROGRAMS\VideoLAN\Release Notes.lnk" \
474 "$INSTDIR\NEWS.txt" ""
475 CreateShortCut "$SMPROGRAMS\VideoLAN\${PRODUCT_GROUP} Website.lnk" \
476 "$INSTDIR\${PRODUCT_GROUP} Website.url"
477 CreateShortCut "$SMPROGRAMS\VideoLAN\VLC media player.lnk" \
478 "$INSTDIR\vlc.exe" ""
481 Section "Desktop Shortcut" SEC02b
483 CreateShortCut "$DESKTOP\VLC media player.lnk" \
484 "$INSTDIR\vlc.exe" ""
487 Section /o
"Mozilla plugin" SEC03
490 SetOutPath "$INSTDIR"
491 !insertmacro OpenUninstallLog
492 !insertmacro InstallFile mozilla\npvlc
.dll
493 !insertmacro CloseUninstallLog
495 !define Moz
"SOFTWARE\MozillaPlugins\@videolan.org/vlc,version=${VERSION}"
496 WriteRegStr HKLM ${Moz} "Description" "VLC Multimedia Plugin"
497 WriteRegStr HKLM ${Moz} "Path" "$INSTDIR\npvlc.dll"
498 WriteRegStr HKLM ${Moz} "Product" "VLC media player"
499 WriteRegStr HKLM ${Moz} "Vendor" "VideoLAN"
500 WriteRegStr HKLM ${Moz} "Version" "${VERSION}"
502 ; for very old version of mozilla, these lines may be needed
507 ;!define Index 'Line${__LINE__}'
513 ; EnumRegKey $R0 HKLM "SOFTWARE\Mozilla" "$R1"
514 ; StrCmp $R0 "" "${Index}-End"
516 ; ReadRegStr $R2 HKLM "SOFTWARE\Mozilla\$R0\Extensions" "Plugins"
517 ; StrCmp $R2 "" "${Index}-Loop" ""
519 ; CopyFiles "$INSTDIR\npvlc.dll" "$R2"
521 ; CopyFiles ${LIBVLC_DLL} "$R2"
523 ; !ifdef LIBVLC_CONTROL_DLL
524 ; CopyFiles ${LIBVLC_CONTROL_DLL} "$R2"
526 ; Goto "${Index}-Loop"
533 Section "ActiveX plugin" SEC04
535 SetOutPath "$INSTDIR"
536 !insertmacro OpenUninstallLog
537 !insertmacro InstallFile activex\axvlc
.dll
538 !insertmacro CloseUninstallLog
539 RegDLL "$INSTDIR\axvlc.dll"
542 SectionGroup
"File type associations" SEC06
543 SectionGroup
"Audio Files"
544 !insertmacro MacroAudioExtensions RegisterExtensionSection
546 SectionGroup
"Video Files"
547 !insertmacro MacroVideoExtensions RegisterExtensionSection
550 !insertmacro MacroOtherExtensions RegisterExtensionSection
554 Section /o
"Context Menus" SEC05
556 !insertmacro MacroAllExtensions AddContextMenu
557 !insertmacro AddContextMenuExt
"Directory"
560 Section /o
"Delete preferences and cache" SEC07
561 !insertmacro delprefs
564 ; Installer section descriptions
565 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
566 !insertmacro MUI_DESCRIPTION_TEXT
${SEC01} \
567 "The media player itself"
568 !insertmacro MUI_DESCRIPTION_TEXT
${SEC02a} \
569 "Adds icons to your start menu for easy access"
570 !insertmacro MUI_DESCRIPTION_TEXT
${SEC02b} \
571 "Adds icon to your desktop for easy access"
572 !insertmacro MUI_DESCRIPTION_TEXT
${SEC03} \
573 "The VLC Mozilla and Mozilla Firefox plugin"
574 !insertmacro MUI_DESCRIPTION_TEXT
${SEC04} \
575 "The VLC ActiveX plugin"
576 !insertmacro MUI_DESCRIPTION_TEXT
${SEC05} \
577 "Add context menu items ('Play With VLC' and 'Add To VLC's Playlist')"
578 !insertmacro MUI_DESCRIPTION_TEXT
${SEC06} \
579 "Sets VLC media player as the default application for the specified file type"
580 !insertmacro MUI_DESCRIPTION_TEXT
${SEC07} \
581 "Deletes VLC media player preferences and cache files leftover from previous installations"
582 !insertmacro MUI_FUNCTION_DESCRIPTION_END
585 ReadRegStr $R0 ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
589 MessageBox MB_YESNO|
MB_ICONEXCLAMATION \
590 "VLC media player has already been installed. $\nDo you want to remove \
591 the previous version before installing $(^Name) ?" \
597 ExecWait '$R0 _?=$INSTDIR' ;Do not copy the uninstaller to a temp file
599 !insertmacro MUI_LANGDLL_DISPLAY
603 WriteUninstaller "$INSTDIR\uninstall.exe"
604 WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "InstallDir" $INSTDIR
605 WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "Version" "${VERSION}"
606 WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\vlc.exe"
608 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
609 "DisplayName" "$(^Name)"
610 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
611 "UninstallString" "$INSTDIR\uninstall.exe"
612 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
613 "DisplayIcon" "$INSTDIR\vlc.exe"
614 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
615 "DisplayVersion" "${PRODUCT_VERSION}"
616 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
617 "URLInfoAbout" "${PRODUCT_WEB_SITE}"
618 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
619 "Publisher" "${PRODUCT_PUBLISHER}"
622 ;;;;;;;;;;;;;;;;;;;;;;;;
623 ; Uninstaller sections ;
624 ;;;;;;;;;;;;;;;;;;;;;;;;
626 ; TrimNewlines (copied from NSIS documentation)
627 ; input, top of stack (e.g. whatever$\r$\n)
628 ; output, top of stack (replaces, with e.g. whatever)
629 ; modifies no other variables.
631 Function un
.TrimNewlines
640 StrCmp $R2 "$\r" loop
641 StrCmp $R2 "$\n" loop
643 IntCmp $R1 0 no_trim_needed
652 Function un
.RemoveEmptyDirs
654 !define Index
'Line${__LINE__}'
655 FindFirst $0 $1 "$INSTDIR$9*"
656 StrCmp $0 "" "${Index}-End"
658 StrCmp $1 "" "${Index}-End"
659 StrCmp $1 "." "${Index}-Next"
660 StrCmp $1 ".." "${Index}-Next"
665 Call un
.RemoveEmptyDirs
679 Section "Uninstall" SEC91
681 SetShellVarContext all
683 !insertmacro MacroAllExtensions DeleteContextMenu
684 !insertmacro MacroAllExtensions UnRegisterExtensionSection
685 !insertmacro DeleteContextMenuExt
"Directory"
687 ;remove activex plugin
688 UnRegDLL "$INSTDIR\axvlc.dll"
689 Delete /REBOOTOK
"$INSTDIR\axvlc.dll"
691 ;remove mozilla plugin
696 !define Index
'Line${__LINE__}'
702 EnumRegKey $R0 HKLM "SOFTWARE\Mozilla" "$R1"
703 StrCmp $R0 "" "${Index}-End"
705 ReadRegStr $R2 HKLM "SOFTWARE\Mozilla\$R0\Extensions" "Plugins"
706 StrCmp $R2 "" "${Index}-Loop" ""
708 ; old files (0.8.5 and before) that may be lying around
709 Delete /REBOOTOK
"$R2\npvlc.dll"
710 Delete /REBOOTOK
"$R2\libvlc.dll"
711 Delete /REBOOTOK
"$R2\vlcintf.xpt"
716 Delete /REBOOTOK
"$INSTDIR\npvlc.dll"
718 RMDir "$SMPROGRAMS\VideoLAN"
719 RMDir /r
$SMPROGRAMS\VideoLAN
721 FileOpen $UninstallLog "$INSTDIR\uninstall.log" r
724 FileRead $UninstallLog $R0
725 IfErrors UninstallEnd
729 Delete "$INSTDIR\$R0"
732 FileClose $UninstallLog
733 Delete "$INSTDIR\uninstall.log"
734 Delete "$INSTDIR\uninstall.exe"
736 Call un
.RemoveEmptyDirs
739 DeleteRegKey HKLM Software\VideoLAN
741 DeleteRegKey HKCR Applications\vlc
.exe
742 DeleteRegKey HKCR AudioCD\shell\PlayWithVLC
743 DeleteRegKey HKCR DVD\shell\PlayWithVLC
744 DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayDVDMovieOnArrival" "VLCPlayDVDMovieOnArrival"
745 DeleteRegKey HKLM Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival
746 DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayCDAudioOnArrival" "VLCPlayCDAudioOnArrival"
747 DeleteRegKey HKLM Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival
748 DeleteRegKey HKLM Software\Clients\Media\VLC
749 DeleteRegKey HKCR "VLC.MediaFile"
752 "SOFTWARE\MozillaPlugins\@videolan.org/vlc,version=${VERSION}"
755 "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
757 Delete "$DESKTOP\VLC media player.lnk"
759 DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
760 DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}"
764 Section /o
"un.Delete preferences and cache" SEC92
765 !insertmacro delprefs
768 ; Uninstaller section descriptions
769 !insertmacro MUI_UNFUNCTION_DESCRIPTION_BEGIN
770 !insertmacro MUI_DESCRIPTION_TEXT
${SEC91} \
771 "Uninstall VLC media player and all its components"
772 !insertmacro MUI_DESCRIPTION_TEXT
${SEC92} \
773 "Deletes VLC media player preferences and cache files"
774 !insertmacro MUI_UNFUNCTION_DESCRIPTION_END
776 ;Function un.onUninstSuccess
778 ; MessageBox MB_ICONINFORMATION|MB_OK \
779 ; "$(^Name) was successfully removed from your computer."
783 !insertmacro MUI_UNGETLANGUAGE