Product Dependency not working

Antworten
bobzbobz
Beiträge: 169
Registriert: 30 Nov 2012, 10:41
Wohnort: Denmark

Product Dependency not working

Beitrag von bobzbobz »

Hello

I have created a new product (fsecure-psb) with the following Product Dependency:

Code: Alles auswählen

[ProductDependency]
action: setup
requiredProduct: fsecurews
requiredStatus: not_installed
requirementType: before
But when setting the action "setup" it starts by running this, instead of uninstalling the product mentioned in the product dependency.
Bild

I have similar dependencies on my Microsoft Office packages (eg. remove 2013 before installing 2016), which works just fine.
Jan.Schmidt
Beiträge: 439
Registriert: 08 Jul 2017, 12:02

Re: Product Dependency not working

Beitrag von Jan.Schmidt »

Hi,

Code: Alles auswählen

requiredStatus: not_installed
Is NOT uninstall .

Do you still need to install that fsecurews somewhere?

If not edit that pakage and add the uninstall script to the install script part..
And then change the dependency on your new apkage from not_installed to installed.
bobzbobz
Beiträge: 169
Registriert: 30 Nov 2012, 10:41
Wohnort: Denmark

Re: Product Dependency not working

Beitrag von bobzbobz »

Hi

Thank you for your answer.
The problem is kinda hard to explain, so im not sure you understand me correctly - let me try to elaborate below.
We need to have both packages.

When setting the ProductDependecy as described above, I would expect the following behaviour (just like our other packages eg. Microsoft Office):
  • When setting action "setup" for fsecure-psb it should:
  • Set action "uninstall" for fsecurews
  • Run this uninstall-action (fsecurews) before running setup for fsecure-psb
  • Afterwards run action setup for fsecure-psb
What it actually does:
  • When setting action "setup" for fsecure-psb:
  • (Correctly) sets action "uninstall" for fsecurews
  • (Not correctly) runs setup action for fsecure-psb
  • (Not correctly) afterwards runs action uninstall on fsecurews
When reading the product dependency below, I am reading:
"When setting action setup for fsecure-psb make sure that fsecurews is not_installed before running setup."

[ProductDependency] (for fsecure-psb)
action: setup
requiredProduct: fsecurews
requiredStatus: not_installed
requirementType: before

Is this not correct?
Benutzeravatar
r.roeder
uib-Team
Beiträge: 540
Registriert: 02 Jul 2008, 10:08

Re: Product Dependency not working

Beitrag von r.roeder »

Hi,
this is indeed a quite intricate matter.

The unterlying problem arises from the fact that the probable uninstall ordering should revert the install ordering. If a product B requires pre-installation of a product A, for example a library, then it could be that the removal of product B still requires product A (possibly for a farewell message). Then A which had to be installed before B can only be uninstalled after B. But there is only one ordering of the products which are handled by the opsi-clientagent.

Becaose of this difficulty the product ordering is constructed only based on setup requirements. uninstall ordering requirements are completely ignored. Exactly this is the situation which you encountered. You are right, this should be shown more clearly in the configed display.

At the moment, there are three ways to circumvent the problem:

(1) You build a removal product whose setup script removes the product you wish to uninstall. Dependencies of this product can possess before or after attributes as any other product, and it would be inserted accoriding to them into the product sequence.

(2) You use the server configuration option
opsi-script.global.reverseproductorderbyuninstall true
(In the server host properties, section opsi-script). As the name indidcates, this has the effect that all uninstall operations are performed before all setup operations, whereby for the uninstall sequence the inverted ordering of the setup sequence is used

(3) You handle the uninstallation of product X which must not co-exist with product Y by an opsiservicecall construction in the setup script of Y

Hope that this explains the matter and gives the required help.

Regards
opsi support - uib gmbh
For productive opsi installations we recommend maintainance + support contracts which are the base of opsi development.


Wondering who's using opsi? Have a look at the opsi map: http://opsi.org/opsi-map/.
Antworten