scoop-nonportable icon indicating copy to clipboard operation
scoop-nonportable copied to clipboard

Can't install newer pgadmin-s: `post_install` fails - even after updating url and hash

Open pmorch opened this issue 2 years ago • 0 comments

#247 is a PR that updates url and hash. (It actually is already a 404, but I've created a comment with a new good url).

However, when I try to install it, I get this:

C:\Users\pvm>scoop install C:\Users\pvm\IdeaProjects\scoop-nonportable\bucket\pgadmin4-np.json
Installing 'pgadmin4-np' (5.7) [64bit]
pgadmin4-5.7-x64.exe (141.1 MB) [=============================================================================] 100%
Checking hash of pgadmin4-5.7-x64.exe ... ok.
Running installer... done.
Linking ~\scoop\apps\pgadmin4-np\current => ~\scoop\apps\pgadmin4-np\5.7
Creating shim for 'psql'.
Creating shim for 'pgAdmin4'.
Creating shim for 'pg_restore'.
Creating shim for 'pg_dumpall'.
Creating shim for 'pg_dump'.
Creating shortcut for pgAdmin 4 (pgAdmin4.exe)
Running post-install script...
Remove-Item : Cannot find path 'C:\ProgramData\Microsoft\Windows\Start Menu\Programs\pgAdmin 4' because it does not
exist.
At line:1 char:1
+ Remove-Item -Recurse "$([Environment]::GetFolderPath('commonstartmenu ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (C:\ProgramData\...grams\pgAdmin 4:String) [Remove-Item], ItemNotFoundEx
   ception
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.RemoveItemCommand

'pgadmin4-np' (5.7) was installed successfully!

And, quite correctly, I don't have a C:\ProgramData\Microsoft\Windows\Start Menu\Programs\pgAdmin 4 folder. I do have a C:\ProgramData\Microsoft\Windows\Start Menu\Programs folder, but no pgAdmin 4 folder under that.

So in addition to the url and hash changes, something else has changed too, and now with version 5.7 the post_install command needs to change. And that is outside of my scoop expertise :-) bucket/pgadmin4-np.json contains:

"post_install": "Remove-Item -Recurse \"$([Environment]::GetFolderPath('commonstartmenu'))\\Programs\\pgAdmin 4\""

pmorch avatar Sep 15 '21 10:09 pmorch