chocolateyBeforeModify.ps1 is not get called for dependent packages

Created on 16 Dec 2016  路  9Comments  路  Source: chocolatey/choco

  1. I have two packages A and B.
  2. Package B is a dependency of package A.
  3. Currently both packages are installed with version 1.0
  4. Both packages are at version 1.1 in package repository(both packages are newer than installed ones)
  5. After calling "choco upgrade A" both packages gets updated to version 1.1(which is good)
  6. But chocolateyBeforeModify.ps1 gets called only for package A(I expected that chocolateyBeforeModify.ps1 should be called for package B also)

chocolatey log: chocolatey.log.txt

0 - Backlog Bug Up For Grabs

Most helpful comment

We have the same problem as well. We're using a meta-package which depends on multiple packages.
Dependencies for example:
meta-package
-> install-pkg-a
-> install-pkg-b
However, one of the parent packages install-pkg-a needs to uninstall the installed msi first before re-installing. We use the chocolateyBeforeModify.ps1 to uninstall the previous version before upgrading. This is working well when doing choco upgrade install-pkg-a, it managed to uninstall the previous version. But when doing choco upgrade meta-package, the new version of install-pkg-a does not run chocolateyBeforeModify.ps1. My next attempt on this issue is to put uninstall steps from chocolateyBeforeModify.ps1 into chocolateyinstall.ps1.

All 9 comments

That's interesting and definitely not desired. I find it odd that it doesn't handle that situation accurately.

As the issue template requested, can you provide a gist of the debug / verbose output? You should have this from what you ran already. It will be in C:\ProgramData\chocolatey\logs\chocolatey.log.

Once we have that, it will provide some better terms for evaluation.

Ok, i'll post it on monday.
Thanks for Your efforts!

Thank you. 馃憤

I've attached chocolatey.log file: https://github.com/chocolatey/choco/files/660065/chocolatey.log.txt

Command issued in console was: choco upgrade itsk.af.local -y

Package dependency tree looks like this:
itsk.af.local
-> itsk.af.db.local
-> itsk.af.dispatcher.local
-> itsk.af.integration.local
-> itsk.af.scheduler.local
-> itsk.af.api.local
-> itsk.af.client.local
-> itsk.af.frontend.local

Each package has tools\chocolateyBeforeModify.ps1 with the same content:
Write-Host $MyInvocation.MyCommand.Definition

But tools\chocolateyBeforeModify.ps1 gets called only for itsk.af.local

This still appears to be a broken, please fix.

I think we know why this is occurring - we'll prolly need to do some additional checks closer to when those dependent packages are discovered for upgrade.

We have the same problem as well. We're using a meta-package which depends on multiple packages.
Dependencies for example:
meta-package
-> install-pkg-a
-> install-pkg-b
However, one of the parent packages install-pkg-a needs to uninstall the installed msi first before re-installing. We use the chocolateyBeforeModify.ps1 to uninstall the previous version before upgrading. This is working well when doing choco upgrade install-pkg-a, it managed to uninstall the previous version. But when doing choco upgrade meta-package, the new version of install-pkg-a does not run chocolateyBeforeModify.ps1. My next attempt on this issue is to put uninstall steps from chocolateyBeforeModify.ps1 into chocolateyinstall.ps1.

Users of keepass package (including me) are repeatedly facing this issue (just see the comments). Would it be possible to fix this, please?

Was this page helpful?
0 / 5 - 0 ratings