# Windows Installer Builder for Actors (`dtrungtin/windows-installer-builder`) Actor

Turns a Node.js actor's source code (.zip) into a Windows installer that runs the actor as a Windows service, managed from a local web console at https://localhost.

- **URL**: https://apify.com/dtrungtin/windows-installer-builder.md
- **Developed by:** [Tin](https://apify.com/dtrungtin) (community)
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $10.00 / installer built

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Windows Installer Builder for Actors

Turns the source code of a Node.js Apify actor into a Windows installer (`.exe`). The installed
actor runs as a Windows service and is managed from a local web console at `https://localhost`,
which works much like Apify Console: input form, runs, live log, results and exports, stored files,
abort, rerun and settings.

### How to use it

1. Download your actor's source code as a `.zip` (for example from the actor's **Source** tab in
   Apify Console), or have the URL of one ready (for example a GitHub archive link).
2. Start this actor and upload the zip in **Actor source code**. Optionally set the application
   name, version and service name.
3. When the run finishes, download the installer from the run's **Storage** tab: key-value store
   record `<ServiceName>-Setup-<version>.exe`. The dataset item has the same link plus the bundled
   Node.js and browser versions and any warnings.

A build takes about 5 to 15 minutes, mostly compressing the installer. The installer for a browser
actor is about 200 MB.

### Pricing

This Actor is priced per event: you pay a fixed price for each installer it builds and saves (the
**Installer built** event). The price is shown on the Actor's page in Apify Store. A run that fails,
for example because the source is not a Node.js actor, is not charged for an installer.

If the run's **Maximum cost per run** is lower than the price of one installer, the run stops right
away instead of building something it cannot deliver.

### What goes into the installer

| Part | Source |
| --- | --- |
| The actor's files | The zip, filtered by its `.dockerignore` like the Apify Docker build. TypeScript actors are built with `npm run build`. |
| npm packages | `npm install --omit=dev --os=win32 --cpu=x64`, so platform-specific packages are the Windows builds. |
| Node.js | Official Windows x64 build from nodejs.org, checksum verified. By default the major version from the actor's Dockerfile, raised to the oldest supported LTS when that one is end-of-life or too old for the packages. |
| Browser | Puppeteer actors get the Chrome build their Puppeteer version expects. Playwright actors get Playwright's Chromium, plus Firefox or WebKit when the source mentions them. Other actors get no browser. |
| Web console | Node.js only, no extra packages. |
| Service wrapper | [WinSW](https://github.com/winsw/winsw) 2.12.0, checksum verified. |

The start command comes from the Dockerfile's `CMD` and the matching `package.json` script, for
example `npm start` → `node src/main.js`. Set **Start command** if the actor starts differently.

### What the installer does on Windows

- Needs 64-bit Windows 10, Windows Server 2016 or later, and an administrator account.
- Installs to `C:\Program Files\<Application name>` and keeps data (runs, results, settings, logs)
  in `C:\ProgramData\<Service name>`, readable only by administrators and the service.
- Registers a service that starts automatically and runs under the low-privilege `LocalService`
  account.
- Creates a certificate for `localhost` and trusts it on the machine, so the console opens without
  a browser warning. The console listens on this computer only and has no login.
- Adds a Start menu shortcut to the console.

#### Upgrade

Run a newer installer over the old one. It keeps the folder, port, certificate and all data, and
re-registers the service. Runs in progress are aborted; the interactive installer asks first. The
service name identifies the installation, so keep it the same across versions.

#### Unattended install and uninstall

```powershell
MyActor-Setup-1.0.0.exe /S /PORT=8443
"C:\Program Files\My Actor\uninstall.exe" /S            # keeps the data
"C:\Program Files\My Actor\uninstall.exe" /S /PURGE     # also deletes the data
```

Exit code `10` means the files were installed but the service could not be configured, and `2`
means the port was invalid or in use. Details are in `C:\ProgramData\<Service name>\logs\setup.log`.

### Limits

- Only Node.js actors (JavaScript or TypeScript). Python actors are not supported.
- Packages with native code that is compiled or downloaded during installation (for example
  `better-sqlite3` or `sharp` without Windows prebuilds) will probably fail on Windows. The run
  lists them as warnings.
- The installed actor stores its data locally, not in Apify storage. Features that need the Apify
  platform (calling other actors, webhooks, Standby mode) do not work without extra setup.
- Apify Proxy works outside the platform only if your Apify plan includes "Proxy external access".
  Otherwise use your own proxies in the actor's input.

### Running the builder on your own computer

The builder runs on Linux or Windows with Node.js 20 or newer and NSIS (`makensis`):

```bash
npm install
## INPUT.json may also point to a local .zip or folder instead of a URL.
echo '{ "sourceZip": "/path/to/actor-source.zip" }' > storage/key_value_stores/default/INPUT.json
MAKENSIS=/path/to/makensis npm start
```

The installer is written to `dist/`. On Windows, set `WORK_DIR` to a short folder such as
`C:\build`, because `node_modules` paths get long. `KEEP_WORK_DIR=1` keeps the staged files for
inspection.

### Developing the web console

The console is in `template/console`. To try it against an actor checkout without installing:

```bash
cd /path/to/actor && npm install
node /path/to/installer-builder/template/console/server.js   # serves http://localhost:8080
```

# Actor input Schema

## `sourceZip` (type: `string`):

The actor's source code as a .zip file, such as the one you download from the actor's Source tab in Apify Console, or the URL of one (for example a GitHub archive). Only Node.js actors (JavaScript or TypeScript) are supported.

## `appName` (type: `string`):

Name shown in the installer, in Apps & features and as the service's display name. Defaults to the title in .actor/actor.json.

## `version` (type: `string`):

Installer version, for example 1.2.0. Defaults to the version in .actor/actor.json. Use a higher number for each release so upgrades are easy to tell apart.

## `serviceName` (type: `string`):

Windows service name. It also names the data folder in C:\ProgramData and identifies the installation for upgrades, so keep it the same across versions. Defaults to the actor name in PascalCase, for example SimpleBookingScraper.

## `defaultPort` (type: `integer`):

Port the installer suggests for the web console. With 443 the console is at https://localhost. The person installing can change it, and upgrades keep the port already in use.

## `publisher` (type: `string`):

Publisher shown in Apps & features and in the installer's file properties.

## `nodeVersion` (type: `string`):

Node.js version to bundle, as a major version (24) or an exact one (24.14.1). By default the builder uses the major version from the actor's Dockerfile, raised to the oldest supported LTS version when that one is end-of-life or too old for the actor's packages.

## `startCommand` (type: `string`):

How to start the actor, in the form "node <file>", for example "node dist/main.js". By default the builder reads it from the Dockerfile's CMD and the scripts in package.json.

## Actor input object example

```json
{
  "defaultPort": 443
}
```

# Actor output Schema

## `installer` (type: `string`):

Dataset item with the download link (installerUrl), file name, size, bundled Node.js version, browsers and warnings.

## `files` (type: `string`):

The run's default key-value store; the installer is the record named in the dataset item's fileName.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("dtrungtin/windows-installer-builder").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("dtrungtin/windows-installer-builder").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call dtrungtin/windows-installer-builder --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,dtrungtin/windows-installer-builder"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/29mUB5cG4uibi6UJe/builds/QDMYrUJWc5OeatfcZ/openapi.json
