ApplicationLibrary.cs 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650
  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. File: '{applicationPath}' Error: {exception}");
  250. numApplicationsFound--;
  251. _loadingError = true;
  252. continue;
  253. }
  254. }
  255. else if (Path.GetExtension(applicationPath).ToLower() == ".nro")
  256. {
  257. BinaryReader reader = new BinaryReader(file);
  258. byte[] Read(long position, int size)
  259. {
  260. file.Seek(position, SeekOrigin.Begin);
  261. return reader.ReadBytes(size);
  262. }
  263. try
  264. {
  265. file.Seek(24, SeekOrigin.Begin);
  266. int assetOffset = reader.ReadInt32();
  267. if (Encoding.ASCII.GetString(Read(assetOffset, 4)) == "ASET")
  268. {
  269. byte[] iconSectionInfo = Read(assetOffset + 8, 0x10);
  270. long iconOffset = BitConverter.ToInt64(iconSectionInfo, 0);
  271. long iconSize = BitConverter.ToInt64(iconSectionInfo, 8);
  272. ulong nacpOffset = reader.ReadUInt64();
  273. ulong nacpSize = reader.ReadUInt64();
  274. // Reads and stores game icon as byte array
  275. applicationIcon = Read(assetOffset + iconOffset, (int) iconSize);
  276. // Read the NACP data
  277. Read(assetOffset + (int)nacpOffset, (int)nacpSize).AsSpan().CopyTo(controlHolder.ByteSpan);
  278. // Get the title name, title ID, developer name and version number from the NACP
  279. version = controlHolder.Value.DisplayVersion.ToString();
  280. GetNameIdDeveloper(ref controlHolder.Value, out titleName, out titleId, out developer);
  281. }
  282. else
  283. {
  284. applicationIcon = _nroIcon;
  285. titleName = Path.GetFileNameWithoutExtension(applicationPath);
  286. }
  287. }
  288. catch
  289. {
  290. Logger.Warning?.Print(LogClass.Application, $"The file encountered was not of a valid type. Errored File: {applicationPath}");
  291. numApplicationsFound--;
  292. continue;
  293. }
  294. }
  295. else if (Path.GetExtension(applicationPath).ToLower() == ".nca")
  296. {
  297. try
  298. {
  299. Nca nca = new Nca(_virtualFileSystem.KeySet, new FileStream(applicationPath, FileMode.Open, FileAccess.Read).AsStorage());
  300. int dataIndex = Nca.GetSectionIndexFromType(NcaSectionType.Data, NcaContentType.Program);
  301. if (nca.Header.ContentType != NcaContentType.Program || nca.Header.GetFsHeader(dataIndex).IsPatchSection())
  302. {
  303. numApplicationsFound--;
  304. continue;
  305. }
  306. }
  307. catch (InvalidDataException)
  308. {
  309. 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}");
  310. }
  311. catch
  312. {
  313. Logger.Warning?.Print(LogClass.Application, $"The file encountered was not of a valid type. Errored File: {applicationPath}");
  314. numApplicationsFound--;
  315. _loadingError = true;
  316. continue;
  317. }
  318. applicationIcon = _ncaIcon;
  319. titleName = Path.GetFileNameWithoutExtension(applicationPath);
  320. }
  321. // If its an NSO we just set defaults
  322. else if (Path.GetExtension(applicationPath).ToLower() == ".nso")
  323. {
  324. applicationIcon = _nsoIcon;
  325. titleName = Path.GetFileNameWithoutExtension(applicationPath);
  326. }
  327. }
  328. }
  329. catch (IOException exception)
  330. {
  331. Logger.Warning?.Print(LogClass.Application, exception.Message);
  332. numApplicationsFound--;
  333. _loadingError = true;
  334. continue;
  335. }
  336. ApplicationMetadata appMetadata = LoadAndSaveMetaData(titleId);
  337. if (appMetadata.LastPlayed != "Never" && !DateTime.TryParse(appMetadata.LastPlayed, out _))
  338. {
  339. Logger.Warning?.Print(LogClass.Application, $"Last played datetime \"{appMetadata.LastPlayed}\" is invalid for current system culture, skipping (did current culture change?)");
  340. appMetadata.LastPlayed = "Never";
  341. }
  342. ApplicationData data = new ApplicationData
  343. {
  344. Favorite = appMetadata.Favorite,
  345. Icon = applicationIcon,
  346. TitleName = titleName,
  347. TitleId = titleId,
  348. Developer = developer,
  349. Version = version,
  350. TimePlayed = ConvertSecondsToReadableString(appMetadata.TimePlayed),
  351. LastPlayed = appMetadata.LastPlayed,
  352. FileExtension = Path.GetExtension(applicationPath).ToUpper().Remove(0, 1),
  353. FileSize = (fileSize < 1) ? (fileSize * 1024).ToString("0.##") + "MB" : fileSize.ToString("0.##") + "GB",
  354. Path = applicationPath,
  355. ControlHolder = controlHolder
  356. };
  357. numApplicationsLoaded++;
  358. OnApplicationAdded(new ApplicationAddedEventArgs()
  359. {
  360. AppData = data
  361. });
  362. OnApplicationCountUpdated(new ApplicationCountUpdatedEventArgs()
  363. {
  364. NumAppsFound = numApplicationsFound,
  365. NumAppsLoaded = numApplicationsLoaded
  366. });
  367. }
  368. OnApplicationCountUpdated(new ApplicationCountUpdatedEventArgs()
  369. {
  370. NumAppsFound = numApplicationsFound,
  371. NumAppsLoaded = numApplicationsLoaded
  372. });
  373. if (_loadingError)
  374. {
  375. Gtk.Application.Invoke(delegate
  376. {
  377. GtkDialog.CreateErrorDialog("One or more files encountered could not be loaded, check logs for more info.");
  378. });
  379. }
  380. }
  381. protected void OnApplicationAdded(ApplicationAddedEventArgs e)
  382. {
  383. ApplicationAdded?.Invoke(null, e);
  384. }
  385. protected void OnApplicationCountUpdated(ApplicationCountUpdatedEventArgs e)
  386. {
  387. ApplicationCountUpdated?.Invoke(null, e);
  388. }
  389. private void GetControlFsAndTitleId(PartitionFileSystem pfs, out IFileSystem controlFs, out string titleId)
  390. {
  391. (_, _, Nca controlNca) = ApplicationLoader.GetGameData(_virtualFileSystem, pfs, 0);
  392. // Return the ControlFS
  393. controlFs = controlNca?.OpenFileSystem(NcaSectionType.Data, IntegrityCheckLevel.None);
  394. titleId = controlNca?.Header.TitleId.ToString("x16");
  395. }
  396. internal ApplicationMetadata LoadAndSaveMetaData(string titleId, Action<ApplicationMetadata> modifyFunction = null)
  397. {
  398. string metadataFolder = Path.Combine(AppDataManager.GamesDirPath, titleId, "gui");
  399. string metadataFile = Path.Combine(metadataFolder, "metadata.json");
  400. ApplicationMetadata appMetadata;
  401. if (!File.Exists(metadataFile))
  402. {
  403. Directory.CreateDirectory(metadataFolder);
  404. appMetadata = new ApplicationMetadata();
  405. using (FileStream stream = File.Create(metadataFile, 4096, FileOptions.WriteThrough))
  406. {
  407. JsonHelper.Serialize(stream, appMetadata, true);
  408. }
  409. }
  410. try
  411. {
  412. appMetadata = JsonHelper.DeserializeFromFile<ApplicationMetadata>(metadataFile);
  413. }
  414. catch (JsonException)
  415. {
  416. Logger.Warning?.Print(LogClass.Application, $"Failed to parse metadata json for {titleId}. Loading defaults.");
  417. appMetadata = new ApplicationMetadata();
  418. }
  419. if (modifyFunction != null)
  420. {
  421. modifyFunction(appMetadata);
  422. using (FileStream stream = File.Create(metadataFile, 4096, FileOptions.WriteThrough))
  423. {
  424. JsonHelper.Serialize(stream, appMetadata, true);
  425. }
  426. }
  427. return appMetadata;
  428. }
  429. private string ConvertSecondsToReadableString(double seconds)
  430. {
  431. const int secondsPerMinute = 60;
  432. const int secondsPerHour = secondsPerMinute * 60;
  433. const int secondsPerDay = secondsPerHour * 24;
  434. string readableString;
  435. if (seconds < secondsPerMinute)
  436. {
  437. readableString = $"{seconds}s";
  438. }
  439. else if (seconds < secondsPerHour)
  440. {
  441. readableString = $"{Math.Round(seconds / secondsPerMinute, 2, MidpointRounding.AwayFromZero)} mins";
  442. }
  443. else if (seconds < secondsPerDay)
  444. {
  445. readableString = $"{Math.Round(seconds / secondsPerHour, 2, MidpointRounding.AwayFromZero)} hrs";
  446. }
  447. else
  448. {
  449. readableString = $"{Math.Round(seconds / secondsPerDay, 2, MidpointRounding.AwayFromZero)} days";
  450. }
  451. return readableString;
  452. }
  453. private void GetNameIdDeveloper(ref ApplicationControlProperty controlData, out string titleName, out string titleId, out string publisher)
  454. {
  455. _ = Enum.TryParse(_desiredTitleLanguage.ToString(), out TitleLanguage desiredTitleLanguage);
  456. if (controlData.Titles.Length > (int)desiredTitleLanguage)
  457. {
  458. titleName = controlData.Titles[(int)desiredTitleLanguage].Name.ToString();
  459. publisher = controlData.Titles[(int)desiredTitleLanguage].Publisher.ToString();
  460. }
  461. else
  462. {
  463. titleName = null;
  464. publisher = null;
  465. }
  466. if (string.IsNullOrWhiteSpace(titleName))
  467. {
  468. foreach (ApplicationControlTitle controlTitle in controlData.Titles)
  469. {
  470. if (!((U8Span)controlTitle.Name).IsEmpty())
  471. {
  472. titleName = controlTitle.Name.ToString();
  473. break;
  474. }
  475. }
  476. }
  477. if (string.IsNullOrWhiteSpace(publisher))
  478. {
  479. foreach (ApplicationControlTitle controlTitle in controlData.Titles)
  480. {
  481. if (!((U8Span)controlTitle.Publisher).IsEmpty())
  482. {
  483. publisher = controlTitle.Publisher.ToString();
  484. break;
  485. }
  486. }
  487. }
  488. if (controlData.PresenceGroupId != 0)
  489. {
  490. titleId = controlData.PresenceGroupId.ToString("x16");
  491. }
  492. else if (controlData.SaveDataOwnerId.Value != 0)
  493. {
  494. titleId = controlData.SaveDataOwnerId.ToString();
  495. }
  496. else if (controlData.AddOnContentBaseId != 0)
  497. {
  498. titleId = (controlData.AddOnContentBaseId - 0x1000).ToString("x16");
  499. }
  500. else
  501. {
  502. titleId = "0000000000000000";
  503. }
  504. }
  505. private bool IsUpdateApplied(string titleId, out string version)
  506. {
  507. string updatePath = "(unknown)";
  508. try
  509. {
  510. (Nca patchNca, Nca controlNca) = ApplicationLoader.GetGameUpdateData(_virtualFileSystem, titleId, 0, out updatePath);
  511. if (patchNca != null && controlNca != null)
  512. {
  513. ApplicationControlProperty controlData = new ApplicationControlProperty();
  514. controlNca.OpenFileSystem(NcaSectionType.Data, IntegrityCheckLevel.None).OpenFile(out IFile nacpFile, "/control.nacp".ToU8Span(), OpenMode.Read).ThrowIfFailure();
  515. nacpFile.Read(out _, 0, SpanHelpers.AsByteSpan(ref controlData), ReadOption.None).ThrowIfFailure();
  516. version = controlData.DisplayVersion.ToString();
  517. return true;
  518. }
  519. }
  520. catch (InvalidDataException)
  521. {
  522. Logger.Warning?.Print(LogClass.Application,
  523. $"The header key is incorrect or missing and therefore the NCA header content type check has failed. Errored File: {updatePath}");
  524. }
  525. catch (MissingKeyException exception)
  526. {
  527. Logger.Warning?.Print(LogClass.Application, $"Your key set is missing a key with the name: {exception.Name}. Errored File: {updatePath}");
  528. }
  529. version = "";
  530. return false;
  531. }
  532. }
  533. }