asticode / go-astilectron-bundler

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

Add flash plugin in bundle #90

Open vbatushev opened 3 years ago

vbatushev commented 3 years ago

How can I add pepflashplayer.dll to bundle? What path do I need to specify in ElectronSwitches?

asticode commented 3 years ago

You need to add your .dll file to the resources folder. Where? It's up to you as long as it's in the resources folder.

Regarding the path you need to specify in ElectronSwitches, unfortunately right now you won't be able to provide the correct absolute path. There'll need to have a change to the lib.

Let me know whether you feel like contributing and creating a PR.

vbatushev commented 3 years ago

My bundler.json { "app_name": "navigator", "icon_path_darwin": "resources/icon.icns", "icon_path_linux": "resources/icon.png", "icon_path_windows": "resources/icon.ico", "environments": [ {"arch": "386", "os": "windows"} ], "output_path": "release", "resources_path": "data/resources/", "working_directory_path": "data", "version_astilectron": "0.45.0", "version_electron": "9.4.4" } I tried adding pepflashplayer.dll to ./data/resources folder. It didn't work. Tried add to archive electron-windows-386-9.4.4.zip 2021-03-19_11h16_36 it did't work :( My code in main.go 2021-03-19_11h18_12

There'll need to have a change to the lib.ElectronSwitches In astilectron? I didn't find where this library is there.

And I use server mode, without embedding html resources.

vbatushev commented 3 years ago

Hmm, the problem was that I used a 64-bit plugin with a 32-bit electron... I replaced plugin in electron-windows-386-9.4.4.zip and.. it work. But may be add a opportunity insert plugins in electron.zip when it is being prepared for bundling?

asticode commented 3 years ago

You seem to be setting the path to your data directory which is good news for your situation. If the resources_path in your bundler.json is still data/resources, you should be able to put your .dll at the root of data/resources and in ElectronSwitches indicate filepath.Join(pathData, "data", "resources", "pepflashplayer.dll") instead of just pepflashplayer.dll.

If this is still not working, would you mind pasting here the list of directories in pathData as well as in pathData/data if it exists?