• This repository has been archived on 19/Jun/2019
  • Stars
    star
    117
  • Rank 301,828 (Top 6 %)
  • Language
    JavaScript
  • Created over 8 years ago
  • Updated over 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

build installer by electron-prebuild & inno-setup

Build Your Installer Easy to RELEASE & UPDATE

npm version

Docker Build Status

Youtube

Installation

  • npm install electron-windows-inno-installer -g

Required(or using [[docker](#Build with Docker)])

  • wine brew install wine --devel
  • gulp npm install gulp -g

Build Your Project

need your *.iss file in your work directory

you can using electron-windows-inno-installer --make-iss and then vim example.iss to make your setup.iss file

rm -rf release/
electron-windows-inno-installer ./setup.iss --platform win32-x64 --icon ./favicon.ico

electron-windows-inno-installer will pack all you local file without directory , if you want customs pack files ,you can use 'sourceFiles' field in you package.json like this

    ...

    "dependencies": {
          "electron-windows-inno-installer": "^0.1.3"
    },
    "sourceFiles":[ "./index.js","./favicon.ico","./www/**/**"],

    ...

Build with Docker

docker run --rm -v ${pwd}:/app -w /app/ quanwei/electron-windows-inno-installer example.iss --platform win32-x64

example.iss

  • #define SourcePath "release/v1.4.3/win32-ia32/"

sourcePath is release/{electron-version}/{platform}

  • #define MyAppExeName "example.exe"

MyAppExeName is {package.json.name}.exe

AutoUpdater

  • npm install electron-windows-inno-installer --save
(electron app.js)

const autoupdater = require('electron-windows-inno-installer');

//support http/https
autoupdater.setFeedURL('http://demo/releases.json');

//release.json:
//{
  //"name": "demo1.1.2",
  //"version": "1.1.2",
  //"date": "2016-08-09",
  //"changelog": "upgrade \n\n\n\n\n?",
  //"updateURL": "http://10.8.3.31:8000/setup.exe"
//}

autoupdater.on('update-downloaded',function(releasefileJSON,fullpath){
  console.log('release notes: ',releasefileJSON.changelog)
  console.log('write to :',fullpath);
  autoupdater.quitAndInstall(); // Upgrade
});

autoupdater.on('update-not-available',function(){
  console.log('INFO: Update not available');
});

autoupdater.on('update-available',function(releasefileJSON,next){
  console.log('INFO: Update available',releasefileJSON);
  next(); //will be download
});

autoupdater.on('progress',function(progress){
  console.log(progress);  // download progress
});

workflow:

(some html/js/css) -> electron-prebuild -> gulp-inno -> installer.exe

event

Event:checking-for-update

Emmitted when updater starts checking update, after 'checkForupdates'

Event: update-not-available

Emmitted when update unavailable,usually the version lowwer current version or server response is '204'

Event: update-available

Returns:

  • releasejson : object
  • next : function

Emmitted when update available, you will be invoke next tell updater to download this installer

Event: update-downloaded

Returns:

  • releasejson: object
  • fullpath: string

Emmitted when the installer package is downloaded. from then on , you can execute updater.quitAndinstall() to quit current process and install installer.

Event error

Returns:

  • err : object

Emmitted when throw a error

Event done

Emmitted when updater stopped work

Event progress

Returns: progress

the downloaded progress

Methods

setFeedURL

Params:

  • url : string

set feed url

checkForUpdates

Params:

  • isForce : bool

if isForce is true , updater will do not check version

start updater , updater will feed a update object from feedurl, updater will checking this object that has field version

quitAndinstall

when the event of update-downloade emmitted, thie method will quit-and-install the new installer

FAQ

There are some case in your building.

  • Download electron-v{version}-win32-x64.zip is slowly or failure

download the file from https://github.com/electron/electron/releases or https://npm.taobao.org/mirrors/electron/ to directory .cache/{version}/{platform}.

example wget https://npm.taobao.org/mirrors/electron/1.3.1/electron-v1.3.1-win32-ia32.zip -P /you/project/.cache/v1.3.1/

Contribution

Very pleasure with anyone contribute code

More Repositories

1

trackpoint-tools

Javascript 无痕埋点辅助工具库(React,Vue),track everywhere,
JavaScript
367
star
2

gante

great gante project
JavaScript
57
star
3

emacs

一生的emacs配置
Python
54
star
4

windows-open-source-apps

windows下的极好开源替代软件
51
star
5

emacs-guess-word-game

emacs guess word game for learning ESL. Emacs 背单词
Emacs Lisp
51
star
6

electron-webtoon

一个webtoon漫画阅读软件(阅读器), Webtoon Viewer, 条漫阅读器
JavaScript
46
star
7

OverAssert

Javascript函数式表单校验库,可组合,可复用,函数式。
JavaScript
14
star
8

auto-beautify.el

js-auto-beautify : emacs mirror-mode auto format Javascript js/jsx
Emacs Lisp
10
star
9

n2c

number convert to chinese
JavaScript
9
star
10

vue-event-debounce

vue-plugin: block event when callback is pedding!
JavaScript
5
star
11

a-webtoon-spider

😈 ⚡ use puppeteer download webtoon from pphanman.com.
JavaScript
5
star
12

js-downloader

Javascript downloader
JavaScript
4
star
13

host-your-folder

Easy Host Local Folder 🎉🎉🎉
JavaScript
3
star
14

recoil-sharedb

recoil connect with sharedb
TypeScript
3
star
15

cpm

c库管理器
Shell
3
star
16

ReadList

3
star
17

CPJCode

C++
2
star
18

tiny-event-manager

tiny event manager
JavaScript
2
star
19

vuex-lens

vue state lenses
TypeScript
2
star
20

web-narrow-mode

minor mode , narrow for web-mode
Emacs Lisp
1
star
21

docker-emacs-email

Emacs and email client with docker compose
Dockerfile
1
star
22

a-toutiao-statistic-spider

1
star
23

istio-helm

A mirror of official istio helm chart
Smarty
1
star
24

recoil-enhance

Enhance recoil
TypeScript
1
star
25

gante-server

JavaScript
1
star
26

react-virtuallist

React 长列表性能优化 (暂未发包)
JavaScript
1
star
27

ramdascript-loader

ramdascript loader for webpack@1,2,3
JavaScript
1
star
28

copycode

JavaScript
1
star