Fix custom data location problems

This commit is contained in:
Lncvrt committed 2026-04-29 15:50:56 -07:00
1 parent 998fb6d309
commit 254a1d5b5c
4 files changed
+121 -46

No files matched your search

+2 -5
View File
@@ -31,14 +31,11 @@
"fs:allow-applocaldata-write",
{
"identifier": "fs:scope",
"allow": [
{ "path": "$APPLOCALDATA/game/**" },
{ "path": "$APPCONFIG/versions.json" }
]
"allow": [{ "path": "**" }]
},
{
"identifier": "opener:allow-open-path",
"allow": [{ "path": "$APPLOCALDATA/game/**" }]
"allow": [{ "path": "**" }]
},
{
"identifier": "http:default",
+33 -11
View File
@@ -29,7 +29,8 @@ export default function Installs () {
downloadProgress,
linuxUseWine,
linuxWineCommand,
versions
versions,
customDataLocation
} = useGlobal()
const params = useSearchParams()
@@ -271,14 +272,28 @@ export default function Installs () {
)
if (
await exists('game/' + v, {
baseDir: BaseDirectory.AppLocalData
})
await exists(
customDataLocation
? customDataLocation + '/'
: null + 'game/' + v,
{
baseDir: customDataLocation
? undefined
: BaseDirectory.AppLocalData
}
)
)
await remove('game/' + v, {
baseDir: BaseDirectory.AppLocalData,
recursive: true
})
await remove(
customDataLocation
? customDataLocation + '/'
: null + 'game/' + v,
{
baseDir: customDataLocation
? undefined
: BaseDirectory.AppLocalData,
recursive: true
}
)
//reinstall
setSelectedVersionList([v])
@@ -356,9 +371,16 @@ export default function Installs () {
e.stopPropagation()
if (
!(await exists('game/' + v + '/BepInEx', {
baseDir: BaseDirectory.AppLocalData
}))
!(await exists(
customDataLocation
? customDataLocation + '/'
: null + 'game/' + v + '/BepInEx',
{
baseDir: customDataLocation
? undefined
: BaseDirectory.AppLocalData
}
))
) {
if (
(await ask(
+44 -15
View File
@@ -27,7 +27,8 @@ export default function ManageVersionPopup () {
setPopupMode,
setSelectedVersionList,
downloadVersions,
versions
versions,
customDataLocation
} = useGlobal()
const [versionSize, setVersionSize] = useState<number>(0)
@@ -140,14 +141,28 @@ export default function ManageVersionPopup () {
)
if (
await exists('game/' + managingVersion, {
baseDir: BaseDirectory.AppLocalData
})
await exists(
(customDataLocation ? customDataLocation + '/' : null) +
'game/' +
managingVersion,
{
baseDir: customDataLocation
? undefined
: BaseDirectory.AppLocalData
}
)
)
await remove('game/' + managingVersion, {
baseDir: BaseDirectory.AppLocalData,
recursive: true
})
await remove(
(customDataLocation ? customDataLocation + '/' : null) +
'game/' +
managingVersion,
{
baseDir: customDataLocation
? undefined
: BaseDirectory.AppLocalData,
recursive: true
}
)
}}
title='Click to uninstall this game. This will NOT remove any progress or any save files.'
hidden={viewingInfoFromDownloads}
@@ -172,14 +187,28 @@ export default function ManageVersionPopup () {
)
if (
await exists('game/' + managingVersion, {
baseDir: BaseDirectory.AppLocalData
})
await exists(
(customDataLocation ? customDataLocation + '/' : null) +
'game/' +
managingVersion,
{
baseDir: customDataLocation
? undefined
: BaseDirectory.AppLocalData
}
)
)
await remove('game/' + managingVersion, {
baseDir: BaseDirectory.AppLocalData,
recursive: true
})
await remove(
(customDataLocation ? customDataLocation + '/' : null) +
'game/' +
managingVersion,
{
baseDir: customDataLocation
? undefined
: BaseDirectory.AppLocalData,
recursive: true
}
)
//reinstall
setSelectedVersionList([managingVersion])
+42 -15
View File
@@ -30,7 +30,8 @@ export default function ModDownloadsPopup () {
setShowModInfo,
downloadVersions,
downloadProgress,
versions
versions,
customDataLocation
} = useGlobal()
const [mods, setMods] = useState<Mod[] | 0 | 1>(0)
@@ -208,14 +209,28 @@ export default function ModDownloadsPopup () {
'/BepInEx/plugins/' +
v.id
if (
await exists(path, {
baseDir: BaseDirectory.AppLocalData
})
await exists(
(customDataLocation
? customDataLocation + '/'
: null) + path,
{
baseDir: customDataLocation
? undefined
: BaseDirectory.AppLocalData
}
)
)
await remove(path, {
baseDir: BaseDirectory.AppLocalData,
recursive: true
})
await remove(
(customDataLocation
? customDataLocation + '/'
: null) + path,
{
baseDir: customDataLocation
? undefined
: BaseDirectory.AppLocalData,
recursive: true
}
)
versions?.set(
'mods',
Object.fromEntries(
@@ -295,14 +310,26 @@ export default function ModDownloadsPopup () {
'/BepInEx/plugins/' +
showModInfo.id
if (
await exists(path, {
baseDir: BaseDirectory.AppLocalData
})
await exists(
(customDataLocation ? customDataLocation + '/' : null) +
path,
{
baseDir: customDataLocation
? undefined
: BaseDirectory.AppLocalData
}
)
)
await remove(path, {
baseDir: BaseDirectory.AppLocalData,
recursive: true
})
await remove(
(customDataLocation ? customDataLocation + '/' : null) +
path,
{
baseDir: customDataLocation
? undefined
: BaseDirectory.AppLocalData,
recursive: true
}
)
versions?.set(
'mods',
Object.fromEntries(