NI Package Manager (NIPM)

cancel
Showing results for 
Search instead for 
Did you mean: 

Order of installed dependecies

Solved!
Go to solution

Is there way how to enforce order in which are packages in dependencies installed? If package A has dependency on package B (as a required) is there way to install B before A?

0 Kudos
Message 1 of 9
(5,848 Views)

If both packages are in a registered feed, and you go to install A, that's the order that will be enforced. Are you seeing something different from this?

-----------------------------------------------
Brandon Grey
Certified LabVIEW Architect

Message 2 of 9
(5,828 Views)

Yes, in particular, if A strictly "Depends" on B, you will not be able to install A without first installing B. If B is available in a registered feed, installing A will first install B with no extra steps required.

0 Kudos
Message 3 of 9
(5,823 Views)

Yes I will get both packages installed, but order in wrong order. Here is my situation in detail:

I have utility written in LV which is distributed via feed in nipkg - this is my package B. Then I have another LV app. in package A, the pkg (not the app) calls utility in B using batch file in post-install schedule. When I chose to install pkg A (while B is not installed yet), the B will show in install list as a dependency, but I will get error when executing post install script, because the B is installed after the A.

 

I know I can switch to post install all schedule but I rather a option to install dependencies in correct order.

0 Kudos
Message 4 of 9
(5,805 Views)
Solution
Accepted by topic author petrz

I found what I'm doing wrong. I've got one more package (C) in required dependency of the A, which is also needs B installed, but it doesn't have the B in its own dependencies. In this case the package manager have no way how to know which required dependency has to be installed first when the are not related.

0 Kudos
Message 5 of 9
(5,801 Views)

Do you know if I will set in the C package required dependency on A, if this will guarantee the tool in B will installed as a first?

My C package is module and it will be never used without A, but I don't want to to put that dependency on B in C.

 

So the dependency it should look like:

A -> B

A -> C

C -> A

 

then if I install A will be B the first?

0 Kudos
Message 6 of 9
(5,800 Views)

In general, I would highly suggest avoiding circular dependencies.  Perhaps you need to split one of your packages to create a new common component that both A & C can depend on.

Message 7 of 9
(5,796 Views)

I didn't try circular dependency on pkgs, but agree in general its is bad thing. I will include this tool in package one level up in hierarchy of dependencies. I found one package which should be common to all in its also refereed by other packages used, so I don't have to go through all my existing packages and add new dependency.

It would be nice to have some better tool display dependencies between packages in more than one level like in project pkg builder.

0 Kudos
Message 8 of 9
(5,790 Views)

If you have a circular dependency, there's no way for all dependencies to be installed before their dependents. I agree that you should split your packages up to remove this loop.

Message 9 of 9
(5,782 Views)