
Security News
MCP Steering Committee Launches Official MCP Registry in Preview
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.
pkg-exe-build
Advanced tools
Configure Windows PKG package generated exe file icon and detailed information windows 平台下 配置图标及详细信息 使用 pkg 打包 生成 exe 文件
中文文档 | English Documentation
A Node.js tool for configuring Windows PKG package generated exe file icons and detailed information. This project is a fork of AngaBlue/exe version 2.0, with updates and improvements.
This version introduces several breaking changes compared to the 1.X series:
@yao-pkg/pkg
instead of the original pkg packagepkge
for easier usageInstall this package and save to devDependencies
using your package manager of choice.
npm i -D pkg-exe-build
You can also use the command line interface to build executables. The package provides a short CLI command alias pkge
for convenience:
npx pkge -e ./index.js -o ./build/My Cool App.exe
Option | Description | Required | Default Value | Example Value |
---|---|---|---|---|
-e, --entry | Path to the entry file of the application. | Yes | N/A | ./index.js |
-o, --out | Path for the output executable file. | Yes | N/A | ./build/My Cool App.exe |
-p, --pkg | Extra arguments for the pkg package. | No | [] | -C GZip |
-t, --target | Target node version and architecture. | No | latest-win-x64 | latest-win-x64 |
--app-version | Version of the application. | No | None | 2.4.2 |
-i, --icon | Path to the application's icon in .ico format. | No | Node.js icon | ./assets/icon.ico |
-l, --execution-level | Execution level for the application. | No | asInvoker | asInvoker |
--properties | Metadata for the executable file (JSON format). | No | None | '{"FileDescription":"My Cool App"}' |
Basic usage:
npx pkge -e ./index.js -o ./build/My Cool App.exe
Full parameters:
npx pkge \
-e ./index.js \
-o ./build/My Cool App.exe \
-p -C GZip \
-t latest-win-x64 \
--app-version 2.4.2 \
-i ./assets/icon.ico \
-l asInvoker \
--properties '{"FileDescription":"My Cool App","ProductName":"My Cool App","LegalCopyright":"PromiseAll https://github.com/PromiseAll","OriginalFilename":"My Cool App.exe"}'
// build.js
import pkgBuild from "pkg-exe-build";
const build = pkgBuild({
entry: "./index.js",
out: "./build/My Cool App.exe",
});
build.then(() => console.log("Build completed!"));
Or using CommonJS:
// build.js
const pkgBuild = require("pkg-exe-build");
const build = pkgBuild({
entry: "./index.js",
out: "./build/My Cool App.exe",
});
build.then(() => console.log("Build completed!"));
Specify more arguments and completely customize the resultant executable.
// build.js
import pkgBuild from "pkg-exe-build";
const build = pkgBuild({
entry: "./index.js",
out: "./build/My Cool App.exe",
pkg: ["-C", "GZip"], // Specify extra pkg arguments
version: "2.4.2",
target: "latest-win-x64",
icon: "./assets/icon.ico", // Application icons must be in .ico format
executionLevel: "asInvoker",
properties: {
FileDescription: "My Cool App",
ProductName: "My Cool App",
LegalCopyright: "PromiseAll https://github.com/PromiseAll",
OriginalFilename: "My Cool App.exe",
},
});
build.then(() => console.log("Build completed!"));
Option | Description | Required | Default Value | Example Value | Possible Values |
---|---|---|---|---|---|
entry | Path to the entry file of the application. | Yes | N/A | './index.js' | Any valid file path. |
out | Path for the output executable file. | Yes | N/A | './build/My Cool App.exe' | Any valid file path. |
pkg | Extra arguments for the pkg package. | No | [] | ['-C', 'GZip'] | Array of pkg arguments. |
version | Version of the application. | No | None | '2.4.2' | Semantic version string. e.g. major.minor.patch |
target | Target node version and architecture. | No | 'latest-win-x64' | 'latest-win-x64' | Windows pkg target string. e.g. latest-win-x64 , node18-windows-x64 , etc. |
icon | Path to the application's icon in .ico format. | No | Node.js icon | './assets/icon.ico' | Any valid .ico file path. |
executionLevel | Execution level for the application. | No | 'asInvoker' | 'asInvoker' | asInvoker , highestAvailable , requireAdministrator |
properties | Metadata for the executable file. | No | None | { FileDescription: 'My Cool App', ... } | Key-value pairs as shown in example. |
properties
:FileDescription
: Description of the executable.ProductName
: Name of the product.LegalCopyright
: Copyright details with the URL.OriginalFilename
: Name of the original file.To build the project:
npm run build
To run tests:
npm test
To run CLI tests:
npm run test:cli
Give a ⭐️ if this project helped you!
Copyright © PromiseAll.
This project is LGPL-3.0-or-later licensed.
This project is based on AngaBlue/exe version 2.0.
FAQs
Configure Windows PKG package generated exe file icon and detailed information windows 平台下 配置图标及详细信息 使用 pkg 打包 生成 exe 文件
The npm package pkg-exe-build receives a total of 11 weekly downloads. As such, pkg-exe-build popularity was classified as not popular.
We found that pkg-exe-build demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.
Product
Socket’s new Pull Request Stories give security teams clear visibility into dependency risks and outcomes across scanned pull requests.
Research
/Security News
npm author Qix’s account was compromised, with malicious versions of popular packages like chalk-template, color-convert, and strip-ansi published.