ralish / PSDotFiles

Bringing simple dotfiles management to Windows with PowerShell
MIT License
89 stars 7 forks source link

Automatic detection doesn't work with programs installed via Scoop #10

Closed bentoner closed 3 years ago

bentoner commented 3 years ago

I installed putty and Windows Terminal via scoop. They don't come up when I run Get-InstalledPrograms so they are not auto-detected and the dotfiles are not installed.

Although I notice I'm a bit confused as I've also installed git and vscode via scoop and it detects them... but maybe that's because they were previously installed the normal way.

I guess the work-around is to manually specify them? I can't figure out how to do that. I tried the following:

$DotFilesAutodetect=$false
Get-DotFiles | ? Name -in putty, winterm | Install-DotFiles
ralish commented 3 years ago

Automatic detection essentially means we build a list of installed programs which should be close to identical to that returned in Settings -> Apps -> Apps & features, or Programs and Features on earlier Windows releases, and then try and match the name of the app against an installed program in the list. The list is built by parsing various Registry keys.

In the case of Scoop apps I expect most are installed in a "portable" mode and so aren't "registered" as installed programs, thus the current method of automatic detection won't find them. Being command-line apps your best bet is to use the FindInPath method and specify the name of the executable. You can see an example in the vscode.xml metadata bundled with the module.

It'd be nice to expand the automatic detection method to perhaps also include FindInPath so it becomes more of a "catch-all" configuration ...