Disallowing uninstallation of component - Advanced Installer Community
Andrey
Posts: 47
Joined: Thu Jul 10, 2014 9:06 am

Disallowing uninstallation of component

Hello AI-team!
I would like to allow users install application per-machine and per-user. MSI registers some common registry keys "Current user / Local machine", COM components and also overrides application name in Add-Remove Panel.

If I install first version of MSI to Current User and second to Local Machine, and then try to uninstall both of them there are several errors in logs:
Disallowing uninstallation of component: {<GUID>} since another client exists
To solve that problem:
- I have separated registry keys, so each value presents in Local Machine and Current User. And their components respectively have conditions ALLUSERS=1 or ALLUSERS <>1.
- same for COM components.
- removed ARP name customization.

Question: How can I create two AI_CustomARPName components for Current User and Local Machine installations?

My test project is attached which reproduce deinstallation failure(1.zip):
- Install 1st version for current user
- Increment ProductVersion and install 2nd version to local machine
- Uninstall 1st version
- Uninstall 2nd version
=> still have dummy record of my program in AddRemovePrograms Panel.

Thanks
Andrey
Attachments
1.zip
(135.71 KiB) Downloaded 1071 times
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Disallowing uninstallation of component

Hi Andrey,

Please keep in mind that a package installed per-machine cannot find and uninstall a previous version that is installed per-user (or vice-versa). In order to achieve this you can use the Uninstall previous versions custom action.
Disallowing uninstallation of component: {<GUID>} since another client exists
This message is displayed because the components with that {GUID} are installed twice (by both versions of the product). For more details you can read the Why files are left behind after package uninstall FAQ article.

Also, please note that it is recommended to make all your tests on clean virtual machines because they can be easily reverted to a clean state.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Andrey
Posts: 47
Joined: Thu Jul 10, 2014 9:06 am

Re: Disallowing uninstallation of component

Hello Eusebiu,
Thanks for your reply!
I understand the reason which caused this "dissalowing" error, but the problem is that I do not have access to AI_CustomARPName component in Organization Tab. I would like to create a separate component for each installation type (Current User and Local Machine).

If i disable "Override Windows Installer programs list entry" in Product Details tab then everything is fine, both types of installations uninstalls independently.

Kind regards,
Andrey
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Disallowing uninstallation of component

Hi Andrey,

Indeed, the "AI_CustomARPName" component is a hidden component, however that component is related to the "Override Windows Installer programs list entry" option from the "Product Details" page and it is added only when that option is enabled. Can you please tell us why do you want to create a separate component for each installation type?

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Andrey
Posts: 47
Joined: Thu Jul 10, 2014 9:06 am

Re: Disallowing uninstallation of component

Hi Eusebiu,
If the "AI_CustomARPName" component exist in MSI then I have problem with deinstallation. As I mentioned in first post:
My test project is attached which reproduce deinstallation failure(1.zip):
- Install 1st version for Current User
- Increment ProductVersion and install 2nd version to Local Machine
- Uninstall 1st version
- Uninstall 2nd version
=> still have dummy record of my program in AddRemovePrograms Panel.
Best regards,
Andrey
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Disallowing uninstallation of component

Hi Andrey,

If you want that component to not be included in your MSI package, you can disable the "Override Windows Installer programs list entry" option.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Andrey
Posts: 47
Joined: Thu Jul 10, 2014 9:06 am

Re: Disallowing uninstallation of component

Sorry for vague explanation.
I want to include this component because I want to override ARP name.
Currently it looks like [ProductName] and I would like to see [ProductName] [ProductVersion].

Thanks,
Andrey.
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Disallowing uninstallation of component

Hi Andrey,

That name can also be set in the "Custom name" field from the "Product Details" page. Plus, if you want to set that name at install time, you can create a "Set installer property" custom action which sets the [AI_PRODUCTNAME_ARP] property with the desired name.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Andrey
Posts: 47
Joined: Thu Jul 10, 2014 9:06 am

Re: Disallowing uninstallation of component

Hi Eusebiu,
This solution doesn't help me. Because if I enable "Custom name" under "Override Windows Installer programs list entry" (Product Details page) it creates one common component "AI_CustomARPName". And both Current User and Local Machine installations packages are referencing to that component. Thats why I have problems with deinstallation.

I have tried to add Custom action to set [AI_PRODUCTNAME_ARP] property with "[ProductName] [ProductVersion]" value without checking checkbox "Override Windows Installer programs list entry". Displayed version didn't changed in add-remove-programs panel.

Am I missing something?

Kind regards,
Andrey
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Disallowing uninstallation of component

Hi Andrey,
This solution doesn't help me. Because if I enable "Custom name" under "Override Windows Installer programs list entry" (Product Details page) it creates one common component "AI_CustomARPName". And both Current User and Local Machine installations packages are referencing to that component. Thats why I have problems with deinstallation.
In order to overcome this problem, you can go in the "Table Editor" page, "Component" table and modify the "ComponentId" of the "AI_CustomARPName" row when you make an upgrade for your application.
I have tried to add Custom action to set [AI_PRODUCTNAME_ARP] property with "[ProductName] [ProductVersion]" value without checking checkbox "Override Windows Installer programs list entry". Displayed version didn't changed in add-remove-programs panel.
The displayed name did not change in Control Panel because you did not check the "Override Windows Installer programs list entry" option. The "AI_CustomARPName" component uses the [AI_PRODUCTNAME_ARP] property, but only when that option is checked.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Andrey
Posts: 47
Joined: Thu Jul 10, 2014 9:06 am

Re: Disallowing uninstallation of component

Thanks Eusebiu, your solution works well!

My project is built from command line so I've added script to find-and-replace ComponentID of AI_CustomARPName for every new build.
Is it possible to change guid with advanced installer command line?

Best regards,
Andrey.
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Disallowing uninstallation of component

Hi Andrey,

I'm afraid that we do not have predefined support for changing a component's GUID from command line.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”