docs: Update the rebranding guide

This commit is contained in:
Cheng Zhao 2015-04-17 11:59:40 +08:00
Родитель 2f9de5a0e9
Коммит b0b6747456
1 изменённых файлов: 44 добавлений и 25 удалений

Просмотреть файл

@ -2,8 +2,8 @@
To distribute your app with Electron, you should name the folder of your app To distribute your app with Electron, you should name the folder of your app
as `app`, and put it under Electron's resources directory (on OS X it is as `app`, and put it under Electron's resources directory (on OS X it is
`Electron.app/Contents/Resources/`, and on Linux and Windows it is `resources/`), `Electron.app/Contents/Resources/`, and on Linux and Windows it is
like this: `resources/`), like this:
On OS X: On OS X:
@ -23,8 +23,8 @@ electron/resources/app
└── index.html └── index.html
``` ```
Then execute `Electron.app` (or `atom` on Linux, and `atom.exe` on Windows), and Then execute `Electron.app` (or `electron` on Linux, `electron.exe` on Windows),
Electron will start as your app. The `electron` directory would then be and Electron will start as your app. The `electron` directory would then be
your distribution that should be delivered to final users. your distribution that should be delivered to final users.
## Packaging your app into a file ## Packaging your app into a file
@ -58,52 +58,71 @@ More details can be found in [Application packaging](application-packaging.md).
After bundling your app into Electron, you will want to rebrand Electron After bundling your app into Electron, you will want to rebrand Electron
before distributing it to users. before distributing it to users.
If you don't care about the executable name on Windows or the helper process
name on OS X, you can simply rename the downloaded binaries, and there is also a
grunt task that can download prebuilt Electron binaries for your current
platform automatically:
[grunt-download-atom-shell](https://github.com/atom/grunt-download-atom-shell).
### Windows ### Windows
You can not rename the `atom.exe` otherwise native modules will not load. But You can rename `electron.exe` to any name you like, and edit its icon and other
you can edit the executable's icon and other information with tools like information with tools like [rcedit](https://github.com/atom/rcedit) or
[rcedit](https://github.com/atom/rcedit) or [ResEdit](http://www.resedit.net). [ResEdit](http://www.resedit.net).
If you don't use any native Node module, it is fine to rename `atom.exe` to any
name you want.
### OS X ### OS X
You can rename `Electron.app` to whatever you want, and you also have to rename the You can rename `Electron.app` to any name you want, and you also have to rename
`CFBundleDisplayName`, `CFBundleIdentifier` and `CFBundleName` fields in the `CFBundleDisplayName`, `CFBundleIdentifier` and `CFBundleName` fields in
following manifest files if they have these keys: following files:
* `Electron.app/Contents/Info.plist` * `Electron.app/Contents/Info.plist`
* `Electron.app/Contents/Frameworks/Atom Helper.app/Contents/Info.plist` * `Electron.app/Contents/Frameworks/Electron Helper.app/Contents/Info.plist`
You can also rename the helper app to avoid showing `Electron Helper` in the
Activity Monitor, but make sure you have renamed the helper app's executable
file's name.
The structure of a renamed app would be like:
```
MyApp.app/Contents
├── Info.plist
├── MacOS/
│   └── MyApp
└── Frameworks/
├── MyApp Helper EH.app
| ├── Info.plist
| └── MacOS/
|    └── MyApp Helper EH
├── MyApp Helper NP.app
| ├── Info.plist
| └── MacOS/
|    └── MyApp Helper NP
└── MyApp Helper.app
├── Info.plist
└── MacOS/
   └── MyApp Helper
```
### Linux ### Linux
You can rename the `atom` executable to whatever you want. You can rename the `electron` executable to any name you like.
## Rebranding by rebuilding Electron from source ## Rebranding by rebuilding Electron from source
The best way to rename Electron is to change the product name and then build It is also possible to rebrand Electron by changing the product name and
from source. To do this you need to override the `GYP_DEFINES` environment building it from source. To do this you need to override the `GYP_DEFINES`
variable and have a clean rebuild: environment variable and have a clean rebuild:
__Windows__ __Windows__
```cmd ```cmd
> set "GYP_DEFINES=project_name=myapp product_name=MyApp" > set "GYP_DEFINES=project_name=myapp product_name=MyApp"
> python script\clean.py
> python script\bootstrap.py > python script\bootstrap.py
> python script\build.py -c Release -t myapp > python script\build.py -c R -t myapp
``` ```
__Bash__ __Bash__
```bash ```bash
$ export GYP_DEFINES="project_name=myapp product_name=MyApp" $ export GYP_DEFINES="project_name=myapp product_name=MyApp"
$ script/clean.py
$ script/bootstrap.py $ script/bootstrap.py
$ script/build.py -c Release -t myapp $ script/build.py -c Release -t myapp
``` ```