@@ -21,10 +21,7 @@ import {
21
21
logInfo ,
22
22
logWarning
23
23
} from 'backend/logger/logger'
24
- import {
25
- ExtractZipService ,
26
- ExtractZipProgressResponse
27
- } from 'backend/services/ExtractZipService'
24
+ import { ExtractZipProgressResponse } from 'backend/services/ExtractZipService'
28
25
import {
29
26
existsSync ,
30
27
mkdirSync ,
@@ -102,6 +99,7 @@ import { ipfsGateway } from 'backend/vite_constants'
102
99
import { GlobalConfig } from 'backend/config'
103
100
import { PatchingError } from './types'
104
101
import { SiweMessage } from 'siwe'
102
+ import { ExtractZipServiceWorker } from 'backend/services/ExtractZipServiceWorker'
105
103
106
104
interface ProgressDownloadingItem {
107
105
DownloadItem : DownloadItem
@@ -114,7 +112,7 @@ interface ProgressDownloadingItem {
114
112
}
115
113
116
114
const inProgressDownloadsMap : Map < string , ProgressDownloadingItem > = new Map ( )
117
- export const inProgressExtractionsMap : Map < string , ExtractZipService > =
115
+ export const inProgressExtractionsMap : Map < string , ExtractZipServiceWorker > =
118
116
new Map ( )
119
117
120
118
export async function getSettings ( appName : string ) : Promise < GameSettings > {
@@ -764,8 +762,6 @@ export async function cancelExtraction(appName: string) {
764
762
)
765
763
766
764
try {
767
- process . noAsar = false
768
-
769
765
const extractZipService = inProgressExtractionsMap . get ( appName )
770
766
if ( extractZipService ) {
771
767
extractZipService . cancel ( )
@@ -963,8 +959,6 @@ export async function install(
963
959
}
964
960
return { status : 'done' }
965
961
} catch ( error ) {
966
- process . noAsar = false
967
-
968
962
logInfo (
969
963
`Error while downloading and extracting game: ${ error } ` ,
970
964
LogPrefix . HyperPlay
@@ -1052,10 +1046,6 @@ export async function extract(
1052
1046
const zipFile = path . join ( directory , fileName )
1053
1047
logInfo ( `Extracting ${ zipFile } to ${ destinationPath } ` , LogPrefix . HyperPlay )
1054
1048
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
-
1059
1049
sendFrontendMessage ( 'gameStatusUpdate' , {
1060
1050
appName,
1061
1051
status : 'extracting' ,
@@ -1078,7 +1068,8 @@ export async function extract(
1078
1068
}
1079
1069
} )
1080
1070
1081
- const extractService = new ExtractZipService ( zipFile , destinationPath )
1071
+ const extractService = new ExtractZipServiceWorker ( zipFile , destinationPath )
1072
+ await extractService . initPromise
1082
1073
1083
1074
inProgressExtractionsMap . set ( appName , extractService )
1084
1075
@@ -1154,8 +1145,6 @@ export async function extract(
1154
1145
status : 'extracting'
1155
1146
} )
1156
1147
1157
- process . noAsar = false
1158
-
1159
1148
if ( isMac && executable . endsWith ( '.app' ) ) {
1160
1149
const macAppExecutable = readdirSync (
1161
1150
join ( executable , 'Contents' , 'MacOS' )
@@ -1192,6 +1181,7 @@ export async function extract(
1192
1181
)
1193
1182
extractService . once ( 'error' , ( error : Error ) => {
1194
1183
logError ( `Extracting Error ${ error . message } ` , LogPrefix . HyperPlay )
1184
+ captureException ( error )
1195
1185
1196
1186
cancelQueueExtraction ( )
1197
1187
callAbortController ( appName )
@@ -1210,8 +1200,6 @@ export async function extract(
1210
1200
LogPrefix . HyperPlay
1211
1201
)
1212
1202
1213
- process . noAsar = false
1214
-
1215
1203
cancelQueueExtraction ( )
1216
1204
callAbortController ( appName )
1217
1205
@@ -1254,8 +1242,6 @@ export async function extract(
1254
1242
extractService . extract ( ) . then ( )
1255
1243
} )
1256
1244
} catch ( error : unknown ) {
1257
- process . noAsar = false
1258
-
1259
1245
logInfo ( `Error while extracting game ${ error } ` , LogPrefix . HyperPlay )
1260
1246
1261
1247
window . webContents . send ( 'gameStatusUpdate' , {
0 commit comments