Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,7 @@
!docs/**
!examples/
!examples/**
!contrib/
!contrib/**
!.github/
!.github/**
3 changes: 3 additions & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

== v0.1.0 (unreleased)

* Unity Install Layout (UIL) v1.0: JSON schema, Antora reference, `installcoordinator.uil` library (parse, validate, classic-path plan, journal dry-run).
* CLI: `uil validate`, `uil plan`, `uil emit-coordinator`; examples `uil-classic-demo.uil.json` and `thin-stub-msi.job.json`.
* Linux/Posix: Unix socket client/server fixes for current Phobos (`Socket`, `getpid`).
* Initial daemon, job state machine, MSI serialization lane, named-pipe IPC, HTTP API + web UI.
* Two surfaces: local user app window (`/ui/user`) and admin remote control (`/ui/admin` + JSON API with Bearer auth when non-local).
* Thin stub submit flow, session elevation lock, batch scope/terms, install history catalog.
Expand Down
36 changes: 34 additions & 2 deletions README.adoc
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
= Install Coordinator

D daemon with **two surfaces**: a local lay-user app window and an admin remote-control HTTP API.
D daemon with **two surfaces**: a local lay-user app window and an admin remote-control HTTP API. It is also a **installer framework option** for DevCentr: the queue plane serializes MSI work while **Unity Install Layout (UIL)** describes package roles, shell claims, and transaction journals for Ibex and other emitters.

## Why

Windows blocks parallel MSI sessions via `_MSIExecute`. GUI users double-click installers and get error 1618. Install Coordinator collects jobs, explains waits, and runs MSI steps one at a time while allowing disjoint work in parallel when claims permit.

UIL adds a layout contract so installs refresh PATH, shortcuts, and environment—not only copy files—on classic Windows/macOS/Linux/BSD paths today, with a forward mapping to connectome-fs.

## Surfaces

* **User (local)** — `install-coordinator gui` opens a framed app window at `/ui/user`. Plain language, no admin jargon. Localhost only.
Expand All @@ -21,11 +23,14 @@ install-coordinator gui # local user app window
install-coordinator list active
install-coordinator session --lock-elevation --batch-terms --scope=perMachine
install-coordinator shortcut <id> --desktop
install-coordinator uil validate examples/uil-classic-demo.uil.json
install-coordinator uil plan examples/uil-classic-demo.uil.json --dry-run
install-coordinator uil emit-coordinator examples/uil-classic-demo.uil.json
```

Environment: `INSTALL_COORD_BIND`, `INSTALL_COORD_AUTH_TOKEN`, `INSTALL_COORD_REMOTE=1`, `INSTALL_COORD_HTTP_PORT`.

## Manifest (minimal)
## Manifest (queue plane, minimal)

```json
{
Expand All @@ -40,12 +45,39 @@ Environment: `INSTALL_COORD_BIND`, `INSTALL_COORD_AUTH_TOKEN`, `INSTALL_COORD_RE
}
```

See `examples/thin-stub-msi.job.json` for a documented MSI stub sample.

## UIL (layout contract)

Ibex and other authors emit `*.uil.json` manifests (schema: `docs/schema/uil-manifest.schema.json`). The CLI validates, plans classic path mapping, and prints a transaction journal (dry-run MVP).

```json
{
"uilVersion": "1.0",
"package": { "id": "dev-centr.myapp", "name": "My App", "version": "1.0.0" },
"layout": { "adapter": "classic-paths", "scope": "perUser" },
"payload": {
"entries": [{ "source": "staging/bin/myapp", "role": "bin", "relativePath": "myapp" }]
},
"claims": [{ "type": "path_entry", "directories": ["${role:bin}"] }]
}
```

Full reference: Antora pages under `docs/modules/ROOT/pages/` (`framework.adoc`, `uil-reference.adoc`).

## Ibex integration

Author installer projects with link:https://github.com/dev-centr/ibex-install-builder[ibex-install-builder]. Select plugin `uil` or `install-coordinator` to emit UIL manifests and coordinator job JSON into `dist/`. If your Ibex revision predates the plugin, copy the patch from `contrib/ibex-uil-option/`.

## Build

```powershell
dub build --config=application
dub test --config=library
```

Library configuration exposes `installcoordinator.uil` for parse, validate, plan, and journal helpers.

## Docs

https://docs.devcentr.org/install-coordinator/latest/index.html (after hub wire)
Expand Down
35 changes: 35 additions & 0 deletions contrib/ibex-uil-option/README.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
= Ibex UIL / Install Coordinator option (contrib patch)

Apply these files to link:https://github.com/dev-centr/ibex-install-builder[ibex-install-builder] when the upstream PR is not yet merged.

== Files

* `plugins/install_coordinator.d` — builtin plugins `uil` and `install-coordinator`
* `docs/modules/ibex/pages/install-coordinator-uil.adoc` — how-to page

== Manual steps

1. Copy `plugins/install_coordinator.d` into the Ibex repo `plugins/` directory.
2. Add to `source/app.d`: `import easyinstaller.plugins.install_coordinator;`
3. Merge nav entry and plugins table row from the install-coordinator PR (or copy from `patches/` below).
4. `dub build --config=application`

== Patches

[source,diff]
----
--- a/docs/modules/ibex/nav.adoc
+++ b/docs/modules/ibex/nav.adoc
@@
* xref:plugins.adoc[Plugins]
+* xref:install-coordinator-uil.adoc[Install Coordinator / UIL]
----

[source,diff]
----
--- a/source/app.d
+++ b/source/app.d
@@
import easyinstaller.plugins.appimage;
+import easyinstaller.plugins.install_coordinator;
----
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
= Install Coordinator and UIL emit
:description: Emit Unity Install Layout manifests and coordinator job JSON from Ibex projects.
:navtitle: Install Coordinator / UIL

Ibex can target link:https://github.com/dev-centr/install-coordinator[Install Coordinator] as the delivery runtime: **UIL** describes layout and shell claims; the **coordinator job** hands work to the daemon queue plane.

== Select the plugin

In `installer.kdl`:

[source,kdl]
----
installer {
name "MyApp"
version "1.0.0"
id "com.example.myapp"
plugin "uil"
add-to-path true
extras {
uilScope "perUser"
sideBySide "true"
emitCoordinatorJob "true"
}
}
----

Plugin ids: `uil` (alias) or `install-coordinator`.

== Build outputs

[source,bash]
----
ibex build .
----

Writes under `dist/`:

* `MyApp.uil.json` — UIL v1.0 manifest (`classic-paths` adapter)
* `MyApp.coordinator.json` — thin-stub job referencing the UIL path (MVP: `uil plan --dry-run` exec step)

Validate on a machine with Install Coordinator:

[source,bash]
----
install-coordinator uil validate dist/MyApp.uil.json
install-coordinator submit dist/MyApp.coordinator.json
----

== Contract reference

UIL schema and Antora reference live in the Install Coordinator repo (`docs/schema/uil-manifest.schema.json`, `uil-reference.adoc`).
173 changes: 173 additions & 0 deletions contrib/ibex-uil-option/plugins/install_coordinator.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
module easyinstaller.plugins.install_coordinator;

import easyinstaller.plugin;
import easyinstaller.project : InstallerProject, extra, extraFlag;
import std.file : exists, mkdirRecurse, write;
import std.json;
import std.path : buildPath;
import std.string : format;

/// Emit UIL manifests and Install Coordinator job JSON (queue plane handoff).
final class InstallCoordinatorPlugin : InstallerPlugin
{
string id() { return "install-coordinator"; }
string displayName() { return "Install Coordinator (UIL)"; }
string[] targets() { return ["all"]; }
bool canBuild() { return true; }
string detectTool() { return "install-coordinator"; }
string guiName() { return "Install Coordinator"; }
string guiInstallUrl() { return "https://github.com/dev-centr/install-coordinator"; }
string guiDetectHint() { return "install-coordinator on PATH"; }
string detectGui() { return ""; }
string installPlaybook() { return ""; }

ExtraField[] extrasSchema()
{
return [
ExtraField("uilScope", "string", "perUser", "perUser or perMachine layout.scope"),
ExtraField("sideBySide", "bool", "false", "Enable UIL side-by-side slot directory"),
ExtraField("emitCoordinatorJob", "bool", "true", "Also write dist/<name>.coordinator.json"),
];
}

string designerSource(const ref InstallerProject project, string outDir)
{
return buildPath(outDir, project.name ~ ".uil.json");
}

string emitSources(const ref InstallerProject project, string outDir)
{
if (!exists(outDir))
mkdirRecurse(outDir);
auto uilPath = buildPath(outDir, project.name ~ ".uil.json");
write(uilPath, emitUilJson(project));
return "Wrote " ~ uilPath;
}

string build(const ref InstallerProject project, string outDir)
{
if (!exists(outDir))
mkdirRecurse(outDir);
auto uilPath = buildPath(outDir, project.name ~ ".uil.json");
write(uilPath, emitUilJson(project));
string[] notes = ["Wrote " ~ uilPath];
if (extraFlag(project, "emitCoordinatorJob", true))
{
auto jobPath = buildPath(outDir, project.name ~ ".coordinator.json");
write(jobPath, emitCoordinatorJob(project, uilPath));
notes ~= "Wrote " ~ jobPath;
}
return notes.join("\n");
}

private string emitUilJson(const ref InstallerProject project)
{
string installScope = extra(project, "uilScope", "perUser");
bool sxs = extraFlag(project, "sideBySide", false);
JSONValue root = JSONValue.emptyObject;
root["uilVersion"] = JSONValue("1.0");
JSONValue pkg = JSONValue.emptyObject;
pkg["id"] = JSONValue(project.id);
pkg["name"] = JSONValue(project.name);
pkg["publisher"] = JSONValue(project.publisher);
pkg["version"] = JSONValue(project.version_);
root["package"] = pkg;
JSONValue layout = JSONValue.emptyObject;
layout["adapter"] = JSONValue("classic-paths");
layout.object["scope"] = JSONValue(installScope);
if (sxs)
{
JSONValue s = JSONValue.emptyObject;
s["enabled"] = JSONValue(true);
s["slot"] = JSONValue(project.version_);
layout["sideBySide"] = s;
}
root["layout"] = layout;
JSONValue entries = JSONValue.emptyArray;
JSONValue bin = JSONValue.emptyObject;
bin["source"] = JSONValue(project.exe.length ? project.exe : "dist/");
bin["role"] = JSONValue("bin");
if (project.exe.length)
bin["relativePath"] = JSONValue(project.exe);
entries.array ~= bin;
JSONValue payload = JSONValue.emptyObject;
payload["entries"] = entries;
root["payload"] = payload;
if (project.addToPath)
{
JSONValue claims = JSONValue.emptyArray;
JSONValue pe = JSONValue.emptyObject;
pe["type"] = JSONValue("path_entry");
JSONValue dirs = JSONValue.emptyArray;
dirs.array ~= JSONValue("${role:bin}");
pe["directories"] = dirs;
claims.array ~= pe;
root["claims"] = claims;
}
JSONValue coord = JSONValue.emptyObject;
coord["presentation"] = JSONValue("thinStub");
coord["termsAccepted"] = JSONValue(true);
root["coordinator"] = coord;
return root.toPrettyString();
}

private string emitCoordinatorJob(const ref InstallerProject project, string uilPath)
{
JSONValue root = JSONValue.emptyObject;
root["displayName"] = JSONValue(project.name);
root["publisher"] = JSONValue(project.publisher);
root["version"] = JSONValue(project.version_);
root["presentation"] = JSONValue("thinStub");
root["termsAccepted"] = JSONValue(true);
root.object["scope"] = JSONValue(extra(project, "uilScope", "perUser"));
JSONValue claims = JSONValue.emptyObject;
claims["msi"] = JSONValue(false);
root["claims"] = claims;
JSONValue steps = JSONValue.emptyArray;
JSONValue step = JSONValue.emptyObject;
step["kind"] = JSONValue("exec");
step["path"] = JSONValue("install-coordinator");
JSONValue args = JSONValue.emptyArray;
args.array ~= JSONValue("uil");
args.array ~= JSONValue("plan");
args.array ~= JSONValue(uilPath);
args.array ~= JSONValue("--dry-run");
step["args"] = args;
steps.array ~= step;
root["steps"] = steps;
JSONValue opts = JSONValue.emptyObject;
opts["uilManifest"] = JSONValue(uilPath);
opts["uilPackageId"] = JSONValue(project.id);
root["options"] = opts;
return root.toPrettyString();
}
}

/// Alias plugin id `uil` for documentation and installer.kdl ergonomics.
final class UilPlugin : InstallerPlugin
{
private InstallCoordinatorPlugin inner;
this() { inner = new InstallCoordinatorPlugin(); }
string id() { return "uil"; }
string displayName() { return "Unity Install Layout (UIL)"; }
string[] targets() { return inner.targets(); }
bool canBuild() { return inner.canBuild(); }
string detectTool() { return inner.detectTool(); }
string guiName() { return inner.guiName(); }
string guiInstallUrl() { return inner.guiInstallUrl(); }
string guiDetectHint() { return inner.guiDetectHint(); }
string detectGui() { return inner.detectGui(); }
string installPlaybook() { return inner.installPlaybook(); }
ExtraField[] extrasSchema() { return inner.extrasSchema(); }
string designerSource(const ref InstallerProject project, string outDir) { return inner.designerSource(project, outDir); }
string emitSources(const ref InstallerProject project, string outDir) { return inner.emitSources(project, outDir); }
string build(const ref InstallerProject project, string outDir) { return inner.build(project, outDir); }
}

shared static this()
{
registerBuiltin(new InstallCoordinatorPlugin());
registerBuiltin(new UilPlugin());
}

private import std.array : join;
Loading
Loading