Brazilian Portuguese translation update by Sidney Doria
[vlc/vlc-skelet.git] / vlc.win32.nsi.in
blob15e9bf26e7d84fa920cdaac62bc089075c9eb6f4
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"
20 @FILE_LIBVLC_DLL@
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
32 SetCompressor lzma
33 !else
34 SetCompressor /SOLID lzma
35 !endif
36 ;ShowInstDetails show
37 ;ShowUnInstDetails show
38 SetOverwrite ifnewer
39 CRCCheck on
41 InstType "Recommended"
42 InstType "Minimum"
43 InstType "Full"
45 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
46 ; NSIS Modern User Interface configuration ;
47 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
49 ; MUI 1.67 compatible ------
50 !include "MUI.nsh"
52 ; MUI Settings
53 !define MUI_ABORTWARNING
54 !define MUI_ICON "vlc48x48.ico"
55 !define MUI_UNICON "vlc48x48.ico"
56 !define MUI_COMPONENTSPAGE_SMALLDESC
58 ; Installer pages
59 ; Welcome page
60 !define MUI_WELCOMEPAGE_TITLE_3LINES
61 !insertmacro MUI_PAGE_WELCOME
62 ; License page
63 !insertmacro MUI_PAGE_LICENSE "COPYING.txt"
64 ; Components page
65 !insertmacro MUI_PAGE_COMPONENTS
66 ; Directory page
67 !insertmacro MUI_PAGE_DIRECTORY
68 ; Instfiles page
69 !insertmacro MUI_PAGE_INSTFILES
70 ; Finish page
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
79 ; Uninstaller pages
80 !insertmacro MUI_UNPAGE_CONFIRM
81 !insertmacro MUI_UNPAGE_COMPONENTS
82 !insertmacro MUI_UNPAGE_INSTFILES
83 !insertmacro MUI_UNPAGE_FINISH
85 ; Language files
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
109 ; Reserve files
110 !insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
112 ; MUI end ------
114 ;;;;;;;;;;;;;;;;;;;
115 ; Extension lists ;
116 ;;;;;;;;;;;;;;;;;;;
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"
132 !macroend
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"
155 !macroend
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"
164 !macroend
166 !macro MacroAllExtensions _action
167 !insertmacro MacroAudioExtensions ${_action}
168 !insertmacro MacroVideoExtensions ${_action}
169 !insertmacro MacroOtherExtensions ${_action}
170 !macroend
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
182 NoBackup:
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'
189 FunctionEnd
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"
198 Goto NoOwn
199 Restore:
200 WriteRegStr HKCR "$R0" "" $1
201 DeleteRegValue HKCR "$R0" "VLC.backup"
202 NoOwn:
203 DeleteRegKey HKCR "VLC$R0" ;Delete key with association settings
204 FunctionEnd
206 !macro RegisterExtensionSection EXT
207 Section ${EXT}
208 SectionIn 1 3
209 Push $R0
210 StrCpy $R0 ${EXT}
211 Call RegisterExtension
212 Pop $R0
213 SectionEnd
214 !macroend
216 !macro UnRegisterExtensionSection EXT
217 Push $R0
218 StrCpy $R0 ${EXT}
219 Call un.RegisterExtension
220 Pop $R0
221 !macroend
223 !macro WriteRegStrSupportedTypes EXT
224 WriteRegStr HKCR Applications\vlc.exe\SupportedTypes ${EXT} ""
225 !macroend
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"'
237 !macroend
239 !macro AddContextMenu EXT
240 Push $R0
241 ReadRegStr $R0 HKCR ${EXT} ""
242 !insertmacro AddContextMenuExt $R0
243 Pop $R0
244 !macroend
246 !macro DeleteContextMenuExt EXT
247 DeleteRegKey HKCR ${EXT}\shell\PlayWithVLC
248 DeleteRegKey HKCR ${EXT}\shell\AddToPlaylistVLC
249 !macroend
251 !macro DeleteContextMenu EXT
252 Push $R0
253 ReadRegStr $R0 HKCR ${EXT} ""
254 !insertmacro DeleteContextMenuExt $R0
255 Pop $R0
256 !macroend
258 ;;;;;;;;;;;;;;;;;;;;;;;;;;
259 ; Delete prefs and cache ;
260 ;;;;;;;;;;;;;;;;;;;;;;;;;;
262 !macro delprefs
263 StrCpy $0 0
264 !define Index 'Line${__LINE__}'
265 "${Index}-Loop:"
266 ; FIXME
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)
269 ClearErrors
270 EnumRegKey $1 HKU "" $0
271 StrCmp $1 "" "${Index}-End"
272 IntOp $0 $0 + 1
273 ReadRegStr $2 HKU "$1\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" AppData
274 StrCmp $2 "" "${Index}-Loop"
275 RMDir /r "$2\vlc"
276 Goto "${Index}-Loop"
277 "${Index}-End:"
278 !undef Index
279 !macroend
281 Var UninstallLog
283 !macro OpenUninstallLog
284 FileOpen $UninstallLog "$INSTDIR\uninstall.log" a
285 FileSeek $UninstallLog 0 END
286 !macroend
288 !macro CloseUninstallLog
289 FileClose $UninstallLog
290 SetFileAttributes "$INSTDIR\uninstall.log" HIDDEN
291 !macroend
293 !macro InstallFile FILEREGEX
294 File "${FILEREGEX}"
295 !define Index 'Line${__LINE__}'
296 FindFirst $0 $1 "$INSTDIR\${FILEREGEX}"
297 StrCmp $0 "" "${Index}-End"
298 "${Index}-Loop:"
299 StrCmp $1 "" "${Index}-End"
300 FileWrite $UninstallLog "$1$\r$\n"
301 FindNext $0 $1
302 Goto "${Index}-Loop"
303 "${Index}-End:"
304 !undef Index
305 !macroend
307 !macro InstallFolder FOLDER
308 File /r "${FOLDER}"
309 Push "${FOLDER}"
310 Call InstallFolderInternal
311 !macroend
313 Function InstallFolderInternal
314 Pop $9
315 !define Index 'Line${__LINE__}'
316 FindFirst $0 $1 "$INSTDIR\$9\*"
317 StrCmp $0 "" "${Index}-End"
318 "${Index}-Loop:"
319 StrCmp $1 "" "${Index}-End"
320 StrCmp $1 "." "${Index}-Next"
321 StrCmp $1 ".." "${Index}-Next"
322 IfFileExists "$9\$1\*" 0 "${Index}-Write"
323 Push $0
324 Push $9
325 Push "$9\$1"
326 Call InstallFolderInternal
327 Pop $9
328 Pop $0
329 Goto "${Index}-Next"
330 "${Index}-Write:"
331 FileWrite $UninstallLog "$9\$1$\r$\n"
332 "${Index}-Next:"
333 FindNext $0 $1
334 Goto "${Index}-Loop"
335 "${Index}-End:"
336 !undef Index
337 FunctionEnd
340 ;;;;;;;;;;;;;;;;;;;;;;
341 ; Installer sections ;
342 ;;;;;;;;;;;;;;;;;;;;;;
344 Section "Media player (required)" SEC01
345 SectionIn 1 2 3 RO
346 SetShellVarContext all
347 SetOutPath "$INSTDIR"
349 !insertmacro OpenUninstallLog
351 !insertmacro InstallFile vlc.exe
352 !insertmacro InstallFile vlc.exe.manifest
353 !ifdef LIBVLC_DLL
354 !insertmacro InstallFile ${LIBVLC_DLL}
355 !endif
356 !ifdef LIBVLC_CONTROL_DLL
357 !insertmacro InstallFile ${LIBVLC_CONTROL_DLL}
358 !endif
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'
416 SectionEnd
418 Section "Start Menu Shortcut" SEC02a
419 SectionIn 1 2 3
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" ""
456 SectionEnd
458 Section "Desktop Shortcut" SEC02b
459 SectionIn 1 2 3
460 CreateShortCut "$DESKTOP\VLC media player.lnk" \
461 "$INSTDIR\vlc.exe" ""
462 SectionEnd
464 Section /o "Mozilla plugin" SEC03
465 SectionIn 3
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
480 ;Push $R0
481 ;Push $R1
482 ;Push $R2
484 ;!define Index 'Line${__LINE__}'
485 ;StrCpy $R1 "0"
487 ;"${Index}-Loop:"
489 ; ; Check for Key
490 ; EnumRegKey $R0 HKLM "SOFTWARE\Mozilla" "$R1"
491 ; StrCmp $R0 "" "${Index}-End"
492 ; IntOp $R1 $R1 + 1
493 ; ReadRegStr $R2 HKLM "SOFTWARE\Mozilla\$R0\Extensions" "Plugins"
494 ; StrCmp $R2 "" "${Index}-Loop" ""
496 ; CopyFiles "$INSTDIR\npvlc.dll" "$R2"
497 ; !ifdef LIBVLC_DLL
498 ; CopyFiles ${LIBVLC_DLL} "$R2"
499 ; !endif
500 ; !ifdef LIBVLC_CONTROL_DLL
501 ; CopyFiles ${LIBVLC_CONTROL_DLL} "$R2"
502 ; !endif
503 ; Goto "${Index}-Loop"
505 ;"${Index}-End:"
506 ;!undef Index
508 SectionEnd
510 Section "ActiveX plugin" SEC04
511 SectionIn 1 3
512 SetOutPath "$INSTDIR"
513 !insertmacro OpenUninstallLog
514 !insertmacro InstallFile activex\axvlc.dll
515 !insertmacro CloseUninstallLog
516 RegDLL "$INSTDIR\axvlc.dll"
517 SectionEnd
519 SectionGroup "File type associations" SEC06
520 SectionGroup "Audio Files"
521 !insertmacro MacroAudioExtensions RegisterExtensionSection
522 SectionGroupEnd
523 SectionGroup "Video Files"
524 !insertmacro MacroVideoExtensions RegisterExtensionSection
525 SectionGroupEnd
526 SectionGroup "Other"
527 !insertmacro MacroOtherExtensions RegisterExtensionSection
528 SectionGroupEnd
529 SectionGroupEnd
531 Section /o "Context Menus" SEC05
532 SectionIn 3
533 !insertmacro MacroAllExtensions AddContextMenu
534 !insertmacro AddContextMenuExt "Directory"
535 SectionEnd
537 Section /o "Delete preferences and cache" SEC07
538 !insertmacro delprefs
539 SectionEnd
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
561 Function .onInit
562 ReadRegStr $R0 ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
563 "UninstallString"
564 StrCmp $R0 "" done
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) ?" \
569 IDNO done
571 ;Run the uninstaller
572 ;uninst:
573 ClearErrors
574 ExecWait '$R0 _?=$INSTDIR' ;Do not copy the uninstaller to a temp file
575 done:
576 !insertmacro MUI_LANGDLL_DISPLAY
577 FunctionEnd
579 Section -Post
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}"
597 SectionEnd
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
609 Exch $R0
610 Push $R1
611 Push $R2
612 StrCpy $R1 0
614 loop:
615 IntOp $R1 $R1 - 1
616 StrCpy $R2 $R0 1 $R1
617 StrCmp $R2 "$\r" loop
618 StrCmp $R2 "$\n" loop
619 IntOp $R1 $R1 + 1
620 IntCmp $R1 0 no_trim_needed
621 StrCpy $R0 $R0 $R1
623 no_trim_needed:
624 Pop $R2
625 Pop $R1
626 Exch $R0
627 FunctionEnd
629 Function un.RemoveEmptyDirs
630 Pop $9
631 !define Index 'Line${__LINE__}'
632 FindFirst $0 $1 "$INSTDIR$9*"
633 StrCmp $0 "" "${Index}-End"
634 "${Index}-Loop:"
635 StrCmp $1 "" "${Index}-End"
636 StrCmp $1 "." "${Index}-Next"
637 StrCmp $1 ".." "${Index}-Next"
638 Push $0
639 Push $1
640 Push $9
641 Push "$9$1\"
642 Call un.RemoveEmptyDirs
643 Pop $9
644 Pop $1
645 Pop $0
646 "${Index}-Remove:"
647 RMDir "$INSTDIR$9$1"
648 "${Index}-Next:"
649 FindNext $0 $1
650 Goto "${Index}-Loop"
651 "${Index}-End:"
652 FindClose $0
653 !undef Index
654 FunctionEnd
656 Section "Uninstall" SEC91
657 SectionIn 1 2 3 RO
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
669 Push $R0
670 Push $R1
671 Push $R2
673 !define Index 'Line${__LINE__}'
674 StrCpy $R1 "0"
676 "${Index}-Loop:"
678 ; Check for Key
679 EnumRegKey $R0 HKLM "SOFTWARE\Mozilla" "$R1"
680 StrCmp $R0 "" "${Index}-End"
681 IntOp $R1 $R1 + 1
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"
689 Goto "${Index}-Loop"
691 "${Index}-End:"
692 !undef Index
693 Delete /REBOOTOK "$INSTDIR\npvlc.dll"
695 RMDir "$SMPROGRAMS\VideoLAN"
696 RMDir /r $SMPROGRAMS\VideoLAN
698 FileOpen $UninstallLog "$INSTDIR\uninstall.log" r
699 UninstallLoop:
700 ClearErrors
701 FileRead $UninstallLog $R0
702 IfErrors UninstallEnd
703 Push $R0
704 Call un.TrimNewLines
705 Pop $R0
706 Delete "$INSTDIR\$R0"
707 Goto UninstallLoop
708 UninstallEnd:
709 FileClose $UninstallLog
710 Delete "$INSTDIR\uninstall.log"
711 Delete "$INSTDIR\uninstall.exe"
712 Push "\"
713 Call un.RemoveEmptyDirs
714 RMDir "$INSTDIR"
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"
727 DeleteRegKey HKLM \
728 "SOFTWARE\MozillaPlugins\@videolan.org/vlc,version=${VERSION}"
730 DeleteRegKey HKLM \
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}"
737 SetAutoClose true
738 SectionEnd
740 Section /o "un.Delete preferences and cache" SEC92
741 !insertmacro delprefs
742 SectionEnd
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
753 ; HideWindow
754 ; MessageBox MB_ICONINFORMATION|MB_OK \
755 ; "$(^Name) was successfully removed from your computer."
756 ;FunctionEnd
758 Function un.onInit
759 !insertmacro MUI_UNGETLANGUAGE
760 FunctionEnd