-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\r
-; NSIS installer script for vlc ;\r
-; (http://nsis.sourceforge.net) ;\r
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\r
-\r
-!define PRODUCT_NAME "VLC media player"\r
-!define PRODUCT_VERSION '${VERSION}'\r
-!define PRODUCT_GROUP "VideoLAN"\r
-!define PRODUCT_PUBLISHER "VideoLAN Team"\r
-!define PRODUCT_WEB_SITE "http://www.videolan.org"\r
-!define PRODUCT_DIR_REGKEY "Software\VideoLAN\VLC"\r
-!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"\r
-!define PRODUCT_UNINST_ROOT_KEY "HKLM"\r
-!define PRODUCT_ID "{ea92ef52-afe4-4212-bacb-dfe9fca94cd6}"\r
-\r
-!define MUI_LANGDLL_REGISTRY_ROOT "HKLM"\r
-!define MUI_LANGDLL_REGISTRY_KEY "${PRODUCT_DIR_REGKEY}"\r
-!define MUI_LANGDLL_REGISTRY_VALUENAME "Language"\r
-\r
-@FILE_LIBVLC_DLL@\r
-@FILE_LIBVLC_CONTROL_DLL@\r
-\r
-;;;;;;;;;;;;;;;;;;;;;;;;;\r
-; General configuration ;\r
-;;;;;;;;;;;;;;;;;;;;;;;;;\r
-\r
-Name "${PRODUCT_GROUP} ${PRODUCT_NAME} ${PRODUCT_VERSION}"\r
-OutFile ..\vlc-${VERSION}-win32.exe\r
-InstallDir "$PROGRAMFILES\VideoLAN\VLC"\r
-InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" ""\r
-!ifdef NSIS_LZMA_COMPRESS_WHOLE\r
-SetCompressor lzma\r
-!else\r
-SetCompressor /SOLID lzma\r
-!endif\r
-;ShowInstDetails show\r
-;ShowUnInstDetails show\r
-SetOverwrite ifnewer\r
-CRCCheck on\r
-BrandingText "${PRODUCT_GROUP} ${PRODUCT_NAME}"\r
-\r
-InstType "Recommended"\r
-InstType "Minimum"\r
-InstType "Full"\r
-\r
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\r
-; NSIS Modern User Interface configuration ;\r
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\r
-\r
-; MUI 1.67 compatible ------\r
- !include "MUI.nsh"\r
-\r
-; MUI Settings\r
- !define MUI_ABORTWARNING\r
- !define MUI_ICON "vlc48x48.ico"\r
- !define MUI_UNICON "vlc48x48.ico"\r
- !define MUI_COMPONENTSPAGE_SMALLDESC\r
-\r
-; Installer pages\r
- ; Welcome page\r
- !define MUI_WELCOMEPAGE_TITLE_3LINES\r
- !insertmacro MUI_PAGE_WELCOME\r
- ; License page\r
- !insertmacro MUI_PAGE_LICENSE "COPYING.txt"\r
- ; Components page\r
- !insertmacro MUI_PAGE_COMPONENTS\r
- ; Directory page\r
- !insertmacro MUI_PAGE_DIRECTORY\r
- ; Instfiles page\r
- !insertmacro MUI_PAGE_INSTFILES\r
- ; Finish page\r
- !define MUI_FINISHPAGE_RUN "$INSTDIR\vlc.exe"\r
- !define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\README.txt"\r
- !define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED\r
- !define MUI_FINISHPAGE_LINK "Visit the VideoLAN VLC media player Website"\r
- !define MUI_FINISHPAGE_LINK_LOCATION "http://www.videolan.org/vlc/"\r
- !define MUI_FINISHPAGE_NOREBOOTSUPPORT\r
- !insertmacro MUI_PAGE_FINISH\r
-\r
-; Uninstaller pages\r
- !insertmacro MUI_UNPAGE_CONFIRM\r
- !insertmacro MUI_UNPAGE_COMPONENTS\r
- !insertmacro MUI_UNPAGE_INSTFILES\r
- !insertmacro MUI_UNPAGE_FINISH\r
-\r
-; Language files\r
- !insertmacro MUI_LANGUAGE "English" # first language is the default language\r
- !insertmacro MUI_LANGUAGE "French"\r
- !insertmacro MUI_LANGUAGE "German"\r
- !insertmacro MUI_LANGUAGE "Spanish"\r
- !insertmacro MUI_LANGUAGE "SimpChinese"\r
- !insertmacro MUI_LANGUAGE "TradChinese"\r
- !insertmacro MUI_LANGUAGE "Japanese"\r
- !insertmacro MUI_LANGUAGE "Korean"\r
- !insertmacro MUI_LANGUAGE "Italian"\r
- !insertmacro MUI_LANGUAGE "Dutch"\r
- !insertmacro MUI_LANGUAGE "Danish"\r
- !insertmacro MUI_LANGUAGE "Swedish"\r
- !insertmacro MUI_LANGUAGE "Norwegian"\r
- !insertmacro MUI_LANGUAGE "Finnish"\r
- !insertmacro MUI_LANGUAGE "Greek"\r
- !insertmacro MUI_LANGUAGE "Russian"\r
- !insertmacro MUI_LANGUAGE "Portuguese"\r
- !insertmacro MUI_LANGUAGE "Arabic"\r
- !insertmacro MUI_LANGUAGE "Polish"\r
- !insertmacro MUI_LANGUAGE "Romanian"\r
- !insertmacro MUI_LANGUAGE "Slovak"\r
- !insertmacro MUI_LANGUAGE "Czech"\r
-\r
-!insertmacro MUI_RESERVEFILE_LANGDLL\r
-\r
-; Reserve files\r
- !insertmacro MUI_RESERVEFILE_INSTALLOPTIONS\r
-\r
-; MUI end ------\r
-\r
-;;;;;;;;;;;;;;;;;;;\r
-; Extension lists ;\r
-;;;;;;;;;;;;;;;;;;;\r
-\r
-!macro MacroAudioExtensions _action\r
- !insertmacro ${_action} ".a52"\r
- !insertmacro ${_action} ".aac"\r
- !insertmacro ${_action} ".ac3"\r
- !insertmacro ${_action} ".dts"\r
- !insertmacro ${_action} ".flac"\r
- !insertmacro ${_action} ".mka"\r
- !insertmacro ${_action} ".mp1"\r
- !insertmacro ${_action} ".mp2"\r
- !insertmacro ${_action} ".mp3"\r
- !insertmacro ${_action} ".ogg"\r
- !insertmacro ${_action} ".spx"\r
- !insertmacro ${_action} ".wav"\r
- !insertmacro ${_action} ".wma"\r
-!macroend\r
-\r
-!macro MacroVideoExtensions _action\r
- !insertmacro ${_action} ".asf"\r
- !insertmacro ${_action} ".avi"\r
- !insertmacro ${_action} ".divx"\r
- !insertmacro ${_action} ".dv"\r
- !insertmacro ${_action} ".m1v"\r
- !insertmacro ${_action} ".m2v"\r
- !insertmacro ${_action} ".mkv"\r
- !insertmacro ${_action} ".mov"\r
- !insertmacro ${_action} ".mp4"\r
- !insertmacro ${_action} ".mpeg"\r
- !insertmacro ${_action} ".mpeg1"\r
- !insertmacro ${_action} ".mpeg2"\r
- !insertmacro ${_action} ".mpeg4"\r
- !insertmacro ${_action} ".mpg"\r
- !insertmacro ${_action} ".mxf"\r
- !insertmacro ${_action} ".ps"\r
- !insertmacro ${_action} ".ts"\r
- !insertmacro ${_action} ".ogm"\r
- !insertmacro ${_action} ".vob"\r
- !insertmacro ${_action} ".wmv"\r
-!macroend\r
-\r
-!macro MacroOtherExtensions _action\r
- !insertmacro ${_action} ".asx"\r
- !insertmacro ${_action} ".bin"\r
- !insertmacro ${_action} ".cue"\r
- !insertmacro ${_action} ".m3u"\r
- !insertmacro ${_action} ".pls"\r
- !insertmacro ${_action} ".vlc"\r
-!macroend\r
-\r
-!macro MacroAllExtensions _action\r
- !insertmacro MacroAudioExtensions ${_action}\r
- !insertmacro MacroVideoExtensions ${_action}\r
- !insertmacro MacroOtherExtensions ${_action}\r
-!macroend\r
-\r
-;;;;;;;;;;;;;;;;;;;;;;;;;;\r
-; File type associations ;\r
-;;;;;;;;;;;;;;;;;;;;;;;;;;\r
-\r
-Function RegisterExtension\r
- ; back up old value for extension $R0 (eg. ".opt")\r
- ReadRegStr $1 HKCR "$R0" ""\r
- StrCmp $1 "" NoBackup\r
- StrCmp $1 "VLC$R0" "NoBackup"\r
- WriteRegStr HKCR "$R0" "VLC.backup" $1\r
-NoBackup:\r
- WriteRegStr HKCR "$R0" "" "VLC$R0"\r
- ReadRegStr $0 HKCR "VLC$R0" ""\r
- WriteRegStr HKCR "VLC$R0" "" "VLC media file ($R0)"\r
- WriteRegStr HKCR "VLC$R0\shell" "" "Play"\r
- WriteRegStr HKCR "VLC$R0\shell\Play\command" "" '"$INSTDIR\vlc.exe" --started-from-file "%1"'\r
- WriteRegStr HKCR "VLC$R0\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'\r
-\r
- ; Vista detection\r
- ReadRegStr $R1 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion\r
- StrCpy $R2 $R1 3\r
- StrCmp $R2 '6.0' ForVista ToEnd\r
-ForVista:\r
- WriteRegStr HKLM "Software\Clients\Media\VLC\Capabilities\FileAssociations" "$R0" "VLC$R0"\r
-ToEnd:\r
-\r
-FunctionEnd\r
-\r
-Function un.RegisterExtension\r
- ;start of restore script\r
- ReadRegStr $1 HKCR "$R0" ""\r
- StrCmp $1 "VLC$R0" 0 NoOwn ; only do this if we own it\r
- ReadRegStr $1 HKCR "$R0" "VLC.backup"\r
- StrCmp $1 "" 0 Restore ; if backup="" then delete the whole key\r
- DeleteRegKey HKCR "$R0"\r
- Goto NoOwn\r
-Restore:\r
- WriteRegStr HKCR "$R0" "" $1\r
- DeleteRegValue HKCR "$R0" "VLC.backup"\r
-NoOwn:\r
- DeleteRegKey HKCR "VLC$R0" ;Delete key with association settings\r
-FunctionEnd\r
-\r
-!macro RegisterExtensionSection EXT\r
- Section ${EXT}\r
- SectionIn 1 3\r
- Push $R0\r
- StrCpy $R0 ${EXT}\r
- Call RegisterExtension\r
- Pop $R0\r
- SectionEnd\r
-!macroend\r
-\r
-!macro UnRegisterExtensionSection EXT\r
- Push $R0\r
- StrCpy $R0 ${EXT}\r
- Call un.RegisterExtension\r
- Pop $R0\r
-!macroend\r
-\r
-!macro WriteRegStrSupportedTypes EXT\r
- WriteRegStr HKCR Applications\vlc.exe\SupportedTypes ${EXT} ""\r
-!macroend\r
-\r
-;;;;;;;;;;;;;;;;;;;;;;;;\r
-; Context menu entries ;\r
-;;;;;;;;;;;;;;;;;;;;;;;;\r
-\r
-!macro AddContextMenuExt EXT\r
- WriteRegStr HKCR ${EXT}\shell\PlayWithVLC "" "Play with VLC media player"\r
- WriteRegStr HKCR ${EXT}\shell\PlayWithVLC\command "" '$INSTDIR\vlc.exe --started-from-file --no-playlist-enqueue "%1"'\r
-\r
- WriteRegStr HKCR ${EXT}\shell\AddToPlaylistVLC "" "Add to VLC media player's Playlist"\r
- WriteRegStr HKCR ${EXT}\shell\AddToPlaylistVLC\command "" '$INSTDIR\vlc.exe --started-from-file --playlist-enqueue "%1"'\r
-!macroend\r
-\r
-!macro AddContextMenu EXT\r
- Push $R0\r
- ReadRegStr $R0 HKCR ${EXT} ""\r
- !insertmacro AddContextMenuExt $R0\r
- Pop $R0\r
-!macroend\r
-\r
-!macro DeleteContextMenuExt EXT\r
- DeleteRegKey HKCR ${EXT}\shell\PlayWithVLC\r
- DeleteRegKey HKCR ${EXT}\shell\AddToPlaylistVLC\r
-!macroend\r
-\r
-!macro DeleteContextMenu EXT\r
- Push $R0\r
- ReadRegStr $R0 HKCR ${EXT} ""\r
- !insertmacro DeleteContextMenuExt $R0\r
- Pop $R0\r
-!macroend\r
-\r
-;;;;;;;;;;;;;;;;;;;;;;;;;;\r
-; Delete prefs and cache ;\r
-;;;;;;;;;;;;;;;;;;;;;;;;;;\r
-\r
-!macro delprefs\r
- StrCpy $0 0\r
- !define Index 'Line${__LINE__}'\r
- "${Index}-Loop:"\r
- ; FIXME\r
- ; this will loop through all the logged users and "virtual" windows users\r
- ; (it looks like users are only present in HKEY_USERS when they are logged in)\r
- ClearErrors\r
- EnumRegKey $1 HKU "" $0\r
- StrCmp $1 "" "${Index}-End"\r
- IntOp $0 $0 + 1\r
- ReadRegStr $2 HKU "$1\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" AppData\r
- StrCmp $2 "" "${Index}-Loop"\r
- RMDir /r "$2\vlc"\r
- Goto "${Index}-Loop"\r
- "${Index}-End:"\r
- !undef Index\r
-!macroend\r
-\r
-Var UninstallLog\r
-\r
-!macro OpenUninstallLog\r
- FileOpen $UninstallLog "$INSTDIR\uninstall.log" a\r
- FileSeek $UninstallLog 0 END\r
-!macroend\r
-\r
-!macro CloseUninstallLog\r
- FileClose $UninstallLog\r
- SetFileAttributes "$INSTDIR\uninstall.log" HIDDEN\r
-!macroend\r
-\r
-!macro InstallFile FILEREGEX\r
- File "${FILEREGEX}"\r
- !define Index 'Line${__LINE__}'\r
- FindFirst $0 $1 "$INSTDIR\${FILEREGEX}"\r
- StrCmp $0 "" "${Index}-End"\r
- "${Index}-Loop:"\r
- StrCmp $1 "" "${Index}-End"\r
- FileWrite $UninstallLog "$1$\r$\n"\r
- FindNext $0 $1\r
- Goto "${Index}-Loop"\r
- "${Index}-End:"\r
- !undef Index\r
-!macroend\r
-\r
-!macro InstallFolder FOLDER\r
- File /r "${FOLDER}"\r
- Push "${FOLDER}"\r
- Call InstallFolderInternal\r
-!macroend\r
-\r
-Function InstallFolderInternal\r
- Pop $9\r
- !define Index 'Line${__LINE__}'\r
- FindFirst $0 $1 "$INSTDIR\$9\*"\r
- StrCmp $0 "" "${Index}-End"\r
- "${Index}-Loop:"\r
- StrCmp $1 "" "${Index}-End"\r
- StrCmp $1 "." "${Index}-Next"\r
- StrCmp $1 ".." "${Index}-Next"\r
- IfFileExists "$9\$1\*" 0 "${Index}-Write"\r
- Push $0\r
- Push $9\r
- Push "$9\$1"\r
- Call InstallFolderInternal\r
- Pop $9\r
- Pop $0\r
- Goto "${Index}-Next"\r
- "${Index}-Write:"\r
- FileWrite $UninstallLog "$9\$1$\r$\n"\r
- "${Index}-Next:"\r
- FindNext $0 $1\r
- Goto "${Index}-Loop"\r
- "${Index}-End:"\r
- !undef Index\r
-FunctionEnd\r
-\r
-\r
-;;;;;;;;;;;;;;;;;;;;;;\r
-; Installer sections ;\r
-;;;;;;;;;;;;;;;;;;;;;;\r
-\r
-Section "Media player (required)" SEC01\r
- SectionIn 1 2 3 RO\r
- SetShellVarContext all\r
- SetOutPath "$INSTDIR"\r
-\r
- !insertmacro OpenUninstallLog\r
-\r
- !insertmacro InstallFile vlc.exe\r
- !insertmacro InstallFile vlc.exe.manifest\r
- !ifdef LIBVLC_DLL\r
- !insertmacro InstallFile ${LIBVLC_DLL}\r
- !endif\r
- !ifdef LIBVLC_CONTROL_DLL\r
- !insertmacro InstallFile ${LIBVLC_CONTROL_DLL}\r
- !endif\r
- !insertmacro InstallFile *.txt\r
-\r
- !insertmacro InstallFolder plugins\r
- !insertmacro InstallFolder locale\r
- !insertmacro InstallFolder osdmenu\r
- !insertmacro InstallFolder skins\r
- !insertmacro InstallFolder http\r
- !insertmacro InstallFolder share\r
-\r
- WriteIniStr "$INSTDIR\${PRODUCT_GROUP} Website.url" "InternetShortcut" "URL" \\r
- "${PRODUCT_WEB_SITE}"\r
- FileWrite $UninstallLog "${PRODUCT_GROUP} Website.url$\r$\n"\r
- WriteIniStr "$INSTDIR\Documentation.url" "InternetShortcut" "URL" \\r
- "${PRODUCT_WEB_SITE}/doc/"\r
- FileWrite $UninstallLog "Documentation.url$\r$\n"\r
-\r
- !insertmacro CloseUninstallLog\r
-\r
- ; Add VLC to "recomended programs" for the following extensions\r
- WriteRegStr HKCR Applications\vlc.exe "" ""\r
- WriteRegStr HKCR Applications\vlc.exe "FriendlyAppName" "VLC media player"\r
- WriteRegStr HKCR Applications\vlc.exe\shell\Play "" "Play with VLC"\r
- WriteRegStr HKCR Applications\vlc.exe\shell\Play\command "" \\r
- '$INSTDIR\vlc.exe --started-from-file "%1"'\r
- !insertmacro MacroAllExtensions WriteRegStrSupportedTypes\r
-\r
- WriteRegStr HKCR "AudioCD\shell\PlayWithVLC" "" "Play with VLC media player"\r
- WriteRegStr HKCR "AudioCD\shell\PlayWithVLC\command" "" \\r
- "$INSTDIR\vlc.exe --started-from-file cdda:%1"\r
- WriteRegStr HKCR "DVD\shell\PlayWithVLC" "" "Play with VLC media player"\r
- WriteRegStr HKCR "DVD\shell\PlayWithVLC\command" "" \\r
- "$INSTDIR\vlc.exe --started-from-file dvd:%1"\r
-\r
- WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayDVDMovieOnArrival" "VLCPlayDVDMovieOnArrival" ""\r
- WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "Action" "Play DVD movie"\r
- WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "DefaultIcon" '"$INSTDIR\vlc.exe",0'\r
- WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "InvokeProgID" "VLC.DVDMovie"\r
- WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "InvokeVerb" "play"\r
- WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "Provider" "VideoLAN VLC media player"\r
-\r
- WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayCDAudioOnArrival" "VLCPlayCDAudioOnArrival" ""\r
- WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "Action" "Play CD audio"\r
- WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "DefaultIcon" '"$INSTDIR\vlc.exe",0'\r
- WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "InvokeProgID" "VLC.CDAudio"\r
- WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "InvokeVerb" "play"\r
- WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "Provider" "VideoLAN VLC media player"\r
- WriteRegStr HKCR "VLC.DVDMovie" "" "VLC DVD Movie"\r
- WriteRegStr HKCR "VLC.DVDMovie\shell" "" "Play"\r
- WriteRegStr HKCR "VLC.DVDMovie\shell\Play\command" "" \\r
- '$INSTDIR\vlc.exe --started-from-file dvd:%1'\r
- WriteRegStr HKCR "VLC.DVDMovie\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'\r
- WriteRegStr HKCR "VLC.CDAudio" "" "VLC CD Audio"\r
- WriteRegStr HKCR "VLC.CDAudio\shell" "" "Play"\r
- WriteRegStr HKCR "VLC.CDAudio\shell\Play\command" "" \\r
- '$INSTDIR\vlc.exe --started-from-file cdda:%1'\r
- WriteRegStr HKCR "VLC.CDAudio\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'\r
-\r
- ; Vista detection\r
- ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion\r
- StrCpy $R1 $R0 3\r
- StrCmp $R1 '6.0' lbl_vista lbl_done\r
-\r
- lbl_vista:\r
- WriteRegStr HKLM "Software\RegisteredApplications" "VLC" "Software\Clients\Media\VLC\Capabilities"\r
- WriteRegStr HKLM "Software\Clients\Media\VLC\Capabilities" "ApplicationName" "VLC media player"\r
- WriteRegStr HKLM "Software\Clients\Media\VLC\Capabilities" "ApplicationDescription" "VLC - The video swiss knife"\r
-\r
- lbl_done:\r
-\r
-SectionEnd\r
-\r
-Section "Start Menu Shortcut" SEC02a\r
- SectionIn 1 2 3\r
- CreateDirectory "$SMPROGRAMS\VideoLAN"\r
- CreateDirectory "$SMPROGRAMS\VideoLAN\Quick Settings"\r
- CreateDirectory "$SMPROGRAMS\VideoLAN\Quick Settings\Audio"\r
- CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Audio\Set Audio mode to DirectX (default).lnk" \\r
- "$INSTDIR\vlc.exe" "--aout aout_directx --save-config vlc:quit"\r
- CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Audio\Set Audio mode to Waveout.lnk" \\r
- "$INSTDIR\vlc.exe" "--aout waveout --save-config vlc:quit"\r
- CreateDirectory "$SMPROGRAMS\VideoLAN\Quick Settings\Interface"\r
- CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Interface\Set Main Interface to Skinnable.lnk" \\r
- "$INSTDIR\vlc.exe" "-I skins --save-config vlc:quit"\r
- CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Interface\Set Main Interface to wxWidgets (default).lnk" \\r
- "$INSTDIR\vlc.exe" "-I wxwin --save-config vlc:quit"\r
- CreateDirectory "$SMPROGRAMS\VideoLAN\Quick Settings\Video"\r
- ; FIXME add detection for Vista. Direct3D will be default there, for all others it's DirectX\r
- CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to Direct3D.lnk" \\r
- "$INSTDIR\vlc.exe" "--vout direct3d --overlay --directx-hw-yuv --save-config vlc:quit"\r
- CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to Direct3D (no hardware acceleration).lnk" \\r
- "$INSTDIR\vlc.exe" "--vout direct3d --overlay --no-directx-hw-yuv --save-config vlc:quit"\r
- CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to DirectX.lnk" \\r
- "$INSTDIR\vlc.exe" "--vout directx --overlay --directx-hw-yuv --save-config vlc:quit"\r
- CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to DirectX (no hardware acceleration).lnk" \\r
- "$INSTDIR\vlc.exe" "--vout directx --no-overlay --no-directx-hw-yuv --save-config vlc:quit"\r
- CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to DirectX (no video overlay).lnk" \\r
- "$INSTDIR\vlc.exe" "--vout directx --no-overlay --directx-hw-yuv --save-config vlc:quit"\r
- CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to OpenGL.lnk" \\r
- "$INSTDIR\vlc.exe" "--vout opengl --overlay --save-config vlc:quit"\r
- CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Reset VLC media player preferences and cache files.lnk" \\r
- "$INSTDIR\vlc.exe" "--reset-config --reset-plugins-cache --save-config vlc:quit"\r
- CreateShortCut "$SMPROGRAMS\VideoLAN\Documentation.lnk" \\r
- "$INSTDIR\Documentation.url"\r
- CreateShortCut "$SMPROGRAMS\VideoLAN\Release Notes.lnk" \\r
- "$INSTDIR\NEWS.txt" ""\r
- CreateShortCut "$SMPROGRAMS\VideoLAN\${PRODUCT_GROUP} Website.lnk" \\r
- "$INSTDIR\${PRODUCT_GROUP} Website.url"\r
- CreateShortCut "$SMPROGRAMS\VideoLAN\VLC media player.lnk" \\r
- "$INSTDIR\vlc.exe" ""\r
-SectionEnd\r
-\r
-Section "Desktop Shortcut" SEC02b\r
- SectionIn 1 2 3\r
- CreateShortCut "$DESKTOP\VLC media player.lnk" \\r
- "$INSTDIR\vlc.exe" ""\r
-SectionEnd\r
-\r
-Section /o "Mozilla plugin" SEC03\r
- SectionIn 3\r
-\r
- SetOutPath "$INSTDIR"\r
- !insertmacro OpenUninstallLog\r
- !insertmacro InstallFile mozilla\npvlc.dll\r
- !insertmacro CloseUninstallLog\r
-\r
- !define Moz "SOFTWARE\MozillaPlugins\@videolan.org/vlc,version=${VERSION}"\r
- WriteRegStr HKLM ${Moz} "Description" "VLC Multimedia Plugin"\r
- WriteRegStr HKLM ${Moz} "Path" "$INSTDIR\npvlc.dll"\r
- WriteRegStr HKLM ${Moz} "Product" "VLC media player"\r
- WriteRegStr HKLM ${Moz} "Vendor" "VideoLAN"\r
- WriteRegStr HKLM ${Moz} "Version" "${VERSION}"\r
-\r
- ; for very old version of mozilla, these lines may be needed \r
- ;Push $R0\r
- ;Push $R1\r
- ;Push $R2\r
-\r
- ;!define Index 'Line${__LINE__}'\r
- ;StrCpy $R1 "0"\r
-\r
- ;"${Index}-Loop:"\r
-\r
- ; ; Check for Key\r
- ; EnumRegKey $R0 HKLM "SOFTWARE\Mozilla" "$R1"\r
- ; StrCmp $R0 "" "${Index}-End"\r
- ; IntOp $R1 $R1 + 1\r
- ; ReadRegStr $R2 HKLM "SOFTWARE\Mozilla\$R0\Extensions" "Plugins"\r
- ; StrCmp $R2 "" "${Index}-Loop" ""\r
-\r
- ; CopyFiles "$INSTDIR\npvlc.dll" "$R2"\r
- ; !ifdef LIBVLC_DLL\r
- ; CopyFiles ${LIBVLC_DLL} "$R2"\r
- ; !endif\r
- ; !ifdef LIBVLC_CONTROL_DLL\r
- ; CopyFiles ${LIBVLC_CONTROL_DLL} "$R2"\r
- ; !endif\r
- ; Goto "${Index}-Loop"\r
-\r
- ;"${Index}-End:"\r
- ;!undef Index\r
-\r
-SectionEnd\r
-\r
-Section "ActiveX plugin" SEC04\r
- SectionIn 1 3\r
- SetOutPath "$INSTDIR"\r
- !insertmacro OpenUninstallLog\r
- !insertmacro InstallFile activex\axvlc.dll\r
- !insertmacro CloseUninstallLog\r
- RegDLL "$INSTDIR\axvlc.dll"\r
-SectionEnd\r
-\r
-SectionGroup "File type associations" SEC06\r
- SectionGroup "Audio Files"\r
- !insertmacro MacroAudioExtensions RegisterExtensionSection\r
- SectionGroupEnd\r
- SectionGroup "Video Files"\r
- !insertmacro MacroVideoExtensions RegisterExtensionSection\r
- SectionGroupEnd\r
- SectionGroup "Other"\r
- !insertmacro MacroOtherExtensions RegisterExtensionSection\r
- SectionGroupEnd\r
-SectionGroupEnd\r
-\r
-Section /o "Context Menus" SEC05\r
- SectionIn 3\r
- !insertmacro MacroAllExtensions AddContextMenu\r
- !insertmacro AddContextMenuExt "Directory"\r
-SectionEnd\r
-\r
-Section /o "Delete preferences and cache" SEC07\r
- !insertmacro delprefs\r
-SectionEnd\r
-\r
-; Installer section descriptions\r
-!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN\r
- !insertmacro MUI_DESCRIPTION_TEXT ${SEC01} \\r
- "The media player itself"\r
- !insertmacro MUI_DESCRIPTION_TEXT ${SEC02a} \\r
- "Adds icons to your start menu for easy access"\r
- !insertmacro MUI_DESCRIPTION_TEXT ${SEC02b} \\r
- "Adds icon to your desktop for easy access"\r
- !insertmacro MUI_DESCRIPTION_TEXT ${SEC03} \\r
- "The VLC Mozilla and Mozilla Firefox plugin"\r
- !insertmacro MUI_DESCRIPTION_TEXT ${SEC04} \\r
- "The VLC ActiveX plugin"\r
- !insertmacro MUI_DESCRIPTION_TEXT ${SEC05} \\r
- "Add context menu items ('Play With VLC' and 'Add To VLC's Playlist')"\r
- !insertmacro MUI_DESCRIPTION_TEXT ${SEC06} \\r
- "Sets VLC media player as the default application for the specified file type"\r
- !insertmacro MUI_DESCRIPTION_TEXT ${SEC07} \\r
- "Deletes VLC media player preferences and cache files leftover from previous installations"\r
-!insertmacro MUI_FUNCTION_DESCRIPTION_END\r
-\r
-Function .onInit\r
- ReadRegStr $R0 ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \\r
- "UninstallString"\r
- StrCmp $R0 "" done\r
- \r
- MessageBox MB_YESNO|MB_ICONEXCLAMATION \\r
- "VLC media player has already been installed. $\nDo you want to remove \\r
- the previous version before installing $(^Name) ?" \\r
- IDNO done\r
- \r
- ;Run the uninstaller\r
- ;uninst:\r
- ClearErrors\r
- ExecWait '$R0 _?=$INSTDIR' ;Do not copy the uninstaller to a temp file\r
- done:\r
- !insertmacro MUI_LANGDLL_DISPLAY\r
-\r
- ;Win98 detection\r
- ReadRegStr $R0 HKLM \\r
- "SOFTWARE\Microsoft\Windows\CurrentVersion" VersionNumber\r
- StrCmp $R0 '4.9' lbl_win98\r
-\r
- lbl_win98:\r
- MessageBox MB_OK|MB_ICONQUESTION "Windows 98 ! Remember to install MSLU" IDOK\r
-\r
-FunctionEnd\r
-\r
-Section -Post\r
- WriteUninstaller "$INSTDIR\uninstall.exe"\r
- WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "InstallDir" $INSTDIR\r
- WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "Version" "${VERSION}"\r
- WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\vlc.exe"\r
-\r
- WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \\r
- "DisplayName" "$(^Name)"\r
- WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \\r
- "UninstallString" "$INSTDIR\uninstall.exe"\r
- WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \\r
- "DisplayIcon" "$INSTDIR\vlc.exe"\r
- WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \\r
- "DisplayVersion" "${PRODUCT_VERSION}"\r
- WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \\r
- "URLInfoAbout" "${PRODUCT_WEB_SITE}"\r
- WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \\r
- "Publisher" "${PRODUCT_PUBLISHER}"\r
-SectionEnd\r
-\r
-;;;;;;;;;;;;;;;;;;;;;;;;\r
-; Uninstaller sections ;\r
-;;;;;;;;;;;;;;;;;;;;;;;;\r
-\r
-; TrimNewlines (copied from NSIS documentation)\r
-; input, top of stack (e.g. whatever$\r$\n)\r
-; output, top of stack (replaces, with e.g. whatever)\r
-; modifies no other variables.\r
-\r
-Function un.TrimNewlines\r
- Exch $R0\r
- Push $R1\r
- Push $R2\r
- StrCpy $R1 0\r
- \r
- loop:\r
- IntOp $R1 $R1 - 1\r
- StrCpy $R2 $R0 1 $R1\r
- StrCmp $R2 "$\r" loop\r
- StrCmp $R2 "$\n" loop\r
- IntOp $R1 $R1 + 1\r
- IntCmp $R1 0 no_trim_needed\r
- StrCpy $R0 $R0 $R1\r
- \r
- no_trim_needed:\r
- Pop $R2\r
- Pop $R1\r
- Exch $R0\r
-FunctionEnd\r
-\r
-Function un.RemoveEmptyDirs\r
- Pop $9\r
- !define Index 'Line${__LINE__}'\r
- FindFirst $0 $1 "$INSTDIR$9*"\r
- StrCmp $0 "" "${Index}-End"\r
- "${Index}-Loop:"\r
- StrCmp $1 "" "${Index}-End"\r
- StrCmp $1 "." "${Index}-Next"\r
- StrCmp $1 ".." "${Index}-Next"\r
- Push $0\r
- Push $1\r
- Push $9\r
- Push "$9$1\"\r
- Call un.RemoveEmptyDirs\r
- Pop $9\r
- Pop $1\r
- Pop $0\r
- "${Index}-Remove:"\r
- RMDir "$INSTDIR$9$1"\r
- "${Index}-Next:"\r
- FindNext $0 $1\r
- Goto "${Index}-Loop"\r
- "${Index}-End:"\r
- FindClose $0\r
- !undef Index\r
-FunctionEnd\r
-\r
-Section "Uninstall" SEC91\r
- SectionIn 1 2 3 RO\r
- SetShellVarContext all\r
-\r
- !insertmacro MacroAllExtensions DeleteContextMenu\r
- !insertmacro MacroAllExtensions UnRegisterExtensionSection\r
- !insertmacro DeleteContextMenuExt "Directory"\r
-\r
- ;remove activex plugin\r
- UnRegDLL "$INSTDIR\axvlc.dll"\r
- Delete /REBOOTOK "$INSTDIR\axvlc.dll"\r
-\r
- ;remove mozilla plugin\r
- Push $R0\r
- Push $R1\r
- Push $R2\r
-\r
- !define Index 'Line${__LINE__}'\r
- StrCpy $R1 "0"\r
-\r
- "${Index}-Loop:"\r
-\r
- ; Check for Key\r
- EnumRegKey $R0 HKLM "SOFTWARE\Mozilla" "$R1"\r
- StrCmp $R0 "" "${Index}-End"\r
- IntOp $R1 $R1 + 1\r
- ReadRegStr $R2 HKLM "SOFTWARE\Mozilla\$R0\Extensions" "Plugins"\r
- StrCmp $R2 "" "${Index}-Loop" ""\r
-\r
- ; old files (0.8.5 and before) that may be lying around\r
- Delete /REBOOTOK "$R2\npvlc.dll"\r
- Delete /REBOOTOK "$R2\libvlc.dll"\r
- Delete /REBOOTOK "$R2\vlcintf.xpt"\r
- Goto "${Index}-Loop"\r
-\r
- "${Index}-End:"\r
- !undef Index\r
- Delete /REBOOTOK "$INSTDIR\npvlc.dll"\r
-\r
- RMDir "$SMPROGRAMS\VideoLAN"\r
- RMDir /r $SMPROGRAMS\VideoLAN\r
-\r
- FileOpen $UninstallLog "$INSTDIR\uninstall.log" r\r
- UninstallLoop:\r
- ClearErrors\r
- FileRead $UninstallLog $R0\r
- IfErrors UninstallEnd\r
- Push $R0\r
- Call un.TrimNewLines\r
- Pop $R0\r
- Delete "$INSTDIR\$R0"\r
- Goto UninstallLoop\r
- UninstallEnd:\r
- FileClose $UninstallLog\r
- Delete "$INSTDIR\uninstall.log"\r
- Delete "$INSTDIR\uninstall.exe"\r
- Push "\"\r
- Call un.RemoveEmptyDirs\r
- RMDir "$INSTDIR"\r
-\r
- DeleteRegKey HKLM Software\VideoLAN\r
-\r
- DeleteRegKey HKCR Applications\vlc.exe\r
- DeleteRegKey HKCR AudioCD\shell\PlayWithVLC\r
- DeleteRegKey HKCR DVD\shell\PlayWithVLC\r
- DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayDVDMovieOnArrival" "VLCPlayDVDMovieOnArrival"\r
- DeleteRegKey HKLM Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival\r
- DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayCDAudioOnArrival" "VLCPlayCDAudioOnArrival"\r
- DeleteRegKey HKLM Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival\r
- DeleteRegKey HKLM Software\Clients\Media\VLC\r
- DeleteRegKey HKCR "VLC.MediaFile"\r
-\r
- DeleteRegKey HKLM \\r
- "SOFTWARE\MozillaPlugins\@videolan.org/vlc,version=${VERSION}"\r
-\r
- DeleteRegKey HKLM \\r
- "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"\r
-\r
- Delete "$DESKTOP\VLC media player.lnk"\r
-\r
- DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"\r
- DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}"\r
- SetAutoClose true\r
-SectionEnd\r
-\r
-Section /o "un.Delete preferences and cache" SEC92\r
- !insertmacro delprefs\r
-SectionEnd\r
-\r
-; Uninstaller section descriptions\r
-!insertmacro MUI_UNFUNCTION_DESCRIPTION_BEGIN\r
- !insertmacro MUI_DESCRIPTION_TEXT ${SEC91} \\r
- "Uninstall VLC media player and all its components"\r
- !insertmacro MUI_DESCRIPTION_TEXT ${SEC92} \\r
- "Deletes VLC media player preferences and cache files"\r
-!insertmacro MUI_UNFUNCTION_DESCRIPTION_END\r
-\r
-;Function un.onUninstSuccess\r
-; HideWindow\r
-; MessageBox MB_ICONINFORMATION|MB_OK \\r
-; "$(^Name) was successfully removed from your computer."\r
-;FunctionEnd\r
-\r
-Function un.onInit\r
- !insertmacro MUI_UNGETLANGUAGE\r
-FunctionEnd\r
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; NSIS installer script for vlc ;
+; (http://nsis.sourceforge.net) ;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+!define PRODUCT_NAME "VLC media player"
+!define VERSION @VERSION@
+!define PRODUCT_VERSION @VERSION@
+!define PRODUCT_GROUP "VideoLAN"
+!define PRODUCT_PUBLISHER "VideoLAN Team"
+!define PRODUCT_WEB_SITE "http://www.videolan.org"
+!define PRODUCT_DIR_REGKEY "Software\VideoLAN\VLC"
+!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
+!define PRODUCT_UNINST_ROOT_KEY "HKLM"
+!define PRODUCT_ID "{ea92ef52-afe4-4212-bacb-dfe9fca94cd6}"
+
+!define MUI_LANGDLL_REGISTRY_ROOT "HKLM"
+!define MUI_LANGDLL_REGISTRY_KEY "${PRODUCT_DIR_REGKEY}"
+!define MUI_LANGDLL_REGISTRY_VALUENAME "Language"
+
+@FILE_LIBVLCCORE_DLL@
+@FILE_LIBVLC_DLL@
+
+;;;;;;;;;;;;;;;;;;;;;;;;;
+; General configuration ;
+;;;;;;;;;;;;;;;;;;;;;;;;;
+
+Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
+OutFile ..\vlc-${VERSION}-win32.exe
+InstallDir "$PROGRAMFILES\VideoLAN\VLC"
+InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" ""
+!ifdef NSIS_LZMA_COMPRESS_WHOLE
+SetCompressor lzma
+!else
+SetCompressor /SOLID lzma
+!endif
+
+;ShowInstDetails show
+;ShowUnInstDetails show
+SetOverwrite ifnewer
+CRCCheck on
+BrandingText "${PRODUCT_GROUP} ${PRODUCT_NAME}"
+
+InstType "Recommended"
+InstType "Minimum"
+InstType "Full"
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; NSIS Modern User Interface configuration ;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+; MUI 1.67 compatible ------
+ !include "MUI.nsh"
+
+; MUI Settings
+ !define MUI_ABORTWARNING
+ !define MUI_ICON "vlc48x48.ico"
+ !define MUI_UNICON "vlc48x48.ico"
+ !define MUI_COMPONENTSPAGE_SMALLDESC
+
+; Installer pages
+ ; Welcome page
+ !define MUI_WELCOMEPAGE_TITLE_3LINES
+ !insertmacro MUI_PAGE_WELCOME
+ ; License page
+ !insertmacro MUI_PAGE_LICENSE "COPYING.txt"
+ ; Components page
+ !insertmacro MUI_PAGE_COMPONENTS
+ ; Directory page
+ !insertmacro MUI_PAGE_DIRECTORY
+ ; Instfiles page
+ !insertmacro MUI_PAGE_INSTFILES
+ ; Finish page
+ !define MUI_FINISHPAGE_RUN "$INSTDIR\vlc.exe"
+ !define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\README.txt"
+ !define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED
+ !define MUI_FINISHPAGE_LINK "Visit the VideoLAN VLC media player Website"
+ !define MUI_FINISHPAGE_LINK_LOCATION "http://www.videolan.org/vlc/"
+ !define MUI_FINISHPAGE_NOREBOOTSUPPORT
+ !insertmacro MUI_PAGE_FINISH
+
+; Uninstaller pages
+ !insertmacro MUI_UNPAGE_CONFIRM
+ !insertmacro MUI_UNPAGE_COMPONENTS
+ !insertmacro MUI_UNPAGE_INSTFILES
+ !insertmacro MUI_UNPAGE_FINISH
+
+; Language files
+ !insertmacro MUI_LANGUAGE "English" # first language is the default language
+ !insertmacro MUI_LANGUAGE "French"
+ !insertmacro MUI_LANGUAGE "German"
+ !insertmacro MUI_LANGUAGE "Spanish"
+ !insertmacro MUI_LANGUAGE "SimpChinese"
+ !insertmacro MUI_LANGUAGE "TradChinese"
+ !insertmacro MUI_LANGUAGE "Japanese"
+ !insertmacro MUI_LANGUAGE "Korean"
+ !insertmacro MUI_LANGUAGE "Italian"
+ !insertmacro MUI_LANGUAGE "Dutch"
+ !insertmacro MUI_LANGUAGE "Danish"
+ !insertmacro MUI_LANGUAGE "Swedish"
+ !insertmacro MUI_LANGUAGE "Norwegian"
+ !insertmacro MUI_LANGUAGE "Finnish"
+ !insertmacro MUI_LANGUAGE "Greek"
+ !insertmacro MUI_LANGUAGE "Russian"
+ !insertmacro MUI_LANGUAGE "Portuguese"
+ !insertmacro MUI_LANGUAGE "Arabic"
+ !insertmacro MUI_LANGUAGE "Polish"
+ !insertmacro MUI_LANGUAGE "Romanian"
+ !insertmacro MUI_LANGUAGE "Slovak"
+ !insertmacro MUI_LANGUAGE "Czech"
+
+; Reserve files for solid compression
+ !insertmacro MUI_RESERVEFILE_LANGDLL
+ !insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
+
+; MUI end ------
+
+;;;;;;;;;;;;;;;;;;;;;;;
+; Macro and Functions ;
+;;;;;;;;;;;;;;;;;;;;;;;
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; 1. File type associations ;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+;; Function that register one extension for VLC
+Function RegisterExtension
+ ; back up old value for extension $R0 (eg. ".opt")
+ ReadRegStr $1 HKCR "$R0" ""
+ StrCmp $1 "" NoBackup
+ StrCmp $1 "VLC$R0" "NoBackup"
+ WriteRegStr HKCR "$R0" "VLC.backup" $1
+NoBackup:
+ WriteRegStr HKCR "$R0" "" "VLC$R0"
+ ReadRegStr $0 HKCR "VLC$R0" ""
+ WriteRegStr HKCR "VLC$R0" "" "VLC media file ($R0)"
+ WriteRegStr HKCR "VLC$R0\shell" "" "Play"
+ WriteRegStr HKCR "VLC$R0\shell\Play\command" "" '"$INSTDIR\vlc.exe" --started-from-file "%1"'
+ WriteRegStr HKCR "VLC$R0\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'
+
+;;; Vista Only part
+ ; Vista detection
+ ReadRegStr $R1 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion
+ StrCpy $R2 $R1 3
+ StrCmp $R2 '6.0' ForVista ToEnd
+ForVista:
+ WriteRegStr HKLM "Software\Clients\Media\VLC\Capabilities\FileAssociations" "$R0" "VLC$R0"
+
+ToEnd:
+FunctionEnd
+
+;; Function that removes one extension that VLC owns.
+Function un.RegisterExtension
+ ;start of restore script
+ ReadRegStr $1 HKCR "$R0" ""
+ StrCmp $1 "VLC$R0" 0 NoOwn ; only do this if we own it
+ ; Read the old value from Backup
+ ReadRegStr $1 HKCR "$R0" "VLC.backup"
+ StrCmp $1 "" 0 Restore ; if backup="" then delete the whole key
+ DeleteRegKey HKCR "$R0"
+ Goto NoOwn
+Restore:
+ WriteRegStr HKCR "$R0" "" $1
+ DeleteRegValue HKCR "$R0" "VLC.backup"
+NoOwn:
+ DeleteRegKey HKCR "VLC$R0" ;Delete key with association settings
+ DeleteRegKey HKLM "Software\Clients\Media\VLC\Capabilities\FileAssociations\VLC$R0" ; for vista
+FunctionEnd
+
+!macro RegisterExtensionSection EXT
+ Section ${EXT}
+ SectionIn 1 3
+ Push $R0
+ StrCpy $R0 ${EXT}
+ Call RegisterExtension
+ Pop $R0
+ SectionEnd
+!macroend
+
+!macro UnRegisterExtensionSection EXT
+ Push $R0
+ StrCpy $R0 ${EXT}
+ Call un.RegisterExtension
+ Pop $R0
+!macroend
+
+!macro WriteRegStrSupportedTypes EXT
+ WriteRegStr HKCR Applications\vlc.exe\SupportedTypes ${EXT} ""
+!macroend
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; Extension lists Macros ;
+; Those macros calls the previous functions ;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+!macro MacroAudioExtensions _action
+ !insertmacro ${_action} ".a52"
+ !insertmacro ${_action} ".aac"
+ !insertmacro ${_action} ".ac3"
+ !insertmacro ${_action} ".dts"
+ !insertmacro ${_action} ".flac"
+ !insertmacro ${_action} ".m4a"
+ !insertmacro ${_action} ".m4p"
+ !insertmacro ${_action} ".mka"
+ !insertmacro ${_action} ".mod"
+ !insertmacro ${_action} ".mp1"
+ !insertmacro ${_action} ".mp2"
+ !insertmacro ${_action} ".mp3"
+ !insertmacro ${_action} ".oma"
+ !insertmacro ${_action} ".ogg"
+ !insertmacro ${_action} ".spx"
+ !insertmacro ${_action} ".wav"
+ !insertmacro ${_action} ".wma"
+ !insertmacro ${_action} ".wma"
+ !insertmacro ${_action} ".xm"
+!macroend
+
+!macro MacroVideoExtensions _action
+ !insertmacro ${_action} ".asf"
+ !insertmacro ${_action} ".avi"
+ !insertmacro ${_action} ".divx"
+ !insertmacro ${_action} ".dv"
+ !insertmacro ${_action} ".flv"
+ !insertmacro ${_action} ".gxf"
+ !insertmacro ${_action} ".m1v"
+ !insertmacro ${_action} ".m2v"
+ !insertmacro ${_action} ".m2ts"
+ !insertmacro ${_action} ".m4v"
+ !insertmacro ${_action} ".mkv"
+ !insertmacro ${_action} ".mov"
+ !insertmacro ${_action} ".mp4"
+ !insertmacro ${_action} ".mpeg"
+ !insertmacro ${_action} ".mpeg1"
+ !insertmacro ${_action} ".mpeg2"
+ !insertmacro ${_action} ".mpeg4"
+ !insertmacro ${_action} ".mpg"
+ !insertmacro ${_action} ".mts"
+ !insertmacro ${_action} ".mxf"
+ !insertmacro ${_action} ".ogm"
+ !insertmacro ${_action} ".ps"
+ !insertmacro ${_action} ".ts"
+ !insertmacro ${_action} ".vob"
+ !insertmacro ${_action} ".wmv"
+!macroend
+
+!macro MacroOtherExtensions _action
+ !insertmacro ${_action} ".asx"
+ !insertmacro ${_action} ".bin"
+ !insertmacro ${_action} ".cue"
+ !insertmacro ${_action} ".m3u"
+ !insertmacro ${_action} ".pls"
+ !insertmacro ${_action} ".vlc"
+!macroend
+
+; One macro to rule them all
+!macro MacroAllExtensions _action
+ !insertmacro MacroAudioExtensions ${_action}
+ !insertmacro MacroVideoExtensions ${_action}
+ !insertmacro MacroOtherExtensions ${_action}
+!macroend
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; 2. Context menu entries ;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+; Generic function for adding the context menu for one ext.
+!macro AddContextMenuExt EXT
+ WriteRegStr HKCR ${EXT}\shell\PlayWithVLC "" "Play with VLC media player"
+ WriteRegStr HKCR ${EXT}\shell\PlayWithVLC\command "" '$INSTDIR\vlc.exe --started-from-file --no-playlist-enqueue "%1"'
+
+ WriteRegStr HKCR ${EXT}\shell\AddToPlaylistVLC "" "Add to VLC media player's Playlist"
+ WriteRegStr HKCR ${EXT}\shell\AddToPlaylistVLC\command "" '$INSTDIR\vlc.exe --started-from-file --playlist-enqueue "%1"'
+!macroend
+
+!macro AddContextMenu EXT
+ Push $R0
+ ReadRegStr $R0 HKCR ${EXT} ""
+ !insertmacro AddContextMenuExt $R0
+ Pop $R0
+!macroend
+
+!macro DeleteContextMenuExt EXT
+ DeleteRegKey HKCR ${EXT}\shell\PlayWithVLC
+ DeleteRegKey HKCR ${EXT}\shell\AddToPlaylistVLC
+!macroend
+
+!macro DeleteContextMenu EXT
+ Push $R0
+ ReadRegStr $R0 HKCR ${EXT} ""
+ !insertmacro DeleteContextMenuExt $R0
+ Pop $R0
+!macroend
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; 3. Delete prefs and cache ;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+!macro delprefs
+ StrCpy $0 0
+ !define Index 'Line${__LINE__}'
+ "${Index}-Loop:"
+ ; FIXME
+ ; this will loop through all the logged users and "virtual" windows users
+ ; (it looks like users are only present in HKEY_USERS when they are logged in)
+ ClearErrors
+ EnumRegKey $1 HKU "" $0
+ StrCmp $1 "" "${Index}-End"
+ IntOp $0 $0 + 1
+ ReadRegStr $2 HKU "$1\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" AppData
+ StrCmp $2 "" "${Index}-Loop"
+ RMDir /r "$2\vlc"
+ Goto "${Index}-Loop"
+ "${Index}-End:"
+ !undef Index
+!macroend
+
+;;;;;;;;;;;;;;;
+; 4. Logging ;
+;;;;;;;;;;;;;;;
+Var UninstallLog
+!macro OpenUninstallLog
+ FileOpen $UninstallLog "$INSTDIR\uninstall.log" a
+ FileSeek $UninstallLog 0 END
+!macroend
+
+!macro CloseUninstallLog
+ FileClose $UninstallLog
+ SetFileAttributes "$INSTDIR\uninstall.log" HIDDEN
+!macroend
+
+;;;;;;;;;;;;;;;;;;;;
+; 5. Installations ;
+;;;;;;;;;;;;;;;;;;;;
+!macro InstallFile FILEREGEX
+ File "${FILEREGEX}"
+ !define Index 'Line${__LINE__}'
+ FindFirst $0 $1 "$INSTDIR\${FILEREGEX}"
+ StrCmp $0 "" "${Index}-End"
+ "${Index}-Loop:"
+ StrCmp $1 "" "${Index}-End"
+ FileWrite $UninstallLog "$1$\r$\n"
+ FindNext $0 $1
+ Goto "${Index}-Loop"
+ "${Index}-End:"
+ !undef Index
+!macroend
+
+!macro InstallFolder FOLDER
+ File /r "${FOLDER}"
+ Push "${FOLDER}"
+ Call InstallFolderInternal
+!macroend
+
+Function InstallFolderInternal
+ Pop $9
+ !define Index 'Line${__LINE__}'
+ FindFirst $0 $1 "$INSTDIR\$9\*"
+ StrCmp $0 "" "${Index}-End"
+ "${Index}-Loop:"
+ StrCmp $1 "" "${Index}-End"
+ StrCmp $1 "." "${Index}-Next"
+ StrCmp $1 ".." "${Index}-Next"
+ IfFileExists "$9\$1\*" 0 "${Index}-Write"
+ Push $0
+ Push $9
+ Push "$9\$1"
+ Call InstallFolderInternal
+ Pop $9
+ Pop $0
+ Goto "${Index}-Next"
+ "${Index}-Write:"
+ FileWrite $UninstallLog "$9\$1$\r$\n"
+ "${Index}-Next:"
+ FindNext $0 $1
+ Goto "${Index}-Loop"
+ "${Index}-End:"
+ !undef Index
+FunctionEnd
+;;; End of Macros
+
+
+;;;;;;;;;;;;;;;;;;;;;;
+; Installer sections ;
+; The CORE of the ;
+; installer ;
+;;;;;;;;;;;;;;;;;;;;;;
+
+Section "Media player (required)" SEC01
+ SectionIn 1 2 3 RO
+ SetShellVarContext all
+ SetOutPath "$INSTDIR"
+
+ !insertmacro OpenUninstallLog
+
+ ; VLC.exe, libvlc.dll
+ !insertmacro InstallFile vlc.exe
+ !insertmacro InstallFile vlc.exe.manifest
+ !ifdef LIBVLCCORE_DLL
+ !insertmacro InstallFile ${LIBVLCCORE_DLL}
+ !endif
+ !ifdef LIBVLC_DLL
+ !insertmacro InstallFile ${LIBVLC_DLL}
+ !endif
+
+ ; Text files
+ !insertmacro InstallFile *.txt
+
+ ; Subfolders
+ !insertmacro InstallFolder plugins
+ !insertmacro InstallFolder locale
+ !insertmacro InstallFolder osdmenu
+ !insertmacro InstallFolder skins
+ !insertmacro InstallFolder http
+ !insertmacro InstallFolder lua
+
+ ; URLs
+ WriteIniStr "$INSTDIR\${PRODUCT_GROUP} Website.url" "InternetShortcut" "URL" \
+ "${PRODUCT_WEB_SITE}"
+ FileWrite $UninstallLog "${PRODUCT_GROUP} Website.url$\r$\n"
+ WriteIniStr "$INSTDIR\Documentation.url" "InternetShortcut" "URL" \
+ "${PRODUCT_WEB_SITE}/doc/"
+ FileWrite $UninstallLog "Documentation.url$\r$\n"
+ WriteIniStr "$INSTDIR\New_Skins.url" "InternetShortcut" "URL" \
+ "${PRODUCT_WEB_SITE}/vlc/skins.php"
+ FileWrite $UninstallLog "New_Skins.url$\r$\n"
+
+ !insertmacro CloseUninstallLog
+
+ ; Add VLC to "recomended programs" for the following extensions
+ WriteRegStr HKCR Applications\vlc.exe "" ""
+ WriteRegStr HKCR Applications\vlc.exe "FriendlyAppName" "VLC media player"
+ WriteRegStr HKCR Applications\vlc.exe\shell\Play "" "Play with VLC"
+ WriteRegStr HKCR Applications\vlc.exe\shell\Play\command "" \
+ '$INSTDIR\vlc.exe --started-from-file "%1"'
+ !insertmacro MacroAllExtensions WriteRegStrSupportedTypes
+
+; Vista Registration
+ ; Vista detection
+ ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion
+ StrCpy $R1 $R0 3
+ StrCmp $R1 '6.0' lbl_vista lbl_done
+
+ lbl_vista:
+ WriteRegStr HKLM "Software\RegisteredApplications" "VLC" "Software\Clients\Media\VLC\Capabilities"
+ WriteRegStr HKLM "Software\Clients\Media\VLC\Capabilities" "ApplicationName" "VLC media player"
+ WriteRegStr HKLM "Software\Clients\Media\VLC\Capabilities" "ApplicationDescription" "VLC - The video swiss knife"
+
+ lbl_done:
+SectionEnd
+
+Section "Start Menu Shortcut" SEC02a
+ SectionIn 1 2 3
+ CreateDirectory "$SMPROGRAMS\VideoLAN"
+ CreateDirectory "$SMPROGRAMS\VideoLAN\Quick Settings"
+ CreateDirectory "$SMPROGRAMS\VideoLAN\Quick Settings\Audio"
+ CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Audio\Set Audio mode to DirectX (default).lnk" \
+ "$INSTDIR\vlc.exe" "--aout aout_directx --save-config vlc://quit"
+ CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Audio\Set Audio mode to Waveout.lnk" \
+ "$INSTDIR\vlc.exe" "--aout waveout --save-config vlc://quit"
+ CreateDirectory "$SMPROGRAMS\VideoLAN\Quick Settings\Interface"
+ CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Interface\Set Main Interface to Skinnable.lnk" \
+ "$INSTDIR\vlc.exe" "-I skins --save-config vlc://quit"
+ CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Interface\Set Main Interface to Qt (default).lnk" \
+ "$INSTDIR\vlc.exe" "-I qt --save-config vlc://quit"
+ CreateDirectory "$SMPROGRAMS\VideoLAN\Quick Settings\Video"
+ ; FIXME add detection for Vista. Direct3D will be default there, for all others it's DirectX
+ CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to Direct3D.lnk" \
+ "$INSTDIR\vlc.exe" "--vout direct3d --overlay --directx-hw-yuv --save-config vlc://quit"
+ CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to Direct3D (no hardware acceleration).lnk" \
+ "$INSTDIR\vlc.exe" "--vout direct3d --overlay --no-directx-hw-yuv --save-config vlc://quit"
+ CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to DirectX.lnk" \
+ "$INSTDIR\vlc.exe" "--vout directx --overlay --directx-hw-yuv --save-config vlc://quit"
+ CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to DirectX (no hardware acceleration).lnk" \
+ "$INSTDIR\vlc.exe" "--vout directx --no-overlay --no-directx-hw-yuv --save-config vlc://quit"
+ CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to DirectX (no video overlay).lnk" \
+ "$INSTDIR\vlc.exe" "--vout directx --no-overlay --directx-hw-yuv --save-config vlc://quit"
+ CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to OpenGL.lnk" \
+ "$INSTDIR\vlc.exe" "--vout opengl --overlay --save-config vlc://quit"
+ CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Reset VLC media player preferences and cache files.lnk" \
+ "$INSTDIR\vlc.exe" "--reset-config --reset-plugins-cache vlc://quit"
+ CreateShortCut "$SMPROGRAMS\VideoLAN\Documentation.lnk" \
+ "$INSTDIR\Documentation.url"
+ CreateShortCut "$SMPROGRAMS\VideoLAN\Release Notes.lnk" \
+ "$INSTDIR\NEWS.txt" ""
+ CreateShortCut "$SMPROGRAMS\VideoLAN\${PRODUCT_GROUP} Website.lnk" \
+ "$INSTDIR\${PRODUCT_GROUP} Website.url"
+ CreateShortCut "$SMPROGRAMS\VideoLAN\VLC media player.lnk" \
+ "$INSTDIR\vlc.exe" ""
+SectionEnd
+
+Section "Desktop Shortcut" SEC02b
+ SectionIn 1 2 3
+ CreateShortCut "$DESKTOP\VLC media player.lnk" \
+ "$INSTDIR\vlc.exe" ""
+SectionEnd
+
+Section /o "Mozilla plugin" SEC03
+ SectionIn 3
+
+ SetOutPath "$INSTDIR"
+ !insertmacro OpenUninstallLog
+ !insertmacro InstallFile mozilla\npvlc.dll
+ !insertmacro CloseUninstallLog
+
+ !define Moz "SOFTWARE\MozillaPlugins\@videolan.org/vlc,version=${VERSION}"
+ WriteRegStr HKLM ${Moz} "Description" "VLC Multimedia Plugin"
+ WriteRegStr HKLM ${Moz} "Path" "$INSTDIR\npvlc.dll"
+ WriteRegStr HKLM ${Moz} "Product" "VLC media player"
+ WriteRegStr HKLM ${Moz} "Vendor" "VideoLAN"
+ WriteRegStr HKLM ${Moz} "Version" "${VERSION}"
+
+ ; for very old version of mozilla, these lines may be needed
+ ;Push $R0
+ ;Push $R1
+ ;Push $R2
+
+ ;!define Index 'Line${__LINE__}'
+ ;StrCpy $R1 "0"
+
+ ;"${Index}-Loop:"
+
+ ; ; Check for Key
+ ; EnumRegKey $R0 HKLM "SOFTWARE\Mozilla" "$R1"
+ ; StrCmp $R0 "" "${Index}-End"
+ ; IntOp $R1 $R1 + 1
+ ; ReadRegStr $R2 HKLM "SOFTWARE\Mozilla\$R0\Extensions" "Plugins"
+ ; StrCmp $R2 "" "${Index}-Loop" ""
+
+ ; CopyFiles "$INSTDIR\npvlc.dll" "$R2"
+ ; !ifdef LIBVLC_DLL
+ ; CopyFiles ${LIBVLC_DLL} "$R2"
+ ; !endif
+ ; !ifdef LIBVLC_CONTROL_DLL
+ ; CopyFiles ${LIBVLC_CONTROL_DLL} "$R2"
+ ; !endif
+ ; Goto "${Index}-Loop"
+
+ ;"${Index}-End:"
+ ;!undef Index
+
+SectionEnd
+
+Section "ActiveX plugin" SEC04
+ SectionIn 1 3
+ SetOutPath "$INSTDIR"
+ !insertmacro OpenUninstallLog
+ !insertmacro InstallFile activex\axvlc.dll
+ !insertmacro CloseUninstallLog
+ RegDLL "$INSTDIR\axvlc.dll"
+SectionEnd
+
+Section "Discs Playback" SEC05
+ SectionIn 1 2 3
+ WriteRegStr HKCR "AudioCD\shell\PlayWithVLC" "" "Play with VLC media player"
+ WriteRegStr HKCR "AudioCD\shell\PlayWithVLC\command" "" \
+ "$INSTDIR\vlc.exe --started-from-file cdda://%1"
+ WriteRegStr HKCR "DVD\shell\PlayWithVLC" "" "Play with VLC media player"
+ WriteRegStr HKCR "DVD\shell\PlayWithVLC\command" "" \
+ "$INSTDIR\vlc.exe --started-from-file dvd://%1"
+
+ WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayDVDMovieOnArrival" "VLCPlayDVDMovieOnArrival" ""
+ WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "Action" "Play DVD movie"
+ WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "DefaultIcon" '"$INSTDIR\vlc.exe",0'
+ WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "InvokeProgID" "VLC.DVDMovie"
+ WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "InvokeVerb" "play"
+ WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "Provider" "VideoLAN VLC media player"
+
+ WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayCDAudioOnArrival" "VLCPlayCDAudioOnArrival" ""
+ WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "Action" "Play CD audio"
+ WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "DefaultIcon" '"$INSTDIR\vlc.exe",0'
+ WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "InvokeProgID" "VLC.CDAudio"
+ WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "InvokeVerb" "play"
+ WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "Provider" "VideoLAN VLC media player"
+ WriteRegStr HKCR "VLC.DVDMovie" "" "VLC DVD Movie"
+ WriteRegStr HKCR "VLC.DVDMovie\shell" "" "Play"
+ WriteRegStr HKCR "VLC.DVDMovie\shell\Play\command" "" \
+ '$INSTDIR\vlc.exe --started-from-file dvd://%1'
+ WriteRegStr HKCR "VLC.DVDMovie\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'
+ WriteRegStr HKCR "VLC.CDAudio" "" "VLC CD Audio"
+ WriteRegStr HKCR "VLC.CDAudio\shell" "" "Play"
+ WriteRegStr HKCR "VLC.CDAudio\shell\Play\command" "" \
+ '$INSTDIR\vlc.exe --started-from-file cdda://%1'
+ WriteRegStr HKCR "VLC.CDAudio\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'
+
+SectionEnd
+
+SectionGroup "File type associations" SEC06
+ SectionGroup "Audio Files"
+ !insertmacro MacroAudioExtensions RegisterExtensionSection
+ SectionGroupEnd
+ SectionGroup "Video Files"
+ !insertmacro MacroVideoExtensions RegisterExtensionSection
+ SectionGroupEnd
+ SectionGroup "Other"
+ !insertmacro MacroOtherExtensions RegisterExtensionSection
+ SectionGroupEnd
+SectionGroupEnd
+
+Section "Context Menus" SEC07
+ SectionIn 3
+ !insertmacro MacroAllExtensions AddContextMenu
+ !insertmacro AddContextMenuExt "Directory"
+SectionEnd
+
+Section /o "Delete preferences and cache" SEC08
+ !insertmacro delprefs
+SectionEnd
+
+; Installer section descriptions
+!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
+ !insertmacro MUI_DESCRIPTION_TEXT ${SEC01} \
+ "The media player itself"
+ !insertmacro MUI_DESCRIPTION_TEXT ${SEC02a} \
+ "Adds icons to your start menu for easy access"
+ !insertmacro MUI_DESCRIPTION_TEXT ${SEC02b} \
+ "Adds icon to your desktop for easy access"
+ !insertmacro MUI_DESCRIPTION_TEXT ${SEC03} \
+ "The VLC Mozilla and Mozilla Firefox plugin"
+ !insertmacro MUI_DESCRIPTION_TEXT ${SEC04} \
+ "The VLC ActiveX plugin"
+ !insertmacro MUI_DESCRIPTION_TEXT ${SEC05} \
+ "DVD and CD playback registration"
+ !insertmacro MUI_DESCRIPTION_TEXT ${SEC06} \
+ "Sets VLC media player as the default application for the specified file type"
+ !insertmacro MUI_DESCRIPTION_TEXT ${SEC07} \
+ "Add context menu items ('Play With VLC' and 'Add To VLC's Playlist')"
+ !insertmacro MUI_DESCRIPTION_TEXT ${SEC08} \
+ "Deletes VLC media player preferences and cache files leftover from previous installations"
+!insertmacro MUI_FUNCTION_DESCRIPTION_END
+
+;;; Start function
+Function .onInit
+ ReadRegStr $R0 ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
+ "UninstallString"
+ StrCmp $R0 "" done
+
+ MessageBox MB_YESNO|MB_ICONEXCLAMATION \
+ "VLC media player has already been installed. $\nDo you want to remove \
+ the previous version before installing $(^Name) ?" \
+ IDNO done
+
+ ;Run the uninstaller
+ ;uninst:
+ ClearErrors
+ ExecWait '$R0 _?=$INSTDIR' ;Do not copy the uninstaller to a temp file
+ done:
+ !insertmacro MUI_LANGDLL_DISPLAY
+
+FunctionEnd
+
+;; End function
+Section -Post
+ WriteUninstaller "$INSTDIR\uninstall.exe"
+ WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "InstallDir" $INSTDIR
+ WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "Version" "${VERSION}"
+ WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\vlc.exe"
+
+ WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
+ "DisplayName" "$(^Name)"
+ WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
+ "UninstallString" "$INSTDIR\uninstall.exe"
+ WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
+ "DisplayIcon" "$INSTDIR\vlc.exe"
+ WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
+ "DisplayVersion" "${PRODUCT_VERSION}"
+ WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
+ "URLInfoAbout" "${PRODUCT_WEB_SITE}"
+ WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
+ "Publisher" "${PRODUCT_PUBLISHER}"
+SectionEnd
+
+;;;;;;;;;;;;;;;;;;;;;;;;
+; Uninstaller sections ;
+;;;;;;;;;;;;;;;;;;;;;;;;
+
+; TrimNewlines (copied from NSIS documentation)
+; input, top of stack (e.g. whatever$\r$\n)
+; output, top of stack (replaces, with e.g. whatever)
+; modifies no other variables.
+
+Function un.TrimNewlines
+ Exch $R0
+ Push $R1
+ Push $R2
+ StrCpy $R1 0
+
+ loop:
+ IntOp $R1 $R1 - 1
+ StrCpy $R2 $R0 1 $R1
+ StrCmp $R2 "$\r" loop
+ StrCmp $R2 "$\n" loop
+ IntOp $R1 $R1 + 1
+ IntCmp $R1 0 no_trim_needed
+ StrCpy $R0 $R0 $R1
+
+ no_trim_needed:
+ Pop $R2
+ Pop $R1
+ Exch $R0
+FunctionEnd
+
+Function un.RemoveEmptyDirs
+ Pop $9
+ !define Index 'Line${__LINE__}'
+ FindFirst $0 $1 "$INSTDIR$9*"
+ StrCmp $0 "" "${Index}-End"
+ "${Index}-Loop:"
+ StrCmp $1 "" "${Index}-End"
+ StrCmp $1 "." "${Index}-Next"
+ StrCmp $1 ".." "${Index}-Next"
+ Push $0
+ Push $1
+ Push $9
+ Push "$9$1\"
+ Call un.RemoveEmptyDirs
+ Pop $9
+ Pop $1
+ Pop $0
+ "${Index}-Remove:"
+ RMDir "$INSTDIR$9$1"
+ "${Index}-Next:"
+ FindNext $0 $1
+ Goto "${Index}-Loop"
+ "${Index}-End:"
+ FindClose $0
+ !undef Index
+FunctionEnd
+
+Section "Uninstall" SEC91
+ SectionIn 1 2 3 RO
+ SetShellVarContext all
+
+ !insertmacro MacroAllExtensions DeleteContextMenu
+ !insertmacro MacroAllExtensions UnRegisterExtensionSection
+ !insertmacro DeleteContextMenuExt "Directory"
+
+ ;remove activex plugin
+ UnRegDLL "$INSTDIR\axvlc.dll"
+ Delete /REBOOTOK "$INSTDIR\axvlc.dll"
+
+ ;remove mozilla plugin
+ Push $R0
+ Push $R1
+ Push $R2
+
+ !define Index 'Line${__LINE__}'
+ StrCpy $R1 "0"
+
+ "${Index}-Loop:"
+
+ ; Check for Key
+ EnumRegKey $R0 HKLM "SOFTWARE\Mozilla" "$R1"
+ StrCmp $R0 "" "${Index}-End"
+ IntOp $R1 $R1 + 1
+ ReadRegStr $R2 HKLM "SOFTWARE\Mozilla\$R0\Extensions" "Plugins"
+ StrCmp $R2 "" "${Index}-Loop" ""
+
+ ; old files (0.8.5 and before) that may be lying around
+ Delete /REBOOTOK "$R2\npvlc.dll"
+ Delete /REBOOTOK "$R2\libvlc.dll"
+ Delete /REBOOTOK "$R2\vlcintf.xpt"
+ Goto "${Index}-Loop"
+
+ "${Index}-End:"
+ !undef Index
+ Delete /REBOOTOK "$INSTDIR\npvlc.dll"
+
+ RMDir "$SMPROGRAMS\VideoLAN"
+ RMDir /r $SMPROGRAMS\VideoLAN
+
+ FileOpen $UninstallLog "$INSTDIR\uninstall.log" r
+ UninstallLoop:
+ ClearErrors
+ FileRead $UninstallLog $R0
+ IfErrors UninstallEnd
+ Push $R0
+ Call un.TrimNewLines
+ Pop $R0
+ Delete "$INSTDIR\$R0"
+ Goto UninstallLoop
+ UninstallEnd:
+ FileClose $UninstallLog
+ Delete "$INSTDIR\uninstall.log"
+ Delete "$INSTDIR\uninstall.exe"
+ Push "\"
+ Call un.RemoveEmptyDirs
+ RMDir "$INSTDIR"
+
+ DeleteRegKey HKLM Software\VideoLAN
+
+ DeleteRegKey HKCR Applications\vlc.exe
+ DeleteRegKey HKCR AudioCD\shell\PlayWithVLC
+ DeleteRegKey HKCR DVD\shell\PlayWithVLC
+ DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayDVDMovieOnArrival" "VLCPlayDVDMovieOnArrival"
+ DeleteRegKey HKLM Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival
+ DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayCDAudioOnArrival" "VLCPlayCDAudioOnArrival"
+ DeleteRegKey HKLM Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival
+ DeleteRegKey HKLM Software\Clients\Media\VLC
+ DeleteRegKey HKCR "VLC.MediaFile"
+
+ DeleteRegKey HKLM \
+ "SOFTWARE\MozillaPlugins\@videolan.org/vlc,version=${VERSION}"
+
+ DeleteRegKey HKLM \
+ "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
+
+ Delete "$DESKTOP\VLC media player.lnk"
+
+ DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
+ DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}"
+ SetAutoClose true
+SectionEnd
+
+Section /o "un.Delete preferences and cache" SEC92
+ !insertmacro delprefs
+SectionEnd
+
+; Uninstaller section descriptions
+!insertmacro MUI_UNFUNCTION_DESCRIPTION_BEGIN
+ !insertmacro MUI_DESCRIPTION_TEXT ${SEC91} \
+ "Uninstall VLC media player and all its components"
+ !insertmacro MUI_DESCRIPTION_TEXT ${SEC92} \
+ "Deletes VLC media player preferences and cache files"
+!insertmacro MUI_UNFUNCTION_DESCRIPTION_END
+
+;Function un.onUninstSuccess
+; HideWindow
+; MessageBox MB_ICONINFORMATION|MB_OK \
+; "$(^Name) was successfully removed from your computer."
+;FunctionEnd
+
+Function un.onInit
+ !insertmacro MUI_UNGETLANGUAGE
+FunctionEnd