vlc.win32.nsi.in
资源名称:vlc-1.0.5.zip [点击查看]
上传用户:kjfoods
上传日期:2020-07-06
资源大小:29949k
文件大小:32k
源码类别:
midi
开发平台:
Unix_Linux
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ; NSIS installer script for vlc ;
- ; (http://nsis.sourceforge.net) ;
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- !include "languagesdeclaration.nsh"
- !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 "SoftwareVideoLANVLC"
- !define PRODUCT_UNINST_KEY "SoftwareMicrosoftWindowsCurrentVersionUninstall${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"
- @BUILD_ACTIVEX_TRUE@ !define INSTALL_ACTIVEX
- @BUILD_MOZILLA_TRUE@ !define INSTALL_MOZILLA
- @FILE_LIBVLCCORE_DLL@
- @FILE_LIBVLC_DLL@
- ;;;;;;;;;;;;;;;;;;;;;;;;;
- ; General configuration ;
- ;;;;;;;;;;;;;;;;;;;;;;;;;
- Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
- OutFile ..vlc-${VERSION}-win32.exe
- InstallDir "$PROGRAMFILESVideoLANVLC"
- 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 $Name_InstTypeRecommended
- InstType $Name_InstTypeMinimum
- InstType $Name_InstTypeFull
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ; NSIS Modern User Interface configuration ;
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ; MUI 1.67 compatible ------
- !include "MUI.nsh"
- ; MUI Settings
- !define MUI_ABORTWARNING
- !define MUI_ICON "vlc.ico"
- !define MUI_UNICON "vlc.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 "$INSTDIRvlc.exe"
- !define MUI_FINISHPAGE_SHOWREADME "$INSTDIRREADME.txt"
- !define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED
- !define MUI_FINISHPAGE_LINK $Link_VisitWebsite
- !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 "PortugueseBR"
- !insertmacro MUI_LANGUAGE "Arabic"
- !insertmacro MUI_LANGUAGE "Polish"
- !insertmacro MUI_LANGUAGE "Romanian"
- !insertmacro MUI_LANGUAGE "Slovak"
- !insertmacro MUI_LANGUAGE "Czech"
- !insertmacro MUI_LANGUAGE "Hungarian"
- !insertmacro MUI_LANGUAGE "Catalan"
- !insertmacro MUI_LANGUAGE "Bulgarian"
- ; 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$R0shell" "" "Open"
- WriteRegStr HKCR "VLC$R0shellOpen" "" $ShellAssociation_Play
- WriteRegStr HKCR "VLC$R0shellOpencommand" "" '"$INSTDIRvlc.exe" --started-from-file "%1"'
- WriteRegStr HKCR "VLC$R0DefaultIcon" "" '"$INSTDIRvlc.exe",0'
- ;;; Vista Only part
- ; Vista detection
- ReadRegStr $R1 HKLM "SOFTWAREMicrosoftWindows NTCurrentVersion" CurrentVersion
- StrCpy $R2 $R1 3
- StrCmp $R2 '6.0' ForVista ToEnd
- ForVista:
- WriteRegStr HKLM "SoftwareClientsMediaVLCCapabilitiesFileAssociations" "$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 "SoftwareClientsMediaVLCCapabilitiesFileAssociationsVLC$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 Applicationsvlc.exeSupportedTypes ${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} ".oga"
- !insertmacro ${_action} ".spx"
- !insertmacro ${_action} ".tta"
- !insertmacro ${_action} ".wav"
- !insertmacro ${_action} ".wma"
- !insertmacro ${_action} ".wv"
- !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} ".nuv"
- !insertmacro ${_action} ".ogg"
- !insertmacro ${_action} ".ogm"
- !insertmacro ${_action} ".ogx"
- !insertmacro ${_action} ".ogv"
- !insertmacro ${_action} ".rmvb"
- !insertmacro ${_action} ".ts"
- !insertmacro ${_action} ".vob"
- !insertmacro ${_action} ".wmv"
- !macroend
- !macro MacroOtherExtensions _action
- !insertmacro ${_action} ".asx"
- !insertmacro ${_action} ".bin"
- !insertmacro ${_action} ".cue"
- !insertmacro ${_action} ".ifo"
- !insertmacro ${_action} ".m3u"
- !insertmacro ${_action} ".pls"
- !insertmacro ${_action} ".vlc"
- !insertmacro ${_action} ".xspf"
- !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}shellPlayWithVLC "" $ContextMenuEntry_PlayWith
- WriteRegStr HKCR ${EXT}shellPlayWithVLCcommand "" '"$INSTDIRvlc.exe" --started-from-file --no-playlist-enqueue "%1"'
- WriteRegStr HKCR ${EXT}shellAddToPlaylistVLC "" $ContextMenuEntry_AddToPlaylist
- WriteRegStr HKCR ${EXT}shellAddToPlaylistVLCcommand "" '"$INSTDIRvlc.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}shellPlayWithVLC
- DeleteRegKey HKCR ${EXT}shellAddToPlaylistVLC
- !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 "$1SoftwareMicrosoftWindowsCurrentVersionExplorerShell Folders" AppData
- StrCmp $2 "" "${Index}-Loop"
- RMDir /r "$2vlc"
- Goto "${Index}-Loop"
- "${Index}-End:"
- !undef Index
- !macroend
- ;;;;;;;;;;;;;;;
- ; 4. Logging ;
- ;;;;;;;;;;;;;;;
- Var UninstallLog
- !macro OpenUninstallLog
- FileOpen $UninstallLog "$INSTDIRuninstall.log" a
- FileSeek $UninstallLog 0 END
- !macroend
- !macro CloseUninstallLog
- FileClose $UninstallLog
- SetFileAttributes "$INSTDIRuninstall.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 $Name_Section01 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
- ; All dlls
- !insertmacro InstallFile *.dll
- ; Text files
- !insertmacro InstallFile *.txt
- ; Subfolders
- !insertmacro InstallFolder plugins
- !insertmacro InstallFolder locale
- @BUILD_OSDMENU_TRUE@ !insertmacro InstallFolder osdmenu
- @BUILD_SKINS_TRUE@ !insertmacro InstallFolder skins
- @BUILD_HTTPD_TRUE@ !insertmacro InstallFolder http
- @BUILD_LUA_TRUE@ !insertmacro InstallFolder lua
- ; URLs
- WriteIniStr "$INSTDIR${PRODUCT_GROUP} Website.url" "InternetShortcut" "URL"
- "${PRODUCT_WEB_SITE}"
- FileWrite $UninstallLog "${PRODUCT_GROUP} Website.url$r$n"
- WriteIniStr "$INSTDIRDocumentation.url" "InternetShortcut" "URL"
- "${PRODUCT_WEB_SITE}/doc/"
- FileWrite $UninstallLog "Documentation.url$r$n"
- WriteIniStr "$INSTDIRNew_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 Applicationsvlc.exe "" ""
- WriteRegStr HKCR Applicationsvlc.exe "FriendlyAppName" "VLC media player"
- WriteRegStr HKCR Applicationsvlc.exeshellOpen "" $ContextMenuEntry_PlayWith
- WriteRegStr HKCR Applicationsvlc.exeshellOpencommand ""
- '"$INSTDIRvlc.exe" --started-from-file "%1"'
- !insertmacro MacroAllExtensions WriteRegStrSupportedTypes
- ; Vista Registration
- ; Vista detection
- ReadRegStr $R0 HKLM "SOFTWAREMicrosoftWindows NTCurrentVersion" CurrentVersion
- StrCpy $R1 $R0 3
- StrCmp $R1 '6.0' lbl_vista lbl_done
- lbl_vista:
- WriteRegStr HKLM "SoftwareRegisteredApplications" "VLC" "SoftwareClientsMediaVLCCapabilities"
- WriteRegStr HKLM "SoftwareClientsMediaVLCCapabilities" "ApplicationName" "VLC media player"
- WriteRegStr HKLM "SoftwareClientsMediaVLCCapabilities" "ApplicationDescription" "VLC - The video swiss knife"
- lbl_done:
- SectionEnd
- Section $Name_Section02a SEC02a
- SectionIn 1 2 3
- CreateDirectory "$SMPROGRAMSVideoLAN"
- CreateDirectory "$SMPROGRAMSVideoLANQuick Settings"
- CreateDirectory "$SMPROGRAMSVideoLANQuick SettingsAudio"
- CreateShortCut "$SMPROGRAMSVideoLANQuick SettingsAudioSet Audio mode to DirectX (default).lnk"
- "$INSTDIRvlc.exe" "--aout aout_directx --save-config vlc://quit"
- CreateShortCut "$SMPROGRAMSVideoLANQuick SettingsAudioSet Audio mode to Waveout.lnk"
- "$INSTDIRvlc.exe" "--aout waveout --save-config vlc://quit"
- CreateDirectory "$SMPROGRAMSVideoLANQuick SettingsInterface"
- @BUILD_SKINS_TRUE@ CreateShortCut "$SMPROGRAMSVideoLANQuick SettingsInterfaceSet Main Interface to Skinnable.lnk"
- @BUILD_SKINS_TRUE@ "$INSTDIRvlc.exe" "-I skins --save-config vlc://quit"
- CreateShortCut "$SMPROGRAMSVideoLANQuick SettingsInterfaceSet Main Interface to Qt (default).lnk"
- "$INSTDIRvlc.exe" "-I qt --save-config vlc://quit"
- CreateDirectory "$SMPROGRAMSVideoLANQuick SettingsVideo"
- ; FIXME add detection for Vista. Direct3D will be default there, for all others it's DirectX
- CreateShortCut "$SMPROGRAMSVideoLANQuick SettingsVideoSet Video mode to Direct3D.lnk"
- "$INSTDIRvlc.exe" "--vout direct3d --overlay --directx-hw-yuv --save-config vlc://quit"
- CreateShortCut "$SMPROGRAMSVideoLANQuick SettingsVideoSet Video mode to Direct3D (no hardware acceleration).lnk"
- "$INSTDIRvlc.exe" "--vout direct3d --overlay --no-directx-hw-yuv --save-config vlc://quit"
- CreateShortCut "$SMPROGRAMSVideoLANQuick SettingsVideoSet Video mode to DirectX.lnk"
- "$INSTDIRvlc.exe" "--vout directx --overlay --directx-hw-yuv --save-config vlc://quit"
- CreateShortCut "$SMPROGRAMSVideoLANQuick SettingsVideoSet Video mode to DirectX (no hardware acceleration).lnk"
- "$INSTDIRvlc.exe" "--vout directx --no-overlay --no-directx-hw-yuv --save-config vlc://quit"
- CreateShortCut "$SMPROGRAMSVideoLANQuick SettingsVideoSet Video mode to DirectX (no video overlay).lnk"
- "$INSTDIRvlc.exe" "--vout directx --no-overlay --directx-hw-yuv --save-config vlc://quit"
- CreateShortCut "$SMPROGRAMSVideoLANQuick SettingsVideoSet Video mode to OpenGL.lnk"
- "$INSTDIRvlc.exe" "--vout opengl --overlay --save-config vlc://quit"
- CreateShortCut "$SMPROGRAMSVideoLANQuick SettingsReset VLC media player preferences and cache files.lnk"
- "$INSTDIRvlc.exe" "--reset-config --reset-plugins-cache vlc://quit"
- CreateShortCut "$SMPROGRAMSVideoLANDocumentation.lnk"
- "$INSTDIRDocumentation.url"
- CreateShortCut "$SMPROGRAMSVideoLANRelease Notes.lnk"
- "$INSTDIRNEWS.txt" ""
- CreateShortCut "$SMPROGRAMSVideoLAN${PRODUCT_GROUP} Website.lnk"
- "$INSTDIR${PRODUCT_GROUP} Website.url"
- CreateShortCut "$SMPROGRAMSVideoLANVLC media player.lnk"
- "$INSTDIRvlc.exe" ""
- SectionEnd
- Section $Name_Section02b SEC02b
- SectionIn 1 2 3
- CreateShortCut "$DESKTOPVLC media player.lnk"
- "$INSTDIRvlc.exe" ""
- SectionEnd
- !ifdef INSTALL_MOZILLA
- Section /o $Name_Section03 SEC03
- SectionIn 3
- SetOutPath "$INSTDIR"
- !insertmacro OpenUninstallLog
- !insertmacro InstallFile mozillanpvlc.dll
- !insertmacro InstallFile mozillanpvlc.dll.manifest
- !insertmacro CloseUninstallLog
- !define Moz "SOFTWAREMozillaPlugins@videolan.org/vlc,version=${VERSION}"
- WriteRegStr HKLM ${Moz} "Description" "VLC Multimedia Plugin"
- WriteRegStr HKLM ${Moz} "Path" "$INSTDIRnpvlc.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 "SOFTWAREMozilla" "$R1"
- ; StrCmp $R0 "" "${Index}-End"
- ; IntOp $R1 $R1 + 1
- ; ReadRegStr $R2 HKLM "SOFTWAREMozilla$R0Extensions" "Plugins"
- ; StrCmp $R2 "" "${Index}-Loop" ""
- ; CopyFiles "$INSTDIRnpvlc.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
- !endif
- !ifdef INSTALL_ACTIVEX
- Section $Name_Section04 SEC04
- SectionIn 3
- SetOutPath "$INSTDIR"
- !insertmacro OpenUninstallLog
- !insertmacro InstallFile activexaxvlc.dll
- !insertmacro InstallFile activexaxvlc.dll.manifest
- !insertmacro CloseUninstallLog
- RegDLL "$INSTDIRaxvlc.dll"
- SectionEnd
- !endif
- Section $Name_Section05 SEC05
- SectionIn 1 2 3
- WriteRegStr HKCR "AudioCDshellPlayWithVLC" "" $ContextMenuEntry_PlayWith
- WriteRegStr HKCR "AudioCDshellPlayWithVLCcommand" ""
- '"$INSTDIRvlc.exe" --started-from-file cdda://%1'
- WriteRegStr HKCR "DVDshellPlayWithVLC" "" $ContextMenuEntry_PlayWith
- WriteRegStr HKCR "DVDshellPlayWithVLCcommand" ""
- '"$INSTDIRvlc.exe" --started-from-file dvd://%1'
- WriteRegStr HKLM "SoftwareMicrosoftWindowsCurrentVersionExplorerAutoplayHandlersEventHandlersPlayDVDMovieOnArrival" "VLCPlayDVDMovieOnArrival" ""
- WriteRegStr HKLM "SoftwareMicrosoftWindowsCurrentVersionExplorerAutoplayHandlersHandlersVLCPlayDVDMovieOnArrival" "Action" $Action_OnArrivalDVD
- WriteRegStr HKLM "SoftwareMicrosoftWindowsCurrentVersionExplorerAutoplayHandlersHandlersVLCPlayDVDMovieOnArrival" "DefaultIcon" '"$INSTDIRvlc.exe",0'
- WriteRegStr HKLM "SoftwareMicrosoftWindowsCurrentVersionExplorerAutoplayHandlersHandlersVLCPlayDVDMovieOnArrival" "InvokeProgID" "VLC.DVDMovie"
- WriteRegStr HKLM "SoftwareMicrosoftWindowsCurrentVersionExplorerAutoplayHandlersHandlersVLCPlayDVDMovieOnArrival" "InvokeVerb" "play"
- WriteRegStr HKLM "SoftwareMicrosoftWindowsCurrentVersionExplorerAutoplayHandlersHandlersVLCPlayDVDMovieOnArrival" "Provider" "VideoLAN VLC media player"
- WriteRegStr HKLM "SoftwareMicrosoftWindowsCurrentVersionExplorerAutoplayHandlersEventHandlersPlayCDAudioOnArrival" "VLCPlayCDAudioOnArrival" ""
- WriteRegStr HKLM "SoftwareMicrosoftWindowsCurrentVersionExplorerAutoplayHandlersHandlersVLCPlayCDAudioOnArrival" "Action" $Action_OnArrivalAudioCD
- WriteRegStr HKLM "SoftwareMicrosoftWindowsCurrentVersionExplorerAutoplayHandlersHandlersVLCPlayCDAudioOnArrival" "DefaultIcon" '"$INSTDIRvlc.exe",0'
- WriteRegStr HKLM "SoftwareMicrosoftWindowsCurrentVersionExplorerAutoplayHandlersHandlersVLCPlayCDAudioOnArrival" "InvokeProgID" "VLC.CDAudio"
- WriteRegStr HKLM "SoftwareMicrosoftWindowsCurrentVersionExplorerAutoplayHandlersHandlersVLCPlayCDAudioOnArrival" "InvokeVerb" "play"
- WriteRegStr HKLM "SoftwareMicrosoftWindowsCurrentVersionExplorerAutoplayHandlersHandlersVLCPlayCDAudioOnArrival" "Provider" "VideoLAN VLC media player"
- WriteRegStr HKCR "VLC.DVDMovie" "" "VLC DVD Movie"
- WriteRegStr HKCR "VLC.DVDMovieshell" "" "Open"
- WriteRegStr HKCR "VLC.DVDMovieshellOpencommand" ""
- '"$INSTDIRvlc.exe" --started-from-file dvd://%1'
- WriteRegStr HKCR "VLC.DVDMovieDefaultIcon" "" '"$INSTDIRvlc.exe",0'
- WriteRegStr HKCR "VLC.CDAudio" "" "VLC CD Audio"
- WriteRegStr HKCR "VLC.CDAudioshell" "" "Open"
- WriteRegStr HKCR "VLC.CDAudioshellOpencommand" ""
- '"$INSTDIRvlc.exe" --started-from-file cdda://%1'
- WriteRegStr HKCR "VLC.CDAudioDefaultIcon" "" '"$INSTDIRvlc.exe",0'
- SectionEnd
- SectionGroup /e !$Name_Section06 SEC06
- SectionGroup $Name_SectionGroupAudio
- !insertmacro MacroAudioExtensions RegisterExtensionSection
- SectionGroupEnd
- SectionGroup $Name_SectionGroupVideo
- !insertmacro MacroVideoExtensions RegisterExtensionSection
- SectionGroupEnd
- SectionGroup $Name_SectionGroupOther
- !insertmacro MacroOtherExtensions RegisterExtensionSection
- SectionGroupEnd
- SectionGroupEnd
- Section $Name_Section07 SEC07
- SectionIn 1 3
- !insertmacro MacroAllExtensions AddContextMenu
- !insertmacro AddContextMenuExt "Directory"
- SectionEnd
- Section $Name_Section08 SEC08
- !insertmacro delprefs
- SectionEnd
- ; Installer section descriptions
- !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
- !insertmacro MUI_DESCRIPTION_TEXT ${SEC01} $Desc_Section01
- !insertmacro MUI_DESCRIPTION_TEXT ${SEC02a} $Desc_Section02a
- !insertmacro MUI_DESCRIPTION_TEXT ${SEC02b} $Desc_Section02b
- @BUILD_MOZILLA_TRUE@ !insertmacro MUI_DESCRIPTION_TEXT ${SEC03} $Desc_Section03
- @BUILD_ACTIVEX_TRUE@ !insertmacro MUI_DESCRIPTION_TEXT ${SEC04} $Desc_Section04
- !insertmacro MUI_DESCRIPTION_TEXT ${SEC05} $Desc_Section05
- !insertmacro MUI_DESCRIPTION_TEXT ${SEC06} $Desc_Section06
- !insertmacro MUI_DESCRIPTION_TEXT ${SEC07} $Desc_Section07
- !insertmacro MUI_DESCRIPTION_TEXT ${SEC08} $Desc_Section08
- !insertmacro MUI_FUNCTION_DESCRIPTION_END
- ;;; Start function
- Function .onInit
- !insertmacro MUI_LANGDLL_DISPLAY
- !include "languagesenglish.nsh"
- StrCmp $LANGUAGE ${LANG_FRENCH} French 0
- StrCmp $LANGUAGE ${LANG_GERMAN} German 0
- StrCmp $LANGUAGE ${LANG_ITALIAN} Italian 0
- StrCmp $LANGUAGE ${LANG_HUNGARIAN} Hungarian 0
- StrCmp $LANGUAGE ${LANG_ROMANIAN} Romanian 0
- StrCmp $LANGUAGE ${LANG_CATALAN} Catalan 0
- StrCmp $LANGUAGE ${LANG_BULGARIAN} Bulgarian 0
- StrCmp $LANGUAGE ${LANG_SLOVAK} Slovak 0
- StrCmp $LANGUAGE ${LANG_POLISH} Polish 0
- StrCmp $LANGUAGE ${LANG_DUTCH} Dutch 0
- StrCmp $LANGUAGE ${LANG_SIMPCHINESE} SChinese 0
- StrCmp $LANGUAGE ${LANG_FINNISH} Finnish 0
- ; StrCmp $LANGUAGE ${LANG_BENGALI} Bengali 0
- ; StrCmp $LANGUAGE ${LANG_PUNJABI} Punjabi 0
- ; StrCmp $LANGUAGE ${LANG_SLOVENIAN} Slovenian 0
- StrCmp $LANGUAGE ${LANG_SPANISH} Spanish 0
- StrCmp $LANGUAGE ${LANG_PORTUGUESEBR} Brazilian EndLanguageCmp
- French:
- !include "languagesfrench.nsh"
- Goto EndLanguageCmp
- German:
- !include "languagesgerman.nsh"
- Goto EndLanguageCmp
- Italian:
- !include "languagesitalian.nsh"
- Goto EndLanguageCmp
- Hungarian:
- !include "languageshungarian.nsh"
- Goto EndLanguageCmp
- Romanian:
- !include "languagesromanian.nsh"
- Goto EndLanguageCmp
- Catalan:
- !include "languagescatalan.nsh"
- Goto EndLanguageCmp
- Bulgarian:
- !include "languagesbulgarian.nsh"
- Goto EndLanguageCmp
- Slovak:
- !include "languagesslovak.nsh"
- Goto EndLanguageCmp
- Polish:
- !include "languagespolish.nsh"
- Goto EndLanguageCmp
- Dutch:
- !include "languagesdutch.nsh"
- Goto EndLanguageCmp
- Schinese:
- !include "languagesschinese.nsh"
- Goto EndLanguageCmp
- Finnish:
- !include "languagesfinnish.nsh"
- Goto EndLanguageCmp
- Bengali:
- !include "languagesbengali.nsh"
- Goto EndLanguageCmp
- Punjabi:
- !include "languagespunjabi.nsh"
- Goto EndLanguageCmp
- Slovenian:
- !include "languagesslovenian.nsh"
- Goto EndLanguageCmp
- Spanish:
- !include "languagesspanish.nsh"
- Goto EndLanguageCmp
- Brazilian:
- !include "languagesbrazilian_portuguese.nsh"
- EndLanguageCmp:
- ReadRegStr $R0 ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
- "UninstallString"
- StrCmp $R0 "" done
- MessageBox MB_YESNO|MB_ICONEXCLAMATION $Message_AlreadyInstalled IDNO done
- ;Run the uninstaller
- ;uninst:
- ClearErrors
- ExecWait '$R0 _?=$INSTDIR' ;Do not copy the uninstaller to a temp file
- done:
- FunctionEnd
- ;; End function
- Section -Post
- WriteUninstaller "$INSTDIRuninstall.exe"
- WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "InstallDir" $INSTDIR
- WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "Version" "${VERSION}"
- WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIRvlc.exe"
- WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
- "DisplayName" "$(^Name)"
- WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
- "UninstallString" "$INSTDIRuninstall.exe"
- WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
- "InstallLocation" "$INSTDIR"
- WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
- "DisplayIcon" "$INSTDIRvlc.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}"
- WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
- "VersionMajor" "@VERSION_MAJOR@"
- WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
- "VersionMinor" "@VERSION_MINOR@"
- 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 "un.$Name_Section91" SEC91
- SectionIn 1 2 3 RO
- SetShellVarContext all
- !insertmacro MacroAllExtensions DeleteContextMenu
- !insertmacro MacroAllExtensions UnRegisterExtensionSection
- !insertmacro DeleteContextMenuExt "Directory"
- ;remove activex plugin
- UnRegDLL "$INSTDIRaxvlc.dll"
- Delete /REBOOTOK "$INSTDIRaxvlc.dll"
- Delete /REBOOTOK "$INSTDIRaxvlc.dll.manifest"
- ;remove mozilla plugin
- Push $R0
- Push $R1
- Push $R2
- !define Index 'Line${__LINE__}'
- StrCpy $R1 "0"
- "${Index}-Loop:"
- ; Check for Key
- EnumRegKey $R0 HKLM "SOFTWAREMozilla" "$R1"
- StrCmp $R0 "" "${Index}-End"
- IntOp $R1 $R1 + 1
- ReadRegStr $R2 HKLM "SOFTWAREMozilla$R0Extensions" "Plugins"
- StrCmp $R2 "" "${Index}-Loop" ""
- ; old files (0.8.5 and before) that may be lying around
- Delete /REBOOTOK "$R2npvlc.dll"
- Delete /REBOOTOK "$R2libvlc.dll"
- Delete /REBOOTOK "$R2vlcintf.xpt"
- Goto "${Index}-Loop"
- "${Index}-End:"
- !undef Index
- Delete /REBOOTOK "$INSTDIRnpvlc.dll"
- Delete /REBOOTOK "$INSTDIRnpvlc.dll.manifest"
- RMDir "$SMPROGRAMSVideoLAN"
- RMDir /r $SMPROGRAMSVideoLAN
- FileOpen $UninstallLog "$INSTDIRuninstall.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 "$INSTDIRuninstall.log"
- Delete "$INSTDIRuninstall.exe"
- Push ""
- Call un.RemoveEmptyDirs
- RMDir "$INSTDIR"
- DeleteRegKey HKLM SoftwareVideoLAN
- DeleteRegKey HKCR Applicationsvlc.exe
- DeleteRegKey HKCR AudioCDshellPlayWithVLC
- DeleteRegKey HKCR DVDshellPlayWithVLC
- DeleteRegValue HKLM "SoftwareMicrosoftWindowsCurrentVersionExplorerAutoplayHandlersEventHandlersPlayDVDMovieOnArrival" "VLCPlayDVDMovieOnArrival"
- DeleteRegKey HKLM SoftwareMicrosoftWindowsCurrentVersionExplorerAutoplayHandlersHandlersVLCPlayDVDMovieOnArrival
- DeleteRegValue HKLM "SoftwareMicrosoftWindowsCurrentVersionExplorerAutoplayHandlersEventHandlersPlayCDAudioOnArrival" "VLCPlayCDAudioOnArrival"
- DeleteRegKey HKLM SoftwareMicrosoftWindowsCurrentVersionExplorerAutoplayHandlersHandlersVLCPlayCDAudioOnArrival
- DeleteRegKey HKLM SoftwareClientsMediaVLC
- DeleteRegKey HKCR "VLC.MediaFile"
- DeleteRegKey HKLM
- "SOFTWAREMozillaPlugins@videolan.org/vlc,version=${VERSION}"
- DeleteRegKey HKLM
- "SoftwareMicrosoftWindowsCurrentVersionUninstall${PRODUCT_NAME}"
- Delete "$DESKTOPVLC media player.lnk"
- DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
- DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}"
- SetAutoClose true
- SectionEnd
- Section /o "un.$Name_Section92" SEC92
- !insertmacro delprefs
- SectionEnd
- ; Uninstaller section descriptions
- !insertmacro MUI_UNFUNCTION_DESCRIPTION_BEGIN
- !insertmacro MUI_DESCRIPTION_TEXT ${SEC91} $Desc_Section91
- !insertmacro MUI_DESCRIPTION_TEXT ${SEC92} $Desc_Section92
- !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
- !include "languagesenglish.nsh"
- StrCmp $LANGUAGE ${LANG_FRENCH} French 0
- StrCmp $LANGUAGE ${LANG_GERMAN} German 0
- StrCmp $LANGUAGE ${LANG_ITALIAN} Italian 0
- StrCmp $LANGUAGE ${LANG_HUNGARIAN} Hungarian 0
- StrCmp $LANGUAGE ${LANG_ROMANIAN} Romanian 0
- StrCmp $LANGUAGE ${LANG_CATALAN} Catalan 0
- StrCmp $LANGUAGE ${LANG_BULGARIAN} Bulgarian 0
- StrCmp $LANGUAGE ${LANG_SLOVAK} Slovak 0
- StrCmp $LANGUAGE ${LANG_POLISH} Polish 0
- StrCmp $LANGUAGE ${LANG_DUTCH} Dutch 0
- StrCmp $LANGUAGE ${LANG_SIMPCHINESE} SChinese 0
- StrCmp $LANGUAGE ${LANG_FINNISH} Finnish 0
- ; StrCmp $LANGUAGE ${LANG_BENGALI} Bengali 0
- ; StrCmp $LANGUAGE ${LANG_PUNJABI} Punjabi 0
- ; StrCmp $LANGUAGE ${LANG_SLOVENIAN} Slovenian 0
- StrCmp $LANGUAGE ${LANG_SPANISH} Spanish 0
- StrCmp $LANGUAGE ${LANG_PORTUGUESEBR} Brazilian EndLanguageCmp
- French:
- !include "languagesfrench.nsh"
- Goto EndLanguageCmp
- German:
- !include "languagesgerman.nsh"
- Goto EndLanguageCmp
- Italian:
- !include "languagesitalian.nsh"
- Goto EndLanguageCmp
- Hungarian:
- !include "languageshungarian.nsh"
- Goto EndLanguageCmp
- Romanian:
- !include "languagesromanian.nsh"
- Goto EndLanguageCmp
- Catalan:
- !include "languagescatalan.nsh"
- Goto EndLanguageCmp
- Bulgarian:
- !include "languagesbulgarian.nsh"
- Goto EndLanguageCmp
- Slovak:
- !include "languagesslovak.nsh"
- Goto EndLanguageCmp
- Polish:
- !include "languagespolish.nsh"
- Goto EndLanguageCmp
- Dutch:
- !include "languagesdutch.nsh"
- Goto EndLanguageCmp
- Schinese:
- !include "languagesschinese.nsh"
- Goto EndLanguageCmp
- Finnish:
- !include "languagesfinnish.nsh"
- Goto EndLanguageCmp
- Bengali:
- !include "languagesbengali.nsh"
- Goto EndLanguageCmp
- Punjabi:
- !include "languagespunjabi.nsh"
- Goto EndLanguageCmp
- Slovenian:
- !include "languagesslovenian.nsh"
- Goto EndLanguageCmp
- Spanish:
- !include "languagesspanish.nsh"
- Goto EndLanguageCmp
- Brazilian:
- !include "languagesbrazilian_portuguese.nsh"
- EndLanguageCmp:
- FunctionEnd