Memnarch / Delphinus

An alternative Packagemanager for the Delphi-IDE
Mozilla Public License 2.0
235 stars 64 forks source link

After installing a package it won't uninstall again #90

Open peardox opened 1 year ago

peardox commented 1 year ago

The log just says Uninstaller not found but I can clearly see a Delphinius.Uninstaller.json file has been created in the Comps/[Package]] directory

michaliskambi commented 1 year ago

To expand on this: I can reproduce the problem too with Castle Game Engine, installing it using "Install from folder" as documented on our https://castle-engine.io/download#delphinus .

That folder still exists, and contains Delphinus.Uninstall.json with contents that seem valid (attaching). It also contains Delphinus.Install.json and Delphinus.Info.json and source correctly copied from CGE.

However, trying to uninstall from Delphinus (clicking on "Uninstall" button on CGE in the "Installed..." tab in Delphinus), results in window showing "Completed" and "Show log" showing

Uninstalling...
Error: No uninstallation file
Error: failed

The workaround is to

  1. manually delete C:\Users\Public\Documents\Embarcadero\Studio\22.0\Comps\castle-engine
  2. in Delphi, manually remove paths from "Search paths"
  3. in Delphi, manually uninstall package using "Component → Install Packages…​"

So basically performing "uinstallation" manually :)

I can reproduce the issue both after installation that was successful and after installation that half-failed (e.g. because package was already installed).

Ideally, Delphinus should try harder to:

A. communicate in case installation / uninstallation failed ( https://github.com/Memnarch/Delphinus/issues/92 )

B. if installation failed, try to leave things in "untouched" state, maybe reverting partial installation, so that half-installed package is not present in "Installed" tab

C. and since B is impossible to do perfectly, then also "uninstallation" should be more robust, prepared to handle cases when installation went wrong. The guarantee should be "if package was added to the Installed tab in Delphinus, then uninstallation of it should be possible".

peardox commented 1 year ago

Your 'manual workaround' is incomplete. Prior to these steps you should also de-register the package(s) via Delphi IDE. Fiulure to perform this step will leave Delphi with the impression it still has CGE but no DCU/BCP etc resulting in a startup warning that CGE is missing. It iss possible to click 'Ignore in future'' if this sutuation occurs

It is possible to De-REgister the comonents programattically (which is what Delphinius should do)

If you simulate a bad install - putting something bad in dpk would suffiice for instance. e.g. require non_existant_package. Then, as desired for testing, installation will fail . Delphinius will inform you it failed but the package will still be copied to Comps etc - there are numerous ways to get a package to fail to install - simple example provided.

In the case of installing with Delphi library versions (not suppoted by simple package CGE uses) installing wrong version wil break Delphinius. Setting the version to AUTO (available from 10.4.2) results in error as package attempts to be called e.g. castle-engineAUTO.bpl. Code exists in source that appears to cater for version re-numbering but doesn't work (libsuffix + dllsuffix tags in project)

Of course (B) is possible to do properly - if fail remove anything you added - requires checking all steps workewd rather than just assuming they did.

michaliskambi commented 1 year ago

Your 'manual workaround' is incomplete. Prior to these steps you should also de-register the package(s) via Delphi IDE. Fiulure to perform this step will leave Delphi with the impression it still has CGE but no DCU/BCP etc resulting in a startup warning that CGE is missing. It iss possible to click 'Ignore in future'' if this sutuation occurs

I have in my post ( https://github.com/Memnarch/Delphinus/issues/90#issuecomment-1557284402 ) a step "2. in Delphi, manually uninstall package using "Component → Install Packages…​" which in my experience exactly does what you mention above.