RaggieScript v1.3.0
Browse Table of Contents (17 chapters)
Getting Started (2)
Language Reference (4)
Core Standard Library (3)
Windows, MSI SQL & Native FFI (3)
Wizard UI & Studio Sandboxes (3)
Diagnostics & Bytecode ISA (2)
Master Symbol Index
7 min read Module: raggiesoft.raggiescript F1: IDH_RSSC_NS_ARCHIVE (0x200A)

archive.*, crypto.*, net.* & log.*

archive.* — Zero-Dependency Multi-Format Packaging & Extraction (23 Methods)

Every archive.* function in both raggiescript.exe (static /MT Win32 C++20) and RaggieScript.Core (.NET v1.2) runs against 100% EULA-clean, zero-dependency engines built straight into Windows 11 (x64 & ARM64):

1. Read-Only & Wizard-Safe Inspection (2 Methods — Allowed Inside wizard { ... })

MethodSignatureReturnMutating?Description
archive.listarchive.list(archiveFile: path)arrayWizard-SafeInspects any supported archive and returns { path: string, size: int, isDir: bool }[] (rejecting Zip-Slip paths & .rar).
archive.verifyarchive.verify(archiveFile: path, expectedSha256?: string)boolWizard-SafeVerifies optional 64-char hex SHA-256, container structure (including RSWPAK1 inner SHA-256), and Zip-Slip path safety.

2. Auto-Detecting & Format-Specific Packaging (21 Mutating Methods — RSW701 Gated)

Every archive.create* call accepts a source folder (or single file), writes outArchive, and returns its 64-character lowercase SHA-256 hex digest. Every archive.extract* call verifies optional expectedSha256 before unpacking and returns the int count of extracted files.

MethodSignatureReturnUnderlying Windows 11 Engine & Container
archive.createarchive.create(sourcePath: path, outArchive: path, options?: map)string (SHA-256)Infers container format automatically from outArchive extension (.zip, .7z, .rswpak, .cab, .tar.*, .zst, .iso, .wim, .cpio, .xar).
archive.extractarchive.extract(archiveFile: path, destDir: path, expectedSha256?: string)int (files)Sniffs magic header bytes (PK\x03\x04 .zip/.nupkg/.vsix/.epub, 7z\xBC\xAF .7z, RSWPAK1 .rswpak, MSCF .cab, CD001 .iso, MSWIM .wim, \x28\xB5\x2F\xFD .zst, 070701 .cpio, xar!) and extracts with rollback tracking.
archive.createZiparchive.createZip(sourcePath: path, outZip: path, options?: map)string (SHA-256)Packs folder/file into standard DEFLATE .zip.
archive.extractZiparchive.extractZip(zipFile: path, destDir: path, expectedSha256?: string)int (files)Extracts .zip (or .nupkg / .vsix / .epub) into destDir.
archive.create7zarchive.create7z(sourcePath: path, out7z: path, options?: map)string (SHA-256)Packs folder/file into solid Public-Domain LZMA2 .7z (System32\tar.exe --format=7zip).
archive.extract7zarchive.extract7z(sevenZipFile: path, destDir: path, expectedSha256?: string)int (files)Extracts .7z (LZMA / LZMA2) archive into destDir.
archive.createLzmaarchive.createLzma(sourcePath: path, out7z: path, options?: map)string (SHA-256)Algorithm-named alias for archive.create7z.
archive.extractLzmaarchive.extractLzma(sevenZipFile: path, destDir: path, expectedSha256?: string)int (files)Algorithm-named alias for archive.extract7z.
archive.createPakarchive.createPak(sourcePath: path, outPakFile: path, options?: map)string (SHA-256)Compresses folder/file into RaggieSoft's solid LZMS .rswpak (RSWPAK1 + inner SHA-256).
archive.extractPakarchive.extractPak(pakFile: path, destDir: path, expectedSha256?: string)int (files)Verifies both outer and inner RSWPAK1 SHA-256 digests and extracts into destDir.
archive.downloadPakarchive.downloadPak(httpsUrl: string, destDir: path, expectedSha256?: string, verifyAuthenticode?: bool)int (files)Streams remote pack over TLS 1.2/1.3 WinHTTP, verifies SHA-256 before unpacking, and extracts.
archive.createCabarchive.createCab(sourcePath: path, outCab: path, options?: map)string (SHA-256)Compresses folder hierarchy into a multi-folder LZX:21 Windows .cab (System32\makecab.exe).
archive.extractCabarchive.extractCab(cabFile: path, destDir: path, expectedSha256?: string)int (files)Extracts a Windows .cab cabinet preserving subdirectory structure.
archive.createTararchive.createTar(sourcePath: path, outTar: path, options?: map)string (SHA-256)Creates .tar, .tar.gz/.tgz, .tar.bz2, .tar.xz, .tar.lzma, or .tar.zst based on extension.
archive.extractTararchive.extractTar(tarFile: path, destDir: path, expectedSha256?: string)int (files)Extracts any uncompressed or compressed POSIX tarball into destDir.
archive.createZstarchive.createZst(sourcePath: path, outZst: path, options?: map)string (SHA-256)Packs folder/file into a fast Zstandard .tar.zst bundle (libzstd 1.5.7).
archive.extractZstarchive.extractZst(zstFile: path, destDir: path, expectedSha256?: string)int (files)Extracts a Zstandard .tar.zst / .tzst bundle into destDir.
archive.createIsoarchive.createIso(sourcePath: path, outIso: path, options?: map)string (SHA-256)Builds an ISO 9660 (.iso) Collector's Edition optical disc image (--format=iso9660).
archive.extractIsoarchive.extractIso(isoFile: path, destDir: path, expectedSha256?: string)int (files)Extracts an ISO 9660 (.iso) optical image into destDir (normalizing writable file attributes).
archive.createWimarchive.createWim(sourceDir: path, outWim: path, options?: map)string (SHA-256)Captures sourceDir into a Windows .wim image via System32\wimgapi.dll (requires elevation).
archive.extractWimarchive.extractWim(wimFile: path, destDir: path, expectedSha256?: string)int (files)Applies image #1 of a Windows .wim file via System32\wimgapi.dll (requires elevation).
use installer;

param payload7z: path = sys.supportDir / "StarlightAssets.7z";
param installDir: path = sys.programFiles / "Starlight";

wizard {
    step VerifyMedia {
        // archive.verify() and archive.list() are 100% read-only & allowed inside wizard {}!
        if (!archive.verify(payload7z)) {
            ui.notice("Collector media archive is missing or corrupted.");
        }
    }
}

install {
    // Automatically journaled in .rsw-rollback.jnl — rolled back cleanly if a later step fails!
    const extracted = archive.extract7z(payload7z, installDir / "Assets");
    const backupSha = archive.createZst(installDir / "Config", sys.localAppData / "Starlight" / "config-backup.tar.zst");
    log.info("Unpacked ${extracted} files; config snapshot SHA-256 = ${backupSha}");
}

crypto.* — CNG bcrypt.dll Hashing, UUIDv5 & Authenticode (7 Methods)

All crypto.* methods are 100% Read-Only & Wizard-Safe, implemented directly against Windows bcrypt.dll and wintrust.dll with zero OpenSSL DLL dependencies:

MethodSignatureReturnDescription
crypto.sha256crypto.sha256(text: string)stringComputes lowercase 64-char hex SHA-256 of UTF-8 text.
crypto.sha256Textcrypto.sha256Text(text: string)stringExplicit alias for crypto.sha256(text).
crypto.sha256Filecrypto.sha256File(file: path)stringStreams file in 64 KB chunks through BCRYPT_SHA256_ALGORITHM and returns 64-char hex SHA-256.
crypto.crc32Textcrypto.crc32Text(text: string)intComputes unsigned IEEE 802.3 CRC-32 checksum of text.
crypto.newGuidcrypto.newGuid()stringGenerates a random uppercase {GUID} via BCryptGenRandom.
crypto.uuid5crypto.uuid5(name: string, namespaceGuid?: string)stringGenerates deterministic RFC 4122 SHA-1 UUIDv5 {GUID} for reproducible MSI Component GUIDs.
crypto.verifyAuthenticodecrypto.verifyAuthenticode(peFile: path)boolVerifies Microsoft Authenticode / Azure Artifact Signing chain via WinVerifyTrust.

net.* — Native TLS 1.2 / 1.3 WinHTTP Client & Winsock2 TCP Port Probes (6 Methods)

net.* pairs the OS-integrated winhttp.dll HTTPS stack with sub-millisecond Winsock2 local TCP port availability probes (isPortFree and findFreePort, both Wizard-Safe for ui.textBox port validators!) under use installer;:

MethodSignatureReturnDescription
net.downloadnet.download(httpsUrl: string, destFile: path, expectedSha256?: string)boolDownloads httpsUrl to destFile with live UI progress; deletes destFile and returns false if expectedSha256 mismatches!
net.getTextnet.getText(httpsUrl: string)stringPerforms an HTTPS GET and returns the UTF-8 response body.
net.getJsonnet.getJson(httpsUrl: string)anyFetches and parses a remote HTTPS JSON manifest (catalog.json, release channels, etc.).
net.probenet.probe(httpsUrl: string)boolPerforms a fast 4-second HEAD/GET reachability probe (true on HTTP 200..299).
net.isPortFreenet.isPortFree(port: int, loopbackOnly?: bool)boolWizard-Safe: Probes via Winsock2 (ws2_32.lib) whether local TCP port (1..65535) is free to bind.
net.findFreePortnet.findFreePort(startPort?: int, endPort?: int)intWizard-Safe: Returns the first available local TCP port in [startPort, endPort] (defaults 8000..9000, or -1).

log.* — Structured Setup & Audit Logging (4 Methods)

MethodSignatureReturnDescription
log.infolog.info(message: string)nullAppends timestamped [INFO] entry to the setup log.
log.warnlog.warn(message: string)nullAppends timestamped [WARN] entry to the setup log.
log.warninglog.warning(message: string)nullAlias for log.warn(message).
log.errorlog.error(message: string)nullAppends timestamped [ERROR] entry to the setup log.
Indexed API Calls & Symbols on This Page (30):
archive.list(archiveFile)Wizard-Safe archive.verify(archiveFile, expectedSha256?)Wizard-Safe archive.create(sourcePath, outArchive, options?)Mutating archive.extract(archiveFile, destDir, expectedSha256?)Mutating archive.createZip(sourcePath, outZip, options?)Mutating archive.extractZip(zipFile, destDir, expectedSha256?)Mutating archive.create7z(sourcePath, out7z, options?)Mutating archive.extract7z(sevenZipFile, destDir, expectedSha256?)Mutating archive.createLzma(sourcePath, out7z, options?)Mutating archive.extractLzma(sevenZipFile, destDir, expectedSha256?)Mutating archive.createPak(sourceDir, outPakFile, options?)Mutating archive.extractPak(pakFile, destDir, expectedSha256?)Mutating archive.downloadPak(url, destDir, expectedSha256?, verifySig?)Mutating archive.createCab(sourcePath, outCab, options?)Mutating archive.extractCab(cabFile, destDir, expectedSha256?)Mutating archive.createTar(sourcePath, outTar, options?)Mutating archive.extractTar(tarFile, destDir, expectedSha256?)Mutating archive.createZst(sourcePath, outZst, options?)Mutating archive.extractZst(zstFile, destDir, expectedSha256?)Mutating archive.createIso(sourcePath, outIso, options?)Mutating archive.extractIso(isoFile, destDir, expectedSha256?)Mutating archive.createWim(sourceDir, outWim, options?)Mutating archive.extractWim(wimFile, destDir, expectedSha256?)Mutating crypto.sha256File(file)Read-Only crypto.uuid5(name, nsGuid?)Read-Only crypto.verifyAuthenticode(peFile)Read-Only net.download(httpsUrl, destFile, expectedSha256?)Network net.getJson(httpsUrl)Network net.probe(httpsUrl)Network net.isPortFree / net.findFreePortWizard-Safe