wip
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
# Covenant-Setup Smoke Test
|
||||
|
||||
This example stays in `HKCU` and `{LocalAppData}` so it can be exercised without elevation.
|
||||
|
||||
Build single-file installers:
|
||||
|
||||
```powershell
|
||||
cargo run -- package examples/install.toml --output dist
|
||||
```
|
||||
|
||||
This emits:
|
||||
|
||||
- `dist\covenant-setup-installer.exe`
|
||||
|
||||
The generated installer is a single executable with the manifest and payload embedded into it.
|
||||
It chooses GUI or TUI mode from context, or you can force one explicitly with `--headed` or `--headless`.
|
||||
|
||||
Run install:
|
||||
|
||||
```powershell
|
||||
cargo run -- install examples/install.toml --json
|
||||
```
|
||||
|
||||
Write the journal somewhere explicit:
|
||||
|
||||
```powershell
|
||||
cargo run -- install examples/install.toml --journal examples/journal.json
|
||||
```
|
||||
|
||||
Run uninstall:
|
||||
|
||||
```powershell
|
||||
cargo run -- uninstall examples/journal.json --json
|
||||
```
|
||||
|
||||
Expected effects:
|
||||
|
||||
- Creates `%LOCALAPPDATA%\CovenantSetupExample`
|
||||
- Copies `sample_app.cmd` into the `bin` directory
|
||||
- Writes `HKCU\Software\CovenantSetupExample\InstallRoot`
|
||||
- Creates a desktop shortcut
|
||||
- Runs an inline PowerShell post-install command and records only the script execution in the journal
|
||||
@@ -0,0 +1,35 @@
|
||||
app_name = "Covenant-Setup Sample App"
|
||||
|
||||
[[directories]]
|
||||
path = "{LocalAppData}\\CovenantSetupSample"
|
||||
|
||||
[[directories]]
|
||||
path = "{LocalAppData}\\CovenantSetupSample\\bin"
|
||||
|
||||
[[files]]
|
||||
source = "payload\\sample_app.cmd"
|
||||
destination = "{LocalAppData}\\CovenantSetupSample\\bin\\sample_app.cmd"
|
||||
|
||||
[[registry]]
|
||||
key = "HKCU\\Software\\CovenantSetupSample"
|
||||
name = "InstallRoot"
|
||||
value = "{LocalAppData}\\CovenantSetupSample"
|
||||
|
||||
[[shortcuts]]
|
||||
path = "{Desktop}\\Covenant-Setup Sample App.lnk"
|
||||
target = "{LocalAppData}\\CovenantSetupSample\\bin\\sample_app.cmd"
|
||||
description = "Launch the Covenant-Setup sample payload"
|
||||
|
||||
[[scripts]]
|
||||
command = "powershell"
|
||||
args = [
|
||||
"-ExecutionPolicy",
|
||||
"Bypass",
|
||||
"-Command",
|
||||
"New-Item -ItemType Directory -Path .\\logs -Force | Out-Null; 'post-install script ran' | Set-Content .\\logs\\post_install.txt"
|
||||
]
|
||||
working_directory = "{LocalAppData}\\CovenantSetupSample"
|
||||
|
||||
[purge]
|
||||
registry_branches = ["HKCU\\Software\\CovenantSetupSample"]
|
||||
paths = ["{LocalAppData}\\CovenantSetupSample"]
|
||||
@@ -0,0 +1,3 @@
|
||||
$logDir = Join-Path $PWD "logs"
|
||||
New-Item -ItemType Directory -Path $logDir -Force | Out-Null
|
||||
"post-install script ran at $(Get-Date -Format o)" | Set-Content -Path (Join-Path $logDir "post_install.txt")
|
||||
@@ -0,0 +1,3 @@
|
||||
@echo off
|
||||
echo GlassBox sample app executed.
|
||||
pause
|
||||
Reference in New Issue
Block a user