Address issue with Store which needed Patch-S

This commit is contained in:
Ben
2023-10-02 23:24:42 -05:00
parent ec5d8234fc
commit 7090eb2058
2 changed files with 10 additions and 1 deletions

View File

@@ -99,6 +99,7 @@
"electron-log": "^4.4.8",
"electron-updater": "^5.3.0",
"howler": "^2.2.3",
"lodash.throttle": "^4.1.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router-dom": "^6.11.2",
@@ -116,6 +117,7 @@
"@testing-library/react": "^14.0.0",
"@types/howler": "^2.2.8",
"@types/jest": "^29.5.2",
"@types/lodash": "^4.14.199",
"@types/mock-fs": "^4.13.1",
"@types/node": "20.2.5",
"@types/react": "^18.2.8",

View File

@@ -485,7 +485,10 @@ export default class FileManager {
const inManifest = await this.CheckManifest(AIORemotePath, aioETag);
const aioClient = path.join(this.addOnsPath, 'AIO_Client/AIO_Client.toc');
if (!inManifest || !fs.existsSync(aioClient)) {
const patchS = await this.downloader.getETag('patches/patch-S.MPQ');
const isPatched = await this.CheckManifest('patches/patch-S.MPQ', patchS);
if (!inManifest || !fs.existsSync(aioClient) || !isPatched) {
return false;
}
@@ -568,10 +571,12 @@ export default class FileManager {
// we need a new instances to make sure we pass the correct event handler.
const downloader = this.DownloaderInstance();
const aioETag = await this.downloader.getETag(AIORemotePath);
const patchSETag = await this.downloader.getETag('patches/patch-S.MPQ');
downloader.on('end', () => {
// update the manifest file with the new install need some more error handling here
this.UpdateManifest(AIORemotePath, aioETag);
this.UpdateManifest('patches/patch-S.MPQ', patchSETag)
setTimeout(() => {
const zip = new AdmZip(path.join(this.basePath, AIOLocalPath));
@@ -583,6 +588,8 @@ export default class FileManager {
log.error('Failed to download AIO');
}
await downloader.downloadFile('patches/patch-S.MPQ', 'Data/patch-S.MPQ');
return downloader;
}