Skip to content

Commit

Permalink
MP1-4827 : Fix backup/restore keymap.xml on MP upgrade.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastiii committed Nov 6, 2016
1 parent ca403d8 commit abfa2b1
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions mediaportal/Setup/setup.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,21 @@ ShowUninstDetails show
${EndIf}
!macroend

!macro BackupKeymapSettings
${If} ${FileExists} "${COMMON_APPDATA}\keymap.xml"
GetTempFileName $PREVIOUS_KEYMAPSETTINGS
${LOG_TEXT} "INFO" "Backup keymap.xml (${COMMON_APPDATA}\keymap.xml)"
CopyFiles /SILENT /FILESONLY "${COMMON_APPDATA}\keymap.xml" "$PREVIOUS_KEYMAPSETTINGS"
${EndIf}
!macroend

!macro RestoreKeymapSettings
${If} ${FileExists} "$PREVIOUS_KEYMAPSETTINGS"
${LOG_TEXT} "INFO" "Restore keymap.xml (${COMMON_APPDATA}\keymap.xml)"
CopyFiles /SILENT /FILESONLY "$PREVIOUS_KEYMAPSETTINGS" "${COMMON_APPDATA}\keymap.xml"
${EndIf}
!macroend

Function RunUninstaller

!ifndef GIT_BUILD
Expand All @@ -349,6 +364,7 @@ Section "-prepare" SecPrepare

!insertmacro ShutdownRunningMediaPortalApplications
!insertmacro BackupSkinSettings
!insertmacro BackupKeymapSettings

${LOG_TEXT} "INFO" "Deleting SkinCache..."
RMDir /r "$MPdir.Cache"
Expand Down Expand Up @@ -664,6 +680,7 @@ Section "MediaPortal core files (required)" SecCore
SendMessage ${HWND_BROADCAST} ${WM_FONTCHANGE} 0 0 /TIMEOUT=1000

!insertmacro RestoreSkinSettings
!insertmacro RestoreKeymapSettings

SectionEnd
!macro Remove_${SecCore}
Expand Down

0 comments on commit abfa2b1

Please sign in to comment.