Skip to content
This repository has been archived by the owner on Sep 5, 2020. It is now read-only.

Commit

Permalink
NSIS installer (#1499)
Browse files Browse the repository at this point in the history
* Update travis config to new format

* fixes

* install gulp

* fixes

* tweaks

* use same install & script tasks for all builds

* Expand build matrix

* tweaks

* fixes

* try to fix wine installation

* Enable mac build

* Extend run time to 30 minutes

* see if extra dependencies resolves build issue for linwin

* Install yarn with npm on osx

* linux and windows in one

* Add gulp to Mac

* Bump timeout to 60 minutes

* remove download-signatures from processing / travis tweaks

* cleanup

* enable gitter notifications

* fix bash double ampersand

* try to build nsis script

* fix nsis verbosity flag

* Customized NSIS installer

* Fix order of commands

* Improve uninstaller

* Add logic and movefile plugins

* Enable separate DATADIR location

* Remove INSTDIR and replace with FILEDIR

* Fix compiler warnings about unknown variables

* Enforce UAC admin requirement

* Move NSI to scripts directory and add plugins

* Include version in output filename

* Remove duplicate execution level command

* Move files from nested folder into main folder

* Update shortcut names and params

* initial architecture detection + various cleanup

* More flexible environment vars

* Cleanup

* User-selectable location for Mist's data files

* Include icon in installation directory

* Cleanup

* Improve/fix registry entries

* Show shortcuts after successful installation

* Estimate installation size

* Fix removal of start menu shortcuts

* Open DATADIR and NODEDATADIR on uninstallation

* Handle firewall rules

* Disable firewall updates

* Include multiple architectures into single installer

* Don't allow user to select Mist data directory

* Integrate NSIS build into Gulp

* Cleanup lint suggestions

* Cleanup more lint suggestions

* One more linter fix

* Remove testnet startmenu entry

* Double the estimated installed size

* Create desktop shortcut

* Delete temporary zips

* Store user settings in HKCU for uninstallation

* Remove user registry settings on uninstallation

* Improved uninstallation to not rely on stack variables

* Compute actual program directory size

* Cleanup
  • Loading branch information
tgerring authored and frozeman committed Jan 19, 2017
1 parent 36e89b3 commit 7825db9
Show file tree
Hide file tree
Showing 9 changed files with 1,078 additions and 27 deletions.
98 changes: 72 additions & 26 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,40 +1,86 @@
sudo: required
dist: trusty

language: node_js
node_js: 6

cache:
yarn: true
sudo: required

branches:
only:
- develop
- travis

matrix:
include:

# WINDOWS cross-built from linux
- os: linux
dist: trusty
env:
- GULP_PLATFORM=win
node_js: 6
addons:
apt:
packages:
- icnsutils
- graphicsmagick
- xz-utils
- nsis
sources:
- mono
before_install:
- sudo dpkg --add-architecture i386 && sudo add-apt-repository ppa:ubuntu-wine/ppa -y
- sudo apt-get update -q
- sudo apt-get install --no-install-recommends -y mono-devel ca-certificates-mono wine1.8
after_script:
- makensis -V2 scripts/windows-installer.nsi

addons:
apt:
packages:
- icnsutils
- graphicsmagick
- xz-utils
- gcc-multilib
- g++-multilib

before_script:
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
- curl https://install.meteor.com/ | sh
- npm install -g meteor-build-client

# LINUX
- os: linux
dist: trusty
env:
- GULP_PLATFORM=linux
node_js: 6
addons:
apt:
packages:
- icnsutils
- graphicsmagick
- xz-utils
- gcc-multilib
- g++-multilib

# MAC
- os: osx
osx_image: xcode8.1
env:
- GULP_PLATFORM=mac
node_js: 6
before_install:
- brew update
- brew install gnu-tar libicns graphicsmagick xz
- npm install -g gulp yarn

cache:
yarn: true
directories:
- node_modules
- app/node_modules
- $HOME/.electron
- $HOME/.cache

install:
- PATH=$PATH:$HOME/.meteor && curl -L https://raw.githubusercontent.com/arunoda/travis-ci-meteor-packages/master/configure.sh | /bin/sh
- npm install -g meteor-build-client electron@1.3.5
- yarn

script:
- npm run ci
- travis_wait 60 gulp mist --platform $GULP_PLATFORM

after_success:
- gulp mist-checksums --platform $GULP_PLATFORM

notifications:
email:
- EMAIL
webhooks:
urls:
- YOUR_WEBHOOK_URL
on_success: change # options: [always|never|change] default: always
- https://webhooks.gitter.im/e/33972d9e627a142c57a6
on_success: change
on_failure: always
on_start: never
14 changes: 13 additions & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ gulp.task('copy-i18n', ['bundling-interface'], () => {
});


gulp.task('build-dist', ['download-signatures', 'copy-i18n'], (cb) => {
gulp.task('build-dist', ['copy-i18n'], (cb) => {
console.log('Bundling platforms: ', options.platform);

const appPackageJson = _.extend({}, packJson, {
Expand Down Expand Up @@ -342,6 +342,10 @@ gulp.task('release-dist', ['build-dist'], (done) => {
break;
}
}

if (platformIsActive('win')) {
runSeq('build-nsis');
}
});

done();
Expand Down Expand Up @@ -410,6 +414,14 @@ gulp.task('wallet-checksums', (cb) => {
runSeq('set-variables-wallet', 'get-release-checksums', cb);
});

gulp.task('build-nsis', (cb) => {
const versionParts = version.split('.');
const versionString = ''.concat('-DVERSIONMAJOR=', versionParts[0], ' -DVERSIONMINOR=', versionParts[1], ' -DVERSIONBUILD=', versionParts[2]);
const cmdString = 'makensis'.concat(' -V3 ', versionString, ' scripts/windows-installer.nsi');
console.log(cmdString);
shell.exec(cmdString, cb);
});


gulp.task('test-wallet', () => {
return gulp.src([
Expand Down
51 changes: 51 additions & 0 deletions scripts/Locate.nsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
!define locate::Open `!insertmacro locate::Open`

!macro locate::Open _PATH _OPTIONS _HANDLE
locate::_Open /NOUNLOAD `${_PATH}` `${_OPTIONS}`
Pop ${_HANDLE}
!macroend


!define locate::Find `!insertmacro locate::Find`

!macro locate::Find _HANDLE _PATHANDNAME _PATH _NAME _SIZE _TIME _ATTRIB
locate::_Find /NOUNLOAD `${_HANDLE}`
Pop ${_PATHANDNAME}
Pop ${_PATH}
Pop ${_NAME}
Pop ${_SIZE}
Pop ${_TIME}
Pop ${_ATTRIB}
!macroend


!define locate::Close `!insertmacro locate::Close`

!macro locate::Close _HANDLE
locate::_Close /NOUNLOAD `${_HANDLE}`
!macroend


!define locate::GetSize `!insertmacro locate::GetSize`

!macro locate::GetSize _PATH _OPTIONS _SIZE _FILES _DIRS
locate::_GetSize /NOUNLOAD `${_PATH}` `${_OPTIONS}`
Pop ${_SIZE}
Pop ${_FILES}
Pop ${_DIRS}
!macroend


!define locate::RMDirEmpty `!insertmacro locate::RMDirEmpty`

!macro locate::RMDirEmpty _PATH _OPTIONS _REMOVED
locate::_RMDirEmpty /NOUNLOAD `${_PATH}` `${_OPTIONS}`
Pop ${_REMOVED}
!macroend


!define locate::Unload `!insertmacro locate::Unload`

!macro locate::Unload
locate::_Unload
!macroend
Loading

0 comments on commit 7825db9

Please sign in to comment.