Skip to content

Commit

Permalink
Fixed problem with pax command that caused it to fail for non-admin u…
Browse files Browse the repository at this point in the history
…sers. Refined how double-launches and launches of URLs from external programs are handled so it more closely approximates the normal Mac experience under Chrome 69.
  • Loading branch information
dmarmor committed Sep 1, 2018
1 parent e0d1790 commit 63e8a2f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
19 changes: 12 additions & 7 deletions app/src/epichrome
Expand Up @@ -307,14 +307,19 @@ configEngineExec="$myContents/$appEngine/$SSBChromeEngine/Contents/MacOS/$engine
/usr/bin/pgrep -fq "$configEngineExec" > /dev/null 2>&1
pgrepResult="$?"
if [[ "$pgrepResult" = 0 ]] ; then
# launch Chrome engine with whatever command-line arguments
# have been passed to us and suppress startup window
# launch Chrome engine but suppress startup window
# (--no-startup-window would also work for this)
"$configEngineExec" --silent-launch --user-data-dir="$myProfilePath" "$@"

# use Applescript to switch app to the front
osascript -e "tell application \"System Events\" to set frontmost of (application processes where bundle identifier is \"$CFBundleIdentifier\") to true" > /dev/null

# but do not launch if unknown args passed -- this appears
# to only happen as a weird duplicate launch
# signal in Chrome 69, so we'll ignore it (for now)
if [[ "${#@}" = 0 ]] ; then
# use Applescript to switch app to the front
osascript -e "tell application \"System Events\" to set frontmost of (application processes where bundle identifier is \"$CFBundleIdentifier\") to true" > /dev/null

# launch
"$configEngineExec" --silent-launch --user-data-dir="$myProfilePath"
fi

# exit this instance
exit

Expand Down
4 changes: 1 addition & 3 deletions app/src/main.applescript
Expand Up @@ -606,9 +606,7 @@ Icon: "
try
set dlgResult to button returned of (display dialog "Created Epichrome app \"" & ssbBase & "\".
IMPORTANT NOTE: A companion extension, Epichrome Helper, will automatically install when the app is first launched.
HOWEVER, it will almost certainly be installed DISABLED. You'll need to go to the Window menu, choose Extensions and enable it manually. Once successfully enabled, its options page will open and display a welcome message." with title "Success!" buttons {"Launch Now", "Reveal in Finder", "Quit"} default button "Launch Now" cancel button "Quit" with icon myIcon)
IMPORTANT NOTE: A companion extension, Epichrome Helper, will automatically install when the app is first launched, but will be DISABLED by default. The first time you run, a welcome page will show you how to enable it." with title "Success!" buttons {"Launch Now", "Reveal in Finder", "Quit"} default button "Launch Now" cancel button "Quit" with icon myIcon)
on error number -128
writeProperties() -- "Quit" button
return -- QUIT
Expand Down
2 changes: 1 addition & 1 deletion app/src/runtime.sh
Expand Up @@ -418,7 +418,7 @@ function linktree { # $1 = SOFT/HARD
"$tryid link error: Unable to create symlink to $entry."
else
# hard link
try /bin/pax -rwlpe "$entry" "$destdir" \
try /bin/pax -rwlpp "$entry" "$destdir" \
"$tryid link error: Unable to create link to $entry."
fi
done
Expand Down

0 comments on commit 63e8a2f

Please sign in to comment.