ShammyLevva / FTAnalyzer

Family Tree Analyzer - Finds hidden details in your family tree. Install at
http://www.ftanalyzer.com/install
Apache License 2.0
56 stars 23 forks source link

Moving form error [BUG] #170

Closed StoPaul closed 4 years ago

StoPaul commented 4 years ago

With FTA version v7.8.0.0 When I try to move the main window, FTA generates the following error report, see below. I click "continue", FTA continues. The error happens every time I try to move the main window. Everything else seams to work fine. My Win 10 device manager notes that all devices are working normally. Capture

"Unhandled exception has occurred in your application. If you click Continue, the application will ignore this error and attempt to continue. If you click Quit, the application will close immediately. A device attached to the system is not functioning."

See the end of this message for details on invoking just-in-time (JIT) debugging instead of this dialog box.

** Exception Text ** System.IO.IOException: A device attached to the system is not functioning.

at Microsoft.Win32.RegistryKey.Win32Error(Int32 errorCode, String str) at Microsoft.Win32.RegistryKey.SetValue(String name, Object value, RegistryValueKind valueKind) at FTAnalyzer.MainForm.SavePosition() at System.Windows.Forms.Control.OnMove(EventArgs e) at System.Windows.Forms.Control.OnLocationChanged(EventArgs e) at System.Windows.Forms.Control.UpdateBounds(Int32 x, Int32 y, Int32 width, Int32 height, Int32 clientWidth, Int32 clientHeight) at System.Windows.Forms.Control.UpdateBounds() at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.Form.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

ShammyLevva commented 4 years ago

An IO exception is when it's trying to save your preferences - in this case to save your preferred location of the window on the screen. This indicates the program has no access to save the preferences. That suggests the apps permissions are not allowing it to save your preferences.

Check the app is allowed to save user preferences.

StoPaul commented 4 years ago

Ok, but how do I allow FTA to save user preferences? Thanks

ShammyLevva commented 4 years ago

https://support.microsoft.com/en-gb/help/10557/windows-10-app-permissions

The default for a regular windows app is to write user settings to the registry. A windows store app needs the user to allow this setting, which may or may not be on by default. See the link on how to change the setting.

Note I appreciate this now seems excessive so I'm going to investigate ways of saving preferences without needing to have this setting enabled. So users don't have to give such a permission. For now that first permission is what is required.

Meantime I've added code to prevent the app crashing instead if will just warn if it can't save preferences. A future version will either save preferences a different way or may have a means of skipping the saving of preferences.

It might be I add these to options rather than registry preferences. As those don't seem to complain and it would be better if the app doesn't go near the registry thus doesn't need that permission turned on.

StoPaul commented 4 years ago

Sounds good, thanks for the reply.

StoPaul commented 4 years ago

Hi Shammy, Just wanted to let you know that I read the microsoft support article on permissions. I checked all FTA options under Select Start > Settings > Privacy and found that FTA was not blocked. There must be some other block in Win 10 or my virus checker that is blocking FTA. Also, checked my system event logs, there were no messages generated by FTA. Also, starting FTA as admin did not help. Also, exporting any of the lists, produced the same device error and the export failed with no list generated. Also, no items in my logs generated from my anti-virus software. Regards, Paul

ShammyLevva commented 4 years ago

Ah ok interesting. I just naturally assumed it would be a permissions thing. The crash is happening when it tries to write to the registry. Can you try this beta version please. https://www.dropbox.com/s/juk0d7aan5sqn90/FTAnalyzer%20v7.8.1.0.zip?dl=0 unzip the files in the zip file to a folder eg: on desktop and run FTAnalyzer.exe to see if that helps.

StoPaul commented 4 years ago

Perfect! No errors at all. On the first time run WIN10 asked if ok to run, I said yes and no problems.

Thanks for update. FTA is a very nice tool in helping review my tree.

Regards, Paul

ShammyLevva commented 4 years ago

Good to hear.