Homebrew Cask shows error connecting to daemon on launch
Bug report
Describe your environment
Occurs on any version of macOS (tested Big Sur and Monterey).
Describe the problem
When I install IVPN via the Homebrew Cask, launching it for the first time shows an error connecting to the daemon.
I thought it might be because the application had been quarantined, but sudo xattr -rd com.apple.quarantine /Applications/IVPN.app/ and attempting to reconnect to the daemon produced the same result. Installing the application manually from the site over the cask does work, but brew install --cask ivpn --no-quarantine produces no change in results.
The daemon is definitely loaded (verified sudo launchctl load /Library/LaunchDaemons/net.ivpn.client.Helper.plist), so I'm not sure why this is occurring.

Steps to reproduce:
- Run "brew install --cask ivpn"
- Launch app
Observed Results:
The app never works or gets past the initial error screen
Expected Results:
Expect to be able to use the app normally.
I have the same error
launchctl shows a status of 1, which means it can't access a file:
[2022-01-11 12:10:05.903] [error] DAEMON CONNECTION ERROR: Unable to obtain IVPN daemon connection parameters: Error: ENOENT: no such file or directory, open '/Library/Application Support/IVPN/port.txt'
the logs indicated it couldn't find a given file, but after creating it manually, I'm getting this:
[2022-01-11 12:14:59.367] [error] DAEMON CONNECTION ERROR: Unable to obtain IVPN daemon connection parameters: Error: Failed to parse port-info file
That traces back to https://github.com/ivpn/desktop-app/blob/070ccdd6f4f7908f9a23ddde3ff6fe2299aec846/ui/src/daemon-client/index.js
What port information should that have by default?
Here seems to be the code responsible for creating the port file. Its content has the format of port_number:some_secret. Looks like this code is not executed correctly because in this case the port.txt file is not created
https://github.com/ivpn/desktop-app/blob/5be864b428ccfdf5af52ddfdb96c7139ed2578d4/daemon/launcher.go#L133-L141
I have the same error, too.
macOS OS version:
% sw_vers
ProductName: macOS
ProductVersion: 11.6.3
BuildVersion: 20G415
Hello, At the current moment, the only official way to install IVPN on macOS - is to download it from our website (https://www.ivpn.net/apps-macos/). I will investigate the Homebrew Cask issue. Unfortunately, I cannot provide any estimates.
But for now, please, use our website to get the latest IVPN software.
(I have removed my last comment)
We are working on this problem and plan to fix the issue in the next official release.
Anyway, the temporary solution to make it work is to change access permissions for a few files:
$ sudo chmod 400 /Applications/IVPN.app/Contents/Resources/etc/ca.crt
$ sudo chmod 400 /Applications/IVPN.app/Contents/Resources/etc/ta.key
$ sudo chmod 400 /Applications/IVPN.app/Contents/Resources/etc/dnscrypt-proxy-template.toml
v3.9.43