Commit 9d26226f authored by Ludovic Fauvet's avatar Ludovic Fauvet

nsis: remember selected components between installs

parent cc43387f
...@@ -75,34 +75,34 @@ NoOwn: ...@@ -75,34 +75,34 @@ NoOwn:
DeleteRegKey HKLM "Software\Clients\Media\VLC\Capabilities\FileAssociations\VLC$R0" ; for vista DeleteRegKey HKLM "Software\Clients\Media\VLC\Capabilities\FileAssociations\VLC$R0" ; for vista
FunctionEnd FunctionEnd
!macro RegisterExtensionSection EXT !macro RegisterExtensionSection TYPE EXT
Section ${EXT} ${MementoSection} ${EXT} SEC_EXT_${TYPE}_${EXT}
SectionIn 1 3 SectionIn 1 3
Push $R0 Push $R0
StrCpy $R0 ${EXT} StrCpy $R0 ${EXT}
Call RegisterExtension Call RegisterExtension
Pop $R0 Pop $R0
SectionEnd ${MementoSectionEnd}
!macroend !macroend
!macro RegisterSkinExtensionSection EXT !macro RegisterSkinExtensionSection TYPE EXT
Section /o ${EXT} ${MementoUnselectedSection} ${EXT} SEC_EXT_SKIN_${EXT}
SectionIn 1 3 SectionIn 1 3
Push $R0 Push $R0
StrCpy $R0 ${EXT} StrCpy $R0 ${EXT}
Call RegisterSkinExtension Call RegisterSkinExtension
Pop $R0 Pop $R0
SectionEnd ${MementoSectionEnd}
!macroend !macroend
!macro UnRegisterExtensionSection EXT !macro UnRegisterExtensionSection TYPE EXT
Push $R0 Push $R0
StrCpy $R0 ${EXT} StrCpy $R0 ${EXT}
Call un.RegisterExtension Call un.RegisterExtension
Pop $R0 Pop $R0
!macroend !macroend
!macro WriteRegStrSupportedTypes EXT !macro WriteRegStrSupportedTypes TYPE EXT
WriteRegStr HKCR Applications\vlc.exe\SupportedTypes ${EXT} "" WriteRegStr HKCR Applications\vlc.exe\SupportedTypes ${EXT} ""
!macroend !macroend
...@@ -112,131 +112,131 @@ FunctionEnd ...@@ -112,131 +112,131 @@ FunctionEnd
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
!macro MacroAudioExtensions _action !macro MacroAudioExtensions _action
!insertmacro ${_action} ".3ga" !insertmacro ${_action} Audio ".3ga"
!insertmacro ${_action} ".669" !insertmacro ${_action} Audio ".669"
!insertmacro ${_action} ".a52" !insertmacro ${_action} Audio ".a52"
!insertmacro ${_action} ".aac" !insertmacro ${_action} Audio ".aac"
!insertmacro ${_action} ".ac3" !insertmacro ${_action} Audio ".ac3"
!insertmacro ${_action} ".adt" !insertmacro ${_action} Audio ".adt"
!insertmacro ${_action} ".adts" !insertmacro ${_action} Audio ".adts"
!insertmacro ${_action} ".aif" !insertmacro ${_action} Audio ".aif"
!insertmacro ${_action} ".aifc" !insertmacro ${_action} Audio ".aifc"
!insertmacro ${_action} ".aiff" !insertmacro ${_action} Audio ".aiff"
!insertmacro ${_action} ".au" !insertmacro ${_action} Audio ".au"
!insertmacro ${_action} ".amr" !insertmacro ${_action} Audio ".amr"
!insertmacro ${_action} ".aob" !insertmacro ${_action} Audio ".aob"
!insertmacro ${_action} ".ape" !insertmacro ${_action} Audio ".ape"
!insertmacro ${_action} ".caf" !insertmacro ${_action} Audio ".caf"
!insertmacro ${_action} ".cda" !insertmacro ${_action} Audio ".cda"
!insertmacro ${_action} ".dts" !insertmacro ${_action} Audio ".dts"
!insertmacro ${_action} ".flac" !insertmacro ${_action} Audio ".flac"
!insertmacro ${_action} ".it" !insertmacro ${_action} Audio ".it"
!insertmacro ${_action} ".m4a" !insertmacro ${_action} Audio ".m4a"
!insertmacro ${_action} ".m4p" !insertmacro ${_action} Audio ".m4p"
!insertmacro ${_action} ".mid" !insertmacro ${_action} Audio ".mid"
!insertmacro ${_action} ".mka" !insertmacro ${_action} Audio ".mka"
!insertmacro ${_action} ".mlp" !insertmacro ${_action} Audio ".mlp"
!insertmacro ${_action} ".mod" !insertmacro ${_action} Audio ".mod"
!insertmacro ${_action} ".mp1" !insertmacro ${_action} Audio ".mp1"
!insertmacro ${_action} ".mp2" !insertmacro ${_action} Audio ".mp2"
!insertmacro ${_action} ".mp3" !insertmacro ${_action} Audio ".mp3"
!insertmacro ${_action} ".mpc" !insertmacro ${_action} Audio ".mpc"
!insertmacro ${_action} ".mpga" !insertmacro ${_action} Audio ".mpga"
!insertmacro ${_action} ".oga" !insertmacro ${_action} Audio ".oga"
!insertmacro ${_action} ".oma" !insertmacro ${_action} Audio ".oma"
!insertmacro ${_action} ".opus" !insertmacro ${_action} Audio ".opus"
!insertmacro ${_action} ".qcp" !insertmacro ${_action} Audio ".qcp"
!insertmacro ${_action} ".ra" !insertmacro ${_action} Audio ".ra"
!insertmacro ${_action} ".rmi" !insertmacro ${_action} Audio ".rmi"
!insertmacro ${_action} ".snd" !insertmacro ${_action} Audio ".snd"
!insertmacro ${_action} ".s3m" !insertmacro ${_action} Audio ".s3m"
!insertmacro ${_action} ".spx" !insertmacro ${_action} Audio ".spx"
!insertmacro ${_action} ".tta" !insertmacro ${_action} Audio ".tta"
!insertmacro ${_action} ".voc" !insertmacro ${_action} Audio ".voc"
!insertmacro ${_action} ".vqf" !insertmacro ${_action} Audio ".vqf"
!insertmacro ${_action} ".w64" !insertmacro ${_action} Audio ".w64"
!insertmacro ${_action} ".wav" !insertmacro ${_action} Audio ".wav"
!insertmacro ${_action} ".wma" !insertmacro ${_action} Audio ".wma"
!insertmacro ${_action} ".wv" !insertmacro ${_action} Audio ".wv"
!insertmacro ${_action} ".xa" !insertmacro ${_action} Audio ".xa"
!insertmacro ${_action} ".xm" !insertmacro ${_action} Audio ".xm"
!macroend !macroend
!macro MacroVideoExtensions _action !macro MacroVideoExtensions _action
!insertmacro ${_action} ".3g2" !insertmacro ${_action} Video ".3g2"
!insertmacro ${_action} ".3gp" !insertmacro ${_action} Video ".3gp"
!insertmacro ${_action} ".3gp2" !insertmacro ${_action} Video ".3gp2"
!insertmacro ${_action} ".3gpp" !insertmacro ${_action} Video ".3gpp"
!insertmacro ${_action} ".amv" !insertmacro ${_action} Video ".amv"
!insertmacro ${_action} ".asf" !insertmacro ${_action} Video ".asf"
!insertmacro ${_action} ".avi" !insertmacro ${_action} Video ".avi"
!insertmacro ${_action} ".divx" !insertmacro ${_action} Video ".divx"
!insertmacro ${_action} ".drc" !insertmacro ${_action} Video ".drc"
!insertmacro ${_action} ".dv" !insertmacro ${_action} Video ".dv"
!insertmacro ${_action} ".f4v" !insertmacro ${_action} Video ".f4v"
!insertmacro ${_action} ".flv" !insertmacro ${_action} Video ".flv"
!insertmacro ${_action} ".gvi" !insertmacro ${_action} Video ".gvi"
!insertmacro ${_action} ".gxf" !insertmacro ${_action} Video ".gxf"
!insertmacro ${_action} ".m1v" !insertmacro ${_action} Video ".m1v"
!insertmacro ${_action} ".m2t" !insertmacro ${_action} Video ".m2t"
!insertmacro ${_action} ".m2v" !insertmacro ${_action} Video ".m2v"
!insertmacro ${_action} ".m2ts" !insertmacro ${_action} Video ".m2ts"
!insertmacro ${_action} ".m4v" !insertmacro ${_action} Video ".m4v"
!insertmacro ${_action} ".mkv" !insertmacro ${_action} Video ".mkv"
!insertmacro ${_action} ".mov" !insertmacro ${_action} Video ".mov"
!insertmacro ${_action} ".mp2" !insertmacro ${_action} Video ".mp2"
!insertmacro ${_action} ".mp2v" !insertmacro ${_action} Video ".mp2v"
!insertmacro ${_action} ".mp4" !insertmacro ${_action} Video ".mp4"
!insertmacro ${_action} ".mp4v" !insertmacro ${_action} Video ".mp4v"
!insertmacro ${_action} ".mpa" !insertmacro ${_action} Video ".mpa"
!insertmacro ${_action} ".mpe" !insertmacro ${_action} Video ".mpe"
!insertmacro ${_action} ".mpeg" !insertmacro ${_action} Video ".mpeg"
!insertmacro ${_action} ".mpeg1" !insertmacro ${_action} Video ".mpeg1"
!insertmacro ${_action} ".mpeg2" !insertmacro ${_action} Video ".mpeg2"
!insertmacro ${_action} ".mpeg4" !insertmacro ${_action} Video ".mpeg4"
!insertmacro ${_action} ".mpg" !insertmacro ${_action} Video ".mpg"
!insertmacro ${_action} ".mpv2" !insertmacro ${_action} Video ".mpv2"
!insertmacro ${_action} ".mts" !insertmacro ${_action} Video ".mts"
!insertmacro ${_action} ".mtv" !insertmacro ${_action} Video ".mtv"
!insertmacro ${_action} ".mxf" !insertmacro ${_action} Video ".mxf"
!insertmacro ${_action} ".nsv" !insertmacro ${_action} Video ".nsv"
!insertmacro ${_action} ".nuv" !insertmacro ${_action} Video ".nuv"
!insertmacro ${_action} ".ogg" !insertmacro ${_action} Video ".ogg"
!insertmacro ${_action} ".ogm" !insertmacro ${_action} Video ".ogm"
!insertmacro ${_action} ".ogx" !insertmacro ${_action} Video ".ogx"
!insertmacro ${_action} ".ogv" !insertmacro ${_action} Video ".ogv"
!insertmacro ${_action} ".rec" !insertmacro ${_action} Video ".rec"
!insertmacro ${_action} ".rm" !insertmacro ${_action} Video ".rm"
!insertmacro ${_action} ".rmvb" !insertmacro ${_action} Video ".rmvb"
!insertmacro ${_action} ".tod" !insertmacro ${_action} Video ".tod"
!insertmacro ${_action} ".ts" !insertmacro ${_action} Video ".ts"
!insertmacro ${_action} ".tts" !insertmacro ${_action} Video ".tts"
!insertmacro ${_action} ".vob" !insertmacro ${_action} Video ".vob"
!insertmacro ${_action} ".vro" !insertmacro ${_action} Video ".vro"
!insertmacro ${_action} ".webm" !insertmacro ${_action} Video ".webm"
!insertmacro ${_action} ".wmv" !insertmacro ${_action} Video ".wmv"
!insertmacro ${_action} ".xesc" !insertmacro ${_action} Video ".xesc"
!macroend !macroend
!macro MacroOtherExtensions _action !macro MacroOtherExtensions _action
!insertmacro ${_action} ".asx" !insertmacro ${_action} Other ".asx"
!insertmacro ${_action} ".b4s" !insertmacro ${_action} Other ".b4s"
!insertmacro ${_action} ".bin" !insertmacro ${_action} Other ".bin"
!insertmacro ${_action} ".cue" !insertmacro ${_action} Other ".cue"
!insertmacro ${_action} ".ifo" !insertmacro ${_action} Other ".ifo"
!insertmacro ${_action} ".m3u" !insertmacro ${_action} Other ".m3u"
!insertmacro ${_action} ".m3u8" !insertmacro ${_action} Other ".m3u8"
!insertmacro ${_action} ".pls" !insertmacro ${_action} Other ".pls"
!insertmacro ${_action} ".ram" !insertmacro ${_action} Other ".ram"
!insertmacro ${_action} ".sdp" !insertmacro ${_action} Other ".sdp"
!insertmacro ${_action} ".vlc" !insertmacro ${_action} Other ".vlc"
!insertmacro ${_action} ".wvx" !insertmacro ${_action} Other ".wvx"
!insertmacro ${_action} ".xspf" !insertmacro ${_action} Other ".xspf"
!macroend !macroend
!macro MacroSkinExtensions _action !macro MacroSkinExtensions _action
!insertmacro ${_action} ".vlt" !insertmacro ${_action} Skin ".vlt"
!insertmacro ${_action} ".wsz" !insertmacro ${_action} Skin ".wsz"
!macroend !macroend
; One macro to rule them all ; One macro to rule them all
...@@ -255,7 +255,7 @@ FunctionEnd ...@@ -255,7 +255,7 @@ FunctionEnd
WriteRegStr HKCR ${EXT}\shell\AddToPlaylistVLC\command "" '"$INSTDIR\vlc.exe" --started-from-file --playlist-enqueue "%1"' WriteRegStr HKCR ${EXT}\shell\AddToPlaylistVLC\command "" '"$INSTDIR\vlc.exe" --started-from-file --playlist-enqueue "%1"'
!macroend !macroend
!macro AddContextMenu EXT !macro AddContextMenu TYPE EXT
Push $R0 Push $R0
ReadRegStr $R0 HKCR ${EXT} "" ReadRegStr $R0 HKCR ${EXT} ""
!insertmacro AddContextMenuExt $R0 !insertmacro AddContextMenuExt $R0
...@@ -267,7 +267,7 @@ FunctionEnd ...@@ -267,7 +267,7 @@ FunctionEnd
DeleteRegKey HKCR ${EXT}\shell\AddToPlaylistVLC DeleteRegKey HKCR ${EXT}\shell\AddToPlaylistVLC
!macroend !macroend
!macro DeleteContextMenu EXT !macro DeleteContextMenu TYPE EXT
Push $R0 Push $R0
ReadRegStr $R0 HKCR ${EXT} "" ReadRegStr $R0 HKCR ${EXT} ""
!insertmacro DeleteContextMenuExt $R0 !insertmacro DeleteContextMenuExt $R0
......
...@@ -20,6 +20,9 @@ ...@@ -20,6 +20,9 @@
!define MUI_LANGDLL_REGISTRY_KEY "${PRODUCT_DIR_REGKEY}" !define MUI_LANGDLL_REGISTRY_KEY "${PRODUCT_DIR_REGKEY}"
!define MUI_LANGDLL_REGISTRY_VALUENAME "Language" !define MUI_LANGDLL_REGISTRY_VALUENAME "Language"
!define MEMENTO_REGISTRY_ROOT ${PRODUCT_UNINST_ROOT_KEY}
!define MEMENTO_REGISTRY_KEY "${PRODUCT_UNINST_KEY}"
!define INSTALL_ACTIVEX !define INSTALL_ACTIVEX
!define INSTALL_MOZILLA !define INSTALL_MOZILLA
...@@ -60,6 +63,7 @@ RequestExecutionLevel user ...@@ -60,6 +63,7 @@ RequestExecutionLevel user
!include WinVer.nsh !include WinVer.nsh
!include FileFunc.nsh !include FileFunc.nsh
!include MUI2.nsh !include MUI2.nsh
!include Memento.nsh
!insertmacro GetParameters !insertmacro GetParameters
!insertmacro GetOptions !insertmacro GetOptions
...@@ -190,7 +194,7 @@ Var UninstallLog ...@@ -190,7 +194,7 @@ Var UninstallLog
; installer ; ; installer ;
;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;
Section $Name_Section01 SEC01 ${MementoSection} $Name_Section01 SEC01
SectionIn 1 2 3 RO SectionIn 1 2 3 RO
SetShellVarContext all SetShellVarContext all
SetOutPath "$INSTDIR" SetOutPath "$INSTDIR"
...@@ -256,9 +260,9 @@ Section $Name_Section01 SEC01 ...@@ -256,9 +260,9 @@ Section $Name_Section01 SEC01
WriteRegDWORD HKLM "Software\Clients\Media\VLC\InstallInfo" "IconsVisible" 0x001 WriteRegDWORD HKLM "Software\Clients\Media\VLC\InstallInfo" "IconsVisible" 0x001
lbl_done: lbl_done:
SectionEnd ${MementoSectionEnd}
Section $Name_Section02a SEC02a ${MementoSection} $Name_Section02a SEC02a
SectionIn 1 2 3 SectionIn 1 2 3
CreateDirectory "$SMPROGRAMS\VideoLAN" CreateDirectory "$SMPROGRAMS\VideoLAN"
CreateShortCut "$SMPROGRAMS\VideoLAN\VLC media player.lnk" \ CreateShortCut "$SMPROGRAMS\VideoLAN\VLC media player.lnk" \
...@@ -273,17 +277,17 @@ Section $Name_Section02a SEC02a ...@@ -273,17 +277,17 @@ Section $Name_Section02a SEC02a
"$INSTDIR\${PRODUCT_GROUP} Website.url" "$INSTDIR\${PRODUCT_GROUP} Website.url"
CreateShortCut "$SMPROGRAMS\VideoLAN\Reset VLC media player preferences and cache files.lnk" \ CreateShortCut "$SMPROGRAMS\VideoLAN\Reset VLC media player preferences and cache files.lnk" \
"$INSTDIR\vlc.exe" "--reset-config --reset-plugins-cache vlc://quit" "$INSTDIR\vlc.exe" "--reset-config --reset-plugins-cache vlc://quit"
SectionEnd ${MementoSectionEnd}
Section $Name_Section02b SEC02b ${MementoSection} $Name_Section02b SEC02b
SectionIn 1 2 3 SectionIn 1 2 3
CreateShortCut "$DESKTOP\VLC media player.lnk" \ CreateShortCut "$DESKTOP\VLC media player.lnk" \
"$INSTDIR\vlc.exe" "" "$INSTDIR\vlc.exe" ""
SectionEnd ${MementoSectionEnd}
SectionGroup /e !$Name_Section34 SectionGroup /e !$Name_Section34
!ifdef INSTALL_MOZILLA !ifdef INSTALL_MOZILLA
Section $Name_Section03 SEC03 ${MementoSection} $Name_Section03 SEC03
SectionIn 1 3 SectionIn 1 3
SetOutPath "$INSTDIR" SetOutPath "$INSTDIR"
...@@ -298,11 +302,11 @@ Section $Name_Section03 SEC03 ...@@ -298,11 +302,11 @@ Section $Name_Section03 SEC03
WriteRegStr HKLM ${Moz} "Product" "VLC media player" WriteRegStr HKLM ${Moz} "Product" "VLC media player"
WriteRegStr HKLM ${Moz} "Vendor" "VideoLAN" WriteRegStr HKLM ${Moz} "Vendor" "VideoLAN"
WriteRegStr HKLM ${Moz} "Version" "${VERSION}" WriteRegStr HKLM ${Moz} "Version" "${VERSION}"
SectionEnd ${MementoSectionEnd}
!endif !endif
!ifdef INSTALL_ACTIVEX !ifdef INSTALL_ACTIVEX
Section $Name_Section04 SEC04 ${MementoSection} $Name_Section04 SEC04
SectionIn 1 3 SectionIn 1 3
SetOutPath "$INSTDIR" SetOutPath "$INSTDIR"
...@@ -312,12 +316,12 @@ Section $Name_Section04 SEC04 ...@@ -312,12 +316,12 @@ Section $Name_Section04 SEC04
!insertmacro CloseUninstallLog !insertmacro CloseUninstallLog
@HAVE_WIN64_FALSE@ RegDLL "$INSTDIR\axvlc.dll" @HAVE_WIN64_FALSE@ RegDLL "$INSTDIR\axvlc.dll"
@HAVE_WIN64_TRUE@ ExecWait 'regsvr32.exe /s "$INSTDIR\axvlc.dll"' @HAVE_WIN64_TRUE@ ExecWait 'regsvr32.exe /s "$INSTDIR\axvlc.dll"'
SectionEnd ${MementoSectionEnd}
!endif !endif
SectionGroupEnd SectionGroupEnd
Section $Name_Section05 SEC05 ${MementoSection} $Name_Section05 SEC05
SectionIn 1 2 3 SectionIn 1 2 3
WriteRegStr HKCR "AudioCD\shell\PlayWithVLC" "" $ContextMenuEntry_PlayWith WriteRegStr HKCR "AudioCD\shell\PlayWithVLC" "" $ContextMenuEntry_PlayWith
WriteRegStr HKCR "AudioCD\shell\PlayWithVLC\command" "" \ WriteRegStr HKCR "AudioCD\shell\PlayWithVLC\command" "" \
...@@ -405,7 +409,7 @@ Section $Name_Section05 SEC05 ...@@ -405,7 +409,7 @@ Section $Name_Section05 SEC05
'"$INSTDIR\vlc.exe" %1' '"$INSTDIR\vlc.exe" %1'
WriteRegStr HKCR "VLC.OPENFolder\DefaultIcon" "" '"$INSTDIR\vlc.exe",0' WriteRegStr HKCR "VLC.OPENFolder\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'
SectionEnd ${MementoSectionEnd}
SectionGroup /e !$Name_Section06 SEC06 SectionGroup /e !$Name_Section06 SEC06
...@@ -421,15 +425,17 @@ SectionGroup /e !$Name_Section06 SEC06 ...@@ -421,15 +425,17 @@ SectionGroup /e !$Name_Section06 SEC06
SectionGroupEnd SectionGroupEnd
SectionGroupEnd SectionGroupEnd
Section $Name_Section07 SEC07 ${MementoSection} $Name_Section07 SEC07
SectionIn 1 3 SectionIn 1 3
!insertmacro MacroAllExtensions AddContextMenu !insertmacro MacroAllExtensions AddContextMenu
!insertmacro AddContextMenuExt "Directory" !insertmacro AddContextMenuExt "Directory"
SectionEnd ${MementoSectionEnd}
Section /o $Name_Section08 SEC08 ${MementoUnselectedSection} $Name_Section08 SEC08
!insertmacro delprefs !insertmacro delprefs
SectionEnd ${MementoSectionEnd}
${MementoSectionDone}
; Installer section descriptions ; Installer section descriptions
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
...@@ -451,6 +457,8 @@ SectionEnd ...@@ -451,6 +457,8 @@ SectionEnd
;;; Start function ;;; Start function
Function .onInit Function .onInit
${MementoSectionRestore}
@HAVE_WIN64_TRUE@ !include "x64.nsh" @HAVE_WIN64_TRUE@ !include "x64.nsh"
@HAVE_WIN64_TRUE@ ${If} ${RunningX64} @HAVE_WIN64_TRUE@ ${If} ${RunningX64}
@HAVE_WIN64_TRUE@ ${Else} @HAVE_WIN64_TRUE@ ${Else}
...@@ -922,6 +930,7 @@ Function .OnInstFailed ...@@ -922,6 +930,7 @@ Function .OnInstFailed
FunctionEnd FunctionEnd
Function .OnInstSuccess Function .OnInstSuccess
${MementoSectionSave}
UAC::Unload UAC::Unload
FunctionEnd FunctionEnd
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment