📜 ⬆️ ⬇️

Own VPN client on JavaScript. Part 11 - Building an Application for Windows

PS Each part is a part, by itself it does not make sense to get the necessary context and not to experience cognitive dissonance from the lack of so necessary blocks of text, start reading from part 1

This time I’ll compile the application with the npm module of the electron-builder , thanks to the developers for the convenient documentation for the module and many examples of config settings (no).

Last time I collected the npm application with the electron-packager module , as far as I know, it cannot build in exe, in any case at that time I could not do it.

The contents of the package.json file.

1 { 2 "name": "JS.VPN-Client", 3 "version": "0.3.77", 4 "description": "VPN Client", 5 "main": "index.js", 6 "homepage": "https://github.com/JsusDev/JS.VPN-Client", 7 "build": { 8 "appId": "JS.VPN-Client", 9 "productName": "JS.VPN-Client", 10 "copyright": "JSus & Developments 2018", 11 "win": { 12 "target": "nsis", 13 "icon": "icon.ico", 14 "legalTrademarks": "JSus & Developments 2018", 15 "asar": false 16 } 17 }, 18 "author": { 19 "name": "JSus & Developments", 20 "email": "jsusdev@yandex.ru" 21 }, 22 "license": "ISC", 23 "dependencies": { 24 "child_process": "^1.0.2", 25 "fs": "^0.0.1-security", 26 "ipify": "^2.0.0", 27 "js-base64": "^2.4.9", 28 "request": "^2.88.0" 29 } 30 } 

Parsing package.json
LineDescription
2Package Name (required)
3Package / Application Version (Required)
fourPackage / Application Description
fivePackage entry point
6Package / Application Home Page
7Config object for electron-builder
eightApplicationUserModelId (AUMID) is a combination of PackageFamilyName and PackageRelativeApplicationID (PRAID) - I do not know what it is
9The name of the application (if you do not specify the value will be taken from the name)
tenCopyright
elevenBuild Platform (win, mac, linux) (required)
12How to package the application (7z, zip, tar.xz, tar.lz, tar.gz, tar.bz2, dir, etc) (required)
13Application icon (if you do not specify it will be standard)
14Trademarks
15The way of internal archiving of the application must be disabled because it removes files with the exe extension.
18Publisher, you can specify a string
23Dependencies, among them there should be no electron otherwise there will be an error

')
To build the application itself, use the command

 electron-builder build 

image

After N minutes ...

image

During the build process, a dist folder will be created in the project root.

image

After the build is completed in the folder, you can find the file to install

image

image

The application is ready for publication!


Project page on Github

Well, how do you like this Ilon Musk?

Poki smacks benches shops.


VPN   JavaScript by JSus

Source: https://habr.com/ru/post/429446/


All Articles