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