mirror of
https://github.com/packwiz/packwiz-installer.git
synced 2025-04-20 13:36:30 +02:00
Ensure index and pack files are rechecked after errors
This commit is contained in:
parent
ce60cdc385
commit
0cba5ba17b
@ -35,6 +35,7 @@ public class UpdateManager {
|
|||||||
private boolean cancelled;
|
private boolean cancelled;
|
||||||
private boolean cancelledStartGame = false;
|
private boolean cancelledStartGame = false;
|
||||||
private InputStateHandler stateHandler;
|
private InputStateHandler stateHandler;
|
||||||
|
private boolean errorsOccurred = false;
|
||||||
|
|
||||||
public static class Options {
|
public static class Options {
|
||||||
SpaceSafeURI downloadURI = null;
|
SpaceSafeURI downloadURI = null;
|
||||||
@ -199,7 +200,14 @@ public class UpdateManager {
|
|||||||
|
|
||||||
// TODO: update MMC params, java args etc
|
// TODO: update MMC params, java args etc
|
||||||
|
|
||||||
|
// If there were errors, don't write the manifest/index hashes, to ensure they are rechecked later
|
||||||
|
if (errorsOccurred) {
|
||||||
|
manifest.indexFileHash = null;
|
||||||
|
manifest.packFileHash = null;
|
||||||
|
} else {
|
||||||
manifest.packFileHash = packFileSource.getHash();
|
manifest.packFileHash = packFileSource.getHash();
|
||||||
|
}
|
||||||
|
|
||||||
manifest.cachedSide = opts.side;
|
manifest.cachedSide = opts.side;
|
||||||
try (Writer writer = new FileWriter(Paths.get(opts.packFolder, opts.manifestFile).toString())) {
|
try (Writer writer = new FileWriter(Paths.get(opts.packFolder, opts.manifestFile).toString())) {
|
||||||
gson.toJson(manifest, writer);
|
gson.toJson(manifest, writer);
|
||||||
@ -333,6 +341,7 @@ public class UpdateManager {
|
|||||||
|
|
||||||
List<IExceptionDetails> failedTasks = tasks.stream().filter(t -> t.getException() != null).collect(Collectors.toList());
|
List<IExceptionDetails> failedTasks = tasks.stream().filter(t -> t.getException() != null).collect(Collectors.toList());
|
||||||
if (!failedTasks.isEmpty()) {
|
if (!failedTasks.isEmpty()) {
|
||||||
|
errorsOccurred = true;
|
||||||
IExceptionDetails.ExceptionListResult exceptionListResult;
|
IExceptionDetails.ExceptionListResult exceptionListResult;
|
||||||
try {
|
try {
|
||||||
exceptionListResult = ui.showExceptions(failedTasks, tasks.size(), true).get();
|
exceptionListResult = ui.showExceptions(failedTasks, tasks.size(), true).get();
|
||||||
@ -430,7 +439,8 @@ public class UpdateManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
List<IExceptionDetails> failedTasks2ElectricBoogaloo = nonFailedFirstTasks.stream().filter(t -> t.getException() != null).collect(Collectors.toList());
|
List<IExceptionDetails> failedTasks2ElectricBoogaloo = nonFailedFirstTasks.stream().filter(t -> t.getException() != null).collect(Collectors.toList());
|
||||||
if (failedTasks2ElectricBoogaloo.size() > 0) {
|
if (!failedTasks2ElectricBoogaloo.isEmpty()) {
|
||||||
|
errorsOccurred = true;
|
||||||
IExceptionDetails.ExceptionListResult exceptionListResult;
|
IExceptionDetails.ExceptionListResult exceptionListResult;
|
||||||
try {
|
try {
|
||||||
exceptionListResult = ui.showExceptions(failedTasks2ElectricBoogaloo, tasks.size(), false).get();
|
exceptionListResult = ui.showExceptions(failedTasks2ElectricBoogaloo, tasks.size(), false).get();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user