Package dependancy - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

srini
Posts: 81
Joined: Mon Sep 14, 2009 4:22 pm

Package dependancy

Hello,

I want to make a package, say PACK2, dependant on another package, say PACK1. While installing, this can be easily done by providing an install condition in PACK2. But I want PACK1 to be uninstallabe until PACK2 is removed. Is this possible? If so how can I do it?

Thanks

PS: Search is not very efficient both on your application help and through this forum. They both simply bring out all the topics that contain any of the word(s) in the sought word list.
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: Package dependancy

Hi,

Here is what you can try:
-- create an extended search to search for the Product Code of PACK 2 using the Search page
-- now you can go to custom actions page and add under the Begin phase a predefined "Error Message" custom action
-- this will display a custom message to the user and quit the uninstall process
-- to condition the custom action to run when only when the user tries to uninstall PACK 1 when PACK 2 is installed you should enter the following condition in the "Condition" field
from the Custom Action Properties page:

Code: Select all

( SEARCH_RESULT AND (REMOVE = "ALL") )
Assuming that SEARCH_RESULT is the name of the search. Please let me know if you have any questions.

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
srini
Posts: 81
Joined: Mon Sep 14, 2009 4:22 pm

Re: Package dependancy

Hi Bogdan,

Thanks for your reply. But it is still not clear to me.

-- create an extended search to search for the Product Code of PACK 2 using the Search page - Is this in PACK1?
-- now you can go to custom actions page and add under the Begin phase a predefined "Error Message" custom action - Again PACK1?
-- this will display a custom message to the user and quit the uninstall process - PACK1?
-- to condition the custom action to run when only when the user tries to uninstall PACK 1 when PACK 2 is installed you should enter the following condition in the "Condition" field - PACK1?

[from the Custom Action Properties page:

Code: Select all
( SEARCH_RESULT AND (REMOVE = "ALL") )

Assuming that SEARCH_RESULT is the name of the search. Please let me know if you have any questions.] - PACK1?

My situation is as below:
1. Install PACK1
2. Later on install PACK2_1 - This will check for the existence of PACK1 before installing
3. Later on if there is any changes to PACK2 make PACK2_2 - Again for the existence of PACK1 before installing

So as long as a version of PACK2 (any release) exists, PACK1 should not be able to be uninstalled.

Thanks
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: Package dependancy

Hi,
-- create an extended search to search for the Product Code of PACK 2 using the Search page - Is this in PACK1?
-- now you can go to custom actions page and add under the Begin phase a predefined "Error Message" custom action - Again PACK1?
-- this will display a custom message to the user and quit the uninstall process - PACK1?
-- to condition the custom action to run when only when the user tries to uninstall PACK 1 when PACK 2 is installed you should enter the following condition in the "Condition" field - PACK1?
Assuming that SEARCH_RESULT is the name of the search. Please let me know if you have any questions.] - PACK1?
All the above settings are to be implemented in PACK1 package. The purpose of the above settings is the following:

-- a custom action will be added in PACK1 that will run only when PACK1 is uninstalled and PACK2 is installed on the machine
-- the custom action has the purpose to stop the uninstall process if PACK2 is installed
-- if PACK2 is not installed on the computer then the custom action will not run and PACK1 can be uninstalled

Please let me know if you have other questions.

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
srini
Posts: 81
Joined: Mon Sep 14, 2009 4:22 pm

Re: Package dependancy

Ho Bogdan,

Thanks for the explaination. But "-- create an extended search to search for the Product Code of PACK 2" seems a bit alarming as far as my requirement is concerned. As I have mentioned in my earlier post, I am planning to to have the following:

1. Install PACK1 - this is an environment set up installer which does not change often
2. Install Pack2 - this is the actual sfotware framework package. This depends on the presence of PACK1. This can have changes often. Therefore in future it may have further releases. If I include the product code of PACK2 in PACK1, my understanding is, it will work for only one version of PACK2. If I had upgraded PACK2 with a different release (and thus a different Product Code), PACK1 will successfully uninstall.

Please let me know if I have understood the problem correctly. Please also let me know if I have not clearly explained my problem.

Thanks
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: Package dependancy

Hi,
If I include the product code of PACK2 in PACK1, my understanding is, it will work for only one version of PACK2. If I had upgraded PACK2 with a different release (and thus a different Product Code), PACK1 will successfully uninstall.
Yes, you are correct. Here is a solution to this scenario:

-- in package PACK2 create a registry value using the Registry page,
-- the register can contain for example the version of the package ( [ProductVersion] )
-- now in PACK1 you will use the search to search for the registry and not for the Product Code
-- the rest of the settings remain the same

Now you will not search for a unique Product Code, you will search for a registry key that is created by PACK2 or by higher versions of PACK2.
If the registry key exists then the uninstall process of PACK1 will stop. If the registry key doesn't exist then you can safely uninstall PACK1.

Please let me know if you have other questions.

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
srini
Posts: 81
Joined: Mon Sep 14, 2009 4:22 pm

Re: Package dependancy

Thanks Bogdan. That was what I imagined. I will implement that.
srini
Posts: 81
Joined: Mon Sep 14, 2009 4:22 pm

Re: Package dependancy

Hi Bogdan,

I have tried your solution. But the search seems to work only during installation. Not during uninstallation. To domnstrate this, I have attached a small project. Please create a registry entry HKLM\Software\MyCompany\MyProduct and put a value 'Version' with some value and try the installer.

Please let me know if I am doing anything wrong.

Thanks
Attachments
Scratch.aip
(17.93 KiB) Downloaded 539 times

Return to “Common Problems”