compiler.build.StandaloneApplicationOptions, compiler.build.StandaloneApplicationOptions
Validated standalone application build options.
📝Syntax
options = compiler.build.StandaloneApplicationOptions(AppFile)
options = compiler.build.StandaloneApplicationOptions(AppFile, Name, Value, ...)
values = struct(options)
📄Description

Load the optional compiler module before constructing this value object. Both standalone build functions accept the same options object. Later edits to the caller's object do not change the options recorded in a completed result.

AppFile: existing .m entry file. The constructor requires this first argument. Other entry formats are not supported. ExecutableName defaults to the entry stem and must be an identifier; reserved Windows device names are rejected.

OutputDir: destination directory, defaulting to ExecutableName followed by standaloneApplication in the current directory. Paths are anchored when assigned. Unrelated files are preserved. A verified previous build of the same executable name and architecture may be replaced; modified outputs and unrecorded collisions are refused. See compiler.build.standaloneApplication for publication and recovery rules.

AdditionalFiles: character vector, scalar string, cell vector or string vector of files, directories or patterns. Automatic resources, including NH5/MAT files, are controlled by AutoDetectDataFiles (true by default). Explicit inclusions are retained even when automatic detection is false.

CustomHelpTextFile: existing UTF-8 text file whose contents become the application's help text; empty by default.

ExecutableVersion: one to four decimal components from 0 to 65535, at most 23 characters; default 1.0.0.0. Writes Windows file/product resources. On other hosts the value is validated but does not modify native executable bytes.

Verbose: false by default; true prints the created executable and runtime module count. Boolean settings accept logical or numeric zero/one and on/off strings.

Constructor settings use complete, case-insensitive name-value option names. Properties validate assignments. The constructor does not accept a settings struct or a second AppFile assignment. struct(options) returns a value snapshot of the public properties.

The current properties are AppFile, AdditionalFiles, AutoDetectDataFiles, CustomHelpTextFile, EmbedArchive, ExecutableName, ExecutableIcon, ExecutableVersion, OutputDir, RuntimeLogFile, SupportPackages, TreatInputsAsNumeric and Verbose. Other deployment effects remain unimplemented: ExternalEncryptionKey, ObfuscateArchive and SecretsManifest. They are not accepted or silently ignored.

Runtime distribution and launch style are not option properties here. The build function chooses console or no-console style and always uses an installed runtime. Existing ncc BuildOptions remains available for Mode, NoConsole and RuntimeMode.

RuntimeLogFile: empty by default (disabled). A nonempty filename enables an append-only UTF-8 log containing runtime initialization, standard output and standard error, without suppressing console output. Relative paths are resolved beside the executable, not against the calling directory. The parent directory must already exist and be writable; environment variables are not expanded. Failure to open or finish the log returns exit code 2 unless the application already failed. Concurrent streams and processes may interleave chunks; complete lines and global ordering are not guaranteed. Capture retains incomplete UTF-8 characters until the next read before appending them. Malformed or truncated output is preserved as raw bytes. Shared append behavior on network filesystems depends on the filesystem. Logging adds file I/O only when enabled and requires a runtime with the output capture interface on Windows.

ExecutableIcon: an existing JPG, JPEG, PNG, BMP or GIF filename, absolute or relative to the current working directory when the option is assigned. Empty by default, preserving the launcher's existing icon. A nonempty value requires Windows in this implementation. The existing graphics_io and image_processing services run only during packaging. The first image/frame is centered without changing its aspect ratio, with transparent padding, and embedded at 16, 24, 32, 48, 64, 128 and 256 pixels. Transparency is retained; source images are limited to 16 megapixels. No separate icon file is distributed and no image-processing dependencies are added to the application runtime.

EmbedArchive: true by default, embedding the application archive in the executable. False writes an adjacent ExecutableName.nca file, included in Results.Files. An .nca file is a ZIP-formatted Nelson application archive containing the manifest, retained code and resources, not the runtime. Distribute both files together; when renaming the application, retain a matching base name for both. Startup checks archive size and SHA-256 before extraction into ctfroot. A missing or changed archive fails before the entry point. This integrity check is neither a signature nor encryption. The executable becomes smaller, but the total distribution size is not reduced. Both modes use the same runtime and numerical engine. Separate archives require launchers advertising archive format 3 and a runtime supporting that format.

TreatInputsAsNumeric: false by default, preserving character-vector function inputs. True converts each command-line argument once through the built-in str2double before calling the entry function. Each result is a double scalar, real or complex. Decimal/exponent notation, Inf and NaN are supported; empty text, invalid text and array literals produce NaN. No argument is evaluated as code. A packaged function named str2double cannot override this conversion. Application code must validate its required values.

argv('user') retains the original character vectors, including empty arguments and spaces; script entries continue to read this text directly. CustomHelpTextFile is processed before numeric conversion. Numeric input builds use application manifest version 2; older runtimes reject that version instead of silently passing strings. The option adds no work to numerical dispatch and no runtime modules. The command forms are -n and --numeric-inputs.

SupportPackages defaults to {'autodetect'}, retaining dependencies found in installed nmm packages. 'none' excludes every registered package; a cell/string vector of registered names permits only those packages. Names are case-sensitive and must exist at build time. This is a dependency allowlist, not a request to copy whole package trees or execute package loaders. All registered versions follow the policy. Excluded dependencies are recorded in the analysis and may cause runtime errors if called. An explicit entry or AdditionalFiles input inside an excluded package is rejected. IncludedSupportPackages reports the packages actually retained. No package selection is performed at application startup.

With an explicit package policy, the compiler can resolve functions from each registered active package's functions directory (or its root when that directory is absent), after existing search paths. It does not run package loaders or alter the session path. A package may still require unsupported initialization or native services; selecting it is not a guarantee of deployability.

💡Examples
🔗See Also
compiler.build.standaloneApplicationcompiler.build.standaloneWindowsApplicationcompiler.build.Results
🕔Version History
Version Description
Edit this page on GitHub