Building GUI launcher icons with raco setup

62 views
Skip to first unread message

Philip McGrath

unread,
Jan 26, 2018, 9:44:47 PM1/26/18
to Racket Users
I have a Racket package that creates a GUI launcher using gracket-launcher-names and gracket-launcher-libraries in the info.rkt file.

The package includes a module that programmatically generates the icons for the GUI launcher at the expected paths ("my-application.png" and so forth). I would like to have raco setup run this code before it builds the launcher, but I haven't figured out how to get the code to run at the right point.

I initially tried adding pre-install-collection to the info.rkt file, but that is run before the collection is compiled, which means it doesn't work if there is a .zo file that is out-of-date. I then tried using install-collection, but that seems to be run after the launcher has been created: it generates the icon files, but the launcher is created using the default icon.

Is there a recommended way to do this? I guess I could have the install function use install-gracket-program-launcher manually, instead of using gracket-launcher-names and gracket-launcher-libraries, but that seems less ideal.

-Philip

Matthew Flatt

unread,
Feb 2, 2018, 12:41:48 PM2/2/18
to Philip McGrath, Racket Users
At Fri, 26 Jan 2018 20:44:44 -0600, Philip McGrath wrote:
> The package includes a module that programmatically generates the icons for
> the GUI launcher at the expected paths ("my-application.png" and so forth).
> I would like to have raco setup run this code before it builds the
> launcher, but I haven't figured out how to get the code to run at the right
> point.
>
> [...]
>
> Is there a recommended way to do this? I guess I could have the install
> function use install-gracket-program-launcher manually, instead of using
> gracket-launcher-names and gracket-launcher-libraries, but that seems less
> ideal.

I don't have a better recommendation than that one.

One drawback of using `install-gracket-program-launcher` directly is
that `raco setup` doesn't record which "info.rkt" generated the
launcher, so that it can be removed if the package containing the
"info.rkt" is unnstalled. Otherwise, I can't think of a problem with
this technique, other than the extra work it requires.

Reply all
Reply to author
Forward
0 new messages