ApplicationLibrary.cs 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651
  1. using LibHac;
  2. using LibHac.Common;
  3. using LibHac.Fs;
  4. using LibHac.Fs.Fsa;
  5. using LibHac.FsSystem;
  6. using LibHac.FsSystem.NcaUtils;
  7. using LibHac.Ns;
  8. using Ryujinx.Common.Configuration;
  9. using Ryujinx.Common.Logging;
  10. using Ryujinx.Configuration.System;
  11. using Ryujinx.HLE.FileSystem;
  12. using Ryujinx.HLE.HOS;
  13. using Ryujinx.HLE.Loaders.Npdm;
  14. using Ryujinx.Ui.Widgets;
  15. using System;
  16. using System.Collections.Generic;
  17. using System.IO;
  18. using System.Reflection;
  19. using System.Text;
  20. using System.Text.Json;
  21. using JsonHelper = Ryujinx.Common.Utilities.JsonHelper;
  22. namespace Ryujinx.Ui.App
  23. {
  24. public class ApplicationLibrary
  25. {
  26. public event EventHandler<ApplicationAddedEventArgs> ApplicationAdded;
  27. public event EventHandler<ApplicationCountUpdatedEventArgs> ApplicationCountUpdated;
  28. private readonly byte[] _nspIcon;
  29. private readonly byte[] _xciIcon;
  30. private readonly byte[] _ncaIcon;
  31. private readonly byte[] _nroIcon;
  32. private readonly byte[] _nsoIcon;
  33. private VirtualFileSystem _virtualFileSystem;
  34. private Language _desiredTitleLanguage;
  35. private bool _loadingError;
  36. public ApplicationLibrary(VirtualFileSystem virtualFileSystem)
  37. {
  38. _virtualFileSystem = virtualFileSystem;
  39. _nspIcon = GetResourceBytes("Ryujinx.Ui.Resources.Icon_NSP.png");
  40. _xciIcon = GetResourceBytes("Ryujinx.Ui.Resources.Icon_XCI.png");
  41. _ncaIcon = GetResourceBytes("Ryujinx.Ui.Resources.Icon_NCA.png");
  42. _nroIcon = GetResourceBytes("Ryujinx.Ui.Resources.Icon_NRO.png");
  43. _nsoIcon = GetResourceBytes("Ryujinx.Ui.Resources.Icon_NSO.png");
  44. }
  45. private byte[] GetResourceBytes(string resourceName)
  46. {
  47. Stream resourceStream = Assembly.GetCallingAssembly().GetManifestResourceStream(resourceName);
  48. byte[] resourceByteArray = new byte[resourceStream.Length];
  49. resourceStream.Read(resourceByteArray);
  50. return resourceByteArray;
  51. }
  52. public IEnumerable<string> GetFilesInDirectory(string directory)
  53. {
  54. Stack<string> stack = new Stack<string>();
  55. stack.Push(directory);
  56. while (stack.Count > 0)
  57. {
  58. string dir = stack.Pop();
  59. string[] content = Array.Empty<string>();
  60. try
  61. {
  62. content = Directory.GetFiles(dir, "*");
  63. }
  64. catch (UnauthorizedAccessException)
  65. {
  66. Logger.Warning?.Print(LogClass.Application, $"Failed to get access to directory: \"{dir}\"");
  67. }
  68. if (content.Length > 0)
  69. {
  70. foreach (string file in content)
  71. {
  72. yield return file;
  73. }
  74. }
  75. try
  76. {
  77. content = Directory.GetDirectories(dir);
  78. }
  79. catch (UnauthorizedAccessException)
  80. {
  81. Logger.Warning?.Print(LogClass.Application, $"Failed to get access to directory: \"{dir}\"");
  82. }
  83. if (content.Length > 0)
  84. {
  85. foreach (string subdir in content)
  86. {
  87. stack.Push(subdir);
  88. }
  89. }
  90. }
  91. }
  92. public void ReadControlData(IFileSystem controlFs, Span<byte> outProperty)
  93. {
  94. controlFs.OpenFile(out IFile controlFile, "/control.nacp".ToU8Span(), OpenMode.Read).ThrowIfFailure();
  95. controlFile.Read(out _, 0, outProperty, ReadOption.None).ThrowIfFailure();
  96. }
  97. public void LoadApplications(List<string> appDirs, Language desiredTitleLanguage)
  98. {
  99. int numApplicationsFound = 0;
  100. int numApplicationsLoaded = 0;
  101. _loadingError = false;
  102. _desiredTitleLanguage = desiredTitleLanguage;
  103. // Builds the applications list with paths to found applications
  104. List<string> applications = new List<string>();
  105. foreach (string appDir in appDirs)
  106. {
  107. if (!Directory.Exists(appDir))
  108. {
  109. Logger.Warning?.Print(LogClass.Application, $"The \"game_dirs\" section in \"Config.json\" contains an invalid directory: \"{appDir}\"");
  110. continue;
  111. }
  112. foreach (string app in GetFilesInDirectory(appDir))
  113. {
  114. if ((Path.GetExtension(app).ToLower() == ".nsp") ||
  115. (Path.GetExtension(app).ToLower() == ".pfs0") ||
  116. (Path.GetExtension(app).ToLower() == ".xci") ||
  117. (Path.GetExtension(app).ToLower() == ".nca") ||
  118. (Path.GetExtension(app).ToLower() == ".nro") ||
  119. (Path.GetExtension(app).ToLower() == ".nso"))
  120. {
  121. applications.Add(app);
  122. numApplicationsFound++;
  123. }
  124. }
  125. }
  126. // Loops through applications list, creating a struct and then firing an event containing the struct for each application
  127. foreach (string applicationPath in applications)
  128. {
  129. double fileSize = new FileInfo(applicationPath).Length * 0.000000000931;
  130. string titleName = "Unknown";
  131. string titleId = "0000000000000000";
  132. string developer = "Unknown";
  133. string version = "0";
  134. byte[] applicationIcon = null;
  135. BlitStruct<ApplicationControlProperty> controlHolder = new BlitStruct<ApplicationControlProperty>(1);
  136. try
  137. {
  138. using (FileStream file = new FileStream(applicationPath, FileMode.Open, FileAccess.Read))
  139. {
  140. if ((Path.GetExtension(applicationPath).ToLower() == ".nsp") ||
  141. (Path.GetExtension(applicationPath).ToLower() == ".pfs0") ||
  142. (Path.GetExtension(applicationPath).ToLower() == ".xci"))
  143. {
  144. try
  145. {
  146. PartitionFileSystem pfs;
  147. bool isExeFs = false;
  148. if (Path.GetExtension(applicationPath).ToLower() == ".xci")
  149. {
  150. Xci xci = new Xci(_virtualFileSystem.KeySet, file.AsStorage());
  151. pfs = xci.OpenPartition(XciPartitionType.Secure);
  152. }
  153. else
  154. {
  155. pfs = new PartitionFileSystem(file.AsStorage());
  156. // If the NSP doesn't have a main NCA, decrement the number of applications found and then continue to the next application.
  157. bool hasMainNca = false;
  158. foreach (DirectoryEntryEx fileEntry in pfs.EnumerateEntries("/", "*"))
  159. {
  160. if (Path.GetExtension(fileEntry.FullPath).ToLower() == ".nca")
  161. {
  162. pfs.OpenFile(out IFile ncaFile, fileEntry.FullPath.ToU8Span(), OpenMode.Read).ThrowIfFailure();
  163. Nca nca = new Nca(_virtualFileSystem.KeySet, ncaFile.AsStorage());
  164. int dataIndex = Nca.GetSectionIndexFromType(NcaSectionType.Data, NcaContentType.Program);
  165. if (nca.Header.ContentType == NcaContentType.Program && !nca.Header.GetFsHeader(dataIndex).IsPatchSection())
  166. {
  167. hasMainNca = true;
  168. break;
  169. }
  170. }
  171. else if (Path.GetFileNameWithoutExtension(fileEntry.FullPath) == "main")
  172. {
  173. isExeFs = true;
  174. }
  175. }
  176. if (!hasMainNca && !isExeFs)
  177. {
  178. numApplicationsFound--;
  179. continue;
  180. }
  181. }
  182. if (isExeFs)
  183. {
  184. applicationIcon = _nspIcon;
  185. Result result = pfs.OpenFile(out IFile npdmFile, "/main.npdm".ToU8Span(), OpenMode.Read);
  186. if (ResultFs.PathNotFound.Includes(result))
  187. {
  188. Npdm npdm = new Npdm(npdmFile.AsStream());
  189. titleName = npdm.TitleName;
  190. titleId = npdm.Aci0.TitleId.ToString("x16");
  191. }
  192. }
  193. else
  194. {
  195. // Store the ControlFS in variable called controlFs
  196. GetControlFsAndTitleId(pfs, out IFileSystem controlFs, out titleId);
  197. ReadControlData(controlFs, controlHolder.ByteSpan);
  198. // Get the title name, title ID, developer name and version number from the NACP
  199. version = IsUpdateApplied(titleId, out string updateVersion) ? updateVersion : controlHolder.Value.DisplayVersion.ToString();
  200. GetNameIdDeveloper(ref controlHolder.Value, out titleName, out _, out developer);
  201. // Read the icon from the ControlFS and store it as a byte array
  202. try
  203. {
  204. controlFs.OpenFile(out IFile icon, $"/icon_{_desiredTitleLanguage}.dat".ToU8Span(), OpenMode.Read).ThrowIfFailure();
  205. using (MemoryStream stream = new MemoryStream())
  206. {
  207. icon.AsStream().CopyTo(stream);
  208. applicationIcon = stream.ToArray();
  209. }
  210. }
  211. catch (HorizonResultException)
  212. {
  213. foreach (DirectoryEntryEx entry in controlFs.EnumerateEntries("/", "*"))
  214. {
  215. if (entry.Name == "control.nacp")
  216. {
  217. continue;
  218. }
  219. controlFs.OpenFile(out IFile icon, entry.FullPath.ToU8Span(), OpenMode.Read).ThrowIfFailure();
  220. using (MemoryStream stream = new MemoryStream())
  221. {
  222. icon.AsStream().CopyTo(stream);
  223. applicationIcon = stream.ToArray();
  224. }
  225. if (applicationIcon != null)
  226. {
  227. break;
  228. }
  229. }
  230. if (applicationIcon == null)
  231. {
  232. applicationIcon = Path.GetExtension(applicationPath).ToLower() == ".xci" ? _xciIcon : _nspIcon;
  233. }
  234. }
  235. }
  236. }
  237. catch (MissingKeyException exception)
  238. {
  239. applicationIcon = Path.GetExtension(applicationPath).ToLower() == ".xci" ? _xciIcon : _nspIcon;
  240. Logger.Warning?.Print(LogClass.Application, $"Your key set is missing a key with the name: {exception.Name}");
  241. }
  242. catch (InvalidDataException)
  243. {
  244. applicationIcon = Path.GetExtension(applicationPath).ToLower() == ".xci" ? _xciIcon : _nspIcon;
  245. Logger.Warning?.Print(LogClass.Application, $"The header key is incorrect or missing and therefore the NCA header content type check has failed. Errored File: {applicationPath}");
  246. }
  247. catch (Exception exception)
  248. {
  249. Logger.Warning?.Print(LogClass.Application, $"The file encountered was not of a valid type. Errored File: {applicationPath}");
  250. Logger.Debug?.Print(LogClass.Application, exception.ToString());
  251. numApplicationsFound--;
  252. _loadingError = true;
  253. continue;
  254. }
  255. }
  256. else if (Path.GetExtension(applicationPath).ToLower() == ".nro")
  257. {
  258. BinaryReader reader = new BinaryReader(file);
  259. byte[] Read(long position, int size)
  260. {
  261. file.Seek(position, SeekOrigin.Begin);
  262. return reader.ReadBytes(size);
  263. }
  264. try
  265. {
  266. file.Seek(24, SeekOrigin.Begin);
  267. int assetOffset = reader.ReadInt32();
  268. if (Encoding.ASCII.GetString(Read(assetOffset, 4)) == "ASET")
  269. {
  270. byte[] iconSectionInfo = Read(assetOffset + 8, 0x10);
  271. long iconOffset = BitConverter.ToInt64(iconSectionInfo, 0);
  272. long iconSize = BitConverter.ToInt64(iconSectionInfo, 8);
  273. ulong nacpOffset = reader.ReadUInt64();
  274. ulong nacpSize = reader.ReadUInt64();
  275. // Reads and stores game icon as byte array
  276. applicationIcon = Read(assetOffset + iconOffset, (int) iconSize);
  277. // Read the NACP data
  278. Read(assetOffset + (int)nacpOffset, (int)nacpSize).AsSpan().CopyTo(controlHolder.ByteSpan);
  279. // Get the title name, title ID, developer name and version number from the NACP
  280. version = controlHolder.Value.DisplayVersion.ToString();
  281. GetNameIdDeveloper(ref controlHolder.Value, out titleName, out titleId, out developer);
  282. }
  283. else
  284. {
  285. applicationIcon = _nroIcon;
  286. titleName = Path.GetFileNameWithoutExtension(applicationPath);
  287. }
  288. }
  289. catch
  290. {
  291. Logger.Warning?.Print(LogClass.Application, $"The file encountered was not of a valid type. Errored File: {applicationPath}");
  292. numApplicationsFound--;
  293. continue;
  294. }
  295. }
  296. else if (Path.GetExtension(applicationPath).ToLower() == ".nca")
  297. {
  298. try
  299. {
  300. Nca nca = new Nca(_virtualFileSystem.KeySet, new FileStream(applicationPath, FileMode.Open, FileAccess.Read).AsStorage());
  301. int dataIndex = Nca.GetSectionIndexFromType(NcaSectionType.Data, NcaContentType.Program);
  302. if (nca.Header.ContentType != NcaContentType.Program || nca.Header.GetFsHeader(dataIndex).IsPatchSection())
  303. {
  304. numApplicationsFound--;
  305. continue;
  306. }
  307. }
  308. catch (InvalidDataException)
  309. {
  310. Logger.Warning?.Print(LogClass.Application, $"The NCA header content type check has failed. This is usually because the header key is incorrect or missing. Errored File: {applicationPath}");
  311. }
  312. catch
  313. {
  314. Logger.Warning?.Print(LogClass.Application, $"The file encountered was not of a valid type. Errored File: {applicationPath}");
  315. numApplicationsFound--;
  316. _loadingError = true;
  317. continue;
  318. }
  319. applicationIcon = _ncaIcon;
  320. titleName = Path.GetFileNameWithoutExtension(applicationPath);
  321. }
  322. // If its an NSO we just set defaults
  323. else if (Path.GetExtension(applicationPath).ToLower() == ".nso")
  324. {
  325. applicationIcon = _nsoIcon;
  326. titleName = Path.GetFileNameWithoutExtension(applicationPath);
  327. }
  328. }
  329. }
  330. catch (IOException exception)
  331. {
  332. Logger.Warning?.Print(LogClass.Application, exception.Message);
  333. numApplicationsFound--;
  334. _loadingError = true;
  335. continue;
  336. }
  337. ApplicationMetadata appMetadata = LoadAndSaveMetaData(titleId);
  338. if (appMetadata.LastPlayed != "Never" && !DateTime.TryParse(appMetadata.LastPlayed, out _))
  339. {
  340. Logger.Warning?.Print(LogClass.Application, $"Last played datetime \"{appMetadata.LastPlayed}\" is invalid for current system culture, skipping (did current culture change?)");
  341. appMetadata.LastPlayed = "Never";
  342. }
  343. ApplicationData data = new ApplicationData
  344. {
  345. Favorite = appMetadata.Favorite,
  346. Icon = applicationIcon,
  347. TitleName = titleName,
  348. TitleId = titleId,
  349. Developer = developer,
  350. Version = version,
  351. TimePlayed = ConvertSecondsToReadableString(appMetadata.TimePlayed),
  352. LastPlayed = appMetadata.LastPlayed,
  353. FileExtension = Path.GetExtension(applicationPath).ToUpper().Remove(0, 1),
  354. FileSize = (fileSize < 1) ? (fileSize * 1024).ToString("0.##") + "MB" : fileSize.ToString("0.##") + "GB",
  355. Path = applicationPath,
  356. ControlHolder = controlHolder
  357. };
  358. numApplicationsLoaded++;
  359. OnApplicationAdded(new ApplicationAddedEventArgs()
  360. {
  361. AppData = data
  362. });
  363. OnApplicationCountUpdated(new ApplicationCountUpdatedEventArgs()
  364. {
  365. NumAppsFound = numApplicationsFound,
  366. NumAppsLoaded = numApplicationsLoaded
  367. });
  368. }
  369. OnApplicationCountUpdated(new ApplicationCountUpdatedEventArgs()
  370. {
  371. NumAppsFound = numApplicationsFound,
  372. NumAppsLoaded = numApplicationsLoaded
  373. });
  374. if (_loadingError)
  375. {
  376. Gtk.Application.Invoke(delegate
  377. {
  378. GtkDialog.CreateErrorDialog("One or more files encountered could not be loaded, check logs for more info.");
  379. });
  380. }
  381. }
  382. protected void OnApplicationAdded(ApplicationAddedEventArgs e)
  383. {
  384. ApplicationAdded?.Invoke(null, e);
  385. }
  386. protected void OnApplicationCountUpdated(ApplicationCountUpdatedEventArgs e)
  387. {
  388. ApplicationCountUpdated?.Invoke(null, e);
  389. }
  390. private void GetControlFsAndTitleId(PartitionFileSystem pfs, out IFileSystem controlFs, out string titleId)
  391. {
  392. (_, _, Nca controlNca) = ApplicationLoader.GetGameData(_virtualFileSystem, pfs, 0);
  393. // Return the ControlFS
  394. controlFs = controlNca?.OpenFileSystem(NcaSectionType.Data, IntegrityCheckLevel.None);
  395. titleId = controlNca?.Header.TitleId.ToString("x16");
  396. }
  397. internal ApplicationMetadata LoadAndSaveMetaData(string titleId, Action<ApplicationMetadata> modifyFunction = null)
  398. {
  399. string metadataFolder = Path.Combine(AppDataManager.GamesDirPath, titleId, "gui");
  400. string metadataFile = Path.Combine(metadataFolder, "metadata.json");
  401. ApplicationMetadata appMetadata;
  402. if (!File.Exists(metadataFile))
  403. {
  404. Directory.CreateDirectory(metadataFolder);
  405. appMetadata = new ApplicationMetadata();
  406. using (FileStream stream = File.Create(metadataFile, 4096, FileOptions.WriteThrough))
  407. {
  408. JsonHelper.Serialize(stream, appMetadata, true);
  409. }
  410. }
  411. try
  412. {
  413. appMetadata = JsonHelper.DeserializeFromFile<ApplicationMetadata>(metadataFile);
  414. }
  415. catch (JsonException)
  416. {
  417. Logger.Warning?.Print(LogClass.Application, $"Failed to parse metadata json for {titleId}. Loading defaults.");
  418. appMetadata = new ApplicationMetadata();
  419. }
  420. if (modifyFunction != null)
  421. {
  422. modifyFunction(appMetadata);
  423. using (FileStream stream = File.Create(metadataFile, 4096, FileOptions.WriteThrough))
  424. {
  425. JsonHelper.Serialize(stream, appMetadata, true);
  426. }
  427. }
  428. return appMetadata;
  429. }
  430. private string ConvertSecondsToReadableString(double seconds)
  431. {
  432. const int secondsPerMinute = 60;
  433. const int secondsPerHour = secondsPerMinute * 60;
  434. const int secondsPerDay = secondsPerHour * 24;
  435. string readableString;
  436. if (seconds < secondsPerMinute)
  437. {
  438. readableString = $"{seconds}s";
  439. }
  440. else if (seconds < secondsPerHour)
  441. {
  442. readableString = $"{Math.Round(seconds / secondsPerMinute, 2, MidpointRounding.AwayFromZero)} mins";
  443. }
  444. else if (seconds < secondsPerDay)
  445. {
  446. readableString = $"{Math.Round(seconds / secondsPerHour, 2, MidpointRounding.AwayFromZero)} hrs";
  447. }
  448. else
  449. {
  450. readableString = $"{Math.Round(seconds / secondsPerDay, 2, MidpointRounding.AwayFromZero)} days";
  451. }
  452. return readableString;
  453. }
  454. private void GetNameIdDeveloper(ref ApplicationControlProperty controlData, out string titleName, out string titleId, out string publisher)
  455. {
  456. _ = Enum.TryParse(_desiredTitleLanguage.ToString(), out TitleLanguage desiredTitleLanguage);
  457. if (controlData.Titles.Length > (int)desiredTitleLanguage)
  458. {
  459. titleName = controlData.Titles[(int)desiredTitleLanguage].Name.ToString();
  460. publisher = controlData.Titles[(int)desiredTitleLanguage].Publisher.ToString();
  461. }
  462. else
  463. {
  464. titleName = null;
  465. publisher = null;
  466. }
  467. if (string.IsNullOrWhiteSpace(titleName))
  468. {
  469. foreach (ApplicationControlTitle controlTitle in controlData.Titles)
  470. {
  471. if (!((U8Span)controlTitle.Name).IsEmpty())
  472. {
  473. titleName = controlTitle.Name.ToString();
  474. break;
  475. }
  476. }
  477. }
  478. if (string.IsNullOrWhiteSpace(publisher))
  479. {
  480. foreach (ApplicationControlTitle controlTitle in controlData.Titles)
  481. {
  482. if (!((U8Span)controlTitle.Publisher).IsEmpty())
  483. {
  484. publisher = controlTitle.Publisher.ToString();
  485. break;
  486. }
  487. }
  488. }
  489. if (controlData.PresenceGroupId != 0)
  490. {
  491. titleId = controlData.PresenceGroupId.ToString("x16");
  492. }
  493. else if (controlData.SaveDataOwnerId.Value != 0)
  494. {
  495. titleId = controlData.SaveDataOwnerId.ToString();
  496. }
  497. else if (controlData.AddOnContentBaseId != 0)
  498. {
  499. titleId = (controlData.AddOnContentBaseId - 0x1000).ToString("x16");
  500. }
  501. else
  502. {
  503. titleId = "0000000000000000";
  504. }
  505. }
  506. private bool IsUpdateApplied(string titleId, out string version)
  507. {
  508. string updatePath = "(unknown)";
  509. try
  510. {
  511. (Nca patchNca, Nca controlNca) = ApplicationLoader.GetGameUpdateData(_virtualFileSystem, titleId, 0, out updatePath);
  512. if (patchNca != null && controlNca != null)
  513. {
  514. ApplicationControlProperty controlData = new ApplicationControlProperty();
  515. controlNca.OpenFileSystem(NcaSectionType.Data, IntegrityCheckLevel.None).OpenFile(out IFile nacpFile, "/control.nacp".ToU8Span(), OpenMode.Read).ThrowIfFailure();
  516. nacpFile.Read(out _, 0, SpanHelpers.AsByteSpan(ref controlData), ReadOption.None).ThrowIfFailure();
  517. version = controlData.DisplayVersion.ToString();
  518. return true;
  519. }
  520. }
  521. catch (InvalidDataException)
  522. {
  523. Logger.Warning?.Print(LogClass.Application,
  524. $"The header key is incorrect or missing and therefore the NCA header content type check has failed. Errored File: {updatePath}");
  525. }
  526. catch (MissingKeyException exception)
  527. {
  528. Logger.Warning?.Print(LogClass.Application, $"Your key set is missing a key with the name: {exception.Name}. Errored File: {updatePath}");
  529. }
  530. version = "";
  531. return false;
  532. }
  533. }
  534. }