Skip to content
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

Studio updates force close all active Studio processes #211

Open
HooferDevelops opened this issue Jul 18, 2024 · 3 comments
Open

Studio updates force close all active Studio processes #211

HooferDevelops opened this issue Jul 18, 2024 · 3 comments
Assignees

Comments

@HooferDevelops
Copy link

When launching the Mod Manager, in the event there is an update for Roblox Studio, it will forcefully close all active studio processes. It does this prior to asking if I would like to close studio.

This is really frustrating, as there are cases where I mistakenly have clicked on mod manager, for it to open and forcefully close all of my studio sessions before I have time to react.

The intended behavior should be that it would only kill the processes after I confirm my action.

@HooferDevelops
Copy link
Author

This issue happens here:

if (running.Count > 0)
{
setStatus("Shutting down Roblox Studio...");
foreach (Process p in running)
{
if (CanForceStudioShutdown)
{
tryToKillProcess(p);
continue;
}
SetForegroundWindow(p.MainWindowHandle);
FlashWindow(p.MainWindowHandle, true);
var delay = Task.Delay(50);
p.CloseMainWindow();
await delay.ConfigureAwait(true);
}
List<Process> runningNow = null;
const int retries = 10;
const int granularity = 300;
Progress = 0;
MaxProgress = retries * granularity;
ProgressBarStyle = ProgressBarStyle.Continuous;
for (int i = 0; i < retries; i++)
{
runningNow = GetRunningStudioProcesses();
if (runningNow.Count == 0)
{
safeToContinue = true;
break;
}
else
{
var delay = Task.Delay(1000);
Progress += granularity;
await delay.ConfigureAwait(true);
}
}
if (runningNow.Count > 0 && !safeToContinue)
{
DialogResult result = DialogResult.OK;
if (mainState == Program.State)
{
result = MessageBox.Show
(
"All Roblox Studio processes need to be closed in order to update Roblox Studio!\n" +
"Press Ok once you've saved your work, or\n" +
"Press Cancel to skip this update temporarily.",
"Notice",
MessageBoxButtons.OKCancel,
MessageBoxIcon.Warning
);
}
if (result == DialogResult.Cancel)
{
safeToContinue = true;
cancelled = true;
}
}
}
else
{
safeToContinue = true;
}
}
return !cancelled;

You can see that it attempts to close all the processes prior to the prompt.

@MaximumADHD MaximumADHD self-assigned this Jul 18, 2024
@MaximumADHD
Copy link
Owner

Sure, I'll tweak this.

@HooferDevelops
Copy link
Author

Another bug I found is that the message box prompts below the Mod Manager, I've found this can be fixed by adding
MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly
to the MessageBox.Show prompt.

I fixed these issues myself on a separate branch, I can PR if wanted.

RobloxStudioBeta_REoSb6la6K.mp4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants