mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-06-20 02:00:55 +07:00
add lsregister deep
This commit is contained in:
@@ -4,7 +4,8 @@ Type=Application
|
||||
Name=AmneziaVPN
|
||||
Version=1.0
|
||||
Comment=Client of your self-hosted VPN
|
||||
Exec=AmneziaVPN
|
||||
Exec=AmneziaVPN %u
|
||||
Icon=/usr/share/pixmaps/AmneziaVPN.png
|
||||
Categories=Network;Qt;Security;
|
||||
MimeType=x-scheme-handler/vpn;
|
||||
Terminal=false
|
||||
|
||||
@@ -44,6 +44,10 @@ sudo cp $APP_PATH/$APP_NAME.desktop /usr/share/applications/ >> $LOG_FILE
|
||||
sudo cp $APP_PATH/$APP_NAME.png /usr/share/pixmaps/ >> $LOG_FILE
|
||||
sudo chmod 555 /usr/share/applications/$APP_NAME.desktop >> $LOG_FILE
|
||||
|
||||
if command -v xdg-mime &> /dev/null; then
|
||||
xdg-mime default $APP_NAME.desktop x-scheme-handler/vpn >> $LOG_FILE 2>&1 || true
|
||||
fi
|
||||
|
||||
echo "user desktop creation loop ended" >> $LOG_FILE
|
||||
|
||||
if command -v steamos-readonly &> /dev/null; then
|
||||
|
||||
@@ -51,6 +51,15 @@ run_cmd sudo chmod -R a-w "$APP_PATH/"
|
||||
run_cmd sudo chown -R root "$APP_PATH/"
|
||||
run_cmd sudo chgrp -R wheel "$APP_PATH/"
|
||||
|
||||
# Refresh Launch Services so CFBundleURLTypes (e.g. vpn://) is picked up without a manual lsregister.
|
||||
LSREGISTER="/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister"
|
||||
if [ -d "$APP_PATH" ]; then
|
||||
log "Launch Services: lsregister -f -R $APP_PATH"
|
||||
run_cmd "$LSREGISTER" -f -R "$APP_PATH" || true
|
||||
else
|
||||
log "WARN: $APP_PATH missing, skipping lsregister"
|
||||
fi
|
||||
|
||||
log "Requesting ${APP_NAME} to quit gracefully"
|
||||
run_cmd osascript -e 'tell application "AmneziaVPN" to quit' || true
|
||||
|
||||
|
||||
Reference in New Issue
Block a user