diff --git a/build/Gruntfile.coffee b/build/Gruntfile.coffee index c5d161b91..5880f5566 100644 --- a/build/Gruntfile.coffee +++ b/build/Gruntfile.coffee @@ -235,7 +235,9 @@ module.exports = (grunt) -> ciTasks.push('set-version', 'check-licenses', 'lint') ciTasks.push('mkdeb') if process.platform is 'linux' ciTasks.push('test') if process.platform isnt 'linux' - ciTasks.push('codesign', 'publish-build') + ciTasks.push('codesign') + ciTasks.push('create-installer') if process.platform is 'win32' + ciTasks.push('publish-build') grunt.registerTask('ci', ciTasks) defaultTasks = ['download-atom-shell', 'build', 'set-version'] diff --git a/build/tasks/codesign-task.coffee b/build/tasks/codesign-task.coffee index 7f579cbca..55aa12df9 100644 --- a/build/tasks/codesign-task.coffee +++ b/build/tasks/codesign-task.coffee @@ -31,6 +31,11 @@ module.exports = (grunt) -> spawn {cmd: 'taskkill', args: ['/F', '/IM', 'atom.exe']}, -> cmd = process.env.JANKY_SIGNTOOL ? 'signtool' args = [path.join(grunt.config.get('atom.shellAppDir'), 'atom.exe')] - spawn {cmd, args}, (error) -> callback(error) + + spawn {cmd, args}, (error) -> + return callback(error) if error? + + args = [path.join(grunt.config.get('atom.shellAppDir'), '..', 'Releases', 'setup.exe')] + spawn {cmd, args}, (error) -> callback(error) else callback() diff --git a/build/tasks/create-installer.coffee b/build/tasks/create-installer.coffee new file mode 100644 index 000000000..fa6152f40 --- /dev/null +++ b/build/tasks/create-installer.coffee @@ -0,0 +1,41 @@ +fs = require 'fs' +path = require 'path' +_ = require 'underscore-plus' + +module.exports = (grunt) -> + {spawn, rm} = require('./task-helpers')(grunt) + + grunt.registerTask 'create-installer', 'Create the Windows installer', -> + return unless process.platform is 'win32' + + done = @async() + + buildDir = grunt.config.get('atom.buildDir') + atomDir = path.join(buildDir, 'Atom') + + packageInfo = grunt.file.readJSON(path.join(atomDir, 'resources', 'app', 'package.json')) + inputTemplate = grunt.file.read(path.join('build', 'windows', 'atom.nuspec.erb')) + + # NB: Build server has some sort of stamp on the version number + packageInfo.version = packageInfo.version.replace(/-.*$/, '') + + targetNuspecPath = path.join(buildDir, 'atom.nuspec') + grunt.file.write(targetNuspecPath, _.template(inputTemplate, packageInfo)) + + cmd = 'build/windows/nuget.exe' + args = ['pack', targetNuspecPath, '-BasePath', atomDir, '-OutputDirectory', buildDir] + + spawn {cmd, args}, (error, result, code) -> + return done(error) if error? + + pkgs = pkg for pkg in fs.readdirSync(buildDir) when path.extname(pkg) is '.nupkg' + + releasesDir = path.join(buildDir, 'Releases') + + # NB: Gonna clear Releases for now, in the future we need to pull down + # the existing version + rm(releasesDir) + + cmd = 'build/windows/update.com' + args = ['--releasify', path.join(buildDir, pkgs), '-r', releasesDir, '-g', 'build/windows/install-spinner.gif'] + spawn {cmd, args}, (error, result, code) -> done(error) diff --git a/build/windows/NuGet.exe b/build/windows/NuGet.exe new file mode 100644 index 000000000..c41a0d0de Binary files /dev/null and b/build/windows/NuGet.exe differ diff --git a/build/windows/Setup.exe b/build/windows/Setup.exe new file mode 100644 index 000000000..73603d2d2 Binary files /dev/null and b/build/windows/Setup.exe differ diff --git a/build/windows/Setup.pdb b/build/windows/Setup.pdb new file mode 100644 index 000000000..2568e268e Binary files /dev/null and b/build/windows/Setup.pdb differ diff --git a/build/windows/Update.com b/build/windows/Update.com new file mode 100644 index 000000000..31bb30230 Binary files /dev/null and b/build/windows/Update.com differ diff --git a/build/windows/Update.exe b/build/windows/Update.exe new file mode 100644 index 000000000..6969bf563 Binary files /dev/null and b/build/windows/Update.exe differ diff --git a/build/windows/Update.exe.pdb b/build/windows/Update.exe.pdb new file mode 100644 index 000000000..9f8afd8e9 Binary files /dev/null and b/build/windows/Update.exe.pdb differ diff --git a/build/windows/atom.nuspec.erb b/build/windows/atom.nuspec.erb new file mode 100644 index 000000000..51b7ac057 --- /dev/null +++ b/build/windows/atom.nuspec.erb @@ -0,0 +1,32 @@ + + + + <%= name %> + <%= version %> + The Atom Community + The Atom Community + https://raw.githubusercontent.com/atom/atom/master/resources/win/atom.ico + false + <%= description %> + + + + + + + + + + + + + + + + + + + + + + diff --git a/build/windows/install-spinner.gif b/build/windows/install-spinner.gif new file mode 100644 index 000000000..9be998f3d Binary files /dev/null and b/build/windows/install-spinner.gif differ