Learn R Programming

RInno (version 0.0.3)

create_app: Creates installation files and Inno Setup Script (ISS), "app_name.iss"

Description

This function manages installation and app start up. To accept all defaults, just provide app_name. After calling create_app, call compile_iss to create an installer in dir_out.

Usage

create_app(app_name, app_dir = getwd(), dir_out = "RInno_installer",
  pkgs = c("jsonlite", "shiny", "magrittr"), include_R = F,
  R_version = paste0(R.version$major, ".", R.version$minor), ...)

Arguments

app_name

The name of the app being installed. It will be displayed throughout the installer and uninstaller in window titles, wizard pages, and dialog boxes. See [Setup]:AppName for details. For continuous installations, app_name is used to check for an R package of the same name, and update it. The Continuous Installation vignette has more details.

app_dir

Shiny app's directory, defaults to getwd().

dir_out

Installer's directory. A sub-directory of app_dir, which will be created if it does not already exist. Defaults to 'RInno_installer'.

pkgs

String vector of the shiny app's default repo package dependencies. See create_config for how to change the default repo.

include_R

To include R in the installer, include_R = TRUE. This will include the version of R specified by R_version in your installer. The installer will check each user's registry for that version of R, and only install it if that check returns FALSE.

R_version

R version to use, defaults to: paste0(R.version$major, '.', R.version$minor).

...

Arguments passed on to setup

app_version

Version number of the app being installed, defaults to '0.0.0'. It is displayed in the Version field of the app's Add/Remove Programs entry. See [Setup]:AppVersion for details.

name

Defaults to ISPP directive, '{#MyAppName}' set by directives(app_name).

publisher

String displayed on the "Support" dialogue of the Add/Remove Programs Control Panel applet, defaults to " ". See [Setup]:AppPublisher for details.

default_dir

The default directory name used by the Select Destination Page of the installer. See [Setup]:DefaultDirName and Constants for details.

privilege

Valid options: 'poweruser', 'admin', 'lowest'. Defaults to 'lowest'. This directive affects whether elevated rights are requested when an installation is started. See [Setup]:PrivilegesRequired for details.

info_before

File, in .txt or .rtf format, which is displayed on the first page of the installer. It must be located in app_dir. See [Setup]:InfoBeforeFile for details.

info_after

File, in .txt or .rtf format, which is displayed on the last page of the installer. It must be located in app_dir. See [Setup]:InfoAfterFile for details.

setup_icon

File name of the icon used for installer/uninstaller. The file must be located in app_dir. See [Setup]:SetupIconFile for details.

license_file

File, in .txt or .rtf format, which is displayed before the Select Destination Page of the wizard. See [Setup]:LicenseFile for details.

inst_pw

Installer password, string. Visit the Inno Setup Downloads page and place ISCrypt.dll in your Inno Setup directory. Afterwards, if a inst_pw is supplied, then the contents of the installer will be encrypted using a 160-bit key derived from the password string. See [Setup]:Password and [Setup]:Encryption for details.

pub_url

String. Defaults to '{#MyAppURL}', which is the ISPP directive for main_url. Therefore, main_url will be used, unless otherwise specified. See [Setup]:AppPublisherURL for details.

sup_url

String. Defaults to '{#MyAppURL}', which is the ISPP directive for main_url. Therefore, main_url will be used, unless otherwise specified. See [Setup]:AppSupportURL for details.

upd_url

String. Defaults to '{#MyAppURL}', which is the ISPP directive for main_url. Therefore, main_url will be used, unless otherwise specified. See [Setup]:AppUpdatesURL for details.

compression

Defaults to 'lzma2/ultra64', which has the best compression ratio available. Other valid options include: 'zip', 'bzip', 'lzma', and 'none'. See [Setup]:Compression for details.

Details

Creates the following files in app_dir:

  • Icons for installer and app, setup.ico and default.ico respectively.

  • Files that manage app start up, utils/package_manager.R and utils/app.R.

  • First/last page of the installer, infobefore.txt and infoafter.txt.

  • Batch support files, utils/wsf/run.wsf, utils/wsf/js/run.js, utils/wsf/js/json2.js, utils/wsf/js/JSON.minify.js.

  • A configuration file, config.cfg. See create_config for details.

  • A batch file, app_name.bat. See create_bat for details.

  • An Inno Setup Script, app_name.iss.

See Also

get_R, copy_installation, create_config, create_bat, create_pkgs, directives, setup, languages, tasks, files, icons, run, and code.

Examples

Run this code
# NOT RUN {
create_app('myapp')

create_app(
  app_name  = 'My AppName',
  app_dir    = 'My/app/path',
  dir_out   = 'wizard',
  pkgs      = c('jsonlite', 'shiny', 'magrittr', 'xkcd'),
  include_R = TRUE,   # Download R and install it with the app
  R_version = 2.2.1,  # Old version of R
  privilege = 'high', # Admin only installation
  default_dir = 'pf') # Program Files
# }

Run the code above in your browser using DataLab