Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: explain how to handle spaces in app name #209

Open
wants to merge 2 commits into
base: v6
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions config/makers/squirrel.windows.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,49 @@ if (require('electron-squirrel-startup')) app.quit();
```
{% endcode %}

### Spaces in the app name

Squirrel.Windows can behave unexpectedly when application names contain spaces. You can use the following setup in this case, which works well:

{% code title="package.json" %}
```json5
{
// Hyphenated version
"name": "app-name",
// The app name with spaces (will be shown to your users)
"productName": "App Name",
// ...
}
```
{% endcode %}

{% code title="forge.config.ts" %}
```typescript
const config: ForgeConfig = {
makers: [
new MakerSquirrel({
// CamelCase version without spaces
name: "AppName",
// ...
}),
],
// ...
}
```
{% endcode %}

Additionally, you'll need to set the App User Model ID from your main process like this:

{% code title="main.ts" %}
```typescript
app.setAppUserModelId("com.squirrel.AppName.AppName");
```
{% endcode %}

Squirrel.Windows will use the `productName` from your `package.json` for any user-facing strings and for the name of your `Setup.exe`.

It will use the camel-cased `name` from the `MakerSquirrel` config for the NuGet package name. NuGet package names cannot contain spaces.

## Debugging

For advanced debug logging for this maker, add the `DEBUG=electron-windows-installer*` environment variable.