 temp.track()
 
 module.exports = (grunt) ->
+  spawn = (options, callback) ->
+    spawnedProcess = grunt.util.spawn(options, callback)
+    spawnedProcess.on('error', callback)
+
   grunt.registerTask 'create-windows-installer', 'Create the Windows installer', ->
     @requiresConfig("#{@name}.appDirectory")
 

      outputDirectory
    ]

    grunt.util.spawn {cmd, args}, (error, result, code) ->
      return done(error) if error?

      nupkgPath = path.join(outputDirectory, "#{metadata.name}.#{metadata.version}.nupkg")

        '--loadingGif'
        loadingGif
      ]

      spawn {cmd, args}, (error, result, code) ->
        grunt.log.writeln result
        grunt.log.writeln code
        done(error)
