From: Jeffrey Altman Date: Mon, 15 Aug 2011 04:23:57 +0000 (-0400) Subject: Windows: Save Wix config at start if possible X-Git-Tag: openafs-devel-1_7_1~135 X-Git-Url: https://git.openafs.org/?p=openafs.git;a=commitdiff_plain;h=020b415be8fa357cded6eb4c50454aaa5b0722bf Windows: Save Wix config at start if possible Save the current configuration at the start of the install process so the user can be presented with a dialog prior to installation asking whether the existing or saved configuration should be used or whether a new configuration should be created. Change-Id: I4a42ad597a7e1806bbae6d63bf1a2db365e6be8e Reviewed-on: http://gerrit.openafs.org/5281 Reviewed-by: Jeffrey Altman Tested-by: Jeffrey Altman --- diff --git a/src/WINNT/install/wix/custom/afscustom.cpp b/src/WINNT/install/wix/custom/afscustom.cpp index 3ea2c4a..714e853 100644 --- a/src/WINNT/install/wix/custom/afscustom.cpp +++ b/src/WINNT/install/wix/custom/afscustom.cpp @@ -576,7 +576,8 @@ do_reg_copy_value(MSIHANDLE hInstall, HKEY hk_src, HKEY hk_dest, const TCHAR * v rv = RegQueryValueEx(hk_src, value, 0, &type, buffer, &cb); if (rv == ERROR_MORE_DATA) { - buffer = new BYTE[cb]; + // Some types require space for a terminating NUL which might not be present + buffer = new BYTE[++cb]; if (buffer == NULL) { ShowMsiActionData(hInstall, _T("Out of memory")); return; @@ -827,6 +828,11 @@ SetAfscredsOptionsFromRegValue(MSIHANDLE hInstall, HKEY hk) // MSIDLLEXPORT DetectSavedConfiguration( MSIHANDLE hInstall ) { + // Attempt a backup. If there is something to save, it will be. + // If not, nothing has changed. + // + BackupAFSClientRegistryKeys( hInstall ); + { MSIHANDLE hRec; diff --git a/src/WINNT/install/wix/lang/en_US/ui.wxi b/src/WINNT/install/wix/lang/en_US/ui.wxi index cd12f7b..a52ef61 100644 --- a/src/WINNT/install/wix/lang/en_US/ui.wxi +++ b/src/WINNT/install/wix/lang/en_US/ui.wxi @@ -780,18 +780,18 @@ - Configuration settings from a prior OpenAFS installation is available. + Configuration settings from a previous OpenAFS installation are available. - [DlgTitleFont]Restore configuration? + [DlgTitleFont]Preserve configuration? Specify new settings. Basic settings can be set via this installer. All others will be reset to defaults. - Restore and use the saved configuration settings. + Use the existing or saved configuration.