► |  | raco: Racket Command-Line Tools

1 | raco make: Compiling Source to Bytecode
2 | raco link: Library Collection Links
3 | raco exe: Creating Stand-Alone Executables
4 | raco distribute: Sharing Stand-Alone Executables
5 | raco pack: Packing Library Collections
6 | raco unpack: Unpacking Library Collections
7 | raco planet: Automatic Package Distribution
8 | raco pkg: Package Management
9 | raco setup: Installation Management
10 | raco decompile: Decompiling Bytecode
11 | raco demod: Demodularizing Programs
12 | raco ctool: Working with C Code
13 | raco test: Run tests
14 | raco docs: Documentation Search
15 | raco expand: Macro Expansion
16 | raco scribble: Building Documentation
17 | Adding a raco Command

▼ | 9 | raco setup: Installation Management

9.1 | Running raco setup
9.2 | "info.rkt" File Format
9.3 | API for Installation
9.4 | API for Installing ".plt" Archives
9.5 | API for Finding Installation Directories
9.6 | API for Reading "info.rkt" Files
9.7 | API for Relative Paths
9.8 | API for Cross-References for Installed Manuals

► | 9.4 | API for Installing ".plt" Archives

9.4.1 | Non-GUI Installer
9.4.2 | GUI Installer
9.4.3 | GUI Unpacking Signature
9.4.4 | GUI Unpacking Unit

On this page:

9.4.1`` Non-GUI Installer
run-single-installer
install-planet-package
reindex-user-documentation
clean-planet-package
9.4.2`` GUI Installer
run-installer
on-installer-run
with-installer-window
run-single-installer
9.4.3`` GUI Unpacking Signature
setup: plt-installer^
9.4.4`` GUI Unpacking Unit

top ← prev up next →

#### 9.4`` API for Installing ".plt" Archives

The setup/plt-single-installer module provides a function for installing a single ".plt" file, and setup/plt-installer wraps it with a GUI interface.

##### 9.4.1`` Non-GUI Installer

(require setup/plt-single-installer)

> > procedure

> > (run-single-installer file get-dir-proc) → void?

> file : path-string?
> get-dir-proc : (-> (or/c path-string? false/c))

Creates a separate thread and namespace, runs the installer in that thread with the new namespace, and returns when the thread completes or dies. It also creates a custodian (see Custodians) to manage the created thread, sets the exit handler for the thread to shut down the custodian, and explicitly shuts down the custodian when the created thread terminates or dies.

The get-dir-proc procedure is called if the installer needs a target directory for installation, and a #f result means that the user canceled the installation. Typically, get-dir-proc is current-directory. v

> > procedure

> > (install-planet-package file directory spec) → void?

> file : path-string?
> directory : path-string?

> spec

> :

> (list/c string? string?
> (listof string?)
> exact-nonnegative-integer?
> exact-nonnegative-integer?)

Similar to run-single-installer, but runs the setup process to install the archive file into directory as the PLaneT package described by spec. The user-specific documentation index is not rebuilt, so reindex-user-documentation should be run after a set of PLaneT packages are installed.

> > procedure

> > (reindex-user-documentation) → void?

Similar to run-single-installer, but runs only the part of the setup process that rebuilds the user-specific documentation start page, search page, and master index.

> > procedure

> > (clean-planet-package directory spec) → void?

> directory : path-string?

> spec

> :

> (list/c string? string?
> (listof string?)
> exact-nonnegative-integer?
> exact-nonnegative-integer?)

Undoes the work of install-planet-package. The user-specific documentation index is not rebuilt, so reindex-user-documentation should be run after a set of PLaneT packages are removed.

##### 9.4.2`` GUI Installer

(require setup/plt-installer)

The setup/plt-installer library in the setup collection defines procedures for installing a ".plt" archive with a GUI (using the facilities of racket/gui/base).

> > procedure

> > (run-installer filename) → void?

> filename : path-string?

Run the installer on the ".plt" file in filename and show the output in a window. This is a composition of with-installer-window and run-single-installer with a get-dir-proc that prompts the user for a directory (turning off the busy cursor while the dialog is active).

> > parameter

> > (on-installer-run) → (-> any)

> (on-installer-run thunk) → void?
> thunk : (-> any)

A thunk that is run after a ".plt" file is installed.

> > procedure

> > (with-installer-window |  | do-install |  |  |  |
> > |  | cleanup-thunk) |  | → |  | void?

> do-install

> :

> (-> (or/c (is-a?/c dialog%) (is-a?/c frame%))
> void?)

> cleanup-thunk : (-> any)

Equivalent to

> (define installer-run (on-installer-run))
> (parameterize ([on-terminal-run
> (λ ()
> (printf "\nInstallation complete.\n")
> (installer-run))])
> (in-terminal
> (λ (custodian tlw) (do-install tlw))
> #:title (string-constant plt-installer-progress-window-title)
> #:cleanup-thunk cleanup-thunk))

> > procedure

> > (run-single-installer file get-dir-proc) → void?

> file : path-string?
> get-dir-proc : (-> (or/c path-string? false/c))

The same as the export from setup/plt-single-installer, but with a GUI.

##### 9.4.3`` GUI Unpacking Signature

(require setup/plt-installer-sig)

> > signature

> > setup:plt-installer^ : signature

> Provides two names: run-installer and on-installer-run.

##### 9.4.4`` GUI Unpacking Unit

(require setup/plt-installer-unit)

Imports mred^ and exports setup:plt-installer^.
top ← prev up next →