X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=extras%2Fpackage%2Fwin32%2Fvlc.win32.nsi.in;h=3527214ae395f5c9f513caafd39a93e388d27e50;hb=a5909adc57c8429890f4fa67bc098f5c50eacd46;hp=2aaf8fab72553fc2fa3a8078ea07160049b652b9;hpb=e2a614c82b502ea6c3cdee7d0fc39cbb9627041e;p=vlc diff --git a/extras/package/win32/vlc.win32.nsi.in b/extras/package/win32/vlc.win32.nsi.in index 2aaf8fab72..3527214ae3 100644 --- a/extras/package/win32/vlc.win32.nsi.in +++ b/extras/package/win32/vlc.win32.nsi.in @@ -3,12 +3,14 @@ ; (http://nsis.sourceforge.net) ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +!include "languages\declaration.nsh" + !define PRODUCT_NAME "VLC media player" !define VERSION @VERSION@ -!define PRODUCT_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_PUBLISHER "VideoLAN" +!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" @@ -18,6 +20,9 @@ !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@ @@ -35,15 +40,18 @@ SetCompressor lzma SetCompressor /SOLID lzma !endif -;ShowInstDetails show -;ShowUnInstDetails show SetOverwrite ifnewer CRCCheck on BrandingText "${PRODUCT_GROUP} ${PRODUCT_NAME}" -InstType "Recommended" -InstType "Minimum" -InstType "Full" +InstType $Name_InstTypeRecommended +InstType $Name_InstTypeMinimum +InstType $Name_InstTypeFull + +RequestExecutionLevel user +!addincludedir NSIS +!addplugindir NSIS +!include UAC.nsh ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; NSIS Modern User Interface configuration ; @@ -54,8 +62,8 @@ InstType "Full" ; MUI Settings !define MUI_ABORTWARNING - !define MUI_ICON "vlc48x48.ico" - !define MUI_UNICON "vlc48x48.ico" + !define MUI_ICON "vlc.ico" + !define MUI_UNICON "vlc.ico" !define MUI_COMPONENTSPAGE_SMALLDESC ; Installer pages @@ -63,6 +71,7 @@ InstType "Full" !define MUI_WELCOMEPAGE_TITLE_3LINES !insertmacro MUI_PAGE_WELCOME ; License page + !define MUI_LICENSEPAGE_BUTTON $(^NextBtn) !insertmacro MUI_PAGE_LICENSE "COPYING.txt" ; Components page !insertmacro MUI_PAGE_COMPONENTS @@ -71,11 +80,21 @@ InstType "Full" ; Instfiles page !insertmacro MUI_PAGE_INSTFILES ; Finish page - !define MUI_FINISHPAGE_RUN "$INSTDIR\vlc.exe" + + Function ExecAppFile + Exec '$INSTDIR\vlc.exe' + FunctionEnd + + Function AppRunAs + !insertmacro UAC.CallFunctionAsUser ExecAppFile + FunctionEnd + + !define MUI_FINISHPAGE_RUN + !define MUI_FINISHPAGE_RUN_FUNCTION AppRunAs + !define MUI_FINISHPAGE_LINK $Link_VisitWebsite + !define MUI_FINISHPAGE_LINK_LOCATION "http://www.videolan.org/vlc/" !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 @@ -103,11 +122,16 @@ InstType "Full" !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" + !insertmacro MUI_LANGUAGE "Estonian" ; Reserve files for solid compression !insertmacro MUI_RESERVEFILE_LANGDLL @@ -123,7 +147,7 @@ InstType "Full" ; 1. File type associations ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Function that register one extension for VLC +;; Function that registers one extension for VLC Function RegisterExtension ; back up old value for extension $R0 (eg. ".opt") ReadRegStr $1 HKCR "$R0" "" @@ -134,15 +158,43 @@ 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\shell" "" "Open" + WriteRegStr HKCR "VLC$R0\shell\Open" "" $ShellAssociation_Play + WriteRegStr HKCR "VLC$R0\shell\Open\command" "" '"$INSTDIR\vlc.exe" --started-from-file "%1"' WriteRegStr HKCR "VLC$R0\DefaultIcon" "" '"$INSTDIR\vlc.exe",0' ;;; Vista Only part - ; Vista detection + ; Vista and above detection ReadRegStr $R1 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion - StrCpy $R2 $R1 3 - StrCmp $R2 '6.0' ForVista ToEnd + StrCpy $R2 $R1 1 + StrCmp $R2 '6' ForVista ToEnd +ForVista: + WriteRegStr HKLM "Software\Clients\Media\VLC\Capabilities\FileAssociations" "$R0" "VLC$R0" + +ToEnd: +FunctionEnd + +;; Function that registers one skin extension for VLC +Function RegisterSkinExtension + ; 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 skin file ($R0)" + WriteRegStr HKCR "VLC$R0\shell" "" "Open" + WriteRegStr HKCR "VLC$R0\shell\Open" "" "" + WriteRegStr HKCR "VLC$R0\shell\Open\command" "" '"$INSTDIR\vlc.exe" -Iskins --skins2-last "%1"' + WriteRegStr HKCR "VLC$R0\DefaultIcon" "" '"$INSTDIR\vlc.exe",0' + +;;; Vista Only part + ; Vista and above detection + ReadRegStr $R1 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion + StrCpy $R2 $R1 1 + StrCmp $R2 '6' ForVista ToEnd ForVista: WriteRegStr HKLM "Software\Clients\Media\VLC\Capabilities\FileAssociations" "$R0" "VLC$R0" @@ -177,6 +229,16 @@ FunctionEnd SectionEnd !macroend +!macro RegisterSkinExtensionSection EXT + Section /o ${EXT} + SectionIn 1 3 + Push $R0 + StrCpy $R0 ${EXT} + Call RegisterSkinExtension + Pop $R0 + SectionEnd +!macroend + !macro UnRegisterExtensionSection EXT Push $R0 StrCpy $R0 ${EXT} @@ -197,48 +259,116 @@ FunctionEnd !insertmacro ${_action} ".a52" !insertmacro ${_action} ".aac" !insertmacro ${_action} ".ac3" + !insertmacro ${_action} ".adt" + !insertmacro ${_action} ".adts" + !insertmacro ${_action} ".aif" + !insertmacro ${_action} ".aifc" + !insertmacro ${_action} ".aiff" + !insertmacro ${_action} ".au" + !insertmacro ${_action} ".amr" + !insertmacro ${_action} ".aob" + !insertmacro ${_action} ".ape" + !insertmacro ${_action} ".cda" !insertmacro ${_action} ".dts" !insertmacro ${_action} ".flac" + !insertmacro ${_action} ".it" + !insertmacro ${_action} ".m4a" + !insertmacro ${_action} ".m4p" + !insertmacro ${_action} ".mid" !insertmacro ${_action} ".mka" + !insertmacro ${_action} ".mlp" + !insertmacro ${_action} ".mod" !insertmacro ${_action} ".mp1" !insertmacro ${_action} ".mp2" !insertmacro ${_action} ".mp3" - !insertmacro ${_action} ".ogg" + !insertmacro ${_action} ".mpc" + !insertmacro ${_action} ".oma" + !insertmacro ${_action} ".oga" + !insertmacro ${_action} ".rmi" + !insertmacro ${_action} ".snd" + !insertmacro ${_action} ".s3m" !insertmacro ${_action} ".spx" + !insertmacro ${_action} ".tta" + !insertmacro ${_action} ".voc" + !insertmacro ${_action} ".vqf" + !insertmacro ${_action} ".w64" !insertmacro ${_action} ".wav" !insertmacro ${_action} ".wma" + !insertmacro ${_action} ".wv" + !insertmacro ${_action} ".xa" + !insertmacro ${_action} ".xm" !macroend !macro MacroVideoExtensions _action + !insertmacro ${_action} ".3g2" + !insertmacro ${_action} ".3gp" + !insertmacro ${_action} ".3gp2" + !insertmacro ${_action} ".3gpp" + !insertmacro ${_action} ".amv" !insertmacro ${_action} ".asf" !insertmacro ${_action} ".avi" !insertmacro ${_action} ".divx" !insertmacro ${_action} ".dv" + !insertmacro ${_action} ".flv" + !insertmacro ${_action} ".gxf" !insertmacro ${_action} ".m1v" + !insertmacro ${_action} ".m2t" !insertmacro ${_action} ".m2v" + !insertmacro ${_action} ".m2ts" + !insertmacro ${_action} ".m4v" !insertmacro ${_action} ".mkv" !insertmacro ${_action} ".mov" + !insertmacro ${_action} ".mp2" + !insertmacro ${_action} ".mp2v" !insertmacro ${_action} ".mp4" + !insertmacro ${_action} ".mp4v" + !insertmacro ${_action} ".mpa" + !insertmacro ${_action} ".mpe" !insertmacro ${_action} ".mpeg" !insertmacro ${_action} ".mpeg1" !insertmacro ${_action} ".mpeg2" !insertmacro ${_action} ".mpeg4" !insertmacro ${_action} ".mpg" + !insertmacro ${_action} ".mpv2" + !insertmacro ${_action} ".mts" !insertmacro ${_action} ".mxf" + !insertmacro ${_action} ".nsv" + !insertmacro ${_action} ".nuv" + !insertmacro ${_action} ".ogg" + !insertmacro ${_action} ".ogm" + !insertmacro ${_action} ".ogx" + !insertmacro ${_action} ".ogv" !insertmacro ${_action} ".ps" + !insertmacro ${_action} ".rec" + !insertmacro ${_action} ".rm" + !insertmacro ${_action} ".rmvb" + !insertmacro ${_action} ".tod" !insertmacro ${_action} ".ts" - !insertmacro ${_action} ".ogm" + !insertmacro ${_action} ".tts" !insertmacro ${_action} ".vob" + !insertmacro ${_action} ".vro" + !insertmacro ${_action} ".webm" !insertmacro ${_action} ".wmv" !macroend !macro MacroOtherExtensions _action !insertmacro ${_action} ".asx" + !insertmacro ${_action} ".b4s" !insertmacro ${_action} ".bin" !insertmacro ${_action} ".cue" + !insertmacro ${_action} ".ifo" !insertmacro ${_action} ".m3u" + !insertmacro ${_action} ".m3u8" !insertmacro ${_action} ".pls" + !insertmacro ${_action} ".ram" + !insertmacro ${_action} ".sdp" !insertmacro ${_action} ".vlc" + !insertmacro ${_action} ".xspf" +!macroend + +!macro MacroSkinExtensions _action + !insertmacro ${_action} ".vlt" + !insertmacro ${_action} ".wsz" !macroend ; One macro to rule them all @@ -254,11 +384,11 @@ FunctionEnd ; 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\PlayWithVLC "" $ContextMenuEntry_PlayWith + 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"' + WriteRegStr HKCR ${EXT}\shell\AddToPlaylistVLC "" $ContextMenuEntry_AddToPlaylist + WriteRegStr HKCR ${EXT}\shell\AddToPlaylistVLC\command "" '"$INSTDIR\vlc.exe" --started-from-file --playlist-enqueue "%1"' !macroend !macro AddContextMenu EXT @@ -281,7 +411,7 @@ FunctionEnd !macroend ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -; 3. Delete prefs and cache ; +; 3. Delete prefs ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; !macro delprefs @@ -374,7 +504,7 @@ FunctionEnd ; installer ; ;;;;;;;;;;;;;;;;;;;;;; -Section "Media player (required)" SEC01 +Section $Name_Section01 SEC01 SectionIn 1 2 3 RO SetShellVarContext all SetOutPath "$INSTDIR" @@ -384,12 +514,10 @@ Section "Media player (required)" SEC01 ; 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 + !insertmacro InstallFile vlc-cache-gen.exe + + ; All dlls + !insertmacro InstallFile *.dll ; Text files !insertmacro InstallFile *.txt @@ -397,12 +525,18 @@ Section "Media player (required)" SEC01 ; Subfolders !insertmacro InstallFolder plugins !insertmacro InstallFolder locale - !insertmacro InstallFolder osdmenu - !insertmacro InstallFolder skins - !insertmacro InstallFolder http - ;!insertmacro InstallFolder share - !insertmacro InstallFolder lua - ;!insertmacro InstallFolder scripts +@BUILD_OSDMENU_TRUE@ !insertmacro InstallFolder osdmenu +@BUILD_SKINS_TRUE@ !insertmacro InstallFolder skins +@BUILD_HTTPD_TRUE@ !insertmacro InstallFolder http +@BUILD_LUA_TRUE@ !insertmacro InstallFolder lua + + ; Generate the cache and add it to uninstall.log + ExecWait "$INSTDIR\vlc-cache-gen.exe $INSTDIR\plugins" + FindFirst $0 $1 "$INSTDIR\plugins\*.dat" + FileWrite $UninstallLog "plugins\$1$\r$\n" + FindClose $0 + + ; URLs WriteIniStr "$INSTDIR\${PRODUCT_GROUP} Website.url" "InternetShortcut" "URL" \ @@ -417,80 +551,64 @@ Section "Media player (required)" SEC01 !insertmacro CloseUninstallLog - ; Add VLC to "recomended programs" for the following extensions + ; Add VLC to "recommended 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"' + WriteRegStr HKCR Applications\vlc.exe\shell\Open "" $ContextMenuEntry_PlayWith + WriteRegStr HKCR Applications\vlc.exe\shell\Open\command "" \ + '"$INSTDIR\vlc.exe" --started-from-file "%1"' !insertmacro MacroAllExtensions WriteRegStrSupportedTypes - -; Vista Registration - ; Vista detection + +; Windows default programs Registration + ; Vista and above detection ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion - StrCpy $R1 $R0 3 - StrCmp $R1 '6.0' lbl_vista lbl_done + StrCpy $R1 $R0 1 + StrCmp $R1 '6' 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" + WriteRegStr HKLM "Software\Clients\Media\VLC" "" "VLC media player" + WriteRegStr HKLM "Software\Clients\Media\VLC\InstallInfo" "HideIconsCommand" "$\"$INSTDIR\spad-setup.exe$\" /HideIcons /S" + WriteRegStr HKLM "Software\Clients\Media\VLC\InstallInfo" "ShowIconsCommand" "$\"$INSTDIR\spad-setup.exe$\" /ShowIcons /S" + WriteRegStr HKLM "Software\Clients\Media\VLC\InstallInfo" "ReinstallCommand" "$\"$INSTDIR\spad-setup.exe$\" /Reinstall /S" + WriteRegDWORD HKLM "Software\Clients\Media\VLC\InstallInfo" "IconsVisible" 0x001 lbl_done: SectionEnd -Section "Start Menu Shortcut" SEC02a +Section $Name_Section02a 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 wxWidgets (default).lnk" \ - "$INSTDIR\vlc.exe" "-I wxwin --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 --save-config vlc:quit" + CreateShortCut "$SMPROGRAMS\VideoLAN\Reset VLC media player preferences and cache files.lnk" \ + "$INSTDIR\vlc.exe" "--reset-config --reset-plugins-cache vlc://quit" + CreateShortCut "$SMPROGRAMS\VideoLAN\VLC media player.lnk" \ + "$INSTDIR\vlc.exe" "" + CreateShortCut "$SMPROGRAMS\VideoLAN\VLC media player skinned.lnk" \ + "$INSTDIR\vlc.exe" "-Iskins" 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 +Section $Name_Section02b SEC02b SectionIn 1 2 3 CreateShortCut "$DESKTOP\VLC media player.lnk" \ "$INSTDIR\vlc.exe" "" SectionEnd -Section /o "Mozilla plugin" SEC03 +!ifdef INSTALL_MOZILLA +Section /o $Name_Section03 SEC03 SectionIn 3 SetOutPath "$INSTDIR" !insertmacro OpenUninstallLog !insertmacro InstallFile mozilla\npvlc.dll + !insertmacro InstallFile mozilla\npvlc.dll.manifest !insertmacro CloseUninstallLog !define Moz "SOFTWARE\MozillaPlugins\@videolan.org/vlc,version=${VERSION}" @@ -499,146 +617,276 @@ Section /o "Mozilla plugin" SEC03 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 +!endif + +!ifdef INSTALL_ACTIVEX +Section $Name_Section04 SEC04 + SectionIn 3 -Section "ActiveX plugin" SEC04 - SectionIn 1 3 SetOutPath "$INSTDIR" !insertmacro OpenUninstallLog !insertmacro InstallFile activex\axvlc.dll + !insertmacro InstallFile activex\axvlc.dll.manifest !insertmacro CloseUninstallLog RegDLL "$INSTDIR\axvlc.dll" SectionEnd +!endif -Section "Discs Playback" SEC05 + +Section $Name_Section05 SEC05 SectionIn 1 2 3 - WriteRegStr HKCR "AudioCD\shell\PlayWithVLC" "" "Play with VLC media player" + WriteRegStr HKCR "AudioCD\shell\PlayWithVLC" "" $ContextMenuEntry_PlayWith WriteRegStr HKCR "AudioCD\shell\PlayWithVLC\command" "" \ - "$INSTDIR\vlc.exe --started-from-file cdda:%1" - WriteRegStr HKCR "DVD\shell\PlayWithVLC" "" "Play with VLC media player" + '"$INSTDIR\vlc.exe" --started-from-file cdda://%1' + WriteRegStr HKCR "DVD\shell\PlayWithVLC" "" $ContextMenuEntry_PlayWith WriteRegStr HKCR "DVD\shell\PlayWithVLC\command" "" \ - "$INSTDIR\vlc.exe --started-from-file dvd:%1" + '"$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" "Action" $Action_OnArrivalDVD 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" "InvokeVerb" "Open" 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" "Action" $Action_OnArrivalAudioCD 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" "InvokeVerb" "Open" WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "Provider" "VideoLAN VLC media player" + + WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayVideoCDMovieOnArrival" "VLCPlayVCDMovieOnArrival" "" + WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayVCDMovieOnArrival" "Action" $Action_OnArrivalVCDMovie + WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayVCDMovieOnArrival" "DefaultIcon" '"$INSTDIR\vlc.exe",0' + WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayVCDMovieOnArrival" "InvokeProgID" "VLC.VCDMovie" + WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayVCDMovieOnArrival" "InvokeVerb" "Open" + WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayVCDMovieOnArrival" "Provider" "VideoLAN VLC media player" + + WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlaySuperVideoCDMovieOnArrival" "VLCPlaySVCDMovieOnArrival" "" + WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlaySVCDMovieOnArrival" "Action" $Action_OnArrivalSVCDMovie + WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlaySVCDMovieOnArrival" "DefaultIcon" '"$INSTDIR\vlc.exe",0' + WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlaySVCDMovieOnArrival" "InvokeProgID" "VLC.SVCDMovie" + WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlaySVCDMovieOnArrival" "InvokeVerb" "Open" + WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlaySVCDMovieOnArrival" "Provider" "VideoLAN VLC media player" + + WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayDVDAudioOnArrival" "VLCPlayDVDAudioOnArrival" "" + WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDAudioOnArrival" "Action" $Action_OnArrivalDVDAudio + WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDAudioOnArrival" "DefaultIcon" '"$INSTDIR\vlc.exe",0' + WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDAudioOnArrival" "InvokeProgID" "VLC.OPENFolder" + WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDAudioOnArrival" "InvokeVerb" "Open" + WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDAudioOnArrival" "Provider" "VideoLAN VLC media player" + + WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayVideoFilesOnArrival" "VLCPlayVideoFilesOnArrival" "" + WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayVideoFilesOnArrival" "Action" $Action_OnArrivalVideoFiles + WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayVideoFilesOnArrival" "DefaultIcon" '"$INSTDIR\vlc.exe",0' + WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayVideoFilesOnArrival" "InvokeProgID" "VLC.OPENFolder" + WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayVideoFilesOnArrival" "InvokeVerb" "Open" + WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayVideoFilesOnArrival" "Provider" "VideoLAN VLC media player" + + WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayMusicFilesOnArrival" "VLCPlayMusicFilesOnArrival" "" + WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayMusicFilesOnArrival" "Action" $Action_OnArrivalMusicFiles + WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayMusicFilesOnArrival" "DefaultIcon" '"$INSTDIR\vlc.exe",0' + WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayMusicFilesOnArrival" "InvokeProgID" "VLC.OPENFolder" + WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayMusicFilesOnArrival" "InvokeVerb" "Open" + WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayMusicFilesOnArrival" "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\shell" "" "Open" + WriteRegStr HKCR "VLC.DVDMovie\shell\Open\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\shell" "" "Open" + WriteRegStr HKCR "VLC.CDAudio\shell\Open\command" "" \ + '"$INSTDIR\vlc.exe" --started-from-file cdda://%1' WriteRegStr HKCR "VLC.CDAudio\DefaultIcon" "" '"$INSTDIR\vlc.exe",0' + WriteRegStr HKCR "VLC.VCDMovie" "" "VLC VCD Movie" + WriteRegStr HKCR "VLC.VCDMovie\shell" "" "Open" + WriteRegStr HKCR "VLC.VCDMovie\shell\Open\command" "" \ + '"$INSTDIR\vlc.exe" --started-from-file vcd://%1' + WriteRegStr HKCR "VLC.VCDMovie\DefaultIcon" "" '"$INSTDIR\vlc.exe",0' + + WriteRegStr HKCR "VLC.SVCDMovie" "" "VLC SVCD Movie" + WriteRegStr HKCR "VLC.SVCDMovie\shell" "" "Open" + WriteRegStr HKCR "VLC.SVCDMovie\shell\Open\command" "" \ + '"$INSTDIR\vlc.exe" --started-from-file vcd://%1' + WriteRegStr HKCR "VLC.SVCDMovie\DefaultIcon" "" '"$INSTDIR\vlc.exe",0' + + WriteRegStr HKCR "VLC.OPENFolder" "" "VLC Play content" + WriteRegStr HKCR "VLC.OPENFolder\shell" "" "Open" + WriteRegStr HKCR "VLC.OPENFolder\shell\Open\command" "" \ + '"$INSTDIR\vlc.exe" %1' + WriteRegStr HKCR "VLC.OPENFolder\DefaultIcon" "" '"$INSTDIR\vlc.exe",0' + SectionEnd -SectionGroup "File type associations" SEC06 - SectionGroup "Audio Files" + +SectionGroup /e !$Name_Section06 SEC06 + SectionGroup $Name_SectionGroupAudio !insertmacro MacroAudioExtensions RegisterExtensionSection SectionGroupEnd - SectionGroup "Video Files" + SectionGroup $Name_SectionGroupVideo !insertmacro MacroVideoExtensions RegisterExtensionSection SectionGroupEnd - SectionGroup "Other" + SectionGroup $Name_SectionGroupOther !insertmacro MacroOtherExtensions RegisterExtensionSection + !insertmacro MacroSkinExtensions RegisterSkinExtensionSection SectionGroupEnd SectionGroupEnd -Section "Context Menus" SEC07 - SectionIn 3 +Section $Name_Section07 SEC07 + SectionIn 1 3 !insertmacro MacroAllExtensions AddContextMenu !insertmacro AddContextMenuExt "Directory" SectionEnd -Section /o "Delete preferences and cache" SEC08 +Section $Name_Section08 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_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 + +UAC_Elevate: + UAC::RunElevated + StrCmp 1223 $0 UAC_ElevationAborted + StrCmp 0 $0 0 UAC_Err + StrCmp 1 $1 0 UAC_Success + Quit + +UAC_Err: + MessageBox mb_iconstop "Unable to elevate, error $0" + Abort + +UAC_ElevationAborted: + MessageBox mb_iconstop "This installer requires admin access, aborting!" + Abort + +UAC_Success: + StrCmp 1 $3 +4 + StrCmp 3 $1 0 UAC_ElevationAborted + MessageBox mb_iconstop "This installer requires admin access, try again" + goto UAC_Elevate + !insertmacro MUI_LANGDLL_DISPLAY + + !include "languages\english.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_DANISH} Danish 0 + StrCmp $LANGUAGE ${LANG_SIMPCHINESE} SChinese 0 + StrCmp $LANGUAGE ${LANG_FINNISH} Finnish 0 + StrCmp $LANGUAGE ${LANG_JAPANESE} Japanese 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_SPANISH} Estonian 0 + StrCmp $LANGUAGE ${LANG_PORTUGUESEBR} Brazilian EndLanguageCmp + French: + !include "languages\french.nsh" + Goto EndLanguageCmp + German: + !include "languages\german.nsh" + Goto EndLanguageCmp + Italian: + !include "languages\italian.nsh" + Goto EndLanguageCmp + Hungarian: + !include "languages\hungarian.nsh" + Goto EndLanguageCmp + Romanian: + !include "languages\romanian.nsh" + Goto EndLanguageCmp + Catalan: + !include "languages\catalan.nsh" + Goto EndLanguageCmp + Bulgarian: + !include "languages\bulgarian.nsh" + Goto EndLanguageCmp + Slovak: + !include "languages\slovak.nsh" + Goto EndLanguageCmp + Polish: + !include "languages\polish.nsh" + Goto EndLanguageCmp + Dutch: + !include "languages\dutch.nsh" + Goto EndLanguageCmp + Schinese: + !include "languages\schinese.nsh" + Goto EndLanguageCmp + Finnish: + !include "languages\finnish.nsh" + Goto EndLanguageCmp + Japanese: + !include "languages\japanese.nsh" + Goto EndLanguageCmp + Bengali: + !include "languages\bengali.nsh" + Goto EndLanguageCmp + Punjabi: + !include "languages\punjabi.nsh" + Goto EndLanguageCmp + Slovenian: + !include "languages\slovenian.nsh" + Goto EndLanguageCmp + Spanish: + !include "languages\spanish.nsh" + Goto EndLanguageCmp + Estonian: + !include "languages\estonian.nsh" + Goto EndLanguageCmp + Brazilian: + !include "languages\brazilian_portuguese.nsh" + EndLanguageCmp: + 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 + 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: - !insertmacro MUI_LANGDLL_DISPLAY FunctionEnd +Function .OnInstFailed + UAC::Unload +FunctionEnd + +Function .OnInstSuccess + UAC::Unload +FunctionEnd + ;; End function Section -Post WriteUninstaller "$INSTDIR\uninstall.exe" @@ -650,6 +898,8 @@ Section -Post "DisplayName" "$(^Name)" WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \ "UninstallString" "$INSTDIR\uninstall.exe" + WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \ + "InstallLocation" "$INSTDIR" WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \ "DisplayIcon" "$INSTDIR\vlc.exe" WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \ @@ -658,6 +908,10 @@ Section -Post "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 ;;;;;;;;;;;;;;;;;;;;;;;; @@ -674,7 +928,7 @@ Function un.TrimNewlines Push $R1 Push $R2 StrCpy $R1 0 - + loop: IntOp $R1 $R1 - 1 StrCpy $R2 $R0 1 $R1 @@ -683,7 +937,7 @@ Function un.TrimNewlines IntOp $R1 $R1 + 1 IntCmp $R1 0 no_trim_needed StrCpy $R0 $R0 $R1 - + no_trim_needed: Pop $R2 Pop $R1 @@ -717,17 +971,19 @@ Function un.RemoveEmptyDirs !undef Index FunctionEnd -Section "Uninstall" SEC91 +Section "un.$Name_Section91" SEC91 SectionIn 1 2 3 RO SetShellVarContext all !insertmacro MacroAllExtensions DeleteContextMenu !insertmacro MacroAllExtensions UnRegisterExtensionSection + !insertmacro MacroSkinExtensions UnRegisterExtensionSection !insertmacro DeleteContextMenuExt "Directory" ;remove activex plugin UnRegDLL "$INSTDIR\axvlc.dll" Delete /REBOOTOK "$INSTDIR\axvlc.dll" + Delete /REBOOTOK "$INSTDIR\axvlc.dll.manifest" ;remove mozilla plugin Push $R0 @@ -755,6 +1011,7 @@ Section "Uninstall" SEC91 "${Index}-End:" !undef Index Delete /REBOOTOK "$INSTDIR\npvlc.dll" + Delete /REBOOTOK "$INSTDIR\npvlc.dll.manifest" RMDir "$SMPROGRAMS\VideoLAN" RMDir /r $SMPROGRAMS\VideoLAN @@ -786,8 +1043,26 @@ Section "Uninstall" SEC91 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 + DeleteRegValue HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayVideoCDMovieOnArrival" "VLCPlayVCDMovieOnArrival" + DeleteRegKey HKLM SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayVCDMovieOnArrival + DeleteRegValue HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlaySuperVideoCDMovieOnArrival" "VLCPlaySVCDMovieOnArrival" + DeleteRegKey HKLM SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlaySVCDMovieOnArrival + DeleteRegValue HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayDVDAudioOnArrival" "VLCPlayDVDAudioOnArrival" + DeleteRegKey HKLM SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDAudioOnArrival + DeleteRegValue HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayVideoFilesOnArrival" "VLCPlayVideoFilesOnArrival" + DeleteRegKey HKLM SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayVideoFilesOnArrival + DeleteRegValue HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayMusicFilesOnArrival" "VLCPlayMusicFilesOnArrival" + DeleteRegKey HKLM SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayMusicFilesOnArrival + DeleteRegKey HKLM Software\Clients\Media\VLC + DeleteRegValue HKLM "Software\RegisteredApplications" "VLC" DeleteRegKey HKCR "VLC.MediaFile" + DeleteRegKey HKCR "VLC.DVDMovie" + DeleteRegKey HKCR "VLC.CDAudio" + DeleteRegKey HKCR "VLC.VCDMovie" + DeleteRegKey HKCR "VLC.SVCDMovie" + DeleteRegKey HKCR "VLC.OPENFolder" + DeleteRegKey HKLM \ "SOFTWARE\MozillaPlugins\@videolan.org/vlc,version=${VERSION}" @@ -802,24 +1077,130 @@ Section "Uninstall" SEC91 SetAutoClose true SectionEnd -Section /o "un.Delete preferences and cache" SEC92 +Section /o "un.$Name_Section92" 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_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.OnUnInstFailed + UAC::Unload +FunctionEnd + +Function un.OnUnInstSuccess + UAC::Unload + Delete "$INSTDIR\UAC.dll" +FunctionEnd Function un.onInit + +UAC_Elevate: + UAC::RunElevated + StrCmp 1223 $0 UAC_ElevationAborted + StrCmp 0 $0 0 UAC_Err + StrCmp 1 $1 0 UAC_Success + Quit + +UAC_Err: + MessageBox mb_iconstop "Unable to elevate, error $0" + Abort + +UAC_ElevationAborted: + MessageBox mb_iconstop "This installer requires admin access, aborting!" + Abort + +UAC_Success: + StrCmp 1 $3 +4 + StrCmp 3 $1 0 UAC_ElevationAborted + MessageBox mb_iconstop "This installer requires admin access, try again" + goto UAC_Elevate + !insertmacro MUI_UNGETLANGUAGE + + !include "languages\english.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_DANISH} Danish 0 + StrCmp $LANGUAGE ${LANG_SIMPCHINESE} SChinese 0 + StrCmp $LANGUAGE ${LANG_FINNISH} Finnish 0 + StrCmp $LANGUAGE ${LANG_JAPANESE} Japanese 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_ESTONIAN} Estonian 0 + StrCmp $LANGUAGE ${LANG_PORTUGUESEBR} Brazilian EndLanguageCmp + French: + !include "languages\french.nsh" + Goto EndLanguageCmp + German: + !include "languages\german.nsh" + Goto EndLanguageCmp + Italian: + !include "languages\italian.nsh" + Goto EndLanguageCmp + Hungarian: + !include "languages\hungarian.nsh" + Goto EndLanguageCmp + Romanian: + !include "languages\romanian.nsh" + Goto EndLanguageCmp + Catalan: + !include "languages\catalan.nsh" + Goto EndLanguageCmp + Bulgarian: + !include "languages\bulgarian.nsh" + Goto EndLanguageCmp + Slovak: + !include "languages\slovak.nsh" + Goto EndLanguageCmp + Polish: + !include "languages\polish.nsh" + Goto EndLanguageCmp + Dutch: + !include "languages\dutch.nsh" + Goto EndLanguageCmp + Danish: + !include "languages\danish.nsh" + Goto EndLanguageCmp + Schinese: + !include "languages\schinese.nsh" + Goto EndLanguageCmp + Finnish: + !include "languages\finnish.nsh" + Goto EndLanguageCmp + Japanese: + !include "languages\japanese.nsh" + Goto EndLanguageCmp + Bengali: + !include "languages\bengali.nsh" + Goto EndLanguageCmp + Punjabi: + !include "languages\punjabi.nsh" + Goto EndLanguageCmp + Slovenian: + !include "languages\slovenian.nsh" + Goto EndLanguageCmp + Spanish: + !include "languages\spanish.nsh" + Goto EndLanguageCmp + Estonian: + !include "languages\estonian.nsh" + Goto EndLanguageCmp + Brazilian: + !include "languages\brazilian_portuguese.nsh" + EndLanguageCmp: + FunctionEnd