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

[GOG]: Refactor almost all GOG components #3020

Merged
merged 66 commits into from
Jan 27, 2024
Merged
Show file tree
Hide file tree
Changes from 49 commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
2fd3101
initial changes to downloading
imLinguin Aug 12, 2023
c844302
feat: changelog with html sanitizer, gogdl config sandboxing
imLinguin Aug 24, 2023
e8c6b65
ui for gog modfiy install, and minor additions for obtaining install …
imLinguin Aug 25, 2023
7e3f61b
split reusable frontend components, add Cyberpunk REDmod support, gog…
imLinguin Aug 27, 2023
c1dd3e2
re-enable playtime sync
imLinguin Aug 27, 2023
f1e1130
feat: private branches, small fixes to redMod
imLinguin Aug 28, 2023
d2aff7e
impov: redmod windows support
imLinguin Aug 28, 2023
d9e1f75
feat: redistributable management
imLinguin Aug 29, 2023
9a79fa2
feat: support instruction parsing compliant with backup installers
imLinguin Aug 30, 2023
d766c20
fix: lint
imLinguin Aug 30, 2023
fe1788d
improv: improvements to backup installers interop
imLinguin Aug 31, 2023
dc0d230
feat: setup should work on windows
imLinguin Aug 31, 2023
21dda3a
add very important comment
imLinguin Sep 3, 2023
4489c1f
improv: avoid refreshing library too much
imLinguin Sep 13, 2023
feed9b5
Pull upstream main changes
imLinguin Sep 13, 2023
7b7b758
i18n: generate locales
imLinguin Sep 13, 2023
c138cba
chore: remove merge leftovers
imLinguin Sep 13, 2023
4770278
linux: default to sniper steam runtime
imLinguin Sep 13, 2023
d1769f8
improv: use steam_compat_install_path env var on Linux (wine, proton …
imLinguin Sep 14, 2023
78e0fce
feat: add redist state
imLinguin Sep 16, 2023
5803351
fix: consistent styling of game card play button
imLinguin Sep 16, 2023
bac4914
generate i18n
imLinguin Sep 16, 2023
667bf45
improv: hide spammy redist update notifications, change ok to apply
imLinguin Sep 16, 2023
4da9a1b
improv: get accurate data for linux native games
imLinguin Sep 16, 2023
3964599
chore: update gogdl binaries
imLinguin Sep 16, 2023
7d9dc00
fix: lint
imLinguin Sep 16, 2023
b4e92ce
fix: error on download modal for Linux native games
imLinguin Sep 19, 2023
28f31f0
shortcuts: prefer icons shipped with games
imLinguin Sep 23, 2023
33f8407
fix: avoid emptying game library if some library page requests fail
imLinguin Sep 23, 2023
defafb1
tech: don't pass onIconClick prop to input element
imLinguin Sep 23, 2023
0a60943
use run verb for uninstall, make clearer script interpreter error
imLinguin Sep 24, 2023
2f77bc4
Merge branch 'main' of github.com:Heroic-Games-Launcher/HeroicGamesLa…
imLinguin Sep 26, 2023
d8c023e
update gogdl with windows and mac fixes
imLinguin Sep 27, 2023
4a47773
Merge branch 'main' of github.com:Heroic-Games-Launcher/HeroicGamesLa…
imLinguin Sep 30, 2023
4b23ba2
don't create prefix on uninstall
imLinguin Sep 30, 2023
98cecbe
fix: loading indicator bug
imLinguin Sep 30, 2023
4cd62b5
fix: uninstall status change, redmod error detection
imLinguin Sep 30, 2023
9c62eaf
make gogdl use redmod config from info file (hacky)
imLinguin Oct 1, 2023
42a8fd2
avoid overwriting metadata for paused installations
imLinguin Oct 2, 2023
719b31c
Merge branch 'main' of github.com:Heroic-Games-Launcher/HeroicGamesLa…
imLinguin Oct 2, 2023
b30564b
Pull upstream main
imLinguin Oct 21, 2023
3134fa6
fix: move from Collapsable to Tabs in modifyinstall
imLinguin Oct 21, 2023
625953d
update gogdl with xdelta patching
imLinguin Oct 21, 2023
e8b516b
improv: make modify install same size as settings modal
imLinguin Oct 28, 2023
e86c196
fix: re-add offline installers changes detection
imLinguin Oct 28, 2023
20bcc34
Merge branch 'main' of github.com:Heroic-Games-Launcher/HeroicGamesLa…
imLinguin Oct 28, 2023
9e093df
fix: patching percentage going over 100%
imLinguin Oct 28, 2023
4051518
Pull upstream main
imLinguin Nov 7, 2023
e2c271b
fix: branch password style
imLinguin Nov 7, 2023
fd5520e
improv: avoid retrying to fetch game data on 404 response
imLinguin Nov 10, 2023
6916885
feat: add ability to select beta channel during install
imLinguin Nov 11, 2023
eb3a2f8
improv: use Intl instead of conspired/i18n-iso-languages
imLinguin Nov 17, 2023
474ca99
Pull upstream
imLinguin Dec 4, 2023
e62e545
tech: gogdl update
imLinguin Dec 4, 2023
476c2cc
linux: new download method
imLinguin Dec 10, 2023
a7bcaff
improv: don't run uninstall exe if we are going to remove the prefix
imLinguin Dec 11, 2023
05f707f
linux: support symlinks - gogdl update
imLinguin Dec 11, 2023
a379515
fix: exception when some images are not defined
imLinguin Dec 11, 2023
7ae8b57
fix: redist not being installed sometimes
imLinguin Dec 14, 2023
2680b41
fix: library refresh + game push race condition
imLinguin Dec 18, 2023
f1bdf6c
Pull upstream main
imLinguin Jan 5, 2024
d741c03
Resolve conflicts afer merging #3393
imLinguin Jan 6, 2024
abf4ddf
fix: let the uninstall command know if we are removing the prefix
imLinguin Jan 16, 2024
551abdb
:shushing_face:
imLinguin Jan 16, 2024
9cd8b35
Pull upstream main v2.12.0
imLinguin Jan 17, 2024
4ee3548
Merge branch 'main' of github.com:Heroic-Games-Launcher/HeroicGamesLa…
imLinguin Jan 27, 2024
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
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@
}
},
"dependencies": {
"@cospired/i18n-iso-languages": "^4.1.0",
arielj marked this conversation as resolved.
Show resolved Hide resolved
"@emotion/react": "11.10.6",
"@emotion/styled": "11.10.6",
"@felipecrs/decompress-tarxz": "4.0.0",
Expand Down Expand Up @@ -176,12 +177,14 @@
"json5": "2.2.3",
"plist": "3.0.5",
"react": "18.2.0",
"react-beautiful-dnd": "^13.1.1",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Drag&Drop for reordering of mods for REDMod integration, I believe we can re-use that in download queue

"react-dom": "18.2.0",
"react-i18next": "12.2.0",
"react-markdown": "8.0.5",
"react-router-dom": "6.9.0",
"recharts": "2.4.3",
"sanitize-filename": "1.6.3",
"sanitize-html": "^2.11.0",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GOG's changelogs are HTML, we sanitize any script or other crap (just in case) with this

"semver": "7.5.2",
"shlex": "2.1.2",
"short-uuid": "4.2.2",
Expand Down Expand Up @@ -239,8 +242,10 @@
"@types/node": "18.15.0",
"@types/plist": "3.0.2",
"@types/react": "18.2.34",
"@types/react-beautiful-dnd": "13.1.4",
"@types/react-dom": "18.2.14",
"@types/react-router-dom": "5.3.3",
"@types/sanitize-html": "2.9.0",
"@types/tmp": "0.2.3",
"@typescript-eslint/eslint-plugin": "5.47.1",
"@typescript-eslint/parser": "5.47.1",
Expand Down
Binary file modified public/bin/darwin/gogdl
Binary file not shown.
Binary file modified public/bin/linux/gogdl
Binary file not shown.
Binary file modified public/bin/win32/gogdl.exe
Binary file not shown.
29 changes: 25 additions & 4 deletions public/locales/en/gamepage.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
"button": {
"add_to_favourites": "Add To Favourites",
"cancel": "Pause/Cancel",
"changelog": "Show Changelog",
"continue": "Continue Download",
"details": "Details",
"finish": "Finish",
Expand All @@ -76,19 +77,28 @@
},
"cloud_save_unsupported": "Unsupported",
"disabled": "Disabled",
"dlc": {
"installDlcs": "Install all DLCs"
},
"enabled": "Enabled",
"game": {
"dlcs": "DLCs",
"branch": {
"disabled": "Disabled",
"password": "Set private channel password",
"select": "Select beta channel",
"setPrivateBranchPassword": "Set private channel password"
},
"builds": {
"buildsSelector": "Select game version",
"toggle": "Keep the game at specific version",
"version": "Version"
},
"changelogFor": "Changelog for {{gameTitle}}",
"downloadSize": "Download Size",
"firstPlayed": "First Played",
"getting-download-size": "Getting download size",
"getting-install-size": "Getting install size",
"installSize": "Install Size",
"language": "Language",
"lastPlayed": "Last Played",
"modify": "Modify Installation",
"neverPlayed": "Never",
"platform": "Select Platform Version to Install",
"requirements": "System Requirements",
Expand Down Expand Up @@ -152,6 +162,7 @@
"start": "Play Now",
"stop": "Playing (Stop)"
},
"redist": "Installing Redistributables",
"saves": {
"syncing": "Syncing Saves"
},
Expand All @@ -160,6 +171,15 @@
"launch": {
"options": "Launch Options..."
},
"modifyInstall": {
"dlcsCollapsible": "DLC",
"nodlcs": "No DLC available",
"redMod": {
"collapsible": "REDmod Integration",
"enable": "Enable mods"
},
"versionCollapsable": "Game Version"
},
"not_logged_in": {
"amazon": "You are not logged in with an Amazon account in Heroic. Don't use the store page to login, click the following button instead:",
"epic": "You are not logged in with an Epic account in Heroic. Don't use the store page to login, click the following button instead:",
Expand Down Expand Up @@ -217,6 +237,7 @@
"playing": "Playing",
"processing": "Processing files, please wait",
"queued": "Queued",
"redist": "Installing Redistributables ({{redist}})",
"reparing": "Repairing Game, please wait",
"syncingSaves": "Syncing Saves",
"this-game-uses-third-party": "This game uses third party launcher and it is not supported yet",
Expand Down
1 change: 1 addition & 0 deletions public/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@
},
"favourites": "Favourites",
"game": {
"modify": "Modify Installation",
"status": "Status",
"store": "Store",
"title": "Game Title"
Expand Down
9 changes: 6 additions & 3 deletions src/backend/api/downloadmanager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,15 @@ export const install = async (args: InstallParams) => {
ipcRenderer.invoke('addToDMQueue', dmQueueElement)

// Add Dlcs to the queue
if (Array.isArray(args.installDlcs) && args.installDlcs.length > 0) {
if (
Array.isArray(args.installDlcs) &&
args.installDlcs.length > 0 &&
args.runner === 'legendary'
arielj marked this conversation as resolved.
Show resolved Hide resolved
) {
args.installDlcs.forEach(async (dlc) => {
const dlcArgs: InstallParams = {
...args,
appName: dlc,
installDlcs: false
appName: dlc
}
const dlcQueueElement: DMQueueElement = {
params: dlcArgs,
Expand Down
29 changes: 27 additions & 2 deletions src/backend/api/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,21 @@ export const getExtraInfo = async (appName: string, runner: Runner) =>
export const getGOGLaunchOptions = async (appName: string) =>
ipcRenderer.invoke('getGOGLaunchOptions', appName)

export const getPrivateBranchPassword = async (appName: string) =>
ipcRenderer.invoke('getPrivateBranchPassword', appName)
export const setPrivateBranchPassword = async (
appName: string,
password: string
) => ipcRenderer.invoke('setPrivateBranchPassword', appName, password)

// REDmod integration
export const getAvailableCyberpunkMods = async () =>
ipcRenderer.invoke('getAvailableCyberpunkMods')
export const setCyberpunModConfig = async (props: {
enabled: boolean
modsToLoad: string[]
}) => ipcRenderer.invoke('setCyberpunkModConfig', props)

export const getGameSettings = async (
appName: string,
runner: Runner
Expand All @@ -82,8 +97,18 @@ export const getGameSettings = async (
export const getInstallInfo = async (
appName: string,
runner: Runner,
installPlatform: InstallPlatform
) => ipcRenderer.invoke('getInstallInfo', appName, runner, installPlatform)
installPlatform: InstallPlatform,
build?: string,
branch?: string
) =>
ipcRenderer.invoke(
'getInstallInfo',
appName,
runner,
installPlatform,
build,
branch
)

export const runWineCommand = async (args: WineCommandArgs) =>
ipcRenderer.invoke('runWineCommand', args)
Expand Down
6 changes: 6 additions & 0 deletions src/backend/api/library.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,12 @@ export const handleRecentGamesChanged = (callback: any) => {

export const addNewApp = (args: GameInfo) => ipcRenderer.send('addNewApp', args)

export const changeGameVersionPinnedStatus = (
appName: string,
runner: Runner,
status: boolean
) => ipcRenderer.send('changeGameVersionPinnedStatus', appName, runner, status)

export const getGameOverride = async () => ipcRenderer.invoke('getGameOverride')

export const getGameSdl = async (appName: string) =>
Expand Down
6 changes: 6 additions & 0 deletions src/backend/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,13 @@ const appFolder = join(configFolder, 'heroic')
const legendaryConfigPath = isSnap
? join(env.XDG_CONFIG_HOME!, 'legendary')
: join(appFolder, 'legendaryConfig', 'legendary')
const gogdlConfigPath = join(appFolder, 'gogdlConfig', 'heroic_gogdl')
const gogSupportPath = join(gogdlConfigPath, 'gog-support')
const nileConfigPath = join(appFolder, 'nile_config', 'nile')
const configPath = join(appFolder, 'config.json')
const gamesConfigPath = join(appFolder, 'GamesConfig')
const toolsPath = join(appFolder, 'tools')
const gogRedistPath = join(toolsPath, 'redist', 'gog')
const heroicIconFolder = join(appFolder, 'icons')
const runtimePath = join(toolsPath, 'runtimes')
const userInfo = join(legendaryConfigPath, 'user.json')
Expand Down Expand Up @@ -266,6 +269,9 @@ export {
customThemesWikiLink,
cachedUbisoftInstallerPath,
gogdlAuthConfig,
gogdlConfigPath,
gogSupportPath,
gogRedistPath,
vulkanHelperBin,
nileConfigPath,
nileInstalled,
Expand Down
33 changes: 31 additions & 2 deletions src/backend/downloadmanager/downloadqueue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { sendFrontendMessage } from '../main_window'
import { callAbortController } from 'backend/utils/aborthandler/aborthandler'
import { notify } from '../dialog/dialog'
import i18next from 'i18next'
import { createRedistDMQueueElement } from 'backend/storeManagers/gog/redist'

const downloadManager = new TypeCheckedStoreBackend('downloadManager', {
cwd: 'store',
Expand Down Expand Up @@ -115,19 +116,41 @@ async function addToQueue(element: DMQueueElement) {
const elements = downloadManager.get('queue', [])

const elementIndex = elements.findIndex(
(el) => el.params.appName === element.params.appName
(el) =>
el.params.appName === element.params.appName &&
el.params.runner === element.params.runner
Comment on lines 118 to +121
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added runner check to avoid collisions

)

if (elementIndex >= 0) {
elements[elementIndex] = element
} else {
const installInfo = await libraryManagerMap[
element.params.runner
].getInstallInfo(element.params.appName, element.params.platformToInstall)
].getInstallInfo(
element.params.appName,
element.params.platformToInstall,
element.params.branch,
element.params.build
)

element.params.size = installInfo?.manifest?.download_size
? getFileSize(installInfo?.manifest?.download_size)
: '?? MB'

if (
element.params.runner === 'gog' &&
element.params.platformToInstall === 'windows' &&
installInfo &&
'dependencies' in installInfo.manifest
) {
const newDependencies = installInfo.manifest.dependencies
if (newDependencies?.length) {
// create redist element
const redistElement = createRedistDMQueueElement()
redistElement.params.dependencies = newDependencies
elements.push(redistElement)
}
}
elements.push(element)
}

Expand Down Expand Up @@ -226,6 +249,12 @@ function stopCurrentDownload() {
// notify the user based on the status of the element and the status of the queue
function processNotification(element: DMQueueElement, status: DMStatus) {
const action = element.type === 'install' ? 'Installation' : 'Update'
if (
element.params.runner === 'gog' &&
element.params.appName === 'gog-redist'
) {
return
}
const { title } = gameManagerMap[element.params.runner].getGameInfo(
element.params.appName
)
Expand Down
14 changes: 11 additions & 3 deletions src/backend/downloadmanager/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ async function installQueueElement(params: InstallParams): Promise<{
sdlList = [],
runner,
installLanguage,
platformToInstall
platformToInstall,
build
} = params
const { title } = gameManagerMap[runner].getGameInfo(appName)

Expand Down Expand Up @@ -70,7 +71,8 @@ async function installQueueElement(params: InstallParams): Promise<{
installDlcs,
sdlList: sdlList.filter((el) => el !== ''),
platformToInstall,
installLanguage
installLanguage,
build
})

if (status === 'error') {
Expand Down Expand Up @@ -139,7 +141,13 @@ async function updateQueueElement(params: InstallParams): Promise<{
}

try {
const { status } = await gameManagerMap[runner].update(appName)
const { status } = await gameManagerMap[runner].update(appName, {
build: params.build,
branch: params.branch,
language: params.installLanguage,
dlcs: params.installDlcs,
dependencies: params.dependencies
})

if (status === 'error') {
errorMessage('')
Expand Down
Loading