What this is for
The Windows installer is a per-machine MSI,guardway-gw-cli-windows-x86_64.msi, built for silent
deployment. It installs to C:\Program Files\Guardway, puts gw-cli on the machine PATH, and
starts the agent and the Guardway tray icon in every signed-in user’s session right away and at
each sign-in after that. There is nothing to run after the install.
Download: https://api.guardway.ai/v1/downloads/gw-cli/latest/guardway-gw-cli-windows-x86_64.msi.
Verify it against SHA256SUMS in the same folder.
What the package installs
Identifiers for your deployment tool:
- UpgradeCode (permanent, detects any version):
{45544182-2B7E-42C6-BE77-0167C1E039A6} - ProductCode changes with each release. Read it from the MSI or from your tool’s inventory after the first deployment.
How to install
- Intune
- SCCM
- Group Policy
- By hand
1
Add the app
Upload the MSI as a Line-of-business app. Intune reads the ProductCode and version from the file and handles detection and upgrades. Or package it as a Win32 app with install command
msiexec /i guardway-gw-cli-windows-x86_64.msi /qn, the uninstall command in Intune uninstall command, install behavior System, and an MSI detection rule.2
Assign to device groups
Assign to devices, not users. The install runs as SYSTEM with no interactive session, so no SmartScreen prompt appears.
3
Enroll with a script (optional)
Deploy the enroll command as a PowerShell script in the system context. See Activate.
After the install
The Guardway tray icon appears in each signed-in session within a few seconds. Verify:GW_NO_SESSION_LAUNCH=1 to the msiexec command; the agent then starts at each
user’s next sign-in.
Then enroll the machine.
Install modes on Windows
The MSI installs the managed mode. To install observe instead, set the registry valueInstallMode (REG_SZ) to observe under HKLM\Software\Policies\Guardway\Agent before you deploy,
for example with an Intune or Group Policy registry setting. Upgrades keep the machine’s mode.
To switch an installed machine, from an elevated PowerShell:
com.guardway.gw-cli.tap, not a Windows
service: schtasks /Query /TN com.guardway.gw-cli.tap. On Windows, Enforce points AI tools directly
at your gateway, so only Enforce, fail closed applies; see Posture.
Removing
gw-cli uninstall: it un-wires every AI tool, stops the agent, gives
back any held skill and deletes the data. From agent 0.2.217 it hands the machine’s console
credential back before the data goes, so Fleet shows
the machine as Uninstalled. With no network the removal goes ahead and the credential is not
handed back. Agent 0.2.219 and later wait at most 20 seconds for Guardway; agents 0.2.217 and 0.2.218
have no limit of their own and wait up to 30 seconds per request. With agents up to 0.2.219, the
removal can leave C:\ProgramData\Guardway behind; see
If the data folder stays behind.
msiexec /x "{ProductCode}" /qn KEEPDATA=1 only un-wires the AI tools and keeps the data and the
enrollment, for a reinstall that reports again without enrolling. Fleet does not show the machine as
Uninstalled. It also leaves Guardway’s scheduled tasks in place. Where one of them starts the
agent, as in the managed mode, the agent starts again at the next boot or sign-in from
C:\ProgramData\Guardway\bin and keeps reporting: its
Credential stays Own device credential. Where
only the Run entries start it, it does not start again, and its Credential shows
Own device credential, then Expired.
After a full removal, a reinstall needs enrolling again; see
Reinstalling.
Earlier archive installs
An earlier.zip archive install belongs to one account: gw-cli in
%LOCALAPPDATA%\Programs\Guardway. To move the PC to the package, remove it first: signed in as the
person who installed it, run gw-cli uninstall from an elevated PowerShell. Then install the
package and enroll the machine again.
The safer order
Rungw-cli uninstall first, elevated, then msiexec /x. gw-cli uninstall stops when its check
fails, while the MSI’s own run of it cannot stop the package removal. Check the mode on the machine
itself with gw-cli hook --installed-mode, because an MSI install can be in either mode. Where it
prints managed, always run both, in this order. A machine switched to observe with
hook --observe prints observe, but a scheduled task starts its agent, as in the managed mode: run
both there too. msiexec /x alone is enough only on a machine installed in the observe mode and
never switched, where schtasks /Query /TN ai.guardway.gw-cli.serve finds no task. This order is
still safer there:
0.
Then do not run step 2: Windows Installer runs one installation at a time, so a second msiexec /x
fails with 1618, or finds the product gone and fails with 1605. Not elevated, step 1 ends by
saying Guardway is still installed and gives the msiexec /x line. Run as SYSTEM, gw-cli uninstall
cleans every user profile under C:\Users; run as a standard user, only that user’s own wiring.
When the un-wire check fails
gw-cli uninstall exits with 2 when it cannot verify that Claude Code is un-wired. Nothing is
stopped or removed, though it may already have un-wired some AI tools. From agent 0.2.219 the
console credential is kept, so the machine keeps reporting. Agents 0.2.217 and 0.2.218 hand it back
before the check, so Fleet shows Uninstalled and the agent, still running, cannot report. Fix the
file it names and run it again.
The MSI’s own removal cannot stop there: it removes the package even when its run of
gw-cli uninstall refuses. The data stays. With agent 0.2.219 and later a working credential stays
too, and what happens next depends on how the agent starts:
- Started by a scheduled task: the managed mode’s
com.guardway.gw-cli.tap, or the all-users sign-in taskai.guardway.gw-cli.servethat an elevatedgw-cli hook --observeinstalls. Both run a copy inC:\ProgramData\Guardway\bin, which the MSI does not remove. The agent starts again at the next boot or sign-in and keeps reporting: its Credential stays Own device credential, while Apps & features no longer lists Guardway. - Started only from the
Runentries: they point intoC:\Program Files\Guardway, which the MSI removes. The agent does not start again, and its Credential shows Own device credential, then Expired.
C:\ProgramData\Guardway behind: the copy runs from
inside that folder, and Windows cannot delete a program while it runs. Its output then has a
could not remove C:\ProgramData\Guardway line. Once the command has ended, delete the folder as
If the data folder stays behind says.
If the data folder stays behind
A full removal can leaveC:\ProgramData\Guardway behind, because Windows cannot delete a program
while it runs. That happens in two cases:
- A skill scan was still running. Where a scheduled task starts the agent, as in the managed
mode, the agent runs from
C:\ProgramData\Guardway\bin, and so do its skill scans (skillspector.exe). With agents up to 0.2.219, a scan that is still running when the removal stops the agent keeps running, so the folder stays. Agent 0.2.221 and later stop the scan before they delete the folder when the removal runs as SYSTEM, asmsiexec /xand an MDM’s command do. Run from an elevated prompt, they cannot see which program a managed-mode scan runs, so they wait up to 10 seconds for it to end. On a machine installed from the package, the package removal that follows runs as SYSTEM: it stops the scan if it is still running, and deletes the folder. - You ran the copy in
C:\ProgramData\Guardway\bin, as When the un-wire check fails says to. That copy cannot delete the folder it runs from, with any agent version.
gw-cli uninstall yourself, its output has a line
could not remove C:\ProgramData\Guardway: Access is denied, and it still ends with exit 0. The
rest of the removal is not affected: the AI tools are un-wired, the package is removed, and the
console credential is handed back as usual, so Fleet shows Uninstalled.
A removal that was refused, or that kept the data on purpose, also leaves the folder, and that
folder must stay. So before you delete anything, check from an elevated Command Prompt:
-
The removal went through. After a removal that went through,
C:\ProgramData\Guardway\bin\gw-cli.exeis gone andschtasksno longer finds thecom.guardway.gw-cli.taptask. That is so after the command in When the un-wire check fails too: the copy it runs is renamedgw-cli.oldand deleted shortly after the command ends. If either is still there, the removal was refused (see When the un-wire check fails) or kept the data on purpose (msiexec /x … KEEPDATA=1, which leaves both). Delete nothing. Both gone does not prove it in two cases. Delete nothing there either:- The agent was removed with
gw-cli uninstall --keep-data. Run elevated, it removes both too, and keeps the folder on purpose. - The machine was installed in the observe mode and never switched (see
The safer order). Only the
Runentries start its agent, so neither was ever there, and neither a running scan nor the copy inbincan keep the folder there.
- The agent was removed with
-
No skill is held there.
C:\ProgramData\Guardway\custodyandC:\ProgramData\Guardway\quarantineare missing or empty. A data folder that still holds skills the removal could not give back is kept on purpose, and the removal sayskeptfor it, notcould not remove(see Skill custody).quarantineis where agents 0.2.62 and 0.2.63 held skills, and no agent since gives those back. -
No scan is running.
tasklistfinds noskillspector.exe. A scan the removal left running has no time limit any more: if one is still there a minute later, end it withtaskkill /F /IM skillspector.exe.
gw-cli enroll as you did the first time
(Activate). The machine comes back on its old Fleet record, and
its Credential goes from Uninstalled back to Own device credential. Do not delete the
folder after that: it is the new install’s data folder.
Intune uninstall command
For an Intune Win32 app, use this uninstall command (one line), with the release’s ProductCode in place of{ProductCode}:
msiexec /x alone. That still removes the agent, but it cannot
keep the package when the un-wire check fails. What each part is for:
--from-package: Intune runs the command as SYSTEM, which is elevated, so a plaingw-cli uninstallwould start its ownmsiexec /xin the background and exit at once. Themsiexecon the command line would then race it: one of the two fails with1618, or the second finds the product gone (1605), and Intune reports a failure or retries a removal that may have worked.--from-packagestopsgw-clifrom starting its ownmsiexec; it changes nothing else.--data-dir "C:\ProgramData\Guardway": without it,gw-clirun as SYSTEM writes its log into SYSTEM’s own profile.|| exit /b 1: whengw-cli uninstallrefuses (exit2), nothing was stopped or removed and, with agent 0.2.219 and later, the console credential was kept (agents 0.2.217 and 0.2.218 hand it back before the check). But the AI tools may already be partly un-wired. The command then ends with1beforemsiexecruns, so the package stays, and so does the tool that un-wires the machine. Intune reports a failure, and the machine’s owngw-clioutput says why.else (msiexec …): whengw-cli.exeis missing, for example on a partial install, only the package removal runs. Without this branchcmdwould return9009, and Intune would retry that failure at every check-in.
msiexec’s: 0, 3010 (soft reboot), 1641 (hard reboot), or the
installer’s own failure code. Intune’s default return codes already cover 0, 3010 and 1641. A
refused first step gives 1.
Agents up to 0.2.218 and the Server service. gw-cli uninstall checks for elevation with
net session first, which fails when the Server service (LanmanServer) is disabled, even as SYSTEM.
Agents up to 0.2.218 then exit 1 before they change anything: the command above ends with 1,
msiexec never runs, and Intune retries at every check-in. msiexec /x alone still removes the
package, but its own run of gw-cli uninstall exits 1 too, so the agent’s own removal does not
run: the data, the scheduled tasks and the console credential stay, and so does the AI tools’
wiring, apart from what the package’s own steps take out (Live guard in the machine-wide settings,
and Claude Code’s telemetry settings). A Server service that is only stopped does not cause this:
net session starts it again. Agent 0.2.219 and later also count a process that can list the Task
Scheduler’s store as elevated, which SYSTEM can, so they do not need the Server service. On a
machine with the Server service disabled and an older agent, set the service back to Automatic and
start it for the removal, from an elevated prompt (disable it again afterwards if your policy needs
it off):
msiexec unconditionally:
2, or 1 for elevation), the package goes anyway,
taking gw-cli.exe in C:\Program Files\Guardway with it. That machine keeps Claude Code and
Cursor pointed at an agent that is not running, at least until the next boot. The data stays, and
with agent 0.2.219 and later so does the console credential;
When the un-wire check fails says what starts again and how to
finish. A missing gw-cli.exe gives 9009, and msiexec still runs.
Limits
- x86_64 only. Windows on ARM is not supported.
- Remote Desktop hosts with several users signed in at once may not get the agent started in every session until those users sign in again.
- MSIs older than 0.2.148 cannot update themselves; install a current MSI over them once.