Advertisement
danielocdh

Untitled

Apr 8th, 2020 (edited)
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.77 KB | None | 0 0
  1. You will need git and visual studio 2019 (visual studio 2019 community works fine)
  2. With all these changes mod assistant will install the bsipa from _local_mods\bspia.zip
  3. If you want a specific version of mod assistant or bsipa you will need to checkout that
  4. specifc version after cloning it (cd into the folder and: git checkout <commit id> --force)
  5.  
  6.  
  7. getting latest mod assistant:
  8. git clone https://github.com/Assistant/ModAssistant.git
  9.  
  10. getting latest bsipa
  11. git clone https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded.git --recursive
  12.  
  13.  
  14. File BeatSaber-IPA-Reloaded\bsinstalldir.txt
  15. Must contain the path to the game (I usually compile on a different computer, the path can be
  16. different, it might be that the version of the game has to be the same) with regular slashes,
  17. ending with a slash, without new lines, encoded in UTF8 without BOM(use notepad/notepad++)
  18. example:
  19. G:/games/Beat Saber/
  20.  
  21.  
  22. File BeatSaber-IPA-Reloaded\IPA.Injector\AntiPiracy.cs
  23. from:
  24. public static bool IsInvalid(string path)
  25. {
  26. to:
  27. public static bool IsInvalid(string path)
  28. {
  29. return false;
  30.  
  31.  
  32. File BeatSaber-IPA-Reloaded\IPA.Loader\Config\SelfConfig.cs
  33. from:
  34. public virtual bool Regenerate { get; set; } = true;
  35. to:
  36. public virtual bool Regenerate { get; set; } = false;
  37.  
  38. from:
  39. public virtual bool AutoUpdate { get; set; } = true;
  40. to:
  41. public virtual bool AutoUpdate { get; set; } = false;
  42.  
  43. from:
  44. public virtual bool AutoCheckUpdates { get; set; } = true;
  45. to:
  46. public virtual bool AutoCheckUpdates { get; set; } = false;
  47.  
  48.  
  49. File ModAssistant\ModAssistant\Classes\Updater.cs
  50. from:
  51. public static async Task<bool> CheckForUpdate()
  52. {
  53. to:
  54. public static async Task<bool> CheckForUpdate()
  55. {
  56. return false;
  57.  
  58.  
  59. File ModAssistant\ModAssistant\Classes\Utils.cs
  60. from:
  61. public static bool IsVoid()
  62. {
  63. to:
  64. public static bool IsVoid()
  65. {
  66. return false;
  67.  
  68.  
  69. File ModAssistant\ModAssistant\Pages\Mods.xaml\Mods.xaml.cs
  70. This file contains the changes that make mod assistant install bsipa from _local_mods
  71. from:
  72. if (mod.name.ToLowerInvariant() == "bsipa")
  73. {
  74. MainWindow.Instance.MainText = $"{string.Format((string)FindResource("Mods:InstallingMod"), mod.name)}...";
  75. await Task.Run(async () => await InstallMod(mod, installDirectory));
  76. to:
  77. if (mod.name.ToLowerInvariant() == "bsipa")
  78. {
  79. MainWindow.Instance.MainText = $"{string.Format((string)FindResource("Mods:InstallingMod"), mod.name)}...";
  80. await Task.Run(async () => await InstallModLocal(mod, installDirectory));
  81.  
  82. from:
  83. private async Task InstallMod(Mod mod, string directory)
  84. to:
  85. private async Task InstallModLocal(Mod mod, string directory)
  86. {
  87. string installDirectory = App.BeatSaberInstallDirectory;
  88. string localDir = Path.Combine(installDirectory, "_local_mods");
  89. string localZip = Path.Combine(localDir, $"{mod.name.ToLower()}.zip");
  90.  
  91. if (!Directory.Exists(localDir) || !File.Exists(localZip))
  92. {
  93. System.Windows.MessageBox.Show(string.Format((string)FindResource("Mods:ModDownloadLinkMissing"), mod.name));
  94. return;
  95. }
  96.  
  97. using (FileStream zipToOpen = new FileStream(localZip, FileMode.Open))
  98. {
  99. using (ZipArchive archive = new ZipArchive(zipToOpen, ZipArchiveMode.Update))
  100. {
  101. foreach (ZipArchiveEntry file in archive.Entries)
  102. {
  103. string fileDirectory = Path.GetDirectoryName(Path.Combine(directory, file.FullName));
  104. if (!Directory.Exists(fileDirectory))
  105. {
  106. Directory.CreateDirectory(fileDirectory);
  107. }
  108.  
  109. if (!String.IsNullOrEmpty(file.Name))
  110. {
  111. await ExtractFile(file, Path.Combine(directory, file.FullName), 3.0, mod.name, 10);
  112. }
  113. }
  114. }
  115. }
  116. }
  117. private async Task InstallMod(Mod mod, string directory)
  118.  
  119.  
  120. for bsipa:
  121. save changes made
  122. build->configuration manager: release, x64, close
  123. build->clean solution
  124. build->rebuild solution
  125. compress files from BSIPA-Meta\bin\x64\Release\Net461 to <game dir>\_local_mods\bsipa.zip
  126.  
  127. for mod assistant:
  128. save changes made
  129. build->configuration manager: release, close
  130. build->clean solution
  131. build->rebuild solution
  132. copy ModAssistant.exe from ModAssistant\bin\Release to <game dir>
  133.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement