Skip to main content
AI tutorials

Package DeepSeek Harness as a Node.js-Free Single-File Windows Installer

This tutorial explains how to use DeepSeek Harness Easy-Setup to package dsh and portable Node.js into a single-file Windows installer, then install, launch, test, troubleshoot logs, and configure versions.

Package DeepSeek Harness as a Node.js-Free Windows Installer

Project Overview

DeepSeek Harness Easy-Setup is a Windows packaging project. It combines the @deepseek-ai/dsh command-line program, a portable Node.js runtime, a launcher, and a stopper into one installer.

End users do not need to install Node.js, npm, or other dependencies in advance. After installation, they can launch dsh web through the shortcut on the desktop or in the Start menu. The browser opens automatically once the service is ready.

Features After Installation

  • Creates “DeepSeek Harness” shortcuts on the desktop and in the Start menu.
  • Creates a “Stop DeepSeek Harness” shortcut to terminate the running service.
  • The launcher runs dsh web and opens the browser automatically after the service starts.
  • The Start menu provides an uninstall entry, and the program also appears in the Windows Apps list.
  • Uses the whale favicon included with the dsh frontend as the application icon.
  • Installs for the current user without triggering UAC elevation.

The default installation directory is:

%LOCALAPPDATA%\Programs\DeepSeekHarness

Users can also choose another directory in the installation wizard.

Understanding the Project Directory

Before starting the build, review the purpose of these key directories and files:

  • build\build.ps1: The main build entry point. It fetches dsh, downloads portable Node.js, generates the icon, compiles the launcher and stopper, and creates the installer.
  • build\fetch-nsis.ps1: Downloads portable NSIS 3.11 and tries other mirrors if the SourceForge mirror is unavailable.
  • src\Launcher.cs: Launcher source code, compiled into DeepSeekHarness.exe.
  • src\Stopper.cs: Stopper source code, compiled into DeepSeekHarnessStop.exe.
  • src\installer.nsi: The NSIS installer script.
  • src\icon\build-icon.js: Uses the sharp package included with dsh to convert the whale SVG into a multi-size ICO file.
  • test\test-install.ps1: Runs silent installation, file checks, launch, stop, HTTP, and uninstall tests.
  • work\: Stores intermediate files such as the Node.js archive, NSIS, and staging files. It can be deleted or retained to speed up later builds.
  • out\: Stores the final single-file installer.

Prepare the Build Environment

The build machine must meet these requirements:

  • Windows 10 or Windows 11 x64.
  • PowerShell 5.1.
  • .NET Framework 4.x.
  • Node.js installed, with node.exe available on PATH, or an explicit path specified during the build.
  • Access to nodejs.org and SourceForge.

The project uses the system C# compiler to compile two executables. Its default path is:

C:\Windows\Microsoft.NET\Framework64\v4.0.30319\csc.exe

If NSIS 3.x is not installed, the build script automatically downloads the portable version to work\nsis.

Important: The project path must not contain spaces because makensis command-line definition parameters cannot correctly handle paths containing spaces.

Step 1: Install dsh

The build script reads @deepseek-ai/dsh from the global npm directory by default. Run this on the build machine first:

npm i -g @deepseek-ai/dsh

The default package directory is:

%APPDATA%\npm\node_modules\@deepseek-ai\dsh

If dsh is located elsewhere, specify its location later with the -DshSource parameter.

Step 2: Build the Single-File Installer

From the project root, run:

powershell -ExecutionPolicy Bypass -File build\build.ps1

The script prepares the dsh files, portable Node.js, application icon, C# launcher, stopper, and NSIS installer in sequence. The default output is similar to:

out\DeepSeekHarness-Setup-0.1.1.exe

The README reports that the example installer is approximately 44 MB.

Common Build Parameters

  • -DshSource <directory>: Specifies the dsh package directory.
  • -NodeExe <path>: Specifies the node.exe on the build machine.
  • -AppVersion <version>: Overrides the installer version.
  • -WorkDir <directory>: Changes the intermediate file directory.
  • -OutDir <directory>: Changes the installer output directory.

For example, to use custom dsh and Node.js paths and a custom version:

powershell -ExecutionPolicy Bypass -File build\build.ps1 -DshSource C:\dev\dsh -NodeExe C:\nodejs\node.exe -AppVersion 0.1.1 -OutDir C:\dsh-output

By default, the version is taken from dsh's package.json. Prerelease versions are converted to the base version; for example, 0.1.1-rc.2 produces 0.1.1.

Files in work\ are retained and reused. The Node.js archive is not downloaded again after the initial download, and the extracted NSIS directory is reused as well.

Step 3: Install and Use the Application

After the build completes, double-click the installer in the out\ directory and complete the installation wizard. Because it uses per-user installation, it does not normally display a UAC elevation prompt.

  1. Double-click “DeepSeek Harness” on the desktop or in the Start menu.
  2. The launcher runs dsh web.
  3. When the service becomes available, the default browser opens the corresponding page automatically.
  4. To stop the service, run “Stop DeepSeek Harness”.
  5. To remove the program, use the uninstall entry in the Start menu or the Windows Apps list.

You can also install silently to the default directory:

out\DeepSeekHarness-Setup-0.1.1.exe /S

Step 4: Run the Automated Tests

The project provides a test script covering the complete installation process:

powershell -ExecutionPolicy Bypass -File test\test-install.ps1

The test script performs these operations:

  1. Silently installs to testinstall\ under the project directory.
  2. Checks the installation files and shortcuts individually.
  3. Uses simulated entry points to verify launcher and stopper behavior.
  4. Uses the portable Node.js in the installation directory to actually start dsh web once.
  5. Checks for an HTTP 200 response on the default test port 3999, avoiding the commonly used 3080 port.
  6. Uninstalls the program and checks the result.

The output includes multiple check messages beginning with ###. The final line should be:

ALL CHECKS PASSED

If a test fails, the number of failed items is shown at the end.

Note: The shortcuts created by the test use exactly the same names as those created by a regular installation. Therefore, while the test is running, the shortcuts on the current user's desktop and in the Start menu temporarily point to testinstall\ and are deleted during uninstallation. To restore the regular installation afterward, run the installer's silent installation command again.

Runtime Logs and Troubleshooting

Important runtime state files are stored at:

%LOCALAPPDATA%\DeepSeekHarness\pid.txt
%LOCALAPPDATA%\DeepSeekHarness\run.log
  • pid.txt stores the process ID of the running dsh process. The stopper uses it to locate the target process.
  • run.log stores dsh standard output and standard error.

If startup fails, the launcher displays the location of run.log in a dialog box. During troubleshooting, check this log first to identify port conflicts, dependency-loading problems, or service startup errors.

Advanced Tips and Implementation Notes

Keep the Node.js Version Compatible with Native Modules

dsh dependencies include native modules such as node-pty, sharp, and koffi. Portable Node.js must be compatible with these modules, so the build script defaults to the same Node.js version as the build machine. When changing -NodeExe, verify again that the installer starts normally.

Avoid Starting Duplicate Services

When dsh is already running on the default 3080 port, double-clicking the launcher again does not create a second instance. The launcher checks whether the process in the PID file is still running and opens the existing service page directly.

Keep the Launcher Running

After starting dsh, the launcher remains in the background as the host process, continuously writing standard output and standard error to run.log until dsh exits. If the launcher ends immediately, the output pipes are closed and dsh may encounter EPIPE when it writes subsequent log entries.

Wait Properly for NSIS Uninstallation to Finish

The NSIS uninstaller first copies itself to %TEMP% and then continues running from the temporary directory. The original uninstall process exits shortly afterward. Therefore, automation scripts cannot simply wait for the original process to end; they should poll until the installation directory disappears. The project's test-install.ps1 already provides this implementation.

Pay Attention to Installer Script Encoding

installer.nsi must use UTF-8 BOM or UTF-16LE. Otherwise, NSIS reports Bad text encoding. The source file in the repository is UTF-8 without a BOM, and build.ps1 converts it to UTF-16LE before invoking makensis.

Control the Installer Size

The packaging process removes files that are not loaded in a Windows x64 environment, including the Darwin, Linux, and ARM64 prebuilt files for node-pty and the WASM version of sharp. The README states that this saves approximately 30 MB.

License

dsh is licensed under the MIT License. See the LICENSE file in the dsh package for details. The installer scripts in this project are also released under the MIT License. The whale icon comes from dsh frontend assets and is copyrighted by DeepSeek.

Summary

DeepSeek Harness Easy-Setup combines dsh, portable Node.js, Windows start and stop programs, and the NSIS installation process. After preparing the environment, install dsh globally and run build\build.ps1 to generate a single-file installer that does not require Node.js to be preinstalled on the target machine. Before release, run the complete test script and pay particular attention to the logs, Node.js version compatibility, and shortcut restoration.