ales.hrodek
Posts: 65
Joined: Mon Jun 11, 2012 11:40 am

Record left behind in "Control Panel - Programs"

Hi,

I have another issue with "Install new version first and then uninstall old version". My application use option "Override Windows Installer programs list entry" and Custom name contain version number. If option "Install new version first and then uninstall old version" is selected then previous version record is left behind in "Control Panel - Programs" (Win XP) after upgrade to new version. Can you suggest any solution for this behaviour?

Ales
Dan
Posts: 4529
Joined: Wed Apr 24, 2013 3:51 pm

Re: Record left behind in "Control Panel - Programs"

Hello Ales,

This may happens if the rules of the Install new version first and then uninstall old version process are broken. Please take a look on the Upgrades article with related information.

Also, in order to have a better view about this, you can send us the .AIP (project file) and a verbose log of the installation process to support at advancedinstaller dot com so we can investigate them. If it contains confidential information you can send us a small test project which reproduce this behavior.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
ales.hrodek
Posts: 65
Joined: Mon Jun 11, 2012 11:40 am

Re: Record left behind in "Control Panel - Programs"

Hi Dan,

I've sent .aip projects and verbose logs to your support email. Maybe I found solution but need consult it with you. There is record "Component - AI_CustomARPName" in "Table Editor". If I change ComponentId then everything works correctly and I undestand why.

Questions are:
a) Is it correct/safe solution?
b) Should not be this GUID generated new automatically for every version/build or upgrade code/product code change?

Thank you,
Ales Hrodek
Dan
Posts: 4529
Joined: Wed Apr 24, 2013 3:51 pm

Re: Record left behind in "Control Panel - Programs"

Hi Ales,

In the installation log of your second package (called Test2.log), you can find the following lines:

Code: Select all

MSI (s) (5C:4C) [09:25:02:537]: Disallowing uninstallation of component: {18B81CE4-A495-4F45-B6A6-EBA909FD5315} since another client exists
MSI (s) (5C:4C) [09:25:02:537]: Disallowing uninstallation of component: {52519647-943F-40E8-80FE-6C38119F4D2D} since another client exists
MSI (s) (5C:4C) [09:25:02:537]: Disallowing uninstallation of component: {531C4019-26F8-4B8E-A1D7-CA7EA71E7F26} since another client exists
MSI (s) (5C:4C) [09:25:02:537]: Disallowing uninstallation of component: {FB9034F3-EC31-497A-8C37-ACE9FFD2FE3D} since another client exists
MSI (s) (5C:4C) [09:25:02:537]: Disallowing uninstallation of component: {D5C873D9-F39C-44EE-B959-6BDE0DC0AA4F} since another client exists
This is the reason why your files or registry entries are not removed.
Basically, this can happen if the same components are shared between multiple packages installed on the same machine. Windows Installer keeps a refcount for the components and does allow removing them until all the applications that use them are removed.

You can find the other product using the same component GUIDs and remove that application as well (it may be a broken old version of your own product that could not be removed). In this case, you will be able to find the component under HKEY_CLASSES_ROOT\Installer\Components. The component keyname is the GUID re-packed.

A packed GUID can be obtained by applying a transform to a standard GUID. This transform performs the following operations:
  • •removes the curly braces and separating dashes from a standard GUID
    •writes each group of the first three groups of hexadecimals characters in a standard GUID in reverse order
    •switches every two characters in the fourth and fifth group in a standard GUID
Let's consider the following example:
Original Product Code:

Code: Select all

{12345678-ABCD-WXYZ-1234-ABCDEFGHIJKL} 
The packed GUID:

Code: Select all

87654321DCBAZYXW2134BADCFEHGJILK
Please note that manually deleting some registry enrties doesn't make a really clean machine. It is highly recommended using virtual machine software, so you can easily reset the virtual machine to a known clean state (and also don't have to worry if your install breaks the machine).
a) Is it correct/safe solution?
b) Should not be this GUID generated new automatically for every version/build or upgrade code/product code change?
When changing a GUID for a component, the ability to create a patch between the two versions of your project is lost.

If you have other questions, please let us know.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
ales.hrodek
Posts: 65
Joined: Mon Jun 11, 2012 11:40 am

Re: Record left behind in "Control Panel - Programs"

Hi Dan,

As I understand change component GUID for every version is not great idea. I am claiming this behaviour is bug i AI as it's not under my control because component we are talking about is automatically created by AI.

I found another way how to fix issue and need your opinion. There is nothing wrong in registry with key "HKEY_CLASSES_ROOT\Installer\Components" which you pointed me to. I think problematic record is in "HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall". AI create subkey "HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\[ProductName] [ProductVersion]" with all installer informations but there is a catch! Upgrade create new key because version is included and previous one is not removed because is part of same component.

My workaround:
Add custom action CreateExeProcess

Code: Select all

cmd.exe /c reg delete "HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\[ProductName] [ProductVersion]" /f
and execute it after Remove Resources with condition: (REMOVE = "ALL")

Suggested AI fix in future version:
Keep key in registry constant eg. AI_[UpgradeCode]. I've tried rename this key and it works. Current [ProductName] [ProductVersion] solution is problematic because each version create new key and even reduce key to [ProductName] only will introduce problem if somebody tweak Product name.

Your view? Does this solution(s) have a holes?
ales.hrodek
Posts: 65
Joined: Mon Jun 11, 2012 11:40 am

Re: Record left behind in "Control Panel - Programs"

Another registry entry left behind after upgrade is Software\Caphyon\Advanced Installer\LZMA\[ProductCode]\[ProductVersion]
Dan
Posts: 4529
Joined: Wed Apr 24, 2013 3:51 pm

Re: Record left behind in "Control Panel - Programs"

Hello Ales,

Indeed, the Software\Caphyon\Advanced Installer\LZMA\[ProductCode]\[ProductVersion] registry entry is not removed too as its component with the GUID {531C4019-26F8-4B8E-A1D7-CA7EA71E7F26} is not uninstalling.
As I said in my previous reply, this can happen if the same components are shared between multiple packages installed on the same machine. Windows Installer keeps a refcount for the components and does allow removing them until all the applications that use them are removed.

You can search in your .AIP (project file), to see all the components which are not uninstalling as they appear in the log file.

If you have other questions, please let us know.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
ales.hrodek
Posts: 65
Joined: Mon Jun 11, 2012 11:40 am

Re: Record left behind in "Control Panel - Programs"

I have tested solution with changed registry key (without delete key CA). It look working correctly for me. Do you see any downsides/danger ?
AI_RegistryChange.png
AI_RegistryChange.png (160.06 KiB) Viewed 15064 times
ales.hrodek
Posts: 65
Joined: Mon Jun 11, 2012 11:40 am

Re: Record left behind in "Control Panel - Programs"

Hi Dan,
To your last post: Yes - I understood what you said. I know why it's not removing registry entry but I claim it is AI bug and need to find solution. This component is managed by AI and user does not have control over it (talking about AI_CustomARPName). Registry key should never ever should be version specific because WI behaviour. Software\Caphyon\Advanced Installer\LZMA\[ProductCode]\[ProductVersion] is not big issue as it's only visible in registry and user will not spot it. Additional dead entry in "Control Panel" on other side is problem.

Could you check my Table Editor solution?

Thank You,
Ales Hrodek
Daniel
Posts: 8279
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Record left behind in "Control Panel - Programs"

Hello Ales,

First of all I apologize for this inconvenience. Indeed, this is an Advanced Installer issue. A fix will be available in a future version of Advanced Installer, thank you for bringing it to our attention. We will notify you as soon as the fix will be out.

This happens because when the "Override Windows Installer programs list entry" option from "Product Details" page is selected AI creates at install time a group of registries corresponding to the product entry from Control Panel. All the above registries are added by Advanced Installer under a hidden component (AI_CustomARPName), as you already saw. Now when the ProductVersion of your project is increased the "AI_CustomARPName" component will preserve its GUID (as in the old ProductVersion). Because the GUID of the "AI_CustomARPName" is the same in both of your product versions, during upgrade it will be installed the new version first and on the uninstall stage of the old version the "AI_CustomARPName" won't be uninstalled because now it is shared by both product versions (as it have the same GUID). Therefore, the Control Panel entry of the old version won't be removed.

As a workaround, to avoid this behavior you can manually generate different GUID for the "AI_CustomARPName" component each time you change the product version to build a major upgrade setup. Just go to "Table Editor" page, select the "Component" table and change the "ComponentID" guid of the "AI_CustomARPName" component. This way the above component won't be shared during upgrade installation and the issue should disappear.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
ales.hrodek
Posts: 65
Joined: Mon Jun 11, 2012 11:40 am

Re: Record left behind in "Control Panel - Programs"

Hi Daniel,

I suggested change component GUID in one of my previous posts but Dan claimed it will break ability to create patch. It's not my issue and I can live without patch (at least for now) but you probably should discuss this inside your team. I came with registry key path solution because change GUID was not suggested.
Daniel
Posts: 8279
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Record left behind in "Control Panel - Programs"

Hello Ales,

When building the next version of your product as a patch installation there is no need to change the GUID of the "AI_CustomARPName" component because this issue is reproducible only during major upgrade installations. During a patch installation this issue doesn't appear. So, you should change the GUID for the "AI_CustomARPName" component only when changing the product version to build a major upgrade setup.

As soon as this issue will be addressed by our development team we will update this thread.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Dan
Posts: 4529
Joined: Wed Apr 24, 2013 3:51 pm

Re: Record left behind in "Control Panel - Programs"

Hello,

This was fixed in version 12.3 of Advanced Installer released on July 16th, 2015.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”