Widget Build And Installer
How nwm build packages your widget and creates a self-contained installer.
Table of Contents
Build Command
Run from your widget project folder:
bash
nwm buildWhat nwm build Does
nwm build performs these steps:
- Validates required
meta.jsonfields. - Recreates
dist/from scratch. - Copies
Novadesk.exeintodist/and renames it to<name>.exe. - Copies your widget project into
dist/Widgets/(excludingdist/). - Applies metadata and icon to
<name>.exe. - Generates an installer executable in
dist/usinginstaller_stub.exe.
Output Structure
Typical output:
- dist/
- YourWidgetName.exe
- setup.exe
- Widgets/
- index.js
- ui/
- script.ui.js
- assets/
- icon.ico
- meta.json
setup.exe name depends on setup.setupName in meta.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
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:
json
{
"setup": {
"createDesktopShortcut": true,
"createStartupShortcut": false,
"runOnStartup": false,
"installDir": "%ProgramFiles%\\MyWidget",
"startMenuFolder": "MyWidget",
"setupName": "MyWidgetSetup",
"setupIcon": "assets/icon.ico",
"enableUninstall": true,
"launchAfterInstall": false
}
}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.
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.