Closed fabiorzfreitas closed 5 months ago
What is pt_BR Windows?
At some point I may change CPLB to read the registry keys for each program's data files location, but low priority as most people use the default locations. Google Drive is a whole other scenario as there are 3 or 4 different programs over the years and locations change.
I haven't looked at where Google Drive puts files for a long time..... but I did notice it popped up a drive letter on my computer sometime ago (ala GFS) and it should have made me realize it was time for a CPLB update!
The simple fix/kludge is just define where you want the files to go using the custom path option until I get around to an update.
PR's for exactly what you mentioned are always welcome; CPLB would be better to find answers to the paths instead of making assumptions. PowerShell is confusing at first, but you'll find it worthwhile to learn because it can do most anything.
What is pt_BR Windows?
It's Windows in Brazilian Portuguese, that's why I figured the current code will only match editions using en_US, en_UK or any other variant of English.
The whole fancy drive letter doesn't really mather, the files are still going to %userprofile%\<Google Drive Folder>
, except that now <Google Drive Folder>
changes with according to system locale. From my inspecting, it seems that this folder's literal name is stored on that registry key.
The simple fix/kludge is just define where you want the files to go using the custom path option
Indeed, that's how I'm handlig it right now! This is always an option for anyone, so a fix is strictly needed. My point is that I created a %userprofile%\Google Drive
folder, which matches English locale, and managed to pinpoint the bug.
On PowerShell, I 100% intend to learn it at some point, specially because I use Chocolatey a lot, but, sadly, this is still a long-term goal for me.
Portugese, ahhhhhhhhhhhhh! Bom dia.
I just did a little local investigation. I no longer have a $env:\userprofile\Google Drive folder. (Probably because I have not designated any locally cached files.) Looking at some reg keys I see Computer\HKEY_CURRENT_USER\Software\Google\DriveFS\Share which points to appdata\local\Google\DriveFS. Plus I checked the download link for the googledrive package... all of this tells me that "Google Drive" is no more and has been replaced by Google DriveFS. (This is probably widely well know but I don't keep up on this.)
Also the files in the DriveFS dir all seem to be SQLlite related. And DriveFS doesn't keep local files, only streams from the cloud.
Back to the drawing board to figure out how to deal iwth DriveFS.... (see if there is a better API way of doing things then just searching for and dropping files on the assigned drive letter). It's out there. When I have time I'll figure it out.
Just did some more digging as using DriveFS used to work. Someone did a PR years ago that I pulled in that checked for it and used it.
This is the important line in the script:
$GoogleFSmountpoint = (Get-ItemProperty -path Registry::HKEY_CURRENT_USER\Software\Google\DriveFS\Share).MountPoint
It now fails to find the mount point which is the locally assigned drive letter. The mount point is not specified there any more. Once we determine how to find that mount point, it should be easy to fix.
Found the assigned DriveFS drive letter in Computer\HKEY_CURRENT_USER\Software\Google\DriveFS\Share\SyncTargets but need to parse it out of the binary data.
Olá, meu amigo,
Found the assigned DriveFS drive letter in Computer\HKEY_CURRENT_USER\Software\Google\DriveFS\Share\SyncTargets but need to parse it out of the binary data.
That's exactly what I meant with "a) I don't understand registry key types well enough"
Finding the key was easy enough, I simply searched the whole registry for Meu Drive
. Besides some Explorer stuff, this was obviously the key handling this.
I then spent quite some time trying to learn how to deal with that data. Then I saw you already had a PowerShell implementation (which I couldn't understand) and figured I should only raise this issue and there'd be a simple fix.
If it helps, here are my key, value and data, as copied using RegCool:
HKEY_CURRENT_USER\Software\Google\DriveFS\Share, SyncTargets, 0A 37 0A 17 0A 15 31 30 33 37 39 31 31 33 36 37 39 37 33 34 33 39 36 33 31 33 38 12 02 47 3A 1A 18 43 3A 5C 55 73 65 72 73 5C 46 61 62 69 6F 5C 4D 65 75 20 44 72 69 76 65
Also, here is how RegCool displays it on the pop-up window:
0000 0A 37 0A 17 0A 15 31 30 .7....10
0008 33 37 39 31 31 33 36 37 37911367
0010 39 37 33 34 33 39 36 33 97343963
0018 31 33 38 12 02 47 3A 1A 138..G:.
0020 18 43 3A 5C 55 73 65 72 .C:\User
0028 73 5C 46 61 62 69 6F 5C s\Fabio\
0030 4D 65 75 20 44 72 69 76 Meu Driv
0038 65 e
The leftmost column is not can't be selected, but the middle and right ones are always highlighted in sync.
Oh, well, that's a bit sad.
I literally have a bcurran3
folder sitting on my desktop, containing a few steps and the result of parsing your profile page at Chocolatey for a list of all your packages, sorted by download count:
I figured any packages you deemed fit to maintain yourself would be worth at least checking out, I've found a lot of gems through Chocolatey!
In any case, thanks for your work, I've certainly been using a lot of your (authoral or not) packages ever since I discovered Chocolatey :)
Obrigado e até mais!
@fabiorzfreitas
Sorry for the delayed response.
Thanks for the kind words.
That's a cool list. Nice to see. None of that is linked to me anymore since I'm person non-grata over at chocolaty.org and my Chocolatey ID was deleted. I did hit up Wayback Machine for a little historical record as well: https://github.com/bcurran3/ChocolateyPackages/blob/master/_Chocolatey%20Profile_/bcurran3%20Chocolatey%20Profile%2020230329.png
I've been casually watching the lack of maintenance on some of my previous packages, e.g. Intel driver packages, and will most likely start pumping them out again sometime in the future published from one of my servers.
The Chocolatey utils, scripts, extensions, hooks, etc. that I have created will definitely come back and new versions will be available from my server at some point in the future. You can watch https://bcurran3.org/ but I can't promise it will be any time soon.
De nada. Eu retornarei.
I read the code and found where the script expected to find a Google Drive folder.
Upon creating that folder, the script worked as expected.
But I'm using pt_BR Windows, which means Google Drive uses
X:\Users\Y\Meu Drive
I intended to submit a PR and checked my registry, but I quickly found that a) I don't understand registry key types well enough; b) it seems Google Drive uses the value stored on the same key DriveFS uses; and c) it looked like a small change would do it, but I don't speak PowerShell (yet!), let alone accessing the registry!