MoscaDotTo / Winapp2

A database of extended cleaning routines for popular Windows PC based maintenance software.
Creative Commons Attribution Share Alike 4.0 International
783 stars 87 forks source link

Annoying startup exception in winapp2ool.exe #872

Closed kintrupf closed 2 years ago

kintrupf commented 2 years ago

Unhandled Exception: System.IO.FileNotFoundException: winapp2ool.exe at System.Diagnostics.FileVersionInfo.GetVersionInfo(String fileName) at winapp2ool.launcher.main()

This annoying exception is often thrown when winapp2ool.exe is launched.

MoscaDotTo commented 2 years ago

this is likely caused by recent builds being unsigned and therefore (incorrectly) flagged as malware. builds will be signed again soon, starting with the next build! Sorry about this, there's been no way around the delay.

MoscaDotTo commented 2 years ago

Hey this should hopefully be fixed now as builds are signed again. winapp2ool has a long history of being incorrectly flagged as malware, so feel free to re-open an issue if you have this problem again

kintrupf commented 2 years ago

Unfortunately, there is still an exception. However, most of the time the exception has changed. Now I get:

Unhandled Exception: System.IO.IOException: The handle is invalid.

   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.Console.GetBufferInfo(Boolean throwOnNoConsole, Boolean& succeeded)
   at System.Console.get_WindowHeight()
   at winapp2ool.launcher.main()

This is the command line winapp2ool is started with. The current directory is the directory where winapp2ool.exe is: winapp2ool.exe -2 -d -s -3d "c:\temp\winapp2.ini"

But sometimes I still get the "original" exception:

Unhandled Exception: System.IO.FileNotFoundException: winapp2ool.exe
at System.Diagnostics.FileVersionInfo.GetVersionInfo(String fileName)
at winapp2ool.launcher.main()

It's hard to track down, now and then the call succeeds and the new winapp2.ini is downloaded without problems. I checked it on three different computers (two with Windows 10, one with Windows 11), and the problem exists on all three.

MoscaDotTo commented 2 years ago

Give this build a try https://github.com/MoscaDotTo/Winapp2/blob/Branch1/winapp2ool/bin/Release/winapp2ool.exe

I was able to recreate and fix a crash when the target directory of -3d doesnt exist, hopefully that addresses the top one. It's possible the second crash is still caused by the unsigned builds, as sometimes the changes can take a while to propagate. Let me know if the issues persist in this build

MoscaDotTo commented 2 years ago

do you experience this on the build posted above?

MoscaDotTo commented 2 years ago

I believe the build above addresses the issue where winapp2ool will crash and fail to save winapp2.ini when run with the commandline targeting a directory which does not exist, so I'm going to close. Feel free to open a new issue or comment back if you're still experiencing this on the latest build

kintrupf commented 2 years ago

Unfortunately, the issue still persist. I still sometimes get an exception when the latest winapp2ool.exe is called. The target directory does exist and is writable.

Unhandled Exception: System.IO.IOException: The handle is invalid.

   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.Console.GetBufferInfo(Boolean throwOnNoConsole, Boolean& succeeded)
   at System.Console.get_WindowHeight()
   at winapp2ool.launcher.main()

This is my command line winapp2ool.exe -2 -d -s -3d "C:\Temp\winapp2.new"

However, I can't really reproduce it reliably. If I call the above command from a batch file it fails every time. If I call it directly from the command line it works. Very weird!

MoscaDotTo commented 2 years ago

I'm not able to reproduce; if you could answer some of these questions it would help. for any directories with things like usernames, you can omit the contents eg c:\users\{user}\desktop

Are you using winapp2ool v1.5.8145.36628

Is winapp2ool.exe -2 -d -s -3d "C:\Temp\winapp2.new" the only contents in the batch file? If not, could you post the contents

Is winapp2ool.exe inside the C:\temp directory? If not, in which directory is it located?

Are you running the batch file and winapp2ool as an administrator?

when winapp2ool crashes, does it produce a winapp2ool.log file? If so, can you post it?

Is your system language set to German?

MoscaDotTo commented 2 years ago

winapp2ool v1.5.8165.37514 is available, it makes some small changes to winapp2ool's startup procedure, it probably will not directly address your problem here but perhaps it can help. I'm not sure why Console.get_WindowHeight() would be called here if you're running with the -s command

kintrupf commented 2 years ago

It seems that this new version fixed the problem for me 😊 I checked it on two systems and this time no error occurred when winapp2ool was called from my batch file. The batch file is automatically called daily, so I will keep an eye open if it the problem appears again.

Thanks a lot for your patience with this error 👍