From af4f99aab64c4e51e94f4947854b77f87328c839 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lauri=20Kentt=C3=A4?= Date: Thu, 9 May 2024 19:41:50 +0300 Subject: [PATCH] If missing files, warn that zip is not extracted --- src/Setup.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Setup.cs b/src/Setup.cs index b927a0d..f9068c3 100644 --- a/src/Setup.cs +++ b/src/Setup.cs @@ -1034,6 +1034,11 @@ public class Setup { SkipShim = args.Contains("skip-shim"); ForwardArguments = String.Join(" ", args.Where(s => ForwardableArguments.Contains(s) || s.StartsWith("arch="))); try { + if (!(Directory.Exists("efi") || Directory.Exists("efi-signed")) || !File.Exists("config.txt")) { + WriteLine("This setup program is not in the correct directory!"); + WriteLine("Please extract the zip file and run the setup program from there."); + return 1; + } SetArch(args.Where(s => s.StartsWith("arch=")).Select(s => s.Substring(5)).LastOrDefault()); if (args.Contains("is-elevated") && !HasPrivileges() && !DryRun) { WriteLine("This installer needs to be run as administrator!");