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

nsis: remember selected components between installs

parent cc43387f
...@@ -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