Widget Build And Installer
How nwm build currently packages your widget into installer and .ndpkg artifacts.
Table of Contents
Build Command
Run from your widget project folder:
nwm buildWhat nwm build Does (Latest)
nwm build performs these steps:
- Validates required
meta.jsonfields. - Recreates
dist/from scratch. - Creates temporary staging folders for installer and
.ndpkgpackaging. - Copies
Novadesk.exeinto staging and renames it to<WidgetName>.exe. - Copies requested addons into staging:
- Installer staging gets all requested addons from
meta.json. .ndpkgstaging excludes default built-in addons and keeps only non-default requested addons.
- Installer staging gets all requested addons from
- Copies widget files (excluding
dist/) into staging. - Applies version/company/description/icon metadata to
<WidgetName>.exe. - Builds a self-extracting setup executable using
installer_stub.exe. - Creates a distributable ZIP package.
- Creates a
.ndpkgpackage with metadata and an NDPKG footer.
Output Structure
Typical output:
- dist/
- YourWidgetName_v1.0.0.0.zip
- setup.exe
- YourWidgetName_v1.0.0.0.ndpkg
Notes:
- ZIP name is generated as
<SanitizedWidgetName>_v<SanitizedVersion>.zip. .ndpkgname is generated as<SanitizedWidgetName>_v<SanitizedVersion>.ndpkg.- Setup EXE name depends on
setup.setupNameinmeta.json.
Required meta.json Fields
nwm build fails if any of these are missing or empty:
Top-level:
nameversionauthordescriptionicon
setup object:
setup.installDirsetup.startMenuFoldersetup.setupNamesetup.setupIcon
excludeItems (Packaging Exclude List)
Use optional excludeItems in meta.json to skip files/folders from both installer and .ndpkg widget payload copies.
{
"excludeItems": [
"node_modules",
".git",
"dist",
"scripts/dev-only.js",
"assets/raw"
]
}Rules:
excludeItemsmust be an array of strings.- Entries are relative paths/pattern-like path prefixes from widget root.
distis excluded by default during packaging.- Invalid
excludeItemstypes causenwm buildvalidation failure.
setup Options
Supported installer options:
setup.createDesktopShortcut(boolean, defaulttrue)setup.createStartupShortcut(boolean, defaultfalse)setup.runOnStartup(boolean, defaultfalse)setup.installDir(string, required)setup.startMenuFolder(string, required)setup.setupName(string, required)setup.setupIcon(string, required)setup.enableUninstall(boolean, defaulttrue)setup.launchAfterInstall(boolean, defaultfalse)
Example:
{
"setup": {
"createDesktopShortcut": true,
"createStartupShortcut": false,
"runOnStartup": false,
"installDir": "%ProgramFiles%\\MyWidget",
"startMenuFolder": "MyWidget",
"setupName": "MyWidgetSetup",
"setupIcon": "assets/icon.ico",
"enableUninstall": true,
"launchAfterInstall": false
}
}Addons (Detailed)
Addons are controlled by the optional addons array in your widget meta.json.
Example:
{
"addons": ["InputBox", "NowPlaying", "CustomAddon.dll"]
}Addon Name Rules in meta.json
- Each
addonsentry must be a string. - You can provide either:
- DLL file name (for example
NowPlaying.dll) - or stem name without extension (for example
NowPlaying)
- DLL file name (for example
- Matching is case-insensitive.
- Duplicate references to the same DLL are deduplicated during packaging.
- If any requested addon cannot be found,
nwm buildfails.
Where nwm build Reads Addons From
nwm build resolves addon source path from the Novadesk installation mode:
- Portable install:
<NovadeskExeDirectory>/Addons - Standard install:
%USERPROFILE%\\Documents\\Novadesk\\Addons
If no addons are requested, addon copying is skipped.
Setup EXE / ZIP Addon Inclusion
For setup/ZIP packaging, all requested addons are copied into staging Addons/ and bundled into installer payload files.
That means the setup installer installs requested addons together with the widget package files.
.ndpkg Addon Inclusion
For .ndpkg packaging, nwm build filters out default built-in addons and includes only non-default requested addons.
Default addon names treated as built-in include:
AppVolume/AppVolume.dllAudioLevel/AudioLevel.dllBrightness/Brightness.dllHotkey/Hotkey.dllNowPlaying/NowPlaying.dll
The included addon file names are written to ndpkg.json:
{
"addons": ["CustomAddon.dll"]
}If no non-default addons remain after filtering, .ndpkg can still be valid with no addon files.
Addons in ndpkg_installer.exe
When opening a package, ndpkg_installer.exe:
- Reads addon candidates from extracted
Addons/files. - Uses
ndpkg.json.addonsas a preferred order/filter signal. - Shows addon rows with status:
Add(not currently installed)Replace(installed and package version is same/older/unknown comparison result)Newer Version Found(installed addon version is newer than package addon)
- Allows checkbox selection per addon before install.
- Copies only checked addons into target
Addonsdirectory using overwrite behavior.
Addon Install Targets
Addon destination follows resolved install mode:
- Portable Novadesk:
<NovadeskFolder>/Addons - Standard Novadesk:
%USERPROFILE%\\Documents\\Novadesk\\Addons
Installer Name Rules
- Installer output name comes from
setup.setupName. - If
.exeis missing,nwmappends it automatically.
Examples:
setupName: "setup"->dist/setup.exesetupName: "MyWidgetSetup"->dist/MyWidgetSetup.exesetupName: "MyWidgetSetup.exe"->dist/MyWidgetSetup.exe
Installer Stub Behavior
nwm uses installer_stub.exe as the base executable for the installer.
Lookup order:
- Next to
nwm.exe - Parent directory fallback
- Fallback to
nwm.exe(with warning) if stub is not found
Install-Time Behavior
When the generated installer runs:
- Installs files to
setup.installDir(environment variables are expanded). - Creates Start Menu shortcut in
setup.startMenuFolder. - Optionally creates Desktop shortcut.
- Optionally creates Startup shortcut (
createStartupShortcutorrunOnStartup). - Optionally creates
Uninstall.exeand uninstall registry entry.
.ndpkg Package Format
nwm build now also creates a widget package with .ndpkg extension.
Internally, .ndpkg is:
- A ZIP payload containing widget package files.
- A 16-byte footer appended at the end:
- magic:
NDPKG1 - format version:
1
- magic:
The installer validates this footer before extraction.
.ndpkg Contents
Typical package structure:
- YourWidgetName_v1.0.0.0.ndpkg
- ZIP payload)
- ndpkg.json
- preview.png optional extension depends on source
- Widgets/
- YourWidgetName/
- index.js
- meta.json
- ui
- assets
- YourWidgetName/
- / optional
- SomeAddon.dll
ndpkg.json is generated by nwm build and includes:
name(string)version(string)author(string)addons(array of addon DLL names included in the package)
.ndpkg Installer Behavior
ndpkg_installer.exe:
- Accepts
.ndpkgpath argument or opens a file picker. - Validates the NDPKG footer and extracts payload.
- Requires
ndpkg.jsonandWidgets/to exist in the package. - Installs to:
- Portable Novadesk:
<NovadeskFolder>/Widgetsand<NovadeskFolder>/Addons - Standard Novadesk:
%USERPROFILE%\\Documents\\Novadesk\\Widgetsand...\\Addons
- Portable Novadesk:
- Shows included addons and allows checkbox-based addon install selection.
- Marks addon rows as Add/Replace/Newer Version Found based on installed DLL version info.
Notes
iconis used for the built app executable (YourWidgetName.exe).setup.setupIconis used for the installer executable.- Unknown extra keys in
setupare ignored. createStartupShortcutandrunOnStartupcurrently result in the same behavior (Startup shortcut creation).launchAfterInstallis carried in installer metadata but is not currently acted on by the installer runtime.