Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to package and distribute Node Webkit NW.js app in windows with nw-builder

I assumed Node Webkit would make it simple to package up and add to Windows as a single executable file, however it seems it doesn't and they recommend using https://github.com/evshiron/nwjs-builder

So I installed nw-builder and managed to get a build folder containing all the files needed and the .exe file.

What next? There are no other clear instructions on that page! How is this then installed onto windows?

Can anyone help direct me to or provide simple step by step instructions for dummies? I find all this really confusing.

please help, thanks :)

like image 690
LeeTee Avatar asked Jul 26 '16 12:07

LeeTee


People also ask

What is NWJS app?

April 22, 2021 5 min read. NW. js, previously known as node-webkit, is among the community's favorite Electron alternatives for native application development. Like its competitor, NW. js also enables the easy setup of cross-platform desktop applications simply by using the core trio of HTML, CSS, and JavaScript.


1 Answers

  1. Zip up your entire application directory package.json should be in the root of the zip file.

  2. Rename the zip to app.nw

  3. Run this command from the command line copy /b nw.exe+app.nw app.exe

Please note that you must distribute the file nw.pak alongside with your newly created app.exe

This is a NullSoft Installer script you can use to package and distribute your app:

Name "App-name"
OutFile "app-installer.exe"
Requestexecutionlevel user

InstallDir $PROGRAMFILES\app-name

Page instfiles

Section "instfiles"

    SetOutPath $INSTDIR
    File "app.exe"
    File "nw.pak"
    File "icudtl.dat"


    WriteUninstaller $INSTDIR\Uninstall.exe
    CreateDirectory "$SMPROGRAMS\app-name"
    CreateShortCut "$SMPROGRAMS\app-name\Uninstall.lnk" "$INSTDIR\Uninstall.exe"
    CreateShortCut "$SMPROGRAMS\app-name\run-app.lnk" "$INSTDIR\app.exe"
SectionEnd



Section "uninstall"
    Delete $INSTDIR\*
    Delete $INSTDIR\uninstall.exe
    RMDir $INSTDIR

    Delete "$SMPROGRAMS\app-name\*"
    RMDir "$SMPROGRAMS\app-name"
SectionEnd

It's stripped down version of my own script I used for distributing a nw.js app.

like image 131
Jorgen Avatar answered Oct 20 '22 16:10

Jorgen