sw3103 / movemouse

Move Mouse is a simple piece of software that is designed to simulate user activity.
http://www.movemouse.co.uk/
GNU General Public License v3.0
576 stars 108 forks source link

Win10: mm 3.5.0 crashes silently #7

Closed kbirger closed 4 years ago

kbirger commented 5 years ago

I downloaded the 3.5.0 exe, regardless of whether I run as admin or not, the app loads up the tray icon, and then closes silently when I try to load up the GUI.

OS: Windows 10 1803 App: MoveMouse 3.5.0 (non win-store) dotNET: 4.7.2

Rolling down to 3.4.1 of MM works.

Event Viewer reports

Faulting application name: mm35.exe, version: 3.5.0.0, time stamp: 0x5bbd2bb6 Faulting module name: System.Windows.Forms.ni.dll, version: 4.7.3056.0, time stamp: 0x5a8e5a21 Exception code: 0xc00000fd Fault offset: 0x0000000000257841 Faulting process id: 0x31e8 Faulting application start time: 0x01d49163389ffd70 Faulting application path: C:\Users\kbirger\Downloads\mm35.exe Faulting module path: C:\WINDOWS\assembly\NativeImages_v4.0.30319_64\System.Windows.Forms\ade68b7a739043dc843f645157b0b636\System.Windows.Forms.ni.dll Report Id: 0fe4baa7-b5b7-4e87-b6e4-6e380ae9c27f Faulting package full name: Faulting package-relative application ID:

According to StackOverflow, Exception code: 0xc00000fd means StackOverflow (ironically :))

sw3103 commented 5 years ago

Hi,

MM 3.5.0 uses .NET 4.5.2, whereas previous versions used .NET 2.0. Windows will normally detect this and prompt you to download the required version of .NET Framework.

Can you see if install .NET Framework 4.5.2 resolves your issue?

https://www.microsoft.com/en-gb/download/details.aspx?id=42642

kbirger commented 5 years ago

Hi @sw3103, Thanks for the response. I have .NET 4.5.2, I just also have newer versions. I am successfully able to create a new application in visual studio and target 4.5.2 (and run it, of course).

I think 4.7 is an in-place upgrade over 4.5 (well, specifically over 4.6).

Is there any reason you don't want to update to the latest .net?

sw3103 commented 5 years ago

I had to go to a 4.5.2 to support the KryptonWinFormControls package. I could've just gone straight to 4.7, but as unlikely as it may be, there may still be a few Windows Vista machines out there that I would've alienated. I'll probably make the jump on my next release.

Are you able to download the source for 3.5.0 and compile it?

kbirger commented 5 years ago

Personally, I would say that if they are on Windows Vista, the inability to run the latest version of this software is probably not their biggest concern. :)

Running from source

Attempt 1: Running as-is Same thing, crashes when I try to pull up the UI with a stackoverflow on SystemTrayIcon.cs:191

_moveMouse.ShowInTaskbar = true;

Attempt 2: Change target Changed the target to 4.7.1 (I don't have the 4.7.2 sdk on this machine). Reinstalled the nuget dependencies to target net471.

Same result as above.. Incidentally, commenting that line seems to fix the immediate problem of crashes. So whatever hooks into that property seems to be the issue.

HarmD commented 5 years ago

This issue is related to #8. The reason, why it is solved either by disabling minimise_to_system_tray in settings or commenting line _moveMouse.ShowInTaskbar = true; in SystemTrayIcon.cs is that assignment of ShowInTaskbar property fires MouseForm_Resize event, which in its turn also interacts with this property. I didn't investigate, what exactly in code has changed that caused this to broke, but I was able to fix it with next change:

    private FormWindowState _lastWindowState = FormWindowState.Minimized;

    private void MouseForm_Resize(object sender, EventArgs e)
    {
        if (WindowState != _lastWindowState)
        {
            _lastWindowState = WindowState;
             if (WindowState == FormWindowState.Minimized)
            {
                ShowInTaskbar = !minimiseToSystemTrayCheckBox.Checked;
            }
        }
    }
sw3103 commented 5 years ago

It must be the KryptonWinFormControls package which is the cause of this, as it is the only thing that has really changed. The idea was to give the UI a more modern look, but it is not worth it if it is causing crashes.

I think I'll release another update without the KryptonWinFormControls package.

kbirger commented 5 years ago

Thanks @sw3103. FWIW, I've always liked MM for its simple UI anyway:)

sw3103 commented 4 years ago

Version 3.6.0 now available without KryptonWinFormControls UI components.