     if not process.env[envName]
       return console.warn envName + ' env var not set.'
 
-  winInstaller
-    appDirectory: './build/win32'
-    outputDirectory: './dist'
-    loadingGif: './build/resources/win/install-spinner.gif'
-    certificateFile: process.env.SIGN_WIN_CERTIFICATE_FILE
-    certificatePassword: process.env.SIGN_WIN_CERTIFICATE_PASSWORD
-    setupIcon: './build/resources/win/setup.ico'
-    iconUrl: 'https://raw.githubusercontent.com/Aluxian/electron-superkit/master/resources/win/app.ico'
-    remoteReleases: manifest.repository.url
+  async.series [
+    # First, compress the source files into an asar archive
+    async.apply asar.createPackage, './build/win32/resources/app', './build/win32/resources/app.asar'
+
+    # Remove leftovers
+    async.apply del, './build/win32/resources/app'
+
+    # Create the installer
+    (callback) ->
+      winInstaller
+        appDirectory: './build/win32'
+        outputDirectory: './dist'
+        loadingGif: './build/resources/win/install-spinner.gif'
+        certificateFile: process.env.SIGN_WIN_CERTIFICATE_FILE
+        certificatePassword: process.env.SIGN_WIN_CERTIFICATE_PASSWORD
+        setupIcon: './build/resources/win/setup.ico'
+        iconUrl: 'https://raw.githubusercontent.com/Aluxian/electron-superkit/master/resources/win/app.ico'
+        remoteReleases: manifest.repository.url
+      .then callback, callback
+  ], done
 
 # Create the win32 portable zip
 gulp.task 'pack:win32:portable', ['build:win32', 'clean:dist:win32'], (done) ->

        '.'
      ]

      cp.exec 'fpm ' + args.join(' '), done

# Create the win32 installer; only works on Windows
gulp.task 'pack:win32:installer', ['build:win32', 'clean:dist:win32'], ->
  if process.platform isnt 'win32'
    return console.warn 'Skipping win32 installer packing; This only works on Windows due to Squirrel.Windows.'


      return done()

  async.series [
    # First, compress the source files into an asar archive
    async.apply asar.createPackage, './build/win32/resources/app', './build/win32/resources/app.asar'

    # Remove leftovers
    async.apply del, './build/win32/resources/app'

    # Sign the exe
    (callback) ->
      cp.exec [
        if process.env.SIGNTOOL_PATH then '"' + process.env.SIGNTOOL_PATH + '"' else 'signtool'
        'sign'
        '/f ' + process.env.SIGN_WIN_CERTIFICATE_FILE
        '/p ' + process.env.SIGN_WIN_CERTIFICATE_PASSWORD
        path.win32.resolve './build/win32/' + manifest.productName + '.exe'
      ].join(' '), callback

    # Archive the files
    (callback) ->
      gulp.src './build/win32/**/*'
        .pipe zip manifest.name + '-win32-portable.zip'
        .pipe gulp.dest './dist'
        .on 'end', callback
