Windows: Backup and restore configuration across installs
[openafs.git] / src / WINNT / install / wix / openafs.wxs
index 3fde40a..e955ea2 100644 (file)
         <Binary
                 Id="BIN_afsCustom"
                 src="$(var.MediaDllDir)afscustom.dll"/>
+    <Binary
+       Id="BIN_idndl.exe"
+       src="$(var.IDNMRedistDir)\idndl.$(var.Arch).exe" />
+    <CustomAction
+       Id="InstallIDNMRedistributable"
+       BinaryKey="BIN_idndl.exe"
+       ExeCommand="/quiet /norestart"
+       Execute="deferred"
+       Impersonate="no"
+       />
+
        <?ifdef UseDllLoopbackInstaller?>
         <CustomAction
          Id="InstallLoopback"
                 BinaryKey="BIN_afsCustom"
                 DllEntry="AbortMsiImmediate"
                 Execute="immediate" />
+                <CustomAction
+                    Id="BackupAFSClientRegistryKeys"
+                    BinaryKey="BIN_afsCustom"
+                    DllEntry="BackupAFSClientRegistryKeys"
+                    Execute="deferred"
+                    Impersonate="no" />
+                <CustomAction
+                    Id="RestoreAFSClientRegistryKeys"
+                    BinaryKey="BIN_afsCustom"
+                    DllEntry="RestoreAFSClientRegistryKeys"
+                    Execute="deferred"
+                    Impersonate="no" />
+                <CustomAction
+                    Id="RollbackRestoreAFSClientRegistryKeys"
+                    BinaryKey="BIN_afsCustom"
+                    DllEntry="BackupAFSClientRegistryKeys"
+                    Execute="rollback"
+                    Impersonate="no" />
+                <CustomAction
+                    Id="DetectSavedConfiguration"
+                    BinaryKey="BIN_afsCustom"
+                    DllEntry="DetectSavedConfiguration"
+                    Execute="firstSequence" />
+                <CustomAction
+                   Id="SetInstallLocation"
+                   Property="ARPINSTALLLOCATION"
+                   Value="[AFSDIR]" />
 
         <!-- Installation Sequences -->
         <AdvertiseExecuteSequence />
         <AdminExecuteSequence />
         <InstallExecuteSequence>
-                       <RemoveExistingProducts After="InstallValidate">IBMAFS_UPGRADE OR OPENAFS_UPGRADE OR AFSPLUGIN_UPGRADE</RemoveExistingProducts>
+                       <RemoveExistingProducts After="InstallValidate">(Not Installed) And (IBMAFS_UPGRADE OR OPENAFS_UPGRADE OR AFSPLUGIN_UPGRADE)</RemoveExistingProducts>
                        <Custom Action="RemoveNsisInstallation" Before="AbortInstallationA">NSISUNINSTALL &lt;&gt; "" AND UILevel &gt;= 4</Custom>
                        <Custom Action="AbortInstallationA" Before="CostInitialize">NSISUNINSTALL &lt;&gt; "" AND UILevel &lt; 4</Custom>
                        <!-- Assert that if the server is going to be installed locally after this session, control center and client are also local -->
             <Custom Action="RollbackNetProvider" After="WriteRegistryValues">&amp;feaClient=3</Custom>
                        <Custom Action="InstallNetProvider" After="RollbackNetProvider">&amp;feaClient=3</Custom>
                        <Custom Action="RemoveNetProvider" After="InstallNetProvider">&amp;feaClient=2</Custom>
+      <Custom Action="InstallIDNMRedistributable" After="WriteRegistryValues">!feaClient=2 And &amp;feaClient=3 And (VersionNT=501 Or VersionNT=502)</Custom>
                        <Custom Action="ConfigureClient" After="InstallServices">&amp;feaClient=3</Custom>
                        <Custom Action="ConfigureServer" After="ConfigureClient">&amp;feaServer=3</Custom>
+                        <Custom Action="RollbackRestoreAFSClientRegistryKeys" After="RemoveNetProvider">!feaClient=2 And &amp;feaClient=3 And RESTORE_CONFIG</Custom>
+                        <Custom Action="RestoreAFSClientRegistryKeys" After="RollbackRestoreAFSClientRegistryKeys">!feaClient=2 And &amp;feaClient=3 And RESTORE_CONFIG</Custom>
+                        <Custom Action="BackupAFSClientRegistryKeys" Before="DeleteServices">!feaClient=3 And &amp;feaClient=2</Custom>
                        <!-- <Custom Action="RemoveAFSAdminGroup" Before="">&amp;feaClient=2</Custom> -->
                        <Custom Action="RollbackAFSAdminGroup" Before="CreateAFSAdminGroup">&amp;feaClient=3</Custom>
                        <Custom Action="CreateAFSAdminGroup" Before="CreateFolders">&amp;feaClient=3</Custom>
+                        <Custom Action="SetInstallLocation" Before="RegisterProduct" />
+                        <Custom Action="DetectSavedConfiguration" Before="CostInitialize" />
             <ScheduleReboot After="PublishProduct">&amp;feaClient=3 OR &amp;feaServer=3 OR &amp;feaClient=2 OR &amp;feaServer=2</ScheduleReboot>
         </InstallExecuteSequence>
 
         <!-- Related producs -->
-        <!-- MIT's OpenAFS MSI installer -->
+        <!-- OpenAFS MSI installer -->
         <Upgrade Id="6823EEDD-84FC-4204-ABB3-A80D25779833">
-            <UpgradeVersion IgnoreRemoveFailure="no" IncludeMaximum="no" Maximum="$(var.NumericVersion)" MigrateFeatures="yes" Property="OPENAFS_UPGRADE" />
+            <UpgradeVersion IgnoreRemoveFailure="no" IncludeMaximum="yes" Maximum="$(var.NumericVersion)" MigrateFeatures="yes" Property="OPENAFS_UPGRADE" />
         </Upgrade>
         
         <!-- MIT's Transarc AFS MSI Installer -->