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 <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
This commit is contained in:
Jeffrey Altman 2011-08-15 00:23:57 -04:00 committed by Jeffrey Altman
parent 73b91bf0c0
commit 020b415be8
2 changed files with 10 additions and 4 deletions

View File

@ -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;

View File

@ -780,18 +780,18 @@
</Control>
<Control Id="BannerBitmap" Type="Bitmap" X="0" Y="0" Width="374" Height="44" FixedSize="yes" TabSkip="no" Text="[BannerBitmap]" />
<Control Id="Description" Type="Text" X="25" Y="23" Width="280" Height="15" Transparent="yes" NoPrefix="yes">
<Text>Configuration settings from a prior OpenAFS installation is available.</Text>
<Text>Configuration settings from a previous OpenAFS installation are available.</Text>
</Control>
<Control Id="BannerLine" Type="Line" X="0" Y="44" Width="374" Height="0" />
<Control Id="BottomLine" Type="Line" X="0" Y="234" Width="374" Height="0" />
<Control Id="Title" Type="Text" X="15" Y="6" Width="200" Height="15" Transparent="yes" NoPrefix="yes">
<Text>[DlgTitleFont]Restore configuration?</Text>
<Text>[DlgTitleFont]Preserve configuration?</Text>
</Control>
<Control Id="CustomText" Type="Text" X="105" Y="131" Width="230" Height="30">
<Text>Specify new settings. Basic settings can be set via this installer. All others will be reset to defaults.</Text>
</Control>
<Control Id="TypicalText" Type="Text" X="105" Y="78" Width="230" Height="20">
<Text>Restore and use the saved configuration settings.</Text>
<Text>Use the existing or saved configuration.</Text>
</Control>
</Dialog>