From e3cd2af01c14ee03534ebaa1c4c24f86ed1bf3c5 Mon Sep 17 00:00:00 2001
From: Miepee <38186597+Miepee@users.noreply.github.com>
Date: Tue, 17 Aug 2021 19:51:22 +0200
Subject: [PATCH] Check if am2r exissts first before extracting it
---
AM2RLauncher/AM2RLauncher/MainForm/MainForm.Methods.cs | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/AM2RLauncher/AM2RLauncher/MainForm/MainForm.Methods.cs b/AM2RLauncher/AM2RLauncher/MainForm/MainForm.Methods.cs
index adc5e2a..2157977 100644
--- a/AM2RLauncher/AM2RLauncher/MainForm/MainForm.Methods.cs
+++ b/AM2RLauncher/AM2RLauncher/MainForm/MainForm.Methods.cs
@@ -35,6 +35,8 @@ namespace AM2RLauncher
/// if yes, if not.
private bool Is11Installed()
{
+ // return safely if file doesn't exist
+ if (!File.Exists(CrossPlatformOperations.CURRENTPATH + "/AM2R_11.zip")) return false;
var returnCode = CheckIfZipIsAM2R11(CrossPlatformOperations.CURRENTPATH + "/AM2R_11.zip");
// Check if it's valid, if not log it, rename it and silently leave
if (returnCode != IsZipAM2R11ReturnCodes.Successful)
@@ -1058,10 +1060,7 @@ namespace AM2RLauncher
/// Checks if a Zip file is a valid AM2R_1.1 zip.
///
/// Full Path to the Zip file to check.
- /// if the zip file is a valid AM2R_1.1 zip
- /// if the zip does not contain AM2R.exe
- /// if the zip does not contain a valid D3D dll
- /// if the zip does not contain a valid data.win file
+ /// detailing the result
private IsZipAM2R11ReturnCodes CheckIfZipIsAM2R11(string zipPath)
{
const string d3dHash = "86e39e9161c3d930d93822f1563c280d";