-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
full launcher and installer #200
base: development
Are you sure you want to change the base?
full launcher and installer #200
Conversation
string registry_key = @"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"; | ||
using (Microsoft.Win32.RegistryKey key = Registry.LocalMachine.OpenSubKey(registry_key)) | ||
{ | ||
foreach (string subkey_name in key.GetSubKeyNames()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This feels a bit unnecessary. Can we use LINQ to find the subkey we're looking for? Do we only expect a few subkeys in each key? Probably fine since it's just during install...
private void PathBrowse_Click(object sender, EventArgs e) | ||
{ | ||
FolderBrowserDialog folderBrowserDialog1 = new FolderBrowserDialog(); | ||
if (folderBrowserDialog1.ShowDialog() == DialogResult.OK) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the cancel button work? Is that inherit functionality from forms?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The functionality of the dialog box is inherited from the second parameter: MessageBoxButtons.YesNo in the declaration.
source/Launcher/Launcher.cs
Outdated
/// Check if MB is installed (through the registry) - Only works in x64. | ||
/// </summary> | ||
/// <returns>Full path where MB is installed</returns> | ||
private string GetBannerLordInstalledPath() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is copy pasta, lets pull this out into some status util for both classes to use. If for some reason this changes in future releases, we don't want to have to change it twice
} | ||
return null; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also some white space to clean
source/Launcher/Launcher.cs
Outdated
process.StartInfo.FileName = "\"" + mbPath + @"\bin\Win64_Shipping_Client\Bannerlord.exe" + "\""; | ||
process.StartInfo.Arguments = "/singleplayer /server _MODULES_*Native*SandBoxCore*CustomBattle*SandBox*StoryMode*Coop*_MODULES_"; | ||
process.Start(); | ||
process.Close(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we close it? I assume this works I just don't know what it does haha
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spawns a process to run MB, once it's done, the process is dead, it just needs to be closed so the resources can be freed up.
56250f7
to
a17f934
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wow
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behaviour?
Adding an installer and a launcher to the mod. Installer contains all the necessary dlls and auto-detects where Mount and Blade is installed. Creates a shortcut if needed.
Launcher runs mount and blade with /server or /client (with the necessary submodules) depending on the selection from UI.
There is potential to add more launch options to this.
What is the new behaviour?
Resolves #
https://i.imgur.com/loc9jqz.png
https://i.imgur.com/OuZTijg.png
Other information