Temporary Folder

Jul 24, 2015 at 2:49 AM
Added Temporary Folder Deletion v1
Jul 24, 2015 at 7:33 PM
Hi, Markis!

Thank you for the patch. I have been reviewing the patch you submitted. I have a few comments on the patch:
  • If you specify the full folder path, you do not need a CSIDL key (CSIDL specifies the path root as a special folder, see https://msdn.microsoft.com/en-us/library/windows/desktop/bb762494(v=vs.85).aspx for the list of folders).
  • Windows comes with a temporary files cleaner that cleans %TEMP% folder. Thus, I removed it from the folder list (also, in my tests, the folder parameter does not support multiple values).
  • Cleaning out temporary files should never cause problems with uninstallation of applications (which is why Windows defaults to cleaning it whenever pressed for space). It is the downloaded installation files and %WINDIR%\Installer folder that contain files required for uninstallation.
I have a question about the Flag value 268435517. Why such value? %WINDIR%\Temp does not seem that special. For comparison, Temporary Files Cleaner has flag value 65.

Yours sincerely
Siim Karus
Jul 24, 2015 at 8:19 PM
HI Siim,

Thank you for a response you cleared up some issues for me.

The idea for the Temporary Folder cleaner is the built-in Disk Clean does not respect the LastAccess value. As per my flag value it does correspond to this specification
https://msdn.microsoft.com/en-us/library/bb776782(v=vs.85).aspx#registering_clsid and in c:\windows\TEMP|appdata...temp directories (the folders are labeled read-only) so I went overboard and wanted to delete everything.

When I run this I want to delete all temporary files.
Jul 24, 2015 at 8:59 PM
Ok, I understand now. The Windows Temporary Files cleaner only deletes files older than 7 days by default. The Data Driven Cleaner is supposed to use LastAccess regardless of the flag value.

Apparently, only one folder can be specified in conjunction with CSIDL, but more should be possible without it. Unfortunately, multiple paths cannot contain expandable paths (like %windir%).

When I started the project, I wanted to implement an improved Data Driven Cleaner that would be configurable and could handle multiple folders with wildcards (which is necessary to properly handle profiles of Firefox, Opera, Chrome, etc.). Unfortunately, other projects and the decrease in the cost of storage space have postponed its implementation.
Jul 25, 2015 at 12:11 AM
Need to implement this and a com object with an IEmptyVolumeCache2 interface
Jul 25, 2015 at 4:13 PM
Edited Jul 25, 2015 at 4:18 PM
Hi Siim,

Again this was some shorted sighted thinking or enforcement for application standards.

I think Disk Cleanup is clearly understood to be the "goto" place to clean-up temp files, install files, log files for windows. Why not for ALL applications?
  • I think all applications should be required to write a cleanup handler to get ride of their own waste.
    (Kinda like visitors at Tour de France, they leave their litter everywhere - take it home.)
In addition to TEMP deletion, I am working to add Firefox and Chrome, especially the removal of .tmp files and .sol files.

I added the logo so far :)
Jul 25, 2015 at 5:21 PM
What are the licensing requirements for the logos?

Implementing COM and the IEmptyVolumeCache2 interface is not the difficult part - ensuring compatibility with different versions of Windows (from 98 to 10 and from US version to European version and so forth) is much more tricky. Especially if we want to create an options dialog for the cleaner.
Jul 25, 2015 at 6:22 PM
Hi Siim,

I think one can use the logo here, for one this software is not being sold. Also thes software is using the logo in good faith. This software is not misrepresentation the Firefox logo and the Firefox must be installed for the logo to appear. But if you are super worried, we can get a alias icon.

Here are the guidelines for Mozilla logo requirements, I think we are good.

Agreed, about international Dialog boxes, a bit of an issue. I will work on http://www.codeproject.com/Articles/2408/Clean-Up-Handler to try to get this to work for TEMP Folder.