Skip to content

Commit

Permalink
docs: explain how to handle spaces in app name (#209)
Browse files Browse the repository at this point in the history
  • Loading branch information
nikwen authored Feb 13, 2025
1 parent 283158f commit 41d5379
Showing 1 changed file with 43 additions and 0 deletions.
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.

0 comments on commit 41d5379

Please sign in to comment.