           '--loadingGif'
           loadingGif
         ]
+                
+        if useMono
+          args.unshift(path.resolve(__dirname, '..', 'vendor', 'Update-Mono.exe'))
+          cmd = monoExe
 
         if signWithParams?
           args.push '--signWithParams'

      nugetOutput
      '-NoDefaultExcludes'
    ]

    syncReleases = (cb) ->
      if remoteReleases?
        cmd = path.resolve(__dirname, '..', 'vendor', 'SyncReleases.exe')
        args = ['-u', remoteReleases, '-r', outputDirectory]
        exec {cmd, args}, cb
      else
        process.nextTick -> cb()

    ChildProcess.execFile options.cmd, options.args, (error, stdout, stderr) ->
      grunt.log.error(stderr) if stderr
      callback(error)
      
  locateExecutableInPath = (name) ->
    haystack = _.map process.env.PATH.split(/[:;]/), (x) -> path.join(x, name)
    _.find haystack, (needle) -> fs.existsSync(needle)

  grunt.registerMultiTask 'create-windows-installer', 'Create the Windows installer', ->
    @requiresConfig("#{@name}.#{@target}.appDirectory")
    
    useMono = false
    [monoExe, wineExe] = _.map(['mono', 'wine'], locateExecutableInPath)
    
    unless process.platform is 'win32'
      useMono = true
      throw new Error("You must install both Mono and Wine on non-Windows") unless wineExe and monoExe

    done = @async()

