Only show DLL location error if installing DLL #3647
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
If you manually install NearFutureElectrical, CKAN detects it and shows it as "AD". If you then tell CKAN to take over management of it via the "upgrade" checkbox, it always fails with the error from #3043:
Note that the plain meaning of the text is false;
GameData/NearFutureElectrical/Plugins/NearFutureElectrical.dll
is exactly where CKAN would install it. (In fact I captured this error by installing with CKAN and then purging theinstalled_dlls
andinstalled_files
collections in my registry to make it look like a manual install).Reported by Discord user Jreg:
Cause
NearFutureElectrical
doesn't installNearFutureElectrical.dll
! That honor is reserved forNearFutureElectrical-Core
, for reasons that were not documented (see KSP-CKAN/NetKAN#1536 and KSP-CKAN/NetKAN#1539 for when this was done).The first consequence of this is that if you install just
NearFutureElectrical-Core
and then scrub your registry, CKAN would detect that asNearFutureElectrical
being installed, not-Core
. Which frankly is probably fine, since you most likely do have it installed and would want to have CKAN take it over when upgrading.The second consequence is that when CKAN tries to install
NearFutureElectrical
when it is already AD status, it looks in the ZIP for where the DLL is supposed to be and doesn't find it, which triggers the install error.Changes
Now we only raise that error if the module actually installs the DLL in question. This allows the upgrade of NFE to succeed.