]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
Windows: Save Wix config at start if possible
authorJeffrey Altman <jaltman@your-file-system.com>
Mon, 15 Aug 2011 04:23:57 +0000 (00:23 -0400)
committerDerrick Brashear <shadow@dementix.org>
Mon, 15 Aug 2011 12:29:32 +0000 (05:29 -0700)
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.

Reviewed-on: http://gerrit.openafs.org/5281
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
(cherry picked from commit 020b415be8fa357cded6eb4c50454aaa5b0722bf)

Change-Id: I49abfa6d6e7b929e3880686f7dc7bad4175adcba
Reviewed-on: http://gerrit.openafs.org/5284
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
src/WINNT/install/wix/custom/afscustom.cpp
src/WINNT/install/wix/lang/en_US/ui.wxi

index 3ea2c4a84890ceb9a72ffbcf393bff42905872fa..714e8531f2d4783ecfb4f2b75ef9e1c76e788fc6 100644 (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;
 
index cd12f7b71d08d8f45e6c3ee93f366349d235660a..a52ef617c2eba709b882df5a986e865014966454 100644 (file)
         </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>