gawindx / WinNUT-Client

This is a NUT windows client for monitoring your ups hooked up to your favorite linux server.
GNU General Public License v3.0
395 stars 70 forks source link

Can't start WinNUT 2.1.7740 in Windows 10 #75

Open lunstudy opened 3 years ago

lunstudy commented 3 years ago

Hi guys,

I install WinNUT 2.1.7740 in Windows 10, then start it, the WinNUT show error message as below, how can I fix it?

Screenshot 2021-03-16 16 35 51

gawindx commented 3 years ago

The installed version is a beta version (pre-release) and therefore for testing purposes.

If WinNUT has never been installed before, I will recommend installing the latest version in 2.0.

I take note of the problem but it would be interesting to know if WinNUT has already been installed before or if it is a new installation (the registry keys are created at the first launch so the problem could come from there given the message error encountered).

gawindx commented 3 years ago

latest stable version

lunstudy commented 3 years ago

Yes, this Windows 10 OS is first time run WinNUT, and I also test install the latest version 2.0 in this Windows 10 OS, but I still get same error message.

gawindx commented 3 years ago

Can you generate an error report ("generate report and close winnut" button) and paste it here to have a little more information (the report is copied both to a file and to the clipboard, so you just have to paste it directly here)

lunstudy commented 3 years ago

I try it("generate report and close winnut" button), but it didn't past any report message, only can copy & past message as below

Exception type: System.TypeInitializationException Exception message: The type initializer for 'WinNUT_client.WinNUT_Params' threw an exception. Exception stack trace: at WinNUT_client.My.MyApplication.Generate_Button_Click(Object sender, EventArgs e) at System.EventHandler.Invoke(Object sender, EventArgs e) at System.Windows.Forms.Control.OnClick(EventArgs e) at System.Windows.Forms.Button.OnClick(EventArgs e) at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ButtonBase.WndProc(Message& m) at System.Windows.Forms.Button.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

gawindx commented 3 years ago

normally, winnut creates a user data directory in the %userprofile%\AppData\Roaming\WinNUT-Client directory as well as a key in the registry (HKEY_CURRENT_USER\SOFTWARE\WinNUT) if you do not find these 2 elements, it means that WinNUT crashes even before having initialized these data, and therefore from the very beginning of the startup. This will be consistent with your error message because it implies that it cannot instantiate the module which takes care of these 2 functions.

quick question, what is the language of your pc? (I wonder about a problem of character that would pose a problem during the treatment)

lunstudy commented 3 years ago

Hi,

My Windows 10 Pro OS default is English(US).

And I check this PC register, it didn't create WinNUT key in HKEY_CURRENT_USER\SOFTWARE

Thanks.

gawindx commented 3 years ago

considering the error encountered, and especially the fact that it arrives early in the launch of Winnut, I am not surprised that the key is not created.

Where it bothers me is that I do not see why it crashes. I took care to work only at the user level to avoid having access to admin rights, and at this stage of the code, we only access a user directory and a user registry key.

Which makes me say that the problem comes from one of these 2 points.

So 2 little questions:

Regarding the registry, I do not see how your session would not have access to it so I think the problem is not there.

If you agree, I will compile a special version for you which will show you a popup at each step to know which line of code it crashes (unless you have access to visual studio in which case you just have to recover the code to know at which line of code an exception is generated).

manjul968 commented 3 years ago

Hi! I have a similar problem with ver.2.1.7740 and 2.0.7722. Windows Server 2012R2 ru. NET v4.8. I have Admin rights with default russian name . The last version that ran was 2.0.4 but it didn't work out the shutdown:) Any ideas? PS "Generate Report" button not copied data to clipboard Version 2.1.7740 Exception type: System.TypeInitializationException Exception message: Инициализатор типа "WinNUT_Client_Common.WinNUT_Params" выдал исключение. Exception stack trace: в WinNUT_Client_Common.WinNUT_Params.Init_Params() в WinNUT_Client.WinNUT.WinNUT_Load(Object sender, EventArgs e) в System.EventHandler.Invoke(Object sender, EventArgs e) в System.Windows.Forms.Form.OnLoad(EventArgs e) в System.Windows.Forms.Form.OnCreateControl() в System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible) в System.Windows.Forms.Control.CreateControl() в System.Windows.Forms.Control.WmShowWindow(Message& m) в System.Windows.Forms.Control.WndProc(Message& m) в System.Windows.Forms.ScrollableControl.WndProc(Message& m) в System.Windows.Forms.Form.WmShowWindow(Message& m) в System.Windows.Forms.Form.WndProc(Message& m) в System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) в System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) в System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) version 2.0.7722 Exception type: System.TypeInitializationException Exception message: Инициализатор типа "WinNUT_client.WinNUT_Params" выдал исключение. Exception stack trace: в WinNUT_client.WinNUT_Params.Init_Params() в WinNUT_client.WinNUT.WinNUT_Load(Object sender, EventArgs e) в System.EventHandler.Invoke(Object sender, EventArgs e) в System.Windows.Forms.Form.OnLoad(EventArgs e) в System.Windows.Forms.Form.OnCreateControl() в System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible) в System.Windows.Forms.Control.CreateControl() в System.Windows.Forms.Control.WmShowWindow(Message& m) в System.Windows.Forms.Control.WndProc(Message& m) в System.Windows.Forms.ScrollableControl.WndProc(Message& m) в System.Windows.Forms.Form.WmShowWindow(Message& m) в System.Windows.Forms.Form.WndProc(Message& m) в System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) в System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) в System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

PaulMerk commented 2 years ago

As new WinNut user I first started the program without connection to the NUT and closed the program without any changes. My second program start did not succeed. Repairing or new installation did not cure. It seems, that an INTERVAL needs to be set. I have not found this parameter with regedit. Installation of 2.0.7722.30975 worked fine now.

WinNUT Bug Report Os Version : 6.2.9200.0 WinNUT Version : 2.1.7740.35837

WinNUT Parameters : { "Delay": 0, "AutoReconnect": "False", "MinInputVoltage": 210, "MaxInputVoltage": 270, "FrequencySupply": 0, "MinInputFrequency": 40, "MaxInputFrequency": 60, "MinOutputVoltage": 210, "MaxOutputVoltage": 250, "MinUPSLoad": 0, "MaxUPSLoad": 100, "MinBattVoltage": 6, "MaxBattVoltage": 18, "MinimizeToTray": "False", "MinimizeOnStart": "False", "CloseToTray": "False", "StartWithWindows": "False", "UseLogFile": "False", "Log Level": 0, "ShutdownLimitBatteryCharge": 30, "ShutdownLimitUPSRemainTime": 120, "ImmediateStopAction": "True", "Follow_FSD": "False", "TypeOfStop": 0, "DelayToShutdown": 15, "AllowExtendedShutdownDelay": "False", "ExtendedShutdownDelay": 15, "VerifyUpdate": "False", "VerifyUpdateAtStart": "False", "DelayBetweenEachVerification": 2, "StableOrDevBranch": 0, "LastDateVerification": "" }

Error Message : Exception type: System.ArgumentOutOfRangeException Exception message: Der Wert 0 ist für "Interval" ungültig. "Interval" muss größer als 0 sein. Parametername: Interval Exception stack trace: bei System.Windows.Forms.Timer.set_Interval(Int32 value) bei WinNUT_Client.WinNUT.WinNUT_Load(Object sender, EventArgs e) bei System.EventHandler.Invoke(Object sender, EventArgs e) bei System.Windows.Forms.Form.OnLoad(EventArgs e) bei System.Windows.Forms.Form.OnCreateControl() bei System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible) bei System.Windows.Forms.Control.CreateControl() bei System.Windows.Forms.Control.WmShowWindow(Message& m) bei System.Windows.Forms.Control.WndProc(Message& m) bei System.Windows.Forms.ScrollableControl.WndProc(Message& m) bei System.Windows.Forms.Form.WmShowWindow(Message& m) bei System.Windows.Forms.Form.WndProc(Message& m) bei System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) bei System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) bei System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Last Events : 27.10.2021 15:13:24 Pid: 3320 WinNUT : Initialisation Globals Variables Complete 27.10.2021 15:13:24 Pid: 3320 WinNUT : Initialisation Params Complete 27.10.2021 15:13:24 Pid: 3320 WinNUT : Loaded Params Complete 27.10.2021 15:13:24 Pid: 3320 WinNUT : NotifyIcons Initialised 27.10.2021 15:13:24 Pid: 3320 WinNUT : Windows 10 Toast Notification Not Available. Too Old Windows Version

clubber1966 commented 2 years ago

Hello,

Did this ever get resolved as I have exactly the same issue as OP. The registry keys are not getting created. English (Singapore) Region and username is ACL.

Thanks

gbakeman commented 2 years ago

This program is currently undergoing a lot of work as I integrate a NUT communication library, please bear with us.

lemppari commented 2 years ago

I have the same problem. Windows Server 2019 1809. Running and installed as admin. WinNUT won't start. Application directory created, registry key not.

Exception type: System.TypeInitializationException Exception message: The type initializer for 'WinNUT_client.WinNUT_Params' threw an exception. Exception stack trace: at WinNUT_client.WinNUT_Params.Init_Params() at WinNUT_client.WinNUT.WinNUT_Load(Object sender, EventArgs e) at System.EventHandler.Invoke(Object sender, EventArgs e) at System.Windows.Forms.Form.OnLoad(EventArgs e) at System.Windows.Forms.Form.OnCreateControl() at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible) at System.Windows.Forms.Control.CreateControl() at System.Windows.Forms.Control.WmShowWindow(Message& m) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ScrollableControl.WndProc(Message& m) at System.Windows.Forms.Form.WmShowWindow(Message& m) at System.Windows.Forms.Form.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

mightyoj commented 2 years ago

Also having the same issue, two systems with Microsoft Windows 10 v1607 [OS Build 14393.4770]. One doesn't have any issues, the other crashes on app start.

Let me know if you'd like any other logs or test anything else.

Exception type: System.TypeInitializationException Exception message: The type initializer for 'WinNUT_client.WinNUT_Params' threw an exception. Exception stack trace: at WinNUT_client.My.MyApplication.Generate_Button_Click(Object sender, EventArgs e) at System.EventHandler.Invoke(Object sender, EventArgs e) at System.Windows.Forms.Control.OnClick(EventArgs e) at System.Windows.Forms.Button.OnClick(EventArgs e) at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ButtonBase.WndProc(Message& m) at System.Windows.Forms.Button.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

zagi988 commented 2 years ago

Having the same error here. It was installed and worked great for half a year and then all of a sudden:

Exception type: System.TypeInitializationException Exception message: The type initializer for 'WinNUT_client.WinNUT_Params' threw an exception. Exception stack trace: at WinNUT_client.WinNUT_Params.Init_Params() at WinNUT_client.WinNUT.WinNUT_Load(Object sender, EventArgs e) at System.EventHandler.Invoke(Object sender, EventArgs e) at System.Windows.Forms.Form.OnLoad(EventArgs e) at System.Windows.Forms.Form.OnCreateControl() at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible) at System.Windows.Forms.Control.CreateControl() at System.Windows.Forms.Control.WmShowWindow(Message& m) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ScrollableControl.WndProc(Message& m) at System.Windows.Forms.Form.WmShowWindow(Message& m) at System.Windows.Forms.Form.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

zagi988 commented 2 years ago

Still nothing on this? Or on anything?

gbakeman commented 2 years ago

We're moving forward on a quick patch in #89. I was supposed to have write access to the repo but found out that the invitations expired, so I sent an email to @gawindx hoping they might resend it. Sorry for the wait!

gbakeman commented 1 year ago

Everyone following this issue - please see the new issue I've created above, https://github.com/nutdotnet/WinNUT-Client/issues/1. Another person has reported the issue after several patches and I'm going to try and get to the bottom of this. This repository is no longer being updated, but the linked one is.

gbakeman commented 1 year ago

Attention subscribers to this issue - I believe I have a fix ready. Please see the linked issue above.

FatsWaler commented 1 year ago

This error has just stated happening to me out of nowhere. I have tried the latest stable edition. Is the any step by step instructions to fix it?

Thanks