]> khamidou — GitHub mirrors - electron.git/commitdiff
docs: Add notes on spawn and exec
authorCheng Zhao <zcbenz@gmail.com>
Fri, 27 Nov 2015 13:29:31 +0000 (21:29 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Fri, 27 Nov 2015 13:29:31 +0000 (21:29 +0800)
docs/tutorial/application-packaging.md

index 45973e49eaa90d615bdc4bad0d9819ed87b0efa0..c6e0ae3c41035de0c3890314dc1cb9fb2fc09230 100644 (file)
@@ -132,6 +132,7 @@ work. This adds a little overhead for those APIs.
 APIs that requires extra unpacking are:
 
 * `child_process.execFile`
+* `child_process.execFileSync`
 * `fs.open`
 * `fs.openSync`
 * `process.dlopen` - Used by `require` on native modules
@@ -143,6 +144,17 @@ archives is generated by guessing, because those files do not exist on the
 filesystem. So you should not trust the `Stats` object except for getting file
 size and checking file type.
 
+### Executing Binaries Inside `asar` Archive
+
+There are Node APIs that can execute binaries like `child_process.exec`,
+`child_process.spawn` and `child_process.execFile`, but only `execFile` is
+supported to execute binaries inside `asar` archive.
+
+This is because `exec` and `spawn` accept `command` instead of `file` as input,
+and `command`s are executed under shell. There is no reliable way to determine
+whether a command uses a file in asar archive, and even if we do, we can not be
+sure whether we can replace the path in command without side effects.
+
 ## Adding Unpacked Files in `asar` Archive
 
 As stated above, some Node APIs will unpack the file to filesystem when