   getPath: (callback) ->
     # If stored, return pathToISCC
     pathToISCC = atom.config.get('language-innosetup.pathToISCC')
-    if pathToISCC
-      callback pathToISCC
-      return
+    if pathToISCC.length > 0
+      return callback(pathToISCC)
 
-    # Find ISCC
-    exec "\"#{which}\" ISCC", (error, stdout, stderr) ->
-      if error isnt null
+    which = spawn which, ["ISCC"]
+
+    which.stdout.on 'data', ( data ) ->
+      path = data.toString().trim()
+      atom.config.set('language-innosetup.pathToISCC', path)
+      return callback(path)
+
+    which.on 'close', ( errorCode ) ->
+      if errorCode > 0
         atom.notifications.addError("**language-innosetup**: `ISCC.exe` is not in your PATH [environmental variable](http://superuser.com/a/284351/195953)", dismissable: true)
-      else
-        atom.config.set('language-innosetup.pathToISCC', stdout.trim())
-        callback stdout
-      return

# Dependencies
{exec} = require 'child_process'
os = require 'os'

if os.platform() is 'win32'

    if script? and scope.startsWith 'source.inno'
      editor.save() if editor.isModified()

      @getPath (pathToISCC) ->
        if not pathToISCC
          atom.notifications.addError("**language-innosetup**: no valid `ISCC.exe` was specified in your config", dismissable: false)
          return

        iscc = spawn pathToISCC, [script]

        stdout = ""
        stderr = ""

        iscc.stderr.on 'data', ( data ) ->
          stderr += data

        iscc.stdout.on 'data', ( data ) ->
          stdout += data

        iscc.on 'close', ( errorCode ) ->
          if errorCode > 0
            return atom.notifications.addError("Compile Error", detail: stderr, dismissable: true)

          return atom.notifications.addSuccess("Compiled successfully", dismissable: false)
    else
      # Something went wrong
      atom.beep()
