rodneyviana / ODSyncService

OneDrive service/DLL for Sync State
MIT License
93 stars 26 forks source link

Taskbar Blinking #15

Closed N0odlez closed 3 years ago

N0odlez commented 4 years ago

Sorry to drag this one back up again but there must be a solution to stop what ever is causing the taskbar to refresh? I personally believe it to be an issue with the cpp files as nothing in the CSharp sticks out to me as causing the issue. Please can we relook in to this as I'm sure solving this issue will help a LOT of people. #4

N0odlez commented 4 years ago

I believe this is the offending line as to what is causing the taskbar to blink https://github.com/rodneyviana/ODSyncService/blob/651286b266b8fbe410b3b7395f8829c9e2addd86/ODNative/ODNative.cpp#L22

rodneyviana commented 4 years ago

ODNative.cpp is the heart of the checking. It blinks if you run it in a loop. How are you using it?

N0odlez commented 4 years ago

@rodneyviana I am running the script every 10-15 minutes, one hour is too long to not check a customers OneDrive.

rodneyviana commented 4 years ago

@rodneyviana I am running the script every 10-15 minutes, one hour is too long to not check a customers OneDrive.

How you run it? Just Get-ODStatus or you specify a folder or folders?

N0odlez commented 4 years ago

I'm just using CyberDrains script: https://www.cyberdrain.com/monitoring-with-powershell-monitoring-onedrive-status-for-current-logged-on-user/

It just uses the Get-ODStatus. But even if i run Get-ODStatus from powershell on its own once it makes the taskbar blink.

rodneyviana commented 3 years ago

I'm just using CyberDrains script: https://www.cyberdrain.com/monitoring-with-powershell-monitoring-onedrive-status-for-current-logged-on-user/

It just uses the Get-ODStatus. But even if i run Get-ODStatus from powershell on its own once it makes the taskbar blink.

How often are you running it? If you are not running every minute, it should not blink.

N0odlez commented 3 years ago

Like I say, it runs once every 15 minutes and the taskbar blinks.

rodneyviana commented 3 years ago

Like I say, it runs once every 15 minutes and the taskbar blinks.

I am coming up with a new approach to get the status. Would you be able to test this beta version? https://github.com/rodneyviana/ODSyncService/tree/master/Binaries/Beta

N0odlez commented 3 years ago

Of course. I'll set this up in the office using Datto rmm and see if this fixes :)

WouterLS commented 3 years ago

That seems to work! The powershell needs some work to distinguish between different onedrive accounts. If you have more than one configured.

N0odlez commented 3 years ago

I've had no issues as of yet. No blinking, seems to detect correctly if there are errors. Looks good👍

N0odlez commented 3 years ago

What else needs doing? I've tested all the things i can possibly think of and it picks up all errors with OnDemand or normal. It picks up multiple instances of OneDrive, i.e. personal and corporate. The only thing i can see missing is an easy way to install this on a computer without having to logon to each machine. Obviously I guess this would be fixed by having the exe signed.

rodneyviana commented 3 years ago

What else needs doing? I've tested all the things i can possibly think of and it picks up all errors with OnDemand or normal. It picks up multiple instances of OneDrive, i.e. personal and corporate. The only thing i can see missing is an easy way to install this on a computer without having to logon to each machine. Obviously I guess this would be fixed by having the exe signed.

N0odlez,

Actually both the installer and app are signed. The stand alone application in the beta folder is not signed, but the one in the installer is. If you want unattended install you may consider adding /MONITOR=1 on your setup.exe command or calling ODOnDemand.exe -onLaunch (logged as Administrator).

N0odlez commented 3 years ago

Okay cool. What are all the status string that will be put in the log? I've tried breaking onedrive to get all the errors but I failed haha.

rodneyviana commented 3 years ago

Okay cool. What are all the status string that will be put in the log? I've tried breaking onedrive to get all the errors but I failed haha.

Hi N0odlez,

I don't know what the messages are, but I believe that you can see them by opening %localappdata%\Microsoft\OneDrive\\FileSync.LocalizedResources.dll in Visual Studio and opening the String Table [English].

image

KelvinTegelaar commented 3 years ago

Hey Rodney, I'm the developer of the PowerShell script abusing your module ;)

Just wanted to drop a quick thank you - Most of my readers had issues with the blinking taskbar and I always had to reference them to decreasing the interval of scans.

Does the latest OneDriveLib.dll PowerShell module also include the improved monitoring for some of the states? In any case; big thanks for this fix.

N0odlez commented 3 years ago

@KelvinTegelaar I dont believe the .dll does. The exe looks to be a better option as this hooks in to the debug mode on the OneDrive exe. This gives better flexibility as it is no longer capturing the taskbar icons.

I could be wrong but I believe the exe needs to be placed in a central location, ie C:\tools for all users to be able to use. I have read through your script before and understand it well. And easy new implementation would be to check if the exe exists, compare hash, if wrong hash download new exe. Then check for registry key. After this use your impersonation script to impersonate the current user and grab the log file that @rodneyviana has already stated in the monitor script he has done.

@rodneyviana in regards to all the possible statuses, thank you for the above but this doesn't give me all the outputs possible in to the debug log file. We need to know all the status possible in the debug output file so we can effectively monitor.

KelvinTegelaar commented 3 years ago

@rodneyviana

I'm not sure how much time you get to spend on this project, or if its more of a pet-project. I'd really love if we could work together on getting the PowerShell DLL file updated to prevent the blinking. I feel that the PowerShell module has more power than the current logging method.

The logging method only seems to check the latest state of the tooltip of onedrive.exe. This means we lose the ability to directly monitor specific sites and folders. It also loses the ability to alert only on specific sites and have the other sites get processed as informational.

If there is anything I can do to help I'd love to assist.

rodneyviana commented 3 years ago

@rodneyviana

I'm not sure how much time you get to spend on this project, or if its more of a pet-project. I'd really love if we could work together on getting the PowerShell DLL file updated to prevent the blinking. I feel that the PowerShell module has more power than the current logging method.

The logging method only seems to check the latest state of the tooltip of onedrive.exe. This means we lose the ability to directly monitor specific sites and folders. It also loses the ability to alert only on specific sites and have the other sites get processed as informational.

If there is anything I can do to help I'd love to assist.

Hi Kevin,

The logging method contains all changes that occurred during the day with the exact time stamp. Install the application using the installer here and make some tests. I tried to make the PowerShell module work but there is no way to implement OnDemand.

rodneyviana commented 3 years ago

@KelvinTegelaar I dont believe the .dll does. The exe looks to be a better option as this hooks in to the debug mode on the OneDrive exe. This gives better flexibility as it is no longer capturing the taskbar icons.

I could be wrong but I believe the exe needs to be placed in a central location, ie C:\tools for all users to be able to use. I have read through your script before and understand it well. And easy new implementation would be to check if the exe exists, compare hash, if wrong hash download new exe. Then check for registry key. After this use your impersonation script to impersonate the current user and grab the log file that @rodneyviana has already stated in the monitor script he has done.

@rodneyviana in regards to all the possible statuses, thank you for the above but this doesn't give me all the outputs possible in to the debug log file. We need to know all the status possible in the debug output file so we can effectively monitor.

@N0odlez,

That is the best way of seeing the available message. I don't have access to any further information than that DLL.

rodneyviana commented 3 years ago

Can I close this thread?