Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- You will need git and visual studio 2019 (visual studio 2019 community works fine)
- With all these changes mod assistant will install the bsipa from _local_mods\bspia.zip
- If you want a specific version of mod assistant or bsipa you will need to checkout that
- specifc version after cloning it (cd into the folder and: git checkout <commit id> --force)
- getting latest mod assistant:
- git clone https://github.com/Assistant/ModAssistant.git
- getting latest bsipa
- git clone https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded.git --recursive
- File BeatSaber-IPA-Reloaded\bsinstalldir.txt
- Must contain the path to the game (I usually compile on a different computer, the path can be
- different, it might be that the version of the game has to be the same) with regular slashes,
- ending with a slash, without new lines, encoded in UTF8 without BOM(use notepad/notepad++)
- example:
- G:/games/Beat Saber/
- File BeatSaber-IPA-Reloaded\IPA.Injector\AntiPiracy.cs
- from:
- public static bool IsInvalid(string path)
- {
- to:
- public static bool IsInvalid(string path)
- {
- return false;
- File BeatSaber-IPA-Reloaded\IPA.Loader\Config\SelfConfig.cs
- from:
- public virtual bool Regenerate { get; set; } = true;
- to:
- public virtual bool Regenerate { get; set; } = false;
- from:
- public virtual bool AutoUpdate { get; set; } = true;
- to:
- public virtual bool AutoUpdate { get; set; } = false;
- from:
- public virtual bool AutoCheckUpdates { get; set; } = true;
- to:
- public virtual bool AutoCheckUpdates { get; set; } = false;
- File ModAssistant\ModAssistant\Classes\Updater.cs
- from:
- public static async Task<bool> CheckForUpdate()
- {
- to:
- public static async Task<bool> CheckForUpdate()
- {
- return false;
- File ModAssistant\ModAssistant\Classes\Utils.cs
- from:
- public static bool IsVoid()
- {
- to:
- public static bool IsVoid()
- {
- return false;
- File ModAssistant\ModAssistant\Pages\Mods.xaml\Mods.xaml.cs
- This file contains the changes that make mod assistant install bsipa from _local_mods
- from:
- if (mod.name.ToLowerInvariant() == "bsipa")
- {
- MainWindow.Instance.MainText = $"{string.Format((string)FindResource("Mods:InstallingMod"), mod.name)}...";
- await Task.Run(async () => await InstallMod(mod, installDirectory));
- to:
- if (mod.name.ToLowerInvariant() == "bsipa")
- {
- MainWindow.Instance.MainText = $"{string.Format((string)FindResource("Mods:InstallingMod"), mod.name)}...";
- await Task.Run(async () => await InstallModLocal(mod, installDirectory));
- from:
- private async Task InstallMod(Mod mod, string directory)
- to:
- private async Task InstallModLocal(Mod mod, string directory)
- {
- string installDirectory = App.BeatSaberInstallDirectory;
- string localDir = Path.Combine(installDirectory, "_local_mods");
- string localZip = Path.Combine(localDir, $"{mod.name.ToLower()}.zip");
- if (!Directory.Exists(localDir) || !File.Exists(localZip))
- {
- System.Windows.MessageBox.Show(string.Format((string)FindResource("Mods:ModDownloadLinkMissing"), mod.name));
- return;
- }
- using (FileStream zipToOpen = new FileStream(localZip, FileMode.Open))
- {
- using (ZipArchive archive = new ZipArchive(zipToOpen, ZipArchiveMode.Update))
- {
- foreach (ZipArchiveEntry file in archive.Entries)
- {
- string fileDirectory = Path.GetDirectoryName(Path.Combine(directory, file.FullName));
- if (!Directory.Exists(fileDirectory))
- {
- Directory.CreateDirectory(fileDirectory);
- }
- if (!String.IsNullOrEmpty(file.Name))
- {
- await ExtractFile(file, Path.Combine(directory, file.FullName), 3.0, mod.name, 10);
- }
- }
- }
- }
- }
- private async Task InstallMod(Mod mod, string directory)
- for bsipa:
- save changes made
- build->configuration manager: release, x64, close
- build->clean solution
- build->rebuild solution
- compress files from BSIPA-Meta\bin\x64\Release\Net461 to <game dir>\_local_mods\bsipa.zip
- for mod assistant:
- save changes made
- build->configuration manager: release, close
- build->clean solution
- build->rebuild solution
- copy ModAssistant.exe from ModAssistant\bin\Release to <game dir>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement