Paxa / postbird

Open source PostgreSQL GUI client for macOS, Linux and Windows
MIT License
1.55k stars 124 forks source link

Fix for issue 118 #119

Closed mastazi closed 4 years ago

mastazi commented 4 years ago

Fixes issue #118

Hey @Paxa

it seems that this line from app.js is not working on Windows:

root: remote.app.MainFilename.replace(/\/(index\.html|main\.js)/, ''),

here's the error from console when I try to open "See History", you can see that /index.html is not removed :

Error: ERR_FILE_NOT_FOUND (-6) loading 'file:///C:/Users/[user]/AppData/Local/Programs/Postbird/resources/app.asar/index.html/views/history_window.html'

Same when I open snippets.

Error: ERR_FILE_NOT_FOUND (-6) loading 'file:///C:/Users/[user]/AppData/Local/Programs/Postbird/resources/app.asar/index.html/views/snippets_window.html'

So I changed the way we get the root of the app, and now it works on my Windows machine

root: remote.app.getAppPath()

you can see getAppPath() documentation here:

https://github.com/electron/electron/blob/master/docs/api/app.md#appgetapppath

Paxa commented 4 years ago

Thank you

antoniojhinojosa commented 3 years ago

Hi, I am trying to fix this in my windows computer but I cannot find the file "app.js" described here in my computer. The most similar I can find is in "C:\Program Files\PostgreSQL\13\pgAdmin 4\web\pgadmin\static\bundle\app.js" but I cannot find that line , I guess this one is from PostgreSQL not PostBird itself. I also looked for in the "Appdata\Roaming\Postbird and Appdata\Local\Postbird" folder and couldn´t find it there either. Could someone assist me please? Thank you!!

mastazi commented 3 years ago

@antoniojhinojosa If you just installed using the installer you will not find that js file on your computer. You need to clone the repository, change the js file and then compile the app on your own machine. You need some familiarity with compiling Electron apps.