Pular para o conteúdo

Binário Standalone

Nesta página

Um .zex gerado sem flags adicionais ainda exige o zolo na máquina de destino. A flag --standalone resolve isso: o runtime é concatenado ao arquivo ZIP, e o executável se localiza em si mesmo via o registro EOCD do ZIP na inicialização — sem nenhuma instalação externa necessária.

--emit zex --standalone produz um .zex autossuficiente; rode em qualquer máquina, mesmo sem zolo instalado.

03-standalone.zolo
Playground
// Feature: self-contained executable — `--standalone`

// Syntax: `zolo build file.zolo --emit zex --standalone`

// When to use: distribute a `.zex` that runs WITHOUT a separate `zolo`

//   install — the runtime is embedded into the archive.


// Run:

//   zolo build 31-distribution/03-standalone.zolo --emit zex --standalone

//   # the resulting .zex embeds the runtime; double-clicking or running

//   # it directly works on a machine that has no `zolo` installed.

//

// How it works: the runtime executable is concatenated with the ZIP

// payload; the program locates its own appended archive via the ZIP

// EOCD record at startup and executes it. (See the archive spec.)


print("I bring my own runtime — no `zolo` needed to run me.")

// Pair with --release for an optimized standalone, and with

// --windowed/--gui (see 04) for a console-free GUI app on Windows.

//

// expected: I bring my own runtime — no `zolo` needed to run me.

Requer a CLI/host do Zolo — abra no playground ou rode localmente.

Para distribuição de produção, combine --standalone com --release para otimização de bytecode:

zolo build app.zolo --emit zex --standalone --release

O arquivo de saída fica em target/<nome>-<versão>.zex (a versão vem do zolo.toml, padrão 0.0.0).

Buscar no Zolo

9 resultados

enespt-br