Installation
Requirements
- Zig: 0.15.0 or later
- Network: Access required only when checking is enabled
Using zig fetch (Recommended)
The easiest way to install updater.zig is using Zig's built-in package manager:
bash
zig fetch --save https://github.com/muhammad-fiaz/updater.zig/archive/refs/tags/0.0.1.tar.gzThis automatically adds the dependency to your build.zig.zon.
Configure build.zig
Add the module to your build configuration:
zig
const std = @import("std");
pub fn build(b: *std.Build) void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
// Add updater.zig dependency
const updater_dep = b.dependency("updater", .{
.target = target,
.optimize = optimize,
});
// Create your executable
const exe = b.addExecutable(.{
.name = "my-app",
.root_source_file = b.path("src/main.zig"),
.target = target,
.optimize = optimize,
});
// Add updater module
exe.root_module.addImport("updater", updater_dep.module("updater"));
b.installArtifact(exe);
}Manual Installation
If you prefer manual installation, add to build.zig.zon:
zig
.dependencies = .{
.updater = .{
.url = "https://github.com/muhammad-fiaz/updater.zig/archive/refs/tags/0.0.1.tar.gz",
.hash = "YOUR_HASH_HERE",
},
},Get the hash:
bash
zig fetch --hash https://github.com/muhammad-fiaz/updater.zig/archive/refs/tags/0.0.1.tar.gzVerify Installation
Run your tests to verify installation:
bash
zig build testBuild Options
updater.zig supports these build options:
| Option | Type | Default | Description |
|---|---|---|---|
enable_update_check | bool | true | Enable/disable update checking |
target | Target | native | Cross-compilation target |
optimize | Optimize | Debug | Optimization level |
Next Steps
- Quick Start - Start using updater.zig
- Configuration - Full configuration reference