1 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2 ; NSIS installer script for vlc ;
3 ; (http://nsis.sourceforge.net) ;
4 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
6 !include "languages\declaration.nsh"
8 !define PRODUCT_NAME "VLC media player"
9 !define VERSION @VERSION@
10 !define PRODUCT_VERSION @VERSION@
11 !define PRODUCT_GROUP "VideoLAN"
12 !define PRODUCT_PUBLISHER "VideoLAN"
13 !define PRODUCT_WEB_SITE "http://www.videolan.org/"
14 !define PRODUCT_DIR_REGKEY "Software\VideoLAN\VLC"
15 !define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
16 !define PRODUCT_UNINST_ROOT_KEY "HKLM"
17 !define PRODUCT_ID "{ea92ef52-afe4-4212-bacb-dfe9fca94cd6}"
19 !define MUI_LANGDLL_REGISTRY_ROOT "HKLM"
20 !define MUI_LANGDLL_REGISTRY_KEY "${PRODUCT_DIR_REGKEY}"
21 !define MUI_LANGDLL_REGISTRY_VALUENAME "Language"
23 !define INSTALL_ACTIVEX
24 !define INSTALL_MOZILLA
26 ;;;;;;;;;;;;;;;;;;;;;;;;;
27 ; General configuration ;
28 ;;;;;;;;;;;;;;;;;;;;;;;;;
30 Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
31 @HAVE_WIN64_FALSE@ OutFile ..\vlc-${VERSION}-win32.exe
32 @HAVE_WIN64_TRUE@ OutFile ..\vlc-${VERSION}-win64.exe
33 InstallDir "$@PROGRAMFILES@\VideoLAN\VLC"
34 !ifdef NSIS_LZMA_COMPRESS_WHOLE
37 SetCompressor /SOLID lzma
42 BrandingText "${PRODUCT_GROUP} ${PRODUCT_NAME}"
44 InstType $Name_InstTypeRecommended
45 InstType $Name_InstTypeMinimum
46 InstType $Name_InstTypeFull
48 RequestExecutionLevel user
54 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
55 ; NSIS Modern User Interface configuration ;
56 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
58 ; MUI 1.67 compatible ------
62 !define MUI_ABORTWARNING
63 !define MUI_ICON "vlc.ico"
64 !define MUI_UNICON "vlc.ico"
65 !define MUI_COMPONENTSPAGE_SMALLDESC
69 !define MUI_WELCOMEPAGE_TITLE_3LINES
70 !insertmacro MUI_PAGE_WELCOME
72 !define MUI_LICENSEPAGE_BUTTON $(^NextBtn)
73 !define MUI_LICENSEPAGE_TEXT_BOTTOM $License_NextText
74 !insertmacro MUI_PAGE_LICENSE "COPYING.txt"
76 !insertmacro MUI_PAGE_COMPONENTS
78 !insertmacro MUI_PAGE_DIRECTORY
80 !insertmacro MUI_PAGE_INSTFILES
82 !define MUI_FINISHPAGE_LINK $Link_VisitWebsite
83 !define MUI_FINISHPAGE_LINK_LOCATION "http://www.videolan.org/vlc/"
84 !define MUI_FINISHPAGE_NOREBOOTSUPPORT
85 !insertmacro MUI_PAGE_FINISH
88 !insertmacro MUI_UNPAGE_CONFIRM
89 !insertmacro MUI_UNPAGE_COMPONENTS
90 !insertmacro MUI_UNPAGE_INSTFILES
91 !insertmacro MUI_UNPAGE_FINISH
94 !insertmacro MUI_LANGUAGE "English" # first language is the default language
95 !insertmacro MUI_LANGUAGE "French"
96 !insertmacro MUI_LANGUAGE "German"
97 !insertmacro MUI_LANGUAGE "Spanish"
98 !insertmacro MUI_LANGUAGE "SimpChinese"
99 !insertmacro MUI_LANGUAGE "TradChinese"
100 !insertmacro MUI_LANGUAGE "Japanese"
101 !insertmacro MUI_LANGUAGE "Korean"
102 !insertmacro MUI_LANGUAGE "Italian"
103 !insertmacro MUI_LANGUAGE "Dutch"
104 !insertmacro MUI_LANGUAGE "Danish"
105 !insertmacro MUI_LANGUAGE "Swedish"
106 !insertmacro MUI_LANGUAGE "Norwegian"
107 !insertmacro MUI_LANGUAGE "Finnish"
108 !insertmacro MUI_LANGUAGE "Greek"
109 !insertmacro MUI_LANGUAGE "Russian"
110 !insertmacro MUI_LANGUAGE "Portuguese"
111 !insertmacro MUI_LANGUAGE "PortugueseBR"
112 !insertmacro MUI_LANGUAGE "Arabic"
113 !insertmacro MUI_LANGUAGE "Polish"
114 !insertmacro MUI_LANGUAGE "Romanian"
115 !insertmacro MUI_LANGUAGE "Slovak"
116 !insertmacro MUI_LANGUAGE "Serbian"
117 !insertmacro MUI_LANGUAGE "Czech"
118 !insertmacro MUI_LANGUAGE "Hungarian"
119 !insertmacro MUI_LANGUAGE "Catalan"
120 !insertmacro MUI_LANGUAGE "Bulgarian"
121 !insertmacro MUI_LANGUAGE "Estonian"
122 !insertmacro MUI_LANGUAGE "Lithuanian"
123 !insertmacro MUI_LANGUAGE "Basque"
125 ; Reserve files for solid compression
126 !insertmacro MUI_RESERVEFILE_LANGDLL
127 !insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
131 ;;;;;;;;;;;;;;;;;;;;;;;
132 ; Macro and Functions ;
133 ;;;;;;;;;;;;;;;;;;;;;;;
135 !include helpers/extensions.nsh
137 !include helpers/install.nsh
139 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
140 ; Delete prefs Macro ;
141 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
145 !define Index 'Line${__LINE__}'
148 ; this will loop through all the logged users and "virtual" windows users
149 ; (it looks like users are only present in HKEY_USERS when they are logged in)
151 EnumRegKey $1 HKU "" $0
152 StrCmp $1 "" "${Index}-End"
154 ReadRegStr $2 HKU "$1\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" AppData
155 StrCmp $2 "" "${Index}-Loop"
162 ;;;;;;;;;;;;;;;;;;;;;;
163 ; Installer sections ;
166 ;;;;;;;;;;;;;;;;;;;;;;
168 Section $Name_Section01 SEC01
170 SetShellVarContext all
171 SetOutPath "$INSTDIR"
173 !insertmacro OpenUninstallLog
175 ; VLC.exe, libvlc.dll
176 !insertmacro InstallFile vlc.exe
177 !insertmacro InstallFile vlc.exe.manifest
178 !insertmacro InstallFile vlc-cache-gen.exe
181 !insertmacro InstallFile *.dll
184 !insertmacro InstallFile *.txt
187 !insertmacro InstallFolder plugins
188 !insertmacro InstallFolder locale
189 !insertmacro InstallFolder sdk
190 @BUILD_SKINS_TRUE@ !insertmacro InstallFolder skins
191 @BUILD_LUA_TRUE@ !insertmacro InstallFolder lua
193 ; Generate the cache and add it to uninstall.log
194 ExecWait "$INSTDIR\vlc-cache-gen.exe $INSTDIR\plugins"
195 FindFirst $0 $1 "$INSTDIR\plugins\*.dat"
196 FileWrite $UninstallLog "plugins\$1$\r$\n"
201 WriteIniStr "$INSTDIR\${PRODUCT_GROUP} Website.url" "InternetShortcut" "URL" "${PRODUCT_WEB_SITE}"
202 FileWrite $UninstallLog "${PRODUCT_GROUP} Website.url$\r$\n"
203 WriteIniStr "$INSTDIR\Documentation.url" "InternetShortcut" "URL" "${PRODUCT_WEB_SITE}/doc/"
204 FileWrite $UninstallLog "Documentation.url$\r$\n"
205 WriteIniStr "$INSTDIR\New_Skins.url" "InternetShortcut" "URL" "${PRODUCT_WEB_SITE}/vlc/skins.php"
206 FileWrite $UninstallLog "New_Skins.url$\r$\n"
208 !insertmacro CloseUninstallLog
210 ; Add VLC to "recommended programs" for the following extensions
211 WriteRegStr HKCR Applications\vlc.exe "" ""
212 WriteRegStr HKCR Applications\vlc.exe "FriendlyAppName" "VLC media player"
213 WriteRegStr HKCR Applications\vlc.exe\shell\Open "" $ContextMenuEntry_PlayWith
214 WriteRegStr HKCR Applications\vlc.exe\shell\Open\command "" '"$INSTDIR\vlc.exe" --started-from-file "%1"'
215 !insertmacro MacroAllExtensions WriteRegStrSupportedTypes
217 ; Windows default programs Registration
218 ; Vista and above detection
219 ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion
221 StrCmp $R1 '6' lbl_vista lbl_done
224 WriteRegStr HKLM "Software\RegisteredApplications" "VLC" "Software\Clients\Media\VLC\Capabilities"
225 WriteRegStr HKLM "Software\Clients\Media\VLC\Capabilities" "ApplicationName" "VLC media player"
226 WriteRegStr HKLM "Software\Clients\Media\VLC\Capabilities" "ApplicationDescription" "VLC - The video swiss knife"
227 WriteRegStr HKLM "Software\Clients\Media\VLC" "" "VLC media player"
228 WriteRegStr HKLM "Software\Clients\Media\VLC\InstallInfo" "HideIconsCommand" "$\"$INSTDIR\spad-setup.exe$\" /HideIcons /S"
229 WriteRegStr HKLM "Software\Clients\Media\VLC\InstallInfo" "ShowIconsCommand" "$\"$INSTDIR\spad-setup.exe$\" /ShowIcons /S"
230 WriteRegStr HKLM "Software\Clients\Media\VLC\InstallInfo" "ReinstallCommand" "$\"$INSTDIR\spad-setup.exe$\" /Reinstall /S"
231 WriteRegDWORD HKLM "Software\Clients\Media\VLC\InstallInfo" "IconsVisible" 0x001
236 Section $Name_Section02a SEC02a
238 CreateDirectory "$SMPROGRAMS\VideoLAN"
239 CreateShortCut "$SMPROGRAMS\VideoLAN\VLC media player.lnk" \
240 "$INSTDIR\vlc.exe" ""
241 CreateShortCut "$SMPROGRAMS\VideoLAN\VLC media player skinned.lnk" \
242 "$INSTDIR\vlc.exe" "-Iskins"
243 CreateShortCut "$SMPROGRAMS\VideoLAN\Documentation.lnk" \
244 "$INSTDIR\Documentation.url"
245 CreateShortCut "$SMPROGRAMS\VideoLAN\Release Notes.lnk" \
246 "$INSTDIR\NEWS.txt" ""
247 CreateShortCut "$SMPROGRAMS\VideoLAN\${PRODUCT_GROUP} Website.lnk" \
248 "$INSTDIR\${PRODUCT_GROUP} Website.url"
249 CreateShortCut "$SMPROGRAMS\VideoLAN\Reset VLC media player preferences and cache files.lnk" \
250 "$INSTDIR\vlc.exe" "--reset-config --reset-plugins-cache vlc://quit"
253 Section $Name_Section02b SEC02b
255 CreateShortCut "$DESKTOP\VLC media player.lnk" \
256 "$INSTDIR\vlc.exe" ""
259 SectionGroup /e !$Name_Section34
260 !ifdef INSTALL_MOZILLA
261 Section $Name_Section03 SEC03
264 SetOutPath "$INSTDIR"
265 !insertmacro OpenUninstallLog
266 !insertmacro InstallFile npvlc.dll
267 !insertmacro InstallFile npvlc.dll.manifest
268 !insertmacro CloseUninstallLog
270 !define Moz "SOFTWARE\MozillaPlugins\@videolan.org/vlc,version=${VERSION}"
271 WriteRegStr HKLM ${Moz} "Description" "VLC Multimedia Plugin"
272 WriteRegStr HKLM ${Moz} "Path" "$INSTDIR\npvlc.dll"
273 WriteRegStr HKLM ${Moz} "Product" "VLC media player"
274 WriteRegStr HKLM ${Moz} "Vendor" "VideoLAN"
275 WriteRegStr HKLM ${Moz} "Version" "${VERSION}"
279 !ifdef INSTALL_ACTIVEX
280 Section $Name_Section04 SEC04
283 SetOutPath "$INSTDIR"
284 !insertmacro OpenUninstallLog
285 !insertmacro InstallFile axvlc.dll
286 !insertmacro InstallFile axvlc.dll.manifest
287 !insertmacro CloseUninstallLog
288 RegDLL "$INSTDIR\axvlc.dll"
294 Section $Name_Section05 SEC05
296 WriteRegStr HKCR "AudioCD\shell\PlayWithVLC" "" $ContextMenuEntry_PlayWith
297 WriteRegStr HKCR "AudioCD\shell\PlayWithVLC\command" "" \
298 '"$INSTDIR\vlc.exe" --started-from-file cdda:///%1'
299 WriteRegStr HKCR "DVD\shell\PlayWithVLC" "" $ContextMenuEntry_PlayWith
300 WriteRegStr HKCR "DVD\shell\PlayWithVLC\command" "" \
301 '"$INSTDIR\vlc.exe" --started-from-file dvd:///%1'
303 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayDVDMovieOnArrival" "VLCPlayDVDMovieOnArrival" ""
304 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "Action" $Action_OnArrivalDVD
305 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "DefaultIcon" '"$INSTDIR\vlc.exe",0'
306 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "InvokeProgID" "VLC.DVDMovie"
307 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "InvokeVerb" "Open"
308 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "Provider" "VideoLAN VLC media player"
310 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayCDAudioOnArrival" "VLCPlayCDAudioOnArrival" ""
311 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "Action" $Action_OnArrivalAudioCD
312 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "DefaultIcon" '"$INSTDIR\vlc.exe",0'
313 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "InvokeProgID" "VLC.CDAudio"
314 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "InvokeVerb" "Open"
315 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "Provider" "VideoLAN VLC media player"
317 WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayVideoCDMovieOnArrival" "VLCPlayVCDMovieOnArrival" ""
318 WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayVCDMovieOnArrival" "Action" $Action_OnArrivalVCDMovie
319 WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayVCDMovieOnArrival" "DefaultIcon" '"$INSTDIR\vlc.exe",0'
320 WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayVCDMovieOnArrival" "InvokeProgID" "VLC.VCDMovie"
321 WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayVCDMovieOnArrival" "InvokeVerb" "Open"
322 WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayVCDMovieOnArrival" "Provider" "VideoLAN VLC media player"
324 WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlaySuperVideoCDMovieOnArrival" "VLCPlaySVCDMovieOnArrival" ""
325 WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlaySVCDMovieOnArrival" "Action" $Action_OnArrivalSVCDMovie
326 WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlaySVCDMovieOnArrival" "DefaultIcon" '"$INSTDIR\vlc.exe",0'
327 WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlaySVCDMovieOnArrival" "InvokeProgID" "VLC.SVCDMovie"
328 WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlaySVCDMovieOnArrival" "InvokeVerb" "Open"
329 WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlaySVCDMovieOnArrival" "Provider" "VideoLAN VLC media player"
331 WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayDVDAudioOnArrival" "VLCPlayDVDAudioOnArrival" ""
332 WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDAudioOnArrival" "Action" $Action_OnArrivalDVDAudio
333 WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDAudioOnArrival" "DefaultIcon" '"$INSTDIR\vlc.exe",0'
334 WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDAudioOnArrival" "InvokeProgID" "VLC.OPENFolder"
335 WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDAudioOnArrival" "InvokeVerb" "Open"
336 WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDAudioOnArrival" "Provider" "VideoLAN VLC media player"
338 WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayVideoFilesOnArrival" "VLCPlayVideoFilesOnArrival" ""
339 WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayVideoFilesOnArrival" "Action" $Action_OnArrivalVideoFiles
340 WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayVideoFilesOnArrival" "DefaultIcon" '"$INSTDIR\vlc.exe",0'
341 WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayVideoFilesOnArrival" "InvokeProgID" "VLC.OPENFolder"
342 WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayVideoFilesOnArrival" "InvokeVerb" "Open"
343 WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayVideoFilesOnArrival" "Provider" "VideoLAN VLC media player"
345 WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayMusicFilesOnArrival" "VLCPlayMusicFilesOnArrival" ""
346 WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayMusicFilesOnArrival" "Action" $Action_OnArrivalMusicFiles
347 WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayMusicFilesOnArrival" "DefaultIcon" '"$INSTDIR\vlc.exe",0'
348 WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayMusicFilesOnArrival" "InvokeProgID" "VLC.OPENFolder"
349 WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayMusicFilesOnArrival" "InvokeVerb" "Open"
350 WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayMusicFilesOnArrival" "Provider" "VideoLAN VLC media player"
352 WriteRegStr HKCR "VLC.DVDMovie" "" "VLC DVD Movie"
353 WriteRegStr HKCR "VLC.DVDMovie\shell" "" "Open"
354 WriteRegStr HKCR "VLC.DVDMovie\shell\Open\command" "" \
355 '"$INSTDIR\vlc.exe" --started-from-file dvd:///%1'
356 WriteRegStr HKCR "VLC.DVDMovie\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'
358 WriteRegStr HKCR "VLC.CDAudio" "" "VLC CD Audio"
359 WriteRegStr HKCR "VLC.CDAudio\shell" "" "Open"
360 WriteRegStr HKCR "VLC.CDAudio\shell\Open\command" "" \
361 '"$INSTDIR\vlc.exe" --started-from-file cdda:///%1'
362 WriteRegStr HKCR "VLC.CDAudio\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'
364 WriteRegStr HKCR "VLC.VCDMovie" "" "VLC VCD Movie"
365 WriteRegStr HKCR "VLC.VCDMovie\shell" "" "Open"
366 WriteRegStr HKCR "VLC.VCDMovie\shell\Open\command" "" \
367 '"$INSTDIR\vlc.exe" --started-from-file vcd:///%1'
368 WriteRegStr HKCR "VLC.VCDMovie\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'
370 WriteRegStr HKCR "VLC.SVCDMovie" "" "VLC SVCD Movie"
371 WriteRegStr HKCR "VLC.SVCDMovie\shell" "" "Open"
372 WriteRegStr HKCR "VLC.SVCDMovie\shell\Open\command" "" \
373 '"$INSTDIR\vlc.exe" --started-from-file vcd:///%1'
374 WriteRegStr HKCR "VLC.SVCDMovie\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'
376 WriteRegStr HKCR "VLC.OPENFolder" "" "VLC Play content"
377 WriteRegStr HKCR "VLC.OPENFolder\shell" "" "Open"
378 WriteRegStr HKCR "VLC.OPENFolder\shell\Open\command" "" \
379 '"$INSTDIR\vlc.exe" %1'
380 WriteRegStr HKCR "VLC.OPENFolder\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'
385 SectionGroup /e !$Name_Section06 SEC06
386 SectionGroup $Name_SectionGroupAudio
387 !insertmacro MacroAudioExtensions RegisterExtensionSection
389 SectionGroup $Name_SectionGroupVideo
390 !insertmacro MacroVideoExtensions RegisterExtensionSection
392 SectionGroup $Name_SectionGroupOther
393 !insertmacro MacroOtherExtensions RegisterExtensionSection
394 !insertmacro MacroSkinExtensions RegisterSkinExtensionSection
398 Section $Name_Section07 SEC07
400 !insertmacro MacroAllExtensions AddContextMenu
401 !insertmacro AddContextMenuExt "Directory"
404 Section /o $Name_Section08 SEC08
405 !insertmacro delprefs
408 ; Installer section descriptions
409 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
410 !insertmacro MUI_DESCRIPTION_TEXT ${SEC01} $Desc_Section01
411 !insertmacro MUI_DESCRIPTION_TEXT ${SEC02a} $Desc_Section02a
412 !insertmacro MUI_DESCRIPTION_TEXT ${SEC02b} $Desc_Section02b
413 !ifdef INSTALL_MOZILLA
414 !insertmacro MUI_DESCRIPTION_TEXT ${SEC03} $Desc_Section03
416 !ifdef INSTALL_ACTIVEX
417 !insertmacro MUI_DESCRIPTION_TEXT ${SEC04} $Desc_Section04
419 !insertmacro MUI_DESCRIPTION_TEXT ${SEC05} $Desc_Section05
420 !insertmacro MUI_DESCRIPTION_TEXT ${SEC06} $Desc_Section06
421 !insertmacro MUI_DESCRIPTION_TEXT ${SEC07} $Desc_Section07
422 !insertmacro MUI_DESCRIPTION_TEXT ${SEC08} $Desc_Section08
423 !insertmacro MUI_FUNCTION_DESCRIPTION_END
428 @HAVE_WIN64_TRUE@ !include "x64.nsh"
429 @HAVE_WIN64_TRUE@ ${If} ${RunningX64}
430 @HAVE_WIN64_TRUE@ ${Else}
431 @HAVE_WIN64_TRUE@ MessageBox MB_OK|MB_ICONSTOP "This version of VLC only runs on 64bits operating systems.$\nYour operating system is 32bits.$\n$\nPlease get the 32 BITS version."
432 @HAVE_WIN64_TRUE@ Quit
433 @HAVE_WIN64_TRUE@ ${Endif}
434 ${If} ${AtLeastWinXP}
436 ${AndIf} ${AtMostServicePack} 1
443 @HAVE_WIN64_TRUE@ SetRegView 64
444 ReadRegStr $INSTDIR HKLM "${PRODUCT_DIR_REGKEY}" "InstallDir"
445 StrCmp $INSTDIR "" 0 UAC_Elevate
446 StrCpy $INSTDIR "$@PROGRAMFILES@\VideoLAN\VLC"
450 StrCmp 1223 $0 UAC_ElevationAborted
451 StrCmp 0 $0 0 UAC_Err
452 StrCmp 1 $1 0 UAC_Success
456 MessageBox mb_iconstop "Unable to elevate, error $0"
459 UAC_ElevationAborted:
460 MessageBox mb_iconstop "This installer requires admin access, aborting!"
464 MessageBox MB_OK|MB_ICONSTOP "This version of VLC only runs on Windows XP SP2 and newer."
469 StrCmp 3 $1 0 UAC_ElevationAborted
470 MessageBox mb_iconstop "This installer requires admin access, try again"
472 !insertmacro MUI_LANGDLL_DISPLAY
474 !include "languages\english.nsh"
475 StrCmp $LANGUAGE ${LANG_FRENCH} French 0
476 StrCmp $LANGUAGE ${LANG_GERMAN} German 0
477 StrCmp $LANGUAGE ${LANG_ITALIAN} Italian 0
478 StrCmp $LANGUAGE ${LANG_HUNGARIAN} Hungarian 0
479 StrCmp $LANGUAGE ${LANG_ROMANIAN} Romanian 0
480 StrCmp $LANGUAGE ${LANG_CATALAN} Catalan 0
481 StrCmp $LANGUAGE ${LANG_BULGARIAN} Bulgarian 0
482 StrCmp $LANGUAGE ${LANG_SLOVAK} Slovak 0
483 StrCmp $LANGUAGE ${LANG_POLISH} Polish 0
484 StrCmp $LANGUAGE ${LANG_DUTCH} Dutch 0
485 StrCmp $LANGUAGE ${LANG_DANISH} Danish 0
486 StrCmp $LANGUAGE ${LANG_SIMPCHINESE} SChinese 0
487 StrCmp $LANGUAGE ${LANG_FINNISH} Finnish 0
488 StrCmp $LANGUAGE ${LANG_JAPANESE} Japanese 0
489 ; StrCmp $LANGUAGE ${LANG_BENGALI} Bengali 0
490 ; StrCmp $LANGUAGE ${LANG_PUNJABI} Punjabi 0
491 ; StrCmp $LANGUAGE ${LANG_SLOVENIAN} Slovenian 0
492 StrCmp $LANGUAGE ${LANG_SPANISH} Spanish 0
493 StrCmp $LANGUAGE ${LANG_ESTONIAN} Estonian 0
494 StrCmp $LANGUAGE ${LANG_LITHUANIAN} Lithuanian 0
495 StrCmp $LANGUAGE ${LANG_BASQUE} Basque 0
496 StrCmp $LANGUAGE ${LANG_SERBIAN} Serbian 0
497 StrCmp $LANGUAGE ${LANG_RUSSIAN} Russian 0
498 StrCmp $LANGUAGE ${LANG_HEBREW} Hebrew 0
499 StrCmp $LANGUAGE ${LANG_GALICIAN} Galician 0
500 StrCmp $LANGUAGE ${LANG_SWEDISH} Swedish 0
501 StrCmp $LANGUAGE ${LANG_PORTUGUESEBR} Brazilian EndLanguageCmp
503 !include "languages\french.nsh"
506 !include "languages\german.nsh"
509 !include "languages\italian.nsh"
512 !include "languages\hungarian.nsh"
515 !include "languages\romanian.nsh"
518 !include "languages\catalan.nsh"
521 !include "languages\bulgarian.nsh"
524 !include "languages\slovak.nsh"
527 !include "languages\polish.nsh"
530 !include "languages\dutch.nsh"
533 !include "languages\danish.nsh"
536 !include "languages\schinese.nsh"
539 !include "languages\finnish.nsh"
542 !include "languages\japanese.nsh"
545 !include "languages\bengali.nsh"
548 !include "languages\punjabi.nsh"
551 !include "languages\slovenian.nsh"
554 !include "languages\spanish.nsh"
557 !include "languages\estonian.nsh"
560 !include "languages\lithuanian.nsh"
563 !include "languages\basque.nsh"
566 !include "languages\serbian.nsh"
569 !include "languages\Russian.nsh"
572 !include "languages\hebrew.nsh"
575 !include "languages\galician.nsh"
578 !include "languages\swedish.nsh"
581 !include "languages\brazilian_portuguese.nsh"
584 ReadRegStr $R0 ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
588 MessageBox MB_YESNO|MB_ICONEXCLAMATION $Message_AlreadyInstalled /SD IDNO IDNO done
593 ExecWait '$R0 _?=$INSTDIR' ;Do not copy the uninstaller to a temp file
598 Function .OnInstFailed
602 Function .OnInstSuccess
608 WriteUninstaller "$INSTDIR\uninstall.exe"
609 WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "InstallDir" $INSTDIR
610 WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "Version" "${VERSION}"
611 WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\vlc.exe"
613 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
614 "DisplayName" "$(^Name)"
615 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
616 "UninstallString" "$INSTDIR\uninstall.exe"
617 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
618 "InstallLocation" "$INSTDIR"
619 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
620 "DisplayIcon" "$INSTDIR\vlc.exe"
621 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
622 "DisplayVersion" "${PRODUCT_VERSION}"
623 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
624 "URLInfoAbout" "${PRODUCT_WEB_SITE}"
625 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
626 "Publisher" "${PRODUCT_PUBLISHER}"
627 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
628 "VersionMajor" "@VERSION_MAJOR@"
629 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
630 "VersionMinor" "@VERSION_MINOR@"
633 ;;;;;;;;;;;;;;;;;;;;;;;;
634 ; Uninstaller sections ;
635 ;;;;;;;;;;;;;;;;;;;;;;;;
637 ; TrimNewlines (copied from NSIS documentation)
638 ; input, top of stack (e.g. whatever$\r$\n)
639 ; output, top of stack (replaces, with e.g. whatever)
640 ; modifies no other variables.
642 Function un.TrimNewlines
651 StrCmp $R2 "$\r" loop
652 StrCmp $R2 "$\n" loop
654 IntCmp $R1 0 no_trim_needed
663 Function un.RemoveEmptyDirs
665 !define Index 'Line${__LINE__}'
666 FindFirst $0 $1 "$INSTDIR$9*"
667 StrCmp $0 "" "${Index}-End"
669 StrCmp $1 "" "${Index}-End"
670 StrCmp $1 "." "${Index}-Next"
671 StrCmp $1 ".." "${Index}-Next"
676 Call un.RemoveEmptyDirs
690 Section "un.$Name_Section91" SEC91
692 SetShellVarContext all
694 !insertmacro MacroAllExtensions DeleteContextMenu
695 !insertmacro MacroAllExtensions UnRegisterExtensionSection
696 !insertmacro MacroSkinExtensions UnRegisterExtensionSection
697 !insertmacro DeleteContextMenuExt "Directory"
699 ;remove activex plugin
700 UnRegDLL "$INSTDIR\axvlc.dll"
701 Delete /REBOOTOK "$INSTDIR\axvlc.dll"
702 Delete /REBOOTOK "$INSTDIR\axvlc.dll.manifest"
704 ;remove mozilla plugin
709 !define Index 'Line${__LINE__}'
715 EnumRegKey $R0 HKLM "SOFTWARE\Mozilla" "$R1"
716 StrCmp $R0 "" "${Index}-End"
718 ReadRegStr $R2 HKLM "SOFTWARE\Mozilla\$R0\Extensions" "Plugins"
719 StrCmp $R2 "" "${Index}-Loop" ""
721 ; old files (0.8.5 and before) that may be lying around
722 Delete /REBOOTOK "$R2\npvlc.dll"
723 Delete /REBOOTOK "$R2\libvlc.dll"
724 Delete /REBOOTOK "$R2\vlcintf.xpt"
729 Delete /REBOOTOK "$INSTDIR\npvlc.dll"
730 Delete /REBOOTOK "$INSTDIR\npvlc.dll.manifest"
732 RMDir "$SMPROGRAMS\VideoLAN"
733 RMDir /r $SMPROGRAMS\VideoLAN
735 FileOpen $UninstallLog "$INSTDIR\uninstall.log" r
738 FileRead $UninstallLog $R0
739 IfErrors UninstallEnd
743 Delete "$INSTDIR\$R0"
746 FileClose $UninstallLog
747 Delete "$INSTDIR\uninstall.log"
748 Delete "$INSTDIR\uninstall.exe"
750 Call un.RemoveEmptyDirs
753 DeleteRegKey HKLM Software\VideoLAN
755 DeleteRegKey HKCR Applications\vlc.exe
756 DeleteRegKey HKCR AudioCD\shell\PlayWithVLC
757 DeleteRegKey HKCR DVD\shell\PlayWithVLC
758 DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayDVDMovieOnArrival" "VLCPlayDVDMovieOnArrival"
759 DeleteRegKey HKLM Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival
760 DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayCDAudioOnArrival" "VLCPlayCDAudioOnArrival"
761 DeleteRegKey HKLM Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival
762 DeleteRegValue HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayVideoCDMovieOnArrival" "VLCPlayVCDMovieOnArrival"
763 DeleteRegKey HKLM SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayVCDMovieOnArrival
764 DeleteRegValue HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlaySuperVideoCDMovieOnArrival" "VLCPlaySVCDMovieOnArrival"
765 DeleteRegKey HKLM SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlaySVCDMovieOnArrival
766 DeleteRegValue HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayDVDAudioOnArrival" "VLCPlayDVDAudioOnArrival"
767 DeleteRegKey HKLM SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDAudioOnArrival
768 DeleteRegValue HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayVideoFilesOnArrival" "VLCPlayVideoFilesOnArrival"
769 DeleteRegKey HKLM SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayVideoFilesOnArrival
770 DeleteRegValue HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayMusicFilesOnArrival" "VLCPlayMusicFilesOnArrival"
771 DeleteRegKey HKLM SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayMusicFilesOnArrival
773 DeleteRegKey HKLM Software\Clients\Media\VLC
774 DeleteRegValue HKLM "Software\RegisteredApplications" "VLC"
775 DeleteRegKey HKCR "VLC.MediaFile"
776 DeleteRegKey HKCR "VLC.DVDMovie"
777 DeleteRegKey HKCR "VLC.CDAudio"
778 DeleteRegKey HKCR "VLC.VCDMovie"
779 DeleteRegKey HKCR "VLC.SVCDMovie"
780 DeleteRegKey HKCR "VLC.OPENFolder"
784 "SOFTWARE\MozillaPlugins\@videolan.org/vlc,version=${VERSION}"
787 "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
789 Delete "$DESKTOP\VLC media player.lnk"
791 DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
792 DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}"
796 Section /o "un.$Name_Section92" SEC92
797 !insertmacro delprefs
800 ; Uninstaller section descriptions
801 !insertmacro MUI_UNFUNCTION_DESCRIPTION_BEGIN
802 !insertmacro MUI_DESCRIPTION_TEXT ${SEC91} $Desc_Section91
803 !insertmacro MUI_DESCRIPTION_TEXT ${SEC92} $Desc_Section92
804 !insertmacro MUI_UNFUNCTION_DESCRIPTION_END
806 Function un.OnUnInstFailed
810 Function un.OnUnInstSuccess
812 Delete "$INSTDIR\UAC.dll"
819 StrCmp 1223 $0 UAC_ElevationAborted
820 StrCmp 0 $0 0 UAC_Err
821 StrCmp 1 $1 0 UAC_Success
825 MessageBox mb_iconstop "Unable to elevate, error $0"
828 UAC_ElevationAborted:
829 MessageBox mb_iconstop "This installer requires admin access, aborting!"
834 StrCmp 3 $1 0 UAC_ElevationAborted
835 MessageBox mb_iconstop "This installer requires admin access, try again"
838 !insertmacro MUI_UNGETLANGUAGE
840 !include "languages\english.nsh"
841 StrCmp $LANGUAGE ${LANG_FRENCH} French 0
842 StrCmp $LANGUAGE ${LANG_GERMAN} German 0
843 StrCmp $LANGUAGE ${LANG_ITALIAN} Italian 0
844 StrCmp $LANGUAGE ${LANG_HUNGARIAN} Hungarian 0
845 StrCmp $LANGUAGE ${LANG_ROMANIAN} Romanian 0
846 StrCmp $LANGUAGE ${LANG_CATALAN} Catalan 0
847 StrCmp $LANGUAGE ${LANG_BULGARIAN} Bulgarian 0
848 StrCmp $LANGUAGE ${LANG_SLOVAK} Slovak 0
849 StrCmp $LANGUAGE ${LANG_POLISH} Polish 0
850 StrCmp $LANGUAGE ${LANG_DUTCH} Dutch 0
851 StrCmp $LANGUAGE ${LANG_DANISH} Danish 0
852 StrCmp $LANGUAGE ${LANG_SIMPCHINESE} SChinese 0
853 StrCmp $LANGUAGE ${LANG_FINNISH} Finnish 0
854 StrCmp $LANGUAGE ${LANG_JAPANESE} Japanese 0
855 ; StrCmp $LANGUAGE ${LANG_BENGALI} Bengali 0
856 ; StrCmp $LANGUAGE ${LANG_PUNJABI} Punjabi 0
857 ; StrCmp $LANGUAGE ${LANG_SLOVENIAN} Slovenian 0
858 StrCmp $LANGUAGE ${LANG_SPANISH} Spanish 0
859 StrCmp $LANGUAGE ${LANG_ESTONIAN} Estonian 0
860 StrCmp $LANGUAGE ${LANG_LITHUANIAN} Lithuanian 0
861 StrCmp $LANGUAGE ${LANG_BASQUE} Basque 0
862 StrCmp $LANGUAGE ${LANG_SERBIAN} Serbian 0
863 StrCmp $LANGUAGE ${LANG_RUSSIAN} Russian 0
864 StrCmp $LANGUAGE ${LANG_HEBREW} Hebrew 0
865 StrCmp $LANGUAGE ${LANG_GALICIAN} Galician 0
866 StrCmp $LANGUAGE ${LANG_SWEDISH} Swedish 0
867 StrCmp $LANGUAGE ${LANG_PORTUGUESEBR} Brazilian EndLanguageCmp
869 !include "languages\french.nsh"
872 !include "languages\german.nsh"
875 !include "languages\italian.nsh"
878 !include "languages\hungarian.nsh"
881 !include "languages\romanian.nsh"
884 !include "languages\catalan.nsh"
887 !include "languages\bulgarian.nsh"
890 !include "languages\slovak.nsh"
893 !include "languages\polish.nsh"
896 !include "languages\dutch.nsh"
899 !include "languages\danish.nsh"
902 !include "languages\schinese.nsh"
905 !include "languages\finnish.nsh"
908 !include "languages\japanese.nsh"
911 !include "languages\bengali.nsh"
914 !include "languages\punjabi.nsh"
917 !include "languages\slovenian.nsh"
920 !include "languages\spanish.nsh"
923 !include "languages\estonian.nsh"
926 !include "languages\lithuanian.nsh"
929 !include "languages\basque.nsh"
932 !include "languages\serbian.nsh"
935 !include "languages\russian.nsh"
938 !include "languages\hebrew.nsh"
941 !include "languages\galician.nsh"
944 !include "languages\swedish.nsh"
947 !include "languages\brazilian_portuguese.nsh"