Skip to content

Commit 5e7caaf

Browse files
committed
Revert "rm process.noAsar changes"
This reverts commit df90e0a.
1 parent d7b0c6e commit 5e7caaf

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

src/backend/ipcHandlers/mods.ts

+2
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,8 @@ export async function prepareBaseGameForModding({
125125
extractService.on('canceled', () => {
126126
logInfo(`Canceled Extracting of base game file`, LogPrefix.HyperPlay)
127127

128+
process.noAsar = false
129+
128130
cancelQueueExtraction()
129131
callAbortController(appName)
130132

src/backend/storeManagers/hyperplay/games.ts

+14
Original file line numberDiff line numberDiff line change
@@ -764,6 +764,8 @@ export async function cancelExtraction(appName: string) {
764764
)
765765

766766
try {
767+
process.noAsar = false
768+
767769
const extractZipService = inProgressExtractionsMap.get(appName)
768770
if (extractZipService) {
769771
extractZipService.cancel()
@@ -961,6 +963,8 @@ export async function install(
961963
}
962964
return { status: 'done' }
963965
} catch (error) {
966+
process.noAsar = false
967+
964968
logInfo(
965969
`Error while downloading and extracting game: ${error}`,
966970
LogPrefix.HyperPlay
@@ -1048,6 +1052,10 @@ export async function extract(
10481052
const zipFile = path.join(directory, fileName)
10491053
logInfo(`Extracting ${zipFile} to ${destinationPath}`, LogPrefix.HyperPlay)
10501054

1055+
// disables electron's fs wrapper called when extracting .asar files
1056+
// which is necessary to extract electron app/game zip files
1057+
process.noAsar = true
1058+
10511059
sendFrontendMessage('gameStatusUpdate', {
10521060
appName,
10531061
status: 'extracting',
@@ -1146,6 +1154,8 @@ export async function extract(
11461154
status: 'extracting'
11471155
})
11481156

1157+
process.noAsar = false
1158+
11491159
if (isMac && executable.endsWith('.app')) {
11501160
const macAppExecutable = readdirSync(
11511161
join(executable, 'Contents', 'MacOS')
@@ -1200,6 +1210,8 @@ export async function extract(
12001210
LogPrefix.HyperPlay
12011211
)
12021212

1213+
process.noAsar = false
1214+
12031215
cancelQueueExtraction()
12041216
callAbortController(appName)
12051217

@@ -1242,6 +1254,8 @@ export async function extract(
12421254
extractService.extract().then()
12431255
})
12441256
} catch (error: unknown) {
1257+
process.noAsar = false
1258+
12451259
logInfo(`Error while extracting game ${error}`, LogPrefix.HyperPlay)
12461260

12471261
window.webContents.send('gameStatusUpdate', {

0 commit comments

Comments
 (0)