On this page:
3.3.1 Creating Launchers
make-mred-launcher
make-mzscheme-launcher
make-mred-program-launcher
make-mzscheme-program-launcher
install-mred-program-launcher
install-mzscheme-program-launcher
3.3.2 Launcher Path and Platform Conventions
mred-program-launcher-path
mzscheme-program-launcher-path
mred-launcher-is-directory?
mzscheme-launcher-is-directory?
mred-launcher-is-actually-directory?
mzscheme-launcher-is-actually-directory?
mred-launcher-add-suffix
mzscheme-launcher-add-suffix
mred-launcher-put-file-extension+ style+ filters
mzscheme-launcher-put-file-extension+ style+ filters
3.3.3 Launcher Configuration
mred-launcher-up-to-date?
mzscheme-launcher-up-to-date?
build-aux-from-path
current-launcher-variant
available-mred-variants
available-mzscheme-variants
3.3.4 Launcher Creation Signature
launcher^
3.3.5 Launcher Creation Unit
launcher@
Version: 4.1

3.3 Installation-Specific Launchers for Scheme Code

 (require launcher/launcher)

The launcher/launcher library provides functions for creating launchers, which are similar to stand-alone executables, but sometimes smaller because they depend permanently on the local PLT Scheme installation. In the case of Unix, in particular, a launcher is simply a shell script. The mzc tool provides no direct support for creating launchers.

3.3.1 Creating Launchers

(make-mred-launcher args dest [aux])  void?

  args : (listof string?)

  dest : path-string?

  aux : (listof (cons/c symbol? any/c)) = null

Creates the launcher dest, which starts MrEd with the command-line arguments specified as strings in args. Extra arguments passed to the launcher at run-time are appended (modulo special Unix/X flag handling, as described below) to this list and passed on to MrEd. If dest exists already, as either a file or directory, it is replaced.

The optional aux argument is an association list for platform-specific options (i.e., it is a list of pairs where the first element of the pair is a key symbol and the second element is the value for that key). See also build-aux-from-path. See create-embedding-executable for a list that applies to both stand-alone executables and launchers under Windows and Mac OS X MrEd; the following additional associations apply to launchers:

For Unix/X, the script created by make-mred-launcher detects and handles X Windows flags specially when they appear as the initial arguments to the script. Instead of appending these arguments to the end of args, they are spliced in after any X Windows flags already listed listed in args. The remaining arguments (i.e., all script flags and arguments after the last X Windows flag or argument) are then appended after the spliced args.

(make-mzscheme-launcher args dest [aux])  void?

  args : (listof string?)

  dest : path-string?

  aux : (listof (cons/c symbol? any/c)) = null

Like make-mred-launcher, but for starting MzScheme. Under Mac OS X, the 'exe-name aux association is ignored.

(make-mred-program-launcher

 

file

 

 

 

 

 

 

collection

 

 

 

 

 

 

dest)

 

 

void?

  file : string?

  collection : string?

  dest : path-string?

Calls make-mred-launcher with arguments that start the MrEd program implemented by file in collection: (list "-l-" (string-append collection "/" file)). The aux argument to make-mred-launcher is generated by stripping the suffix (if any) from file, adding it to the path of collection, and passing the result to build-aux-from-path.

(make-mzscheme-program-launcher

 

file

 

 

 

 

 

 

collection

 

 

 

 

 

 

dest)

 

 

void?

  file : string?

  collection : string?

  dest : path-string?

Like make-mred-program-launcher, but for make-mzscheme-launcher.

(install-mred-program-launcher

 

file

 

 

 

 

 

 

collection

 

 

 

 

 

 

name)

 

 

void?

  file : string?

  collection : string?

  name : string?

Same as

  (make-mred-program-launcher

   file collection

   (mred-program-launcher-path name))

(install-mzscheme-program-launcher

 

file

 

 

 

 

 

 

collection

 

 

 

 

 

 

name)

 

 

void?

  file : string?

  collection : string?

  name : string?

Same as

  (make-mzscheme-program-launcher

   file collection

   (mzscheme-program-launcher-path name))

3.3.2 Launcher Path and Platform Conventions

(mred-program-launcher-path name)  path?

  name : string?

Returns a pathname for an executable in the PLT Scheme installation called something like name. For Windows, the ".exe" suffix is automatically appended to name. For Unix, name is changed to lowercase, whitespace is changed to -, and the path includes the "bin" subdirectory of the PLT Scheme installation. For Mac OS X, the ".app" suffix is appended to name.

(mzscheme-program-launcher-path name)  path?

  name : string?

Returns the same path as (mred-program-launcher-path name) for Unix and Windows. For Mac OS X, the result is the same as for Unix.

(mred-launcher-is-directory?)  boolean?

Returns #t if MrEd launchers for the current platform are directories from the user’s perspective. For all currently supported platforms, the result is #f.

(mzscheme-launcher-is-directory?)  boolean?

Like mred-launcher-is-directory?, but for MzScheme launchers.

(mred-launcher-is-actually-directory?)  boolean?

Returns #t if MrEd launchers for the current platform are implemented as directories from the filesystem’s perspective. The result is #t for Mac OS X, #f for all other platforms.

(mzscheme-launcher-is-actually-directory?)  boolean?

Like mred-launcher-is-actuall-directory?, but for MzScheme launchers. The result is #f for all platforms.

(mred-launcher-add-suffix path-string?)  path?

  path-string? : path

Returns a path with a suitable executable suffix added, if it’s not present already.

(mzscheme-launcher-add-suffix path-string?)  path?

  path-string? : path

Like mred-launcher-add-suffix, but for MzScheme launchers.

(mred-launcher-put-file-extension+style+filters)

 

 

(or/c string? false/c)

(listof (one-of/c 'packages 'enter-packages))

(listof (list/c string? string?))

Returns three values suitable for use as the extension, style, and filters arguments to put-file, respectively.

If MrEd launchers for the current platform were directories form the user’s perspective, the style result is suitable for use with get-directory, and the extension result may be a string indicating a required extension for the directory name.

(mzscheme-launcher-put-file-extension+style+filters)

 

 

(or/c string? false/c)

(listof (one-of/c 'packages 'enter-packages))

(listof (list/c string? string?))

Like mred-launcher-get-file-extension+style+filters, but for MzScheme launchers.

3.3.3 Launcher Configuration

(mred-launcher-up-to-date? dest aux)  boolean?

  dest : path-string?

  aux : (listof (cons/c symbol? any/c))

Returns #t if the MrEd launcher dest does not need to be updated, assuming that dest is a launcher and its arguments have not changed.

(mzscheme-launcher-up-to-date? dest aux)  boolean?

  dest : path-string?

  aux : (listof (cons/c symbol? any/c))

Analogous to mred-launcher-up-to-date?, but for a MzScheme launcher.

(build-aux-from-path path)  (listof (cons/c symbol? any/c))

  path : path-string?

Creates an association list suitable for use with make-mred-launcher or create-embedding-executable. It builds associations by adding to path suffixes, such as ".icns", and checking whether such a file exists.

The recognized suffixes are as follows:

(current-launcher-variant)  symbol?

(current-launcher-variant variant)  void?

  variant : symbol?

A parameter that indicates a variant of MzScheme or MrEd to use for launcher creation and for generating launcher names. The default is the result of (system-type 'gc). Under Unix and Windows, the possibilities are 'cgc and '3m. Under Mac OS X, the 'script-3m and 'script-cgc variants are also available for MrEd launchers.

(available-mred-variants)  (listof symbol?)

Returns a list of symbols corresponding to available variants of MrEd in the current PLT Scheme installation. The list normally includes at least one of '3m or 'cgc – whichever is the result of (system-type 'gc) – and may include the other, as well as 'script-3m and/or 'script-cgc under Mac OS X.

(available-mzscheme-variants)  (listof symbol?)

Returns a list of symbols corresponding to available variants of MzScheme in the current PLT Scheme installation. The list normally includes at least one of '3m or 'cgc – whichever is the result of (system-type 'gc) – and may include the other.

3.3.4 Launcher Creation Signature

 (require launcher/launcher-sig)

launcher^ : signature

Includes the identifiers provided by launcher/launcher.

3.3.5 Launcher Creation Unit

 (require launcher/launcher-unit)

launcher@ : unit?

A unit that imports nothing and exports launcher^.