% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/build.R
\name{build_app}
\alias{build_app}
\title{Build a self-contained distributable from an RDesk application}
\usage{
build_app(
  app_dir = ".",
  out_dir = file.path(tempdir(), "dist"),
  app_name = NULL,
  version = NULL,
  r_version = NULL,
  include_packages = character(0),
  portable_r_method = c("extract_only", "installer"),
  runtime_dir = NULL,
  overwrite = FALSE,
  build_installer = FALSE,
  publisher = "RDesk User",
  website = "https://github.com/Janakiraman-311/RDesk",
  license_file = NULL,
  icon_file = NULL,
  prune_runtime = TRUE,
  dry_run = FALSE
)
}
\arguments{
\item{app_dir}{Path to the app directory (must contain app.R and www/)}

\item{out_dir}{Output directory for the zip file (created if not exists)}

\item{app_name}{Name of the application. Defaults to name in DESCRIPTION or "MyRDeskApp".}

\item{version}{Version string. Defaults to version in DESCRIPTION or "1.0.0".}

\item{r_version}{R version to bundle e.g. "4.4.2". Defaults to current R version.}

\item{include_packages}{Character vector of extra CRAN packages to bundle.
RDesk's own dependencies are always included automatically.}

\item{portable_r_method}{How to provision the bundled R runtime when
\code{runtime_dir = "download"} is used explicitly. \code{"extract_only"} requires
standalone 7-Zip and never launches the R installer. \code{"installer"} allows
the legacy silent installer path explicitly.}

\item{runtime_dir}{Controls which R runtime is bundled with the app.
\itemize{
\item \code{NULL} (default) -- copies the developer's currently running R
installation. Guarantees the bundled packages and the runtime are the
same R version, eliminating renv version-mismatch crashes.
\item A filesystem path -- copies that R installation root directly.
\item \code{"download"} -- downloads a portable R installer from CRAN
(legacy behaviour; requires network; risks version mismatch with renv).
}}

\item{overwrite}{If TRUE, overwrite existing output. Default FALSE.}

\item{build_installer}{If TRUE, also build a Windows installer (.exe) using InnoSetup.}

\item{publisher}{Documentation for the application publisher (used in installer).}

\item{website}{URL for the application website (used in installer).}

\item{license_file}{Path to a license file (.txt or .rtf) to include in the installer.}

\item{icon_file}{Path to an .ico file for the installer and application shortcut.}

\item{prune_runtime}{If TRUE, remove unnecessary files (Tcl/Tk, docs, tests) from
the bundled R runtime to reduce size (~15-20MB saving). Default TRUE.}

\item{dry_run}{If TRUE, performs a quick validation of the app structure and
environment without performing the full build. Default FALSE.}
}
\value{
Path to the created zip file, invisibly.
}
\description{
Build a self-contained distributable from an RDesk application
}
\examples{
# Prepare an app directory (following scaffold example)
app_path <- file.path(tempdir(), "MyApp")
rdesk_create_app("MyApp", path = tempdir())

# Perform a dry-run build (fast, no external binaries downloaded)
build_app(app_path, out_dir = tempdir(), dry_run = TRUE)
}
