Jump to content

How well defined is two packages installing the same file?


Recommended Posts

I would like to build the following:

 

Package B depends upon Package A.

Package A installs first. Then Package B installs. Package B overwrites one file that Package A installed.

When Package B uninstalls, it restores the file to the version that was installed by Package A.

 

Does VIPM support this directly? If I make one package depend upon another package, are the two packages installed sequentially or does VIPM reserve the right to install them in parallel or randomly? If they do install in order, when the second uninstalls, will the original file be put back or do I need to encode that in the pre and post build VIs?

Link to post
Share on other sites
  • 2 weeks later...

VIPM does not make backups of older files. If you need the older file then reinstall the package linked to that file.

 

However, VIPM has a built-in file counter feature. This is necessary to avoid errors during uninstall and to preserve the integrity of the install database. It also prevents broken package installs. For example, Package A installs first. Package B installs second. If you uninstall package A then B is broken. If a target file already exists then VIPM will overwrite it with the second package install and it will increment an internal counter to indicate that the file was installed twice. During uninstall the counter is decremented until the last uninstall, upon which the file is actually deleted.

 

So your question was related to dependent packages but this can really happen with any package. You could build a package that stomps on someone else's package files.

 

So the problem arises when the two files are incompatible with the each others owning package. For example File B from Package B will break Package A if installed. Not because the filenames are different (they are actually the same) but just that the VI works differently. Or it calls some other code which is missing from package A. In this scenario, even if you uninstall package B, package A will remain broken because the counter is decremented and VIPM no longer has access to the original file from package A. The fix is to uninstall Package A and reinstall it.

 

In the above scenario, if you uninstall package A after installing package B then there is no problem because the counter decrements and File B from package B remains.

 

Now the explanation is slightly different if Package A depends on Package B. If none of the packages are installed and you install package A, VIPM will include package B in the list of install actions automatically. During the install process, VIPM installs packages from the bottom up. It will install the dependancies first and then the toplevel packages. This is always true if both A and B are installed in the same install session. However this is not guaranteed since the user can choose to override this. Most users leave the defaults but this is not always true. Even if the order is preserved, the user could still decide later to upgrade only Package B to a newer version.

 

Solution? I think a post uninstall VI needs to be used that should be included in both package A and B. Then you can put back the right version of the file.

 

PS. VIPM doesn't do parallel installs. All package installs are sequential. But the order, as indicated above can be changed by the user.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.