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

nsis: remember selected components between installs

parent cc43387f
......@@ -20,6 +20,9 @@
!define MUI_LANGDLL_REGISTRY_KEY "${PRODUCT_DIR_REGKEY}"
!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_MOZILLA
......@@ -60,6 +63,7 @@ RequestExecutionLevel user
!include WinVer.nsh
!include FileFunc.nsh
!include MUI2.nsh
!include Memento.nsh
!insertmacro GetParameters
!insertmacro GetOptions
......@@ -190,7 +194,7 @@ Var UninstallLog
; installer ;
;;;;;;;;;;;;;;;;;;;;;;
Section $Name_Section01 SEC01
${MementoSection} $Name_Section01 SEC01
SectionIn 1 2 3 RO
SetShellVarContext all
SetOutPath "$INSTDIR"
......@@ -256,9 +260,9 @@ Section $Name_Section01 SEC01
WriteRegDWORD HKLM "Software\Clients\Media\VLC\InstallInfo" "IconsVisible" 0x001
lbl_done:
SectionEnd
${MementoSectionEnd}
Section $Name_Section02a SEC02a
${MementoSection} $Name_Section02a SEC02a
SectionIn 1 2 3
CreateDirectory "$SMPROGRAMS\VideoLAN"
CreateShortCut "$SMPROGRAMS\VideoLAN\VLC media player.lnk" \
......@@ -273,17 +277,17 @@ Section $Name_Section02a SEC02a
"$INSTDIR\${PRODUCT_GROUP} Website.url"
CreateShortCut "$SMPROGRAMS\VideoLAN\Reset VLC media player preferences and cache files.lnk" \
"$INSTDIR\vlc.exe" "--reset-config --reset-plugins-cache vlc://quit"
SectionEnd
${MementoSectionEnd}
Section $Name_Section02b SEC02b
${MementoSection} $Name_Section02b SEC02b
SectionIn 1 2 3
CreateShortCut "$DESKTOP\VLC media player.lnk" \
"$INSTDIR\vlc.exe" ""
SectionEnd
${MementoSectionEnd}
SectionGroup /e !$Name_Section34
!ifdef INSTALL_MOZILLA
Section $Name_Section03 SEC03
${MementoSection} $Name_Section03 SEC03
SectionIn 1 3
SetOutPath "$INSTDIR"
......@@ -298,11 +302,11 @@ Section $Name_Section03 SEC03
WriteRegStr HKLM ${Moz} "Product" "VLC media player"
WriteRegStr HKLM ${Moz} "Vendor" "VideoLAN"
WriteRegStr HKLM ${Moz} "Version" "${VERSION}"
SectionEnd
${MementoSectionEnd}
!endif
!ifdef INSTALL_ACTIVEX
Section $Name_Section04 SEC04
${MementoSection} $Name_Section04 SEC04
SectionIn 1 3
SetOutPath "$INSTDIR"
......@@ -312,12 +316,12 @@ Section $Name_Section04 SEC04
!insertmacro CloseUninstallLog
@HAVE_WIN64_FALSE@ RegDLL "$INSTDIR\axvlc.dll"
@HAVE_WIN64_TRUE@ ExecWait 'regsvr32.exe /s "$INSTDIR\axvlc.dll"'
SectionEnd
${MementoSectionEnd}
!endif
SectionGroupEnd
Section $Name_Section05 SEC05
${MementoSection} $Name_Section05 SEC05
SectionIn 1 2 3
WriteRegStr HKCR "AudioCD\shell\PlayWithVLC" "" $ContextMenuEntry_PlayWith
WriteRegStr HKCR "AudioCD\shell\PlayWithVLC\command" "" \
......@@ -405,7 +409,7 @@ Section $Name_Section05 SEC05
'"$INSTDIR\vlc.exe" %1'
WriteRegStr HKCR "VLC.OPENFolder\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'
SectionEnd
${MementoSectionEnd}
SectionGroup /e !$Name_Section06 SEC06
......@@ -421,15 +425,17 @@ SectionGroup /e !$Name_Section06 SEC06
SectionGroupEnd
SectionGroupEnd
Section $Name_Section07 SEC07
${MementoSection} $Name_Section07 SEC07
SectionIn 1 3
!insertmacro MacroAllExtensions AddContextMenu
!insertmacro AddContextMenuExt "Directory"
SectionEnd
${MementoSectionEnd}
Section /o $Name_Section08 SEC08
${MementoUnselectedSection} $Name_Section08 SEC08
!insertmacro delprefs
SectionEnd
${MementoSectionEnd}
${MementoSectionDone}
; Installer section descriptions
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
......@@ -451,6 +457,8 @@ SectionEnd
;;; Start function
Function .onInit
${MementoSectionRestore}
@HAVE_WIN64_TRUE@ !include "x64.nsh"
@HAVE_WIN64_TRUE@ ${If} ${RunningX64}
@HAVE_WIN64_TRUE@ ${Else}
......@@ -922,6 +930,7 @@ Function .OnInstFailed
FunctionEnd
Function .OnInstSuccess
${MementoSectionSave}
UAC::Unload
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