Product Dependency based on Product Property
Product Dependency based on Product Property
Is it possible to have a Product Dependency based on a Product Property?
We have this program, where "normal users" just use the program without any other programs needed.
If the user is an "admin" he needs another program to be installed for it to work.
Now i would like to create a product property called "Admin" with the options "yes/no".
If the property is "yes" then the package should have a product dependency on the other program.
Best Regards
Soren Birk
Re: Product Dependency based on Product Property
this exactly is not possible but you could solve your problem in your script by using winst OpsiServiceCall sections (ask the service if the product is installed, set the product to setup if necessary)bobzbobz hat geschrieben:
Is it possible to have a Product Dependency based on a Product Property?
Regards!
Rupert
Vielen Dank für die Nutzung von opsi. Im Forum ist unser Support begrenzt.
Für den professionellen Einsatz und individuelle Beratung empfehlen wir einen Support-Vertrag und eine Schulung.
Gerne informieren wir Sie zu unserem Angebot.
uib GmbH
Telefon: +49 6131 27561 0
E-Mail: sales@uib.de
Re: Product Dependency based on Product Property
Okay, i will try this.
But do you have any examples?
Best Regards,
Soren
Re: Product Dependency based on Product Property
bobzbobz hat geschrieben: But do you have any examples
your guess that the task is not very simple is right and the documentation at this point is rather short. I will try a sketch how it should work (not tested).
The part of the script for the case admin should look like:
Code: Alles auswählen
DefVar $myProduct$
Set $myProduct$ = "xxxx"
DefVar $isInstalled$
set $isInstalled$ = "false"
Def StringList resultlist
Set resultlist=getReturnListFromSection("opsiservicecall_installedProducts")
for %product% in resultlist do sub_testcontained
if $isInstalled$ = "false"
opsiservicecall_setSetup
endif
[sub_testcontained]
if "%product%" = $myProduct$
set $isInstalled$ = "true"
endif
[opsiservicecall_installedProducts]
"method" : "getInstalledProductIds_list"
"params" : [
"%hostId%"
]
[opsiservicecall_setSetup]
"method" : "setProductState"
"params" : [
"$myproduct",
"%hostId%",
"installationStatus": "not_installed",
"actionRequest": "setup"
]
Regards
Rupert
Vielen Dank für die Nutzung von opsi. Im Forum ist unser Support begrenzt.
Für den professionellen Einsatz und individuelle Beratung empfehlen wir einen Support-Vertrag und eine Schulung.
Gerne informieren wir Sie zu unserem Angebot.
uib GmbH
Telefon: +49 6131 27561 0
E-Mail: sales@uib.de
Re: Product Dependency based on Product Property
I have tried your idea, but i get this error in the log:
Code: Alles auswählen
[5] [feb 28 15:28:51:933] Execution of opsiservicecall_setSetup
[6] [feb 28 15:28:51:933] "method": "setProductState"
[6] [feb 28 15:28:51:933] Calling opsi service at https://172.16.0.3:4447
[6] [feb 28 15:28:51:933] JSON service request https://172.16.0.3:4447/rpc setProductState
[6] [feb 28 15:28:52:042] JSON Bench for setProductState "params":["alternatiff","opsi-client.fmts.lan","in Start: 15:28:51:933 Time: 00:00:00:109
[3] [feb 28 15:28:52:046] Error: retrieveJSONObject --- opsi service problem ----> {"message":"Bad installation status: 'installationstatus'","class":"ValueError"}
[3] [feb 28 15:28:52:046] Error: -> {"message":"Bad installation status: 'installationstatus'","class":"ValueError"}
Code: Alles auswählen
[opsiservicecall_setSetup]
"method": "setProductState"
"params": [
"$Alternatiff$",
"%hostId%",
"installationStatus":"not_installed",
"actionRequest":"setup"
]
Re: Product Dependency based on Product Property
An working example for setting something to "setup"
Code: Alles auswählen
comment "Set office_2010_hotfix=setup"
Set $ActionRequest$ = 'setup'
Set $SetupProductId$ = 'office_2010_hotfix'
opsiServiceCall_setActionRequestStatus
Code: Alles auswählen
comment "Need a reboot to force the installation"
ExitWindows /Reboot
...
[opsiServiceCall_setActionRequestStatus]
"method": "setProductActionRequest"
"params": [
"$SetupProductId$",
"$ClientId$",
"$ActionRequest$"
]
Vielen Dank für die Nutzung von opsi. Im Forum ist unser Support begrenzt.
Für den professionellen Einsatz und individuelle Beratung empfehlen wir einen Support-Vertrag und eine Schulung.
Gerne informieren wir Sie zu unserem Angebot.
uib GmbH
Telefon: +49 6131 27561 0
E-Mail: sales@uib.de
Re: Product Dependency based on Product Property
Works like a charm

Guess i was using the wrong servicecall.
setProductState should be setActionRequestStatus