RaggieScript
›
Language Reference
5 min read
Module: raggiesoft.raggiescript
F1: IDH_RSSC_BUILTINS (0x2006)
Global Built-In Functions, Enum Constants & compile.* / feature.*
Global functions and built-in enum tables are available in every RaggieScript file without needing any namespace prefix.
Global Built-In Functions (16 Functions)
Signature Return Type Mutating? Description
str(value: any)stringRead-Only Converts any RaggieScript value (int, float, bool, path, version, array, map) to UTF-8 text.
int(value: any)intRead-Only Parses or truncates a string, float, or bool into a 64-bit signed integer (0x... hex supported).
float(value: any)floatRead-Only Converts a string or int into a 64-bit IEEE floating-point number.
bool(value: any)boolRead-Only Evaluates RaggieScript truthiness (false, null, 0, and "" are false).
path(value: any)pathRead-Only Normalizes slashes into a first-class OS path value supporting the / path-join operator.
ver(value: any)versionRead-Only Parses "10.0.22631.0" into a 4-part SemVer value for component-wise < / >= comparisons.
len(collectionOrStr: any)intRead-Only Returns character/byte length of a string, element count of an array, or key count of a map.
typeof(value: any)stringRead-Only Returns runtime type tag: "null", "bool", "int", "float", "string", "path", "version", "array", "map", or "closure".
print(...values)nullRead-Only Writes space-joined values to standard output (stdout / CLI console).
log(message: string, level?: string)nullRead-Only Appends a timestamped line to the structured setup log (/l=install.log).
assert(condition: bool, message?: string)boolSafe Gate Raises an immediate runtime error if condition is false—automatically triggering LIFO rollback when inside install { ... }!
sleep(milliseconds: int)nullRead-Only Pauses script execution for milliseconds ms.
coalesce(a: any, b: any, ...)anyRead-Only Returns the first non-null, non-empty "" argument (a ?? b operator equivalent).
range(end: int) / range(start: int, end: int, step?: int)arrayRead-Only Produces an integer array [start .. end) for deterministic loops.
def(name: string, fallback?: string)stringRead-Only Reads a compile-time -DNAME=VAL CLI define or #define macro value (returning fallback if unset).
targetArch()stringRead-Only Returns the target compilation or native host architecture ("arm64" or "x64").
Global Exit Constants & Built-In Enum Tables
Standard Exit Code Constants
EXIT_OK (0) — Clean installation / execution success.
EXIT_ELEVATION_REQUIRED (740) — ERROR_ELEVATION_REQUIRED when UAC is disabled (EnableLUA = 0) for a Standard User.
EXIT_REBOOT_NEEDED (3010) — ERROR_SUCCESS_REBOOT_REQUIRED signaling enterprise deployment tools that a restart is pending.
EXIT_UNSUPPORTED_OS (9007) — Host OS build or RAM is below minimum package floor.
EXIT_PREREQ_MISSING (9008) — Required prerequisite runtime was declined or unavailable.
EXIT_DOWNLOAD_FAILED (9009) — Remote .rswpak or prerequisite download/SHA-256 verification failed.
Built-In Enum & Metadata Maps
Global Table Members Purpose
product.id, .name, .version, .publisher, .scope, .uac, .styleRead-only metadata mirror of the active package / showcase / app header!
ScopeScope.User ("user"), Scope.Machine ("machine")Selects per-user (%LOCALAPPDATA%) vs. per-machine (Program Files) installation scope.
UacUac.AsInvoker, Uac.HighestAvailable, Uac.RequireAdministrator, Uac.DeferredControls PE UAC manifest & deferred commit-time elevation broker.
HiveHive.HKCU, Hive.HKLM, Hive.HKCR, Hive.HKUWindows Registry root hive constants for reg.* calls.
RegViewRegView.Native64, RegView.Wow32, RegView.BothPer-call stateless 64-bit / 32-bit WOW64 Registry view selector (KEY_WOW64_64KEY / 32KEY).
TokenToken.Current, Token.Elevated, Token.DesktopProcess token selector for proc.run() (Token.Desktop de-elevates via explorer.exe!).
IconIcon.Info, Icon.Warning, Icon.Error, Icon.ShieldAccessible glyph selector for ui.taskDialog() and ui.notice().
SetupModeSetupMode.Express, SetupMode.Compact, SetupMode.Custom, SetupMode.CompleteStandard installation preset identifiers.
WizardStyleStandard, Wizard95, Wizard97, AeroWizard, FluentMica, OneClick, PassiveToast, FullScreenBlue, FullScreenTeal, Autorun16x9, SimpleSelects any of the 11 native Per-Monitor V2 DPI Win32 wizard layouts.
DeliveryDelivery.Embedded, Delivery.DownloadMarks a feature as embedded inside #220 or fetched from a SHA-256 verified .rswpak URL.
Validation.* — Wizard Input Validation Helpers
Used inside validate: (val) => ... closures on ui.textBox, ui.folderPicker, and ui.filePicker to gate the Next > button with inline accessible error banners (zero modal MessageBox spam!):
Method Signature Return Type Description
Validation.okValidation.ok()mapReturns { ok: true, message: "" }, clearing any inline field error and enabling Next > .
Validation.errorValidation.error(message: string)mapReturns { ok: false, message }, focusing the invalid field and announcing message to screen readers.
compile.* — Build-Time Asset Embedding
compile.* calls execute at compile time during raggiescript.exe compile / pack-exe / instbuild.exe and bake the resulting JSON object or text string directly into the RSWBC2 constant pool—requiring zero external files at runtime!
Method Signature Return Type Description
compile.jsoncompile.json(relativePath: string)anyParses a JSON file at build time and embeds the structured map/array into bytecode.
compile.textcompile.text(relativePath: string)stringReads a UTF-8 text/Markdown/RTF file at build time and embeds it as a string constant.
compile.defcompile.def(key: string, fallback?: string)stringAlias for def(key, fallback) reading -DKEY=VAL or #define.
compile.definecompile.define(key: string, fallback?: string)stringAlias for compile.def(key, fallback).
payload.* & feature.* — Package Feature & Payload Inspection
Method Signature Return Type Mutating? Description
payload.dirpayload.dir(payloadId: string)pathRead-Only Resolves the extracted staging directory path for a declared payload.
payload.pathpayload.path(payloadId: string)pathRead-Only Resolves the extracted file or directory path for payloadId.
feature.listfeature.list()arrayRead-Only Returns an array of { id, title, description, selected, required, inCompact } maps for all declared feature blocks.
feature.infofeature.info(featureId: string)mapRead-Only Returns the metadata and selection map for featureId.
feature.isSelectedfeature.isSelected(featureId: string)boolRead-Only Returns true if featureId is currently checked for installation.
feature.setSelectedfeature.setSelected(featureId: string, selected?: bool)boolWizard-Safe Programmatically toggles a non-required feature's selection state (false ignored on required: true features).
feature.setStatefeature.setState(featureId: string, selected?: bool)boolWizard-Safe Alias for feature.setSelected(...).
feature.selectPresetfeature.selectPreset(preset?: string)boolWizard-Safe Applies "express", "compact", or "complete" selection tiers across all declared features.
Indexed API Calls & Symbols on This Page (28):