Open spdegabrielle opened 1 month ago
For Mac, one possibility is to write an AppleScript wrapper, though we have to be very careful about shell-injection attack, correct quoting, etc.
#lang racket
(define (do-it path)
(define tmpdir (make-temporary-directory))
(define racket.app (build-path tmpdir "Racket.app"))
(parameterize ([current-input-port
(open-input-string
(format #<<EOF
set thePath to quoted form of ~s
do shell script "echo " & thePath & " > /etc/paths.d/racket" with administrator privileges
EOF
path))])
(system* (find-executable-path "osacompile")
"-x" "-o" racket.app))
(system* (build-path racket.app "Contents" "MacOS" "applet")))
(do-it "/Users/sorawee/projects/racket/racket/bin")
Looks like -extauth
argument is designed for this purpose.
I don't know how to use authopen
, but if -extauth
works, that would be a much better approach!
I don't really see how to use it but if we do change the code, probably there needs to be a guard on the version of the operating system where the argument was added.
From the man page, it sounds like using -extauth
requires writing a serialized AuthorizationExternalForm
, but I'm not familiar with the Authorization Services API.
can I make the auth dialog for 'configure command line' say Racket rather than 'authopen'?
-- feel free to ignore low priority reminder to myself to see if this can be done