WinThumbsPreloader-V2: [Bugs Masterlist] Backlog
Hey there! Just testing the new pre-release version and off the bat I just wanted to ask if you could provide a portable version (without an installer) for people like me who want to keep tools like this portable! Just save all the stuff in the same folder (and load from) as the exe, if you’re not doing that already. Add the portable version on the Releases page as well please!
Secondly, I encountered this unhandled exception when opening the backup folder before it exists:
************** Exception Text **************
System.IO.FileNotFoundException: Could not find file 'E:\Programs\WinThumbsPreloader\New folder\Explorer Backup'.
File name: 'E:\Programs\WinThumbsPreloader\New folder\Explorer Backup'
at System.IO.FileSystem.CreateDirectory(String fullPath, Byte[] securityDescriptor)
at System.IO.Directory.CreateDirectory(String path)
at WinThumbsPreloader.CacheForm.ClearButton_Click(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.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, WM msg, IntPtr wparam, IntPtr lparam)
About this issue
- Original URL
- State: open
- Created 3 years ago
- Comments: 55 (24 by maintainers)
Gladly! You’re awesome for carrying this torch more or less alone, and I’m here to help as best I can.
Looping back to my backup restore corruption - I’ve recently tried going back to my bat-based backup/restore solution and much to my dismay I noticed it failed to restore them as well (i.e. instantly getting nuked by windows) - could it be that something changed recently with windows to cause this? Is the new beta 4 causing issues with generating as well? Maybe related to what you said about empty entries in the db causing issues? Is my PC throwing a fit? Can you reproduce this issue as well if you restore?
I may try adding a setting to choose whether to close out of explorer only once or per every file in case either one works better. I would’ve thought using the same method as the bat file would’ve made it work better, not the other way around (lol)
That’s interesting, it also doesn’t seem to be working on my side either. I’ll be looking into what’s causing it to not generate webm files in particular.
Currently I don’t have it working very well enough to be reliable as the blank entries at the start issue tends to cripple it for some reason, though I guess ThumbCache Viewer could read the backup cache and verify checksums there as well, just without being able to repair them.
In the meantime, I’m working on the bulk preloading feature and doing some testing with webm files, though if there are any other changes that you want to be added, feel free to let me know.
Also, I just want to say thank you for helping with this project and responding to the other issues, it’s been very helpful and I appreciate your help!
Thanks for finding all of these issues, I’ve managed to fix them for the next release and am currently adding other features beforehand.
For the folder thumbnail generation, I had initially created that feature and deemed it working by testing the amount of items that would be generated as there would be more with the option enabled. With thumbscache viewer, I found out it wasn’t actually working which is most likely due to how it was initially supposed to only generate folder thumbs if the files within contained the specified extensions which wasn’t implemented properly. It should now work and I’m adding an option to choose between only loading folder thumbs if they contain files with the set extensions or to load them all which could potentially have instabilities.
After doing some digging/research and some trial and error, I’ve found out that the thumbnail cache databases aren’t SQLite (as far as I can tell) and are instead a proprietary binary file format, though the file information including the data checksum was able to be extracted and utilized in some other programs (Thumbcache Viewer technically does but its written in C++ which is a lot harder to understand), which led me to find a C# implementation under a similar name that is also able to read the information, though it’s going to take some time to understand how exactly it works and how to utilize it myself if possible.
While the C# implementation doesn’t have the logic for calculating the CRC64 checksum to compare to the stored data checksum and it isn’t well documented on how the checksum is actually calculated, the C++ implementation can do it, though it’s going to take some learning and understanding on how it works. The lookup table for the checksum was also used from a thumbscache dll and implemented into the C++ implementation, and the calculator was able to be implemented in C#, though it’s not clear what part of the data actually gets calculated as trying to calculate it from the image data outputs a different checksum in my testing.
This may take a while to ensure it would actually work or how to get it to work properly as I also believe there is a master cache database index that keeps track of the files so I’ll have to see if it’s still fully possible in the end. I’m not sure if deleting or modifying the checksum/database entries will cause issues with the index database not accepting the thumbs cache.
I don’t want to get your hopes too high, but if I can get this implemented eventually, I’d like to have an option to shift click the backup button to repair the thumbnail cache backup or something similar, though perhaps I could also turn this into its own program that can repair thumbnail cache which can interact with mine if I can figure out how to replace the checksum in the file or just remove the faulty entries to allow the cache to be usable by Windows if it doesn’t disturb the index cache.
Like I said though, it’s not guaranteed that I will be able to get this working soon if at all, but I am looking into it and actually making some progress using some resources to learn how the thumbscache works such as this journal and this documentation.
Back with finds! Sure enough, the cache viewer found errors in my corrupted backups:
Which leads me to hope that there is indeed a way to sanitize corrupted databases and restore functionality with only losing a few entries!
Oh shucks, and here I hoped given the other tool being able to even calculate the correct checksums…
Ah drat, sorry, I think I was testing at the time my script and was constantly opening task manager to double-check processes running so ultimately i just added it there for whatever reason. It was an oversight on my part and not intended as part of the script functionality.
Beta 3 is out now, it should fix most of the issues, though I’m still looking into the implementation of the windows disk cleaner method of deleting the thumbnail cache.
I’m targeting this weekend to release the next beta if all goes well as this is a substantial bug that affects everything related to the preloader. So far it seems to work for paths with spaces and special characters as far as my testing goes.
I don’t see any prescheduled tasks for disk cleanup in the task scheduler, though it seems the method I talked about before applies similarly when creating a new task except you have to manually specify what folders you want to clear in a dialog before the sageset number is set in the registry to the specific folders that are going to be cleaned up, then it can be called to clean up those selected folders by the sageset number, which is essentially just a preset.
I discovered that you can manually set the sageset number for clearing thumbnail cache in the registry within the program so the user doesn’t have to manually specify that the thumbnail cache needs to be cleared in a separate dialog, which allows it to work in a hopefully seamless way, by running a command and waiting for it to complete before doing things like the restore.
Honestly, I knew nothing about how Windows thumbnail cache or even coding in general worked less than a year ago. I did watch some coding tutorials to get started and help fix the old repository, but especially with this V2 repository, I’ve been relying mostly on GPT-4 to learn the specifics of how coding works along with it giving good results on how the Windows thumbnail cache works. It’s helped a lot for making all these new features possible and allowed me to help build this version to be significantly more advanced than the previous version.
I believe the original purpose of the setup file was to add the context menus to folders, and then I added an environment path variable so it could be used in the command line without navigating to the directory along with adding the context menu to the drives themselves. It also allows the program to do things like use the Task Scheduler function without administrator permissions.
In theory the setup may not actually be needed, though I would have to integrate a toggle inside the GUI to enable context menus and the environment path variable, or I can also have it enabled by default, though the user would have to run the GUI first before those things occur, and if the exe is moved the environment path variable and running as administrator would probably also need to be reset, where the environment path would also affect the context menus and the task scheduler as well.
It would probably be simpler then to have the setup alongside the portable version so that the user doesn’t have to go through all the steps of setup manually, though now that I know what problems have popped up from the new portable version compared to the old portable version, which was a lot simpler, I can try my best to compensate for some of these new issues.
Running as Administrator may also end up being a requirement as some features of the program such as the Task Scheduler and probably the previously mentioned things would need more permissions, ~though running as administrator wouldn’t be able to be toggled in the program~ or kept set in the compatibility settings when the file is moved around, and would need to be reset manually, which could be helped by either a prompt on startup or giving error messages when access is denied.
Edit: I’ve found out that setting the app to publish as a self-contained executable has caused a new warning message to popup on the admin toggle button code, which helped to describe how to modify it to now set as admin within the application even with the portable version, though it still doesn’t keep the setting if the exe is moved from the location where it was set.
I may also end up changing some of the error messages to indicate that the program needs to be run as administrator if it can’t perform an action such as setting or deleting a task from the Task Scheduler. If I end up adding a toggle to enable context menus and the environment path, it would end up breaking functionality if the exe is moved around, which may be helped by checking for the application path at the startup of the GUI and adjusting it accordingly if it is able to discover the previous paths.
Overall, I have a lot more work that needs to be done to this application, though I may try putting out some betas when I get enough fixed in order to hopefully decrease wait times and prevent keeping people from being stuck on a buggy version.
Certainly, I will rename the two tickets accordingly.
And I’m afraid I won’t be using the installer version at all, so I can’t really stress enough the importance of having the portable one work properly!
Now, I don’t mean to impose, but maybe eventually you could merge the two version behaviors to be more in common, to avoid having to maintain two versions of it (and risk such bugs slipping between them), which I guess would mean basically maintaining just the portable version with the extra features/integrations available if installed via setup.
Actually I have to ask, why have an installable version at all? What can it do that the portable version cannot?
Yeah if you’d like we could keep the bugs at this issue and perhaps the features at the other since it’s a beta so there would probably be a ton of issues to fix. I’ll be looking into all of these problems, cause it seems like the portable version is being far buggier than the setup version as most of these problems weren’t discovered when I tried them in the regular version.
Portable version should be up and working now, file size may be slightly larger due to .NET 6.