Skip to content

Commit 77f065c

Browse files
committed
do not strip spaces from the windows executable name
1 parent d8848ef commit 77f065c

File tree

2 files changed

+7
-18
lines changed

2 files changed

+7
-18
lines changed

packages/compass/src/main/squirrel-startup.ts

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,6 @@ function runUpdateExe(args: string[]): Promise<void> {
1717
});
1818
}
1919

20-
function getShortcutName() {
21-
// The shortcut name is the app name plus the channel name if it is not
22-
// stable. ie. "MongoDB Compass Readonly Beta"
23-
24-
const parts: string[] = [process.env.HADRON_PRODUCT_NAME];
25-
if (process.env.HADRON_CHANNEL !== 'stable') {
26-
parts.push(
27-
process.env.HADRON_CHANNEL.charAt(0).toUpperCase() +
28-
process.env.HADRON_CHANNEL.slice(1)
29-
);
30-
}
31-
return `"${parts.join(' ')}"`;
32-
}
33-
3420
/*
3521
Squirrel will spawn Compass with command line flags on first run, updates, and
3622
uninstalls. It is very important that we handle these events as early as
@@ -42,7 +28,10 @@ export async function handleSquirrelWindowsStartup(): Promise<boolean> {
4228
return false;
4329
}
4430

45-
const shortcutName = getShortcutName();
31+
// This has to be an executable that was packaged up with the app. There's no
32+
// way to control what the shortcut name will be - it is always the same as
33+
// the executable.
34+
const shortcutName = path.basename(process.execPath);
4635

4736
const cmd = process.argv[1];
4837
debug('processing squirrel command `%s`', cmd);

packages/hadron-build/lib/target.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ class Target {
314314
* remoteToken: this.githubToken,
315315
*/
316316
Object.assign(this.packagerOptions, {
317-
name: this.productName.replace(/ /g, ''),
317+
name: this.productName,
318318
icon: this.src(platformSettings.icon),
319319
'version-string': {
320320
CompanyName: this.author,
@@ -451,12 +451,12 @@ class Target {
451451
outputDirectory: this.packagerOptions.out,
452452
exe: this.packagerOptions.name,
453453
name: this.productName,
454+
// NOTE: falling back to author would result in MongoDB Inc
455+
shortcutFolderName: this.shortcutFolderName || this.author,
454456
shortcutName: this.productName,
455457
description: this.description,
456458
manufacturer: this.author,
457459
version: windowsInstallerVersion(this.installerVersion || this.version),
458-
// NOTE: falling back to author would result in MongoDB Inc
459-
shortcutFolderName: this.shortcutFolderName || this.author,
460460
programFilesFolderName: this.programFilesFolderName || this.productName,
461461
appUserModelId: this.bundleId,
462462
upgradeCode: this.upgradeCode,

0 commit comments

Comments
 (0)