tsellman
Posts: 24
Joined: Fri Sep 14, 2012 2:37 pm

saving registry values during upgrade

Wed Oct 31, 2012 10:16 pm

I'm building a upgrade and the AI installer package prior to this did not use the 'Permanent' or 'Never Overwrite'
component properties... so within the 'Registry' tab, I selected the right-most tree-view leaf
(Current user/Local machine // Software // Manufacturer // ProductName), then using the registry key editor,
selected 'Preserve key content' with a condition of OLDPRODUCTS on the Operations tab.

The goal is to not blow away the registry values currently in use that had been created by the older installer package.


When executing the new installer, I get the error: "Could not open key: \UNKNOWN\Software\_myMfgName_\_myProdName_'
Verify that you have sufficient access...."

In regedit, you can see that HKEY_LOCAL_MACHINE\SOFTWARE\_myMfgName_\_myProdName_ does in fact exist.
Any clue as to the issue? Is it significant that in the Registry tab the path includes 'Software', yet in regedit it's upper cased as 'SOFTWARE' ?

Daniel
Posts: 8237
Joined: Mon Apr 02, 2012 1:11 pm
Contact:  Website

Re: saving registry values during upgrade

Thu Nov 01, 2012 12:42 pm

Hello,

I've tested your scenario, but I cannot reproduce the behavior. Can you reproduce the behavior on multiple clean machines? If so, can you attach a sample project which reproduce the behavior so we can investigate it?

Also, you can take a look on our "Error 1402. Could not open key: HKEY_CURRENT_USER32..." thread.
Is it significant that in the Registry tab the path includes 'Software', yet in regedit it's upper cased as 'SOFTWARE' ?
No, it isn't.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

tsellman
Posts: 24
Joined: Fri Sep 14, 2012 2:37 pm

Re: saving registry values during upgrade

Thu Nov 01, 2012 5:12 pm

I have attached a zip file containing the configuration file (AIP) for both the install that succeeds and that which fails.
Also included are the log files captured during each install attempt.

I have tried this on two different systems (an XP SP3 32bit system and a Windows 7 64-bit system).
The config and log files are from the 32-bit system.

The difference between the two installer configuration files is that on the failed attempt, the 'Never Overwrite' and 'Permanent' options
were selected for most of the registry settings (done on the Organizational tab - component property view). Additionally, I had
set the 'Preserve key content' with a condition of OLDPRODUCTS on the 'Operations-tab' of the 'Edit Registry Key' for the
Software\Manufacturer\ProductName leaf of the Current user/Local machine hive.
Attachments
AI_installProblem.zip
config and resulting install log for both success and failed installs
(55.76KiB)Downloaded 502 times

Daniel
Posts: 8237
Joined: Mon Apr 02, 2012 1:11 pm
Contact:  Website

Re: saving registry values during upgrade

Fri Nov 02, 2012 4:40 pm

Hello,

I've tested your scenario and I can reproduce the related behavior. It seems it appears because Windows Installer will not install a component if the following conditions are true:
1. The component key resource is a registry.
2. The component has the "Never Overwrite" option enabled.

So, it is not recommended to enable the "Never Overwrite" option for a component which contains as a key resource a registry. However, as a workaround in order to achieve what you want you can use the "Preserve key content" option from "Registry Key Operations Tab".

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

tsellman
Posts: 24
Joined: Fri Sep 14, 2012 2:37 pm

Re: saving registry values during upgrade

Mon Nov 05, 2012 9:42 pm

Thanks for the suggestion.. although the installer will now actually run, it does not preserve
the registry content as advertised.

I have attached the AI configuration file. FYI, the older AI package was built with an AI release version 6.7.
In the attached config file, I modified the Operations tab 'Persistence' property to be conditional on OLDPRODUCTS.
As reflected in the attached config file, I also changed the registry components to have the 'Permanent' check-box
enabled (although the same result occurred whether checked or not).

No matter what, any of the registry subkey values are reset after installing the upgrade. Is there an order of operations
that I'm not following.

Any assistance would be appreciated. Thanks.
Attachments
AllworxTsp_x64.aip
(27KiB)Downloaded 596 times

mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: saving registry values during upgrade

Thu Nov 08, 2012 10:47 am

Hello,

I just tested this on a fresh project because yours is a bit complex to isolate the problem. I simply set OLDPRODUCTS condition in the Operations tab of a registry key in the upgrading version. In my case this was ver. 2.0.0 which was installed over ver. 1.0.0.
Everything worked as expected and all the values in the registry key were preserved from ver. 1.0.0.

Forget about setting any flag. If you already released a version without using the "Permanent" option but want to prevent a registry key content from being overwritten just enable its preserve operation with OLDPRODUCTS condition from the Registry page -> Operations tab. This is described in our How do I prevent a file or registry entry from being uninstalled or repaired? related user guide article.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

tsellman
Posts: 24
Joined: Fri Sep 14, 2012 2:37 pm

Re: saving registry values during upgrade

Fri Nov 16, 2012 10:30 pm

Thanks for your suggestions.

I have partial success.

I have an installer config for x86 systems and one for x64 systems. With a small difference being the destination
directories for the dll library, as far as I can ascertain, they are in principle the same. I used the method suggested
(simply using the OLDPRODUCTS condition in the registry preservation area of the Edit Registry Key Operations Tab).

I have two test systems ( one an x86 with XP ServicePack 3 ) and one that's a Windows 7 x64 system.
Both have the old software product installed. When installing with the new x86 package, the registry contents
are preserved, as desired. However, when performing the same on the x64 system, the registry values are overwritten
with the installer defaults, instead of preserving the values as they were.

I have attached a zip file containing the AIP config files for each ( x86 vs x64 ) and corresponding install log files captured.
The log file captured for the x86 install was performed within the "run+log" option within Advanced Installer.
The x64 log was captured by executing the .exe with arguments to generate the log.
SetupTsp_x64.aip --- Failed64RegPreserveInstall.log
SetupTsp_x86.aip --- Successful86RegPreserveInstall.log


Can you examine to see what might account for the difference. I did try the x64 install scenario on another
individuals Windows 7 x64 system. The difference between that Windows 7 system and mine is the UAC enablement.
The net result for the install was the same -- failure to retain registry settings on the x64 box.

Thanks in advance for your help.
Attachments
registryOverwritten.zip
(82.17KiB)Downloaded 466 times

mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: saving registry values during upgrade

Tue Nov 20, 2012 9:37 am

Hello,

Indeed I tested and can confirm this behavior. It is caused by a limitation in the preserve feature.
Our development team will investigate for a solution and we'll keep this thread updated.

Meanwhile, here's an older user guide article you can follow to preserve a registry key: All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

tsellman
Posts: 24
Joined: Fri Sep 14, 2012 2:37 pm

Re: saving registry values during upgrade

Tue Nov 27, 2012 5:00 pm

Thanks for suggesting the workaround. We have a bit of time before a release.
I would prefer not to "special-case" if you anticipate a correction to the standard practice
(as accomplished in the XP x86 installer that did work). Is there a projection as to
a potential date for correction ?

Daniel
Posts: 8237
Joined: Mon Apr 02, 2012 1:11 pm
Contact:  Website

Re: saving registry values during upgrade

Wed Nov 28, 2012 12:44 pm

Hello,

I'm afraid that we cannot offer an ETA for now. However, we will try to implement a fix in the first few months of the next year.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

forceamp
Posts: 2
Joined: Fri Feb 28, 2014 10:25 pm

Re: saving registry values during upgrade

Fri Feb 28, 2014 10:29 pm

Was the bug ever corrected for the 64 bit case ?

Daniel
Posts: 8237
Joined: Mon Apr 02, 2012 1:11 pm
Contact:  Website

Re: saving registry values during upgrade

Tue Mar 04, 2014 11:18 am

Hello and welcome to Advanced Installer forums,

Thank you for your interest in Advanced Installer.

Unfortunately, this is still on our TODO list. Also, currently I'm afraid I cannot give you an ETA for this fix. However, we will update this thread as soon as this fix will be included in a future version of Advanced Installer.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

forceamp
Posts: 2
Joined: Fri Feb 28, 2014 10:25 pm

Re: saving registry values during upgrade

Mon Apr 28, 2014 4:05 pm

Was this fixed in the latest release ?

How can we get this escalated ? It seems a pretty basic function of an installer to be able to preserve registry settings on an upgrade. Is this a problem with your software or the underlying Windows installer code ?

Thanks.

Daniel
Posts: 8237
Joined: Mon Apr 02, 2012 1:11 pm
Contact:  Website

Re: saving registry values during upgrade

Tue Apr 29, 2014 10:32 am

Hello,

I'm afraid this wasn't fixed yet. We apologize for this inconvenience. This is caused by a limitation in the registry persistence support of our application, and currently seems to be quite complicated to find out a fix for it. We will update this thread as soon as a fix for this limitation will be available.

Until then, as a workaround, you can use the approach indicated by my colleague Mihai about "How to prevent a registry key from being overwritten by a newer version of the package.zip".

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

twindsor
Posts: 2
Joined: Sat Nov 29, 2014 1:38 pm

Re: saving registry values during upgrade

Sun Nov 30, 2014 10:16 am

Hi All, I'm having the same issues and we're at the point that we're currently working out how to use other tools to do this... We've tried the scripting version, which I'd be completely happy with, but it doesn't work on Windows 8.1 (we haven't yet tested further afield). The script runs, we display msgbox for the creation of backup key, but the CreateKey just doesn't create the key, but also, doesn't error either (if errr.number <> 0 doesn't fire)! The only way I can get the script to createKey and actually create the key is to run the script using 'Run As administrator' this is manual not in the msi. Can we force Windows 8 to run the script as Administrator - the msi obviously has the permissions as it can modifiy the registry... but how come the script can't?

Thanks for any assistance - we're now desperate a at risk of losing customers over this one!

Tim

Return to “Building Installers”