Cody is packaged for Windows using electron-builder, which produces two distribution artifacts from a single command: an NSIS per-user installer and a self-contained portable executable. This page walks through everything needed to produce a distributable build — from setting up the environment and bumping the version number, through running the build pipeline, to verifying the installer on a clean machine before sharing it with the team.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/miu-ll/Cody-assistant/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
Before running any build commands, confirm the following are available on your Windows machine:Node.js
A Node.js version compatible with Electron 33. Run
node -v to check. Install via the official Node.js installer or winget install OpenJS.NodeJS.Windows
Builds must run on Windows — electron-builder’s NSIS and MSIX targets require Windows APIs and tooling that are not available on other platforms.
PowerShell
The
package:win script invokes a PowerShell post-build step (scripts/copy-release.ps1) to copy artifacts to the team work folder. PowerShell 5.1+ (built into Windows) is sufficient.Build commands
All commands usenpm.cmd (the correct Windows invocation of npm when called from PowerShell or a batch context):
What each script does
| Script | What it runs |
|---|---|
typecheck | tsc --noEmit — type-checks all TypeScript without emitting files |
build | tsc --noEmit && electron-vite build — type-check then bundle main + preload + renderer |
package:win | build → electron-builder --win → powershell … scripts/copy-release.ps1 |
package:store | build → electron-builder --win appx |
Output artifacts
Afternpm.cmd run package:win completes, two files appear in outputs/:
package:win script also copies both files to the team work folder via the post-build PowerShell script:
Choosing between installer and portable
NSIS Installer (Cody Setup …exe)
Use for standard team rollout. Installs per-user — no admin rights needed. Creates a desktop shortcut and Start Menu entry. Does not delete user data on uninstall, so tasks and preferences survive a reinstall.
Portable (Cody-…-portable.exe)
Use for demos, quick validation, or testing on a machine before a full install. No installation step — just run the
.exe. Ideal for smoke-testing a new build before distributing the installer.NSIS installer configuration
The NSIS target is configured in thensis section of package.json. Key settings:
oneClick: false— the installer shows a wizard with a license agreement screen (sourced frombuild/eula.txt) and a directory picker.perMachine: false— installs into the current user’s profile; no elevation prompt.allowToChangeInstallationDirectory: true— the user can choose where Cody is installed.deleteAppDataOnUninstall: false— uninstalling Cody does not delete tasks, settings, or any data under%APPDATA%/cody-desktop-assistant/. Users must manually delete that folder if they want a full wipe.
App identity
The application is identified by these values in thebuild section of package.json:
appId is used by Windows to associate the app with its installer entry, shortcuts, and notification toast registrations. Do not change it between versions without testing that upgrades work correctly.
Versioning
Before packaging a new release, update the version string in both files:Keeping both files in sync ensures that
npm ci on a fresh clone produces the same version as the build environment. A mismatch causes electron-builder to embed a different version string in the installer than what package.json reports.Release workflow
Follow these steps every time a new installer is being prepared for distribution:Verify a clean working tree
Run
git status and confirm there are no uncommitted code changes. Artifacts built from a dirty tree are not reproducible and cannot be traced to a specific commit.Bump the version number
Edit
version in both package.json and package-lock.json to the new release version (e.g. 0.12.0). Commit the change before building.Run the build and confirm it passes
Audit the commit for sensitive files
Confirm that none of the following are staged or present in the build output:
.envfiles of any name- API keys or credentials in any source file
- Files from
%APPDATA%/cody-desktop-assistant/ - Screenshots containing real email content or personal information
Update documentation if behavior changed
If this release changes how Cody handles data, network calls, or security controls, update
README.md, SECURITY.md, and PRIVACY.md accordingly before tagging the release.Package the installer and portable
Test the installer on a clean machine
Copy
outputs/Cody Setup <version>.exe to a machine where Cody has never been installed. Run the installer, complete onboarding, open Outlook Classic, and confirm sync works. Do not skip this step — issues with ASAR packaging or missing resources only appear on clean machines.MSIX / Microsoft Store packaging
For Store submission, additional identity values must be filled in under theappx section of package.json before running package:store. The placeholder values in the repository are:
identityName and publisher with the exact values from Microsoft Partner Center before running:
StartupTask requirement for launch-at-startup under MSIX.