Repository navigation
fix(search,windows): show installed location for all config levels - #207
Conversation
|
|
||
| // For drivers in the registry, set FilePath to the registry key instead | ||
| // of the filesystem path since that's technically where the driver exists. | ||
| di.FilePath = fmt.Sprintf("%s\\%s", lvl.rootKeyString(), regKeyADBC) |
There was a problem hiding this comment.
Since we have k and dkey, can't we get the full key names from those instead of needing the new function?
There was a problem hiding this comment.
I tried and failed to get a name from the k (which appears to be just a handle not a rich object). I'll try again though since it'd be nice.
There was a problem hiding this comment.
Huh, you're right. That really sucks, there's no way to get the current name of the key from the handle.
There was a problem hiding this comment.
I looked again and I don't see how. It looks like keys are comparable so we can at least simplify it a bit. I'd be happy if you took a look at the package too just in case I'm missing something.
There was a problem hiding this comment.
hrm, maybe not. the new change results in this,
Installed Versions:
╰── 1.8.0
├── user => UNK\SOFTWARE\ADBC\Drivers
├── system => UNK\SOFTWARE\ADBC\Drivers
╰── env => C:\Users\Bryce\src\columnar-tech\dbc
There was a problem hiding this comment.
Actually, my first attempt I was comparing the wrong handles. But comparing the right handles would require changing the function signature of driverInfoFromKey or moving setting FileInfo out of driverInfoFromKey. So driverInfoFromKey unfortunately has to be modified.
I like what I have now enough. Take another look?
There was a problem hiding this comment.
is there any way we can add a test for this? otherwise, this looks good to me
Should we add tests for CI for this case? |
Yeah we should. I'll resurrect the PR for testing user and system, IIRC it's basically ready. |
|
Latest output |
|
Let me file another PR to fix the test failure. |
|
Filed as #212. We can merge that first if we want. |
e997658 to
cda221d
Compare
|
Rebased. |
) Fixes an issue where the driver install location wasn't showing up when a user runs `dbc search -v` on Windows. This was only impacting user and system level installs and the reason we didn't catch this is that we don't test those levels in CI. This PR updates the Windows code paths that set the FileInfo member on the DriverInfo struct so it's set to the registry root for the appropriate level. We just weren't setting it before for registry user and system levels. I went with the registry key root instead of the location of the DLL because the driver is really installed to the registry and we don't want users thinking they can uninstall a driver from %APPDATA% or something. Here's an example of what this looks like on my system: ``` • sqlite Title: ASF SQLite Driver Description: An ADBC driver for SQLite developed under the Apache Software Foundation License: Apache-2.0 Installed Versions: ╰── 1.8.0 ├── system => HKEY_LOCAL_MACHINE\SOFTWARE\ADBC\Drivers ├── env => C:\Users\Bryce\src\columnar-tech\dbc ╰── user => HKEY_CURRENT_USER\SOFTWARE\ADBC\Drivers Available Versions: ``` Closes #203
Fixes an issue where the driver install location wasn't showing up when a user runs
dbc search -von Windows. This was only impacting user and system level installs and the reason we didn't catch this is that we don't test those levels in CI.This PR updates the Windows code paths that set the FileInfo member on the DriverInfo struct so it's set to the registry root for the appropriate level. We just weren't setting it before for registry user and system levels. I went with the registry key root instead of the location of the DLL because the driver is really installed to the registry and we don't want users thinking they can uninstall a driver from %APPDATA% or something.
Here's an example of what this looks like on my system:
Closes #203