Skip to content

Commit

Permalink
Use a wrapper script to launch the app installed with homebrew
Browse files Browse the repository at this point in the history
Electron looks for the "Helper" app inside of the ".app" directory
and this path depends on the executable that started the app.
If the executable is invoked indirectly through a symlink, Electron
will look for the "Helper" in the wrong directory.

Instead of symlinking the executable, create a script that starts
the application using the full path.
  • Loading branch information
Gabriele Mazzotta committed Jan 29, 2024
1 parent 416b374 commit 269425b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,15 @@ jobs:
name "openfortivpn-webview"
homepage "https://github.com/${{ github.repository_owner }}/openfortivpn-webview"
binary "#{staged_path}/openfortivpn-webview.app/Contents/MacOS/openfortivpn-webview"
wrapper_script = "#{staged_path}/openfortivpn-webview.sh"
binary wrapper_script, target: "openfortivpn-webview"
preflight do
File.write wrapper_script, <<~EOS
#!/bin/sh
"#{staged_path}/openfortivpn-webview.app/Contents/MacOS/openfortivpn-webview" "$@"
EOS
end
zap trash: "~/Library/Application Support/openfortivpn-webview/"
end
Expand Down

0 comments on commit 269425b

Please sign in to comment.