Skip to content

Commit

Permalink
docs(mac): Installing kernel extensions using scripts (#1455)
Browse files Browse the repository at this point in the history
  • Loading branch information
gniezen authored and develar committed Apr 11, 2017
1 parent 8c73f57 commit a053229
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions docs/Kernel extensions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Kernel extensions

Installing macOS kernel extensions with `electron-builder` can be done using scripts.

First, in `package.json`, make sure you're building a package (.pkg) and not the default .dmg:

```json
"mac": {
"target": "pkg"
}
```

Place your script and the kernel extensions in `build/pkg-scripts`, or [define a custom directory](/~https://github.com/electron-userland/electron-builder/wiki/Options#PkgOptions-scripts). Note that the script **must** be called either `preinstall` or `postinstall`. Remember to use ` #!/bin/sh` as the first line in your script. Also, your script must be executable (`chmod +x <filename>`).

An example script:
```sh
#!/bin/sh

echo "Unloading and uninstalling old extensions..."
# unload old extensions
sudo kextunload /Library/Extensions/myExt.kext

# delete old extensions
sudo rm -rf /Library/Extensions/myExtension.kext

# install new extensions
echo "Installing and loading new extensions..."
sudo cp -R myExt.kext /Library/Extensions/myExt.kext
sudo kextload /Library/Extensions/myExt.kext/
```

0 comments on commit a053229

Please sign in to comment.