Skip to content

Commit 6724386

Browse files
[FIX] Steam on macOS not launching (#1175)
* tech: refactor download and install steam * fix: Update Steam download URL and improve error handling during installation * feat: Enhance Steam installation dialog with progress messages and cleanup translations * feat: Add recommended specs and warnings to Steam installation dialog * Update src/frontend/screens/Library/components/SteamInstall/SteamInstallDialog.tsx Co-authored-by: Brett <[email protected]> * Update src/frontend/screens/Library/components/SteamInstall/SteamInstallDialog.tsx Co-authored-by: Brett <[email protected]> * Update src/frontend/screens/Library/components/SteamInstall/SteamInstallDialog.tsx Co-authored-by: Brett <[email protected]> * Update src/frontend/screens/Library/components/SteamInstall/SteamInstallDialog.tsx Co-authored-by: Brett <[email protected]> * i18n: updated keys --------- Co-authored-by: Flavio F Lima <[email protected]> Co-authored-by: Brett <[email protected]>
1 parent fb5ab23 commit 6724386

File tree

3 files changed

+79
-44
lines changed

3 files changed

+79
-44
lines changed

public/locales/en/translation.json

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"16GB of RAM": "16GB of RAM",
23
"accessibility": {
34
"actions_font_family_no_default": "Actions Font Family (Default: ",
45
"all_tiles_in_color": "Show all game tiles in color",
@@ -26,8 +27,9 @@
2627
"status": "Status",
2728
"title": "This game includes anticheat software"
2829
},
29-
"At the end make sure to": "At the end make sure to",
30+
"Apple Silicon M1 or above": "Apple Silicon M1 or above",
3031
"back_to_game": "Back to game",
32+
"Be aware that not all games will work, and even if they do, they may not run as expected": "Be aware that not all games will work, and even if they do, they may not run as expected.",
3133
"box": {
3234
"cache-cleared": {
3335
"message": "HyperPlay cache cleared.",
@@ -232,6 +234,7 @@
232234
},
233235
"title_dm": "Download Manager"
234236
},
237+
"Downloading": "Downloading {{percent}}%",
235238
"email_subscription": {
236239
"subtitle": "You’re now a part of our community, and we’re excited to share valuable updates and insights with you.",
237240
"title": "Thank you for subscribing!"
@@ -461,9 +464,6 @@
461464
"viewPortfolio": "View portfolio"
462465
},
463466
"HyperPlay": "",
464-
"HyperPlay will download and start the Steam Setup for you": {
465-
" Please follow Steam instructions on their installer;": "HyperPlay will download and start the Steam Setup for you. Please follow Steam instructions on their installer;"
466-
},
467467
"HyperPlay will notify you once the installation is done;": "HyperPlay will notify you once the installation is done;",
468468
"hyperplayOverlay": {
469469
"chainRequest": {
@@ -502,7 +502,7 @@
502502
"INITIATED": "Add custom token request pending"
503503
}
504504
},
505-
"If you wish to continue, be patient since it can take a few minutes to finish depending on your internet connection and system configuration;": "If you wish to continue, be patient since it can take a few minutes to finish depending on your internet connection and system configuration;",
505+
"If you wish to continue, please be patient since it can take a few minutes to finish depending on your internet connection and system configuration": "If you wish to continue, please be patient since it can take a few minutes to finish depending on your internet connection and system configuration.",
506506
"import-game-folder": {
507507
"cta": "Import Game Folder",
508508
"dialog": {
@@ -544,6 +544,7 @@
544544
"path": "Select Install Path"
545545
},
546546
"Install Steam": "Install Steam",
547+
"Installing": "Installing",
547548
"Installing Steam": "Installing Steam...",
548549
"Launch Steam": "Launch Steam",
549550
"Launching Steam": "Launching Steam...",
@@ -565,6 +566,9 @@
565566
"message": "Login with your platform. You can login to more than one platform at the same time.",
566567
"old-mac": "Your macOS version is {{version}}. macOS 12 or newer is required to log in."
567568
},
569+
"macOS 14": {
570+
"0 or above": "macOS 14.0 or above"
571+
},
568572
"message": {
569573
"sync": "Sync Complete",
570574
"unsync": "Unsync Complete"
@@ -680,7 +684,6 @@
680684
"offline-retry-in": "Offline. Retrying in {{seconds}} seconds.",
681685
"retrying": "Retrying"
682686
},
683-
"On first launch Steam will download the necessary files and will take a few minutes to finish and the login screen to appear;": "On first launch Steam will download the necessary files and will take a few minutes to finish and the login screen to appear;",
684687
"options": {
685688
"advanced": {
686689
"key": "Variable Name",
@@ -736,6 +739,7 @@
736739
"prefered_language": "2-char code (i.e.: \"en\" or \"fr\")"
737740
},
738741
"Please connect to the internet to access the stores": "",
742+
"Please Wait": "Please Wait",
739743
"please-wait": "Please wait...",
740744
"profile": "Profile",
741745
"progress": "Progress",
@@ -846,6 +850,7 @@
846850
}
847851
},
848852
"Recent": "Played Recently",
853+
"Recommended specs for a better experience": "Recommended specs for a better experience",
849854
"search": "Search for Games",
850855
"setting": {
851856
"adddesktopshortcuts": "Add desktop shortcuts automatically",
@@ -1038,7 +1043,6 @@
10381043
"warningMessage": "Side-loading a game is a feature intended for developers and experienced power users. Side-loading an installer that contains malware could compromise your computer and lead to theft of funds.",
10391044
"warningTitle": "Important"
10401045
},
1041-
"since it will block HyperPlay configuration until Steam is closed;": "",
10421046
"status": {
10431047
"installing": "Installing",
10441048
"logging": "Logging In...",
@@ -1075,7 +1079,6 @@
10751079
"two_col_table": {
10761080
"save_hint": "Changes in this table are not saved automatically. Click the + button"
10771081
},
1078-
"UNCHECK 'Run Steam'": "UNCHECK 'Run Steam'",
10791082
"userselector": {
10801083
"logging_out": "Logging out",
10811084
"logIn": "Log in",

src/backend/tools.ts

Lines changed: 34 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import {
1515
downloadFile,
1616
execAsync,
1717
getWineFromProton,
18+
spawnAsync,
1819
writeConfig
1920
} from './utils'
2021
import {
@@ -31,7 +32,7 @@ import { dirname, join } from 'path'
3132
import { isOnline } from './online_monitor'
3233
import { showDialogBoxModalAuto } from './dialog/dialog'
3334
import { runWineCommand, validWine } from './launcher'
34-
import { chmod } from 'fs/promises'
35+
import { chmod, mkdir } from 'fs/promises'
3536
import {
3637
any_gpu_supports_version,
3738
get_nvngx_path,
@@ -599,9 +600,9 @@ export const SteamWindows = {
599600
}
600601

601602
const steamURL =
602-
'https://cdn.cloudflare.steamstatic.com/client/installer/SteamSetup.exe'
603+
'https://drive.usercontent.google.com/download?id=1MXowtPBihbljXFs_5cM1AfyOjnC3raaT&export=download&authuser=0&confirm=t&uuid=e159346a-5836-4f7d-8aed-af3d8340fef7&at=AENtkXa2d83g4dE_UZYQKKLoEUje%3A1732794843031'
603604
const directory = `${toolsPath}/steam`
604-
const fileName = 'SteamSetup.exe'
605+
const fileName = 'Steam.zip'
605606
const window = getMainWindow()
606607

607608
if (!isOnline() || existsSync(join(directory, fileName)) || !window) {
@@ -618,13 +619,13 @@ export const SteamWindows = {
618619
) {
619620
const currentProgress = calculateProgress(
620621
downloadedBytes,
621-
Number.parseInt('2380800'),
622+
Number.parseInt('718394478'),
622623
downloadSpeed,
623624
diskWriteSpeed,
624625
progress
625626
)
626627

627-
window?.webContents.send(`progressUpdate-steam}`, {
628+
window?.webContents.send(`progressUpdate-steam`, {
628629
appName: 'steam',
629630
status: 'installing',
630631
runner: 'hyperplay',
@@ -634,19 +635,19 @@ export const SteamWindows = {
634635
})
635636
}
636637

637-
try {
638-
logInfo('Downloading Steam', LogPrefix.Backend)
639-
await downloadFile(
638+
return new Promise<void>((resolve, reject) => {
639+
downloadFile(
640640
steamURL,
641641
directory,
642642
fileName,
643643
abortController,
644-
handleProgess
645-
)
646-
return
647-
} catch (error) {
648-
return logWarning(['Error Downloading Steam', error], LogPrefix.Backend)
649-
}
644+
handleProgess,
645+
() => resolve()
646+
).catch((error) => {
647+
logWarning(['Error Downloading Steam', error], LogPrefix.Backend)
648+
reject(error)
649+
})
650+
})
650651
},
651652
installSteam: async () => {
652653
if (!isMac) {
@@ -655,7 +656,7 @@ export const SteamWindows = {
655656

656657
const steamCoverArt =
657658
'https://cdn2.steamgriddb.com/file/sgdb-cdn/grid/a7e8ba67562ea4d4ca0421066466ece4.png'
658-
const steamSetupPath = `${toolsPath}/steam/SteamSetup.exe`
659+
const steamSetupPath = `${toolsPath}/steam/Steam.zip`
659660
const { defaultWinePrefix, wineVersion } = GlobalConfig.get().getSettings()
660661
// won't use just Steam here to avoid issue with people that already has a prefix with this name
661662
const winePrefix = join(dirname(defaultWinePrefix), 'SteamHyperPlay')
@@ -664,16 +665,21 @@ export const SteamWindows = {
664665
await SteamWindows.downloadSteam()
665666
}
666667

667-
// Run Steam Setup and write settings
668668
const gameSettings = await gameManagerMap['sideload'].getSettings('steam')
669669
if (!gameSettings) {
670670
return
671671
}
672-
writeConfig('steam', { ...gameSettings, winePrefix, wineVersion })
672+
writeConfig('steam', {
673+
...gameSettings,
674+
winePrefix,
675+
wineVersion,
676+
launcherArgs:
677+
'-noverifyfiles -nobootstrapupdate -skipinitialbootstrap -norepairfiles -overridepackageurl'
678+
})
673679

674680
try {
675681
await runWineCommand({
676-
commandParts: [steamSetupPath],
682+
commandParts: ['wineboot', '-init'],
677683
wait: true,
678684
gameSettings: {
679685
...gameSettings,
@@ -682,8 +688,17 @@ export const SteamWindows = {
682688
}
683689
})
684690

691+
const unzipFile = join(toolsPath, 'steam', 'Steam.zip')
692+
const unzipPath = `${winePrefix}/drive_c/Program Files (x86)/Steam`
693+
if (!existsSync(unzipPath)) {
694+
await mkdir(unzipPath, { recursive: true })
695+
}
696+
697+
logInfo('Extracting Steam...', LogPrefix.Backend)
698+
await spawnAsync('unzip', ['-o', unzipFile, '-d', unzipPath])
699+
685700
// Add Steam to the library
686-
const executable = `${winePrefix}/drive_c/Program Files (x86)/Steam/Steam.exe`
701+
const executable = join(unzipPath, 'Steam.exe')
687702

688703
if (!existsSync(executable)) {
689704
logError(['Steam executable not found', executable], LogPrefix.Backend)

src/frontend/screens/Library/components/SteamInstall/SteamInstallDialog.tsx

Lines changed: 34 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,38 @@
11
import React from 'react'
22
import { useTranslation } from 'react-i18next'
3+
import { TFunction } from 'i18next'
34
import { Button } from '@hyperplay/ui'
45
import { Dialog } from 'frontend/components/UI/Dialog'
5-
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
6-
import { faSpinner } from '@fortawesome/free-solid-svg-icons'
6+
import { hasProgress } from 'frontend/hooks/hasProgress'
77

88
interface SteamInstallDialogProps {
99
isInstalling: boolean
1010
onClose: () => void
1111
onInstall: () => void
1212
}
1313

14+
const getProgressMessage = (percent: number, t: TFunction) => {
15+
if (!percent) {
16+
return t('Please Wait', 'Please Wait')
17+
}
18+
if (percent > 95) {
19+
return t('Installing', 'Installing')
20+
}
21+
return t('Downloading', 'Downloading {{percent}}%', {
22+
percent: percent.toFixed(0)
23+
})
24+
}
25+
1426
const SteamInstallDialog: React.FC<SteamInstallDialogProps> = ({
1527
isInstalling,
1628
onClose,
1729
onInstall
1830
}) => {
1931
const { t } = useTranslation()
32+
const { progress } = hasProgress('steam')
33+
34+
const percent = progress.percent ?? 0
35+
const downloadMessage = getProgressMessage(percent, t)
2036

2137
return (
2238
<Dialog showCloseButton={false} onClose={onClose}>
@@ -27,33 +43,34 @@ const SteamInstallDialog: React.FC<SteamInstallDialogProps> = ({
2743
<ul>
2844
<li>
2945
{t(
30-
'If you wish to continue, be patient since it can take a few minutes to finish depending on your internet connection and system configuration;',
31-
'If you wish to continue, be patient since it can take a few minutes to finish depending on your internet connection and system configuration;'
46+
'Recommended specs for a better experience',
47+
'Recommended specs for a better experience'
3248
)}
49+
:
3350
</li>
51+
<ul>
52+
<li>
53+
{t('Apple Silicon M1 or above', 'Apple Silicon M1 or above')}
54+
</li>
55+
<li>{t('macOS 14.0 or above', 'macOS 14.0 or above')}</li>
56+
<li>{t('16GB of RAM', '16GB of RAM')}</li>
57+
</ul>
3458
<li>
3559
{t(
36-
'HyperPlay will download and start the Steam Setup for you. Please follow Steam instructions on their installer;',
37-
'HyperPlay will download and start the Steam Setup for you. Please follow Steam instructions on their installer;'
60+
'Be aware that not all games will work, and even if they do, they may not run as expected.',
61+
'Be aware that not all games will work, and even if they do, they may not run as expected.'
3862
)}
3963
</li>
4064
<li>
41-
{t('At the end make sure to', 'At the end make sure to')}{' '}
42-
<strong>{t("UNCHECK 'Run Steam'", "UNCHECK 'Run Steam'")}</strong>,{' '}
4365
{t(
44-
'since it will block HyperPlay configuration until Steam is closed;'
66+
'If you wish to continue, please be patient since it can take a few minutes to finish depending on your internet connection and system configuration.',
67+
'If you wish to continue, please be patient since it can take a few minutes to finish depending on your internet connection and system configuration.'
4568
)}
4669
</li>
4770
<li>
4871
{t(
4972
'HyperPlay will notify you once the installation is done;',
50-
'HyperPlay will notify you once the installation is done;'
51-
)}
52-
</li>
53-
<li>
54-
{t(
55-
'On first launch Steam will download the necessary files and will take a few minutes to finish and the login screen to appear;',
56-
'On first launch Steam will download the necessary files and will take a few minutes to finish and the login screen to appear;'
73+
'HyperPlay will notify you once the installation is done.'
5774
)}
5875
</li>
5976
</ul>
@@ -66,7 +83,7 @@ const SteamInstallDialog: React.FC<SteamInstallDialogProps> = ({
6683
disabled={isInstalling}
6784
>
6885
{isInstalling ? (
69-
<FontAwesomeIcon icon={faSpinner} spin />
86+
<span>{downloadMessage}</span>
7087
) : (
7188
t('Install Steam', 'Install Steam')
7289
)}

0 commit comments

Comments
 (0)