1.1.15 • Published 6 years ago

nexe-deploy-utils v1.1.15

Weekly downloads
5
License
ISC
Repository
github
Last release
6 years ago

DeployUtils

Designed to be a very simple way to deploy a windows application. The tools are written in typescript.

Usage

  1. Include the dependencies.
npm i nexe nexe-deploy-utils
  1. Create a TS or JS main file for your node application, and add in some build steps:
import { Engine, write } from 'nexe-deploy-utils';

(async() => {
    let engine = new Engine();
    await engine.describe('my sample package')
        .step(() => write('This is step 1 in the deployment.'))
        .exec();
})();

That's it! You can test it by running 'node index.js'.

A more Useful Example

Say you had a few steps that looked like this:

(async () => {

    let engine = new Engine();
    await engine.describe("Install Example Product")
        .step(() => unpack('./resources/samplezip.zip', 'release.zip'), "Unpacking Release Zip")
        .step(() => unzip('release.zip', 'release'), "Unzipping Release")
        .step(() => copy('release/example.txt', 'release/test.txt'), 'Copying Configuration')
        .step(() => stopService('bthserv'), 'Stopping Bluetooth Service')
        .step(() => startService('bthserv'), 'Starting Bluetooth Service')
        .exec();

})();

So in order to create a useful "install.exe", we'll need to tell nexe to package up the zip file inside of our resources folder. We can do that by the following NPM script:

"build": "nexe -r resources/samplezip.zip -o dist/install.exe"

And now we can run 'npm run build' to create our dist/install.exe file.

Running the install.exe as an administrator produces this output:

Install Example Product - 5 steps.
Build Step 1: Unpacking Release Zip... success
Build Step 2: Unzipping Release... success
Build Step 3: Copying Configuration... success
Build Step 4: Stopping Bluetooth Service... success
Build Step 5: Starting Bluetooth Service... success

And we have successfully deployed our application!

Features

Similar to 'write', as shown above, other deployment tools exist for the developer.

Basic Tools

  • copy: Copies folders and files to a new location.

  • write: Just a simple console logging tool that has some options for colors and newline characters.

  • unpack: Unpacks a nexe-packed file inside of your executable to a new location. You can pack a file into your nexe-build executable using the '-r' switch.

note: Nexe uses globby for glob parsing. You can include multiple files with brackets: "{./fileone,./filetwo}".

  • unzip: Unzips a zip file to a new location.

  • assert: Fails if your assert expression returns false.

  • killAll: Given a folder, kills all processes that have a handle (or file lock) on the folder's children. This tool uses handle.

note: To use killall, you must add handle64 (located in ./node_modules/nexe-deploy-utils/bin/handle64) and unpack it as './handle64.exe'.

  • mkdir: Makes directories (and sub directories) using the windows 'mkdir' command. This is similar to linux 'mkdir -p'.

IIS Tools

  • addSSL: Adds an SSL certificate to an IIS port. Affects all websites running under that port.

  • deleteSite: Deletes an IIS website.

  • newApp: Adds a new application under an existing IIS website.

  • newSite: Adds an IIS website.

  • startSite Starts an IIS website. However, sites should auto-start on addition if they are configured correctly.

  • newAppPool: Adds an application pool into IIS.

Service Tools

  • deleteService: Deletes a windows service.

  • newService: Adds a new windows service.

  • startService: Starts a windows service.

  • stopService: Stops a windows service.

More features to come!

1.1.15

6 years ago

1.1.14

6 years ago

1.1.13

6 years ago

1.1.12

6 years ago

1.1.11

6 years ago

1.1.10

6 years ago

1.1.9

6 years ago

1.1.8

6 years ago

1.1.7

6 years ago

1.1.6

6 years ago

1.1.5

6 years ago

1.1.4

6 years ago

1.1.3

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.22

6 years ago

1.0.21

6 years ago

1.0.20

6 years ago

1.0.19

6 years ago

1.0.18

6 years ago

1.0.16

6 years ago

1.0.15

6 years ago

1.0.14

6 years ago

1.0.13

6 years ago

1.0.12

6 years ago

1.0.11

6 years ago

1.0.10

6 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago