asticode / go-astilectron-bundler

Bundle your Astilectron app with ease
MIT License
127 stars 67 forks source link

main package not in working directory #74

Closed segator closed 4 years ago

segator commented 4 years ago
/gui
   main.go
   resources/
        icons...
        index.html
        js
        css
/cli
   main.go

I played with all the parameters input path resources path in the bundle.json tryied changing working dir to the gui folder but the result is always or applicaito is not build or when trying to create the systray in the code fails because the png path is not found. Any idea how to properly configure the json and main.go with the paths?

Thanks!

asticode commented 4 years ago

When using the bootstrap, you need to put all html, js and css files in a folder called "app" and located in your "resources" folder. Leave your icons in the "resources" folder. Therefore you should do something like :

/gui
   main.go
   resources/
        icons...
        app/
            index.html
            js
            css
/cli
   main.go

Then, if your bundle.json file is at the same level as both "gui" and "cli" folders and you run the bundler at the very same level, change the bundle.json input path to gui. That should do the trick.

If that still doesn't work, please share your boostrap options, bundle.json content and bundler command your running.

segator commented 4 years ago

Thanks it works using bootstrap, but i wonder how is the correct way to embed resources without bootstrap, I saw that bundler is embeding but astilectron can not have access to resources in runtime, I supose we need to use a function to disembed the files

asticode commented 4 years ago

I think you're better off using the bootstrap but if you really don't want to use it, you'll have to implement the disembed logic all over again.

segator commented 4 years ago

For now i will try to use bootstrap but in first instance i wanted to use astilectron directly to have more flexibity, btw thanks for the whole stack its amazing ;)