Jump to content

Support for reading registry keys' values


Recommended Posts

It would be a huge change, because when one is using custom install folders, CCleaner won't clean them. A good example is Steam, right now CCleaner checks for %ProgramFiles%\Steam\Steam.exe only, but it should read HKEY_CURRENT_USER\Software\Valve\Steam\SteamPath value. Supporting this for winapp2 is also a must, let's say something like this ReadValue1=HKEY_CURRENT_USER\Software\Valve\Steam\SteamPath and then storing that value in %ReadValue1% etc.

Link to comment
Share on other sites

  • 5 weeks later...
  • Moderators

Perhaps because nobody understands (as is my case here) nor has comment to make

 

Many software identifications, in CCleaner, are Detect (registry key) and not DetectFile

 

ADVICE FOR USING CCleaner'S REGISTRY INTEGRITY SECTION

DON'T JUST CLEAN EVERYTHING THAT'S CHECKED OFF.

Do your Registry Cleaning in small bits (at the very least Check-mark by Check-mark)

ALWAYS BACKUP THE ENTRY, YOU NEVER KNOW WHAT YOU'LL BREAK IF YOU DON'T.

Support at https://support.ccleaner.com/s/?language=en_US

Pro users file a PRIORITY SUPPORT via email support@ccleaner.com

Link to comment
Share on other sites

  • Moderators

Right but what exactly are you asking for. The way I read it, is for ccleaner to detect programs via specific registry keys, but this already occurs in ccleaner (quite often). Feel free to attempt to answer in your native language and include with it Google's (or any other software's) translation

 

 

ADVICE FOR USING CCleaner'S REGISTRY INTEGRITY SECTION

DON'T JUST CLEAN EVERYTHING THAT'S CHECKED OFF.

Do your Registry Cleaning in small bits (at the very least Check-mark by Check-mark)

ALWAYS BACKUP THE ENTRY, YOU NEVER KNOW WHAT YOU'LL BREAK IF YOU DON'T.

Support at https://support.ccleaner.com/s/?language=en_US

Pro users file a PRIORITY SUPPORT via email support@ccleaner.com

Link to comment
Share on other sites

CCleaner mostly only checks if file exist in specific location, with Steam as example, CCleaner just checks %ProgramFiles%\Steam\Steam.exe exist, but what it should do is read location from HKEY_CURRENT_USER\Software\Valve\Steam\SteamPath. If dev team would implement that, they should also expose this for other to use in winapp2.ini, and I made example how it could be done. Here a "proper" example, taken from winapp2.ini, instead of using

[Steam Big Picture Cache*]
Section=Games
Detect=HKCU\Software\Valve\Steam
Default=False
FileKey1=%ProgramFiles%\Steam\tenfoot\config\httpcache|*.*|RECURSE
FileKey2=%ProgramFiles%\Steam\tenfoot\config\images\web|*.*|RECURSE
FileKey3=%LocalAppData%\VirtualStore\Program Files*\Steam\tenfoot\config\httpcache|*.*|RECURSE
FileKey4=%LocalAppData%\VirtualStore\Program Files*\Steam\tenfoot\config\images\web|*.*|RECURSE

you could use

[Steam Big Picture Cache*]
Section=Games
Detect=HKCU\Software\Valve\Steam
Default=False
ReadValue1=HKCU\Software\Valve\Steam\SteamPath
FileKey1=%ReadValue1%\tenfoot\config\httpcache|*.*|RECURSE
FileKey2=%ReadValue1%\tenfoot\config\images\web|*.*|RECURSE
FileKey3=%LocalAppData%\VirtualStore\Program Files*\Steam\tenfoot\config\httpcache|*.*|RECURSE
FileKey4=%LocalAppData%\VirtualStore\Program Files*\Steam\tenfoot\config\images\web|*.*|RECURSE

And it's better if I write in english than to use Google translate :P

Link to comment
Share on other sites

  • Moderators

And I'm telling you, (opposed to the steam example you present) most entries are detected via the registry e.g.

 

[SUPERAntiSpyware (Logs) More*]
LangSecRef=3024
Detect=HKCU\Software\SUPERAntiSpyware.com\SUPERAntiSpyware
Default=False
FileKey1=%CommonAppData%\!SASCORE\AppLogs|*.dmp;*.SDB
FileKey2=%LocalAppData%\VirtualStore\ProgramData\!SASCORE\AppLogs|*.dmp;*.SDB
FileKey3=%CommonAppData%\SUPERAntiSpyware.com\SUPERAntiSpyware\Applogs\|*.dmp;*.SDB;*.ZIP

 

 

 

ADVICE FOR USING CCleaner'S REGISTRY INTEGRITY SECTION

DON'T JUST CLEAN EVERYTHING THAT'S CHECKED OFF.

Do your Registry Cleaning in small bits (at the very least Check-mark by Check-mark)

ALWAYS BACKUP THE ENTRY, YOU NEVER KNOW WHAT YOU'LL BREAK IF YOU DON'T.

Support at https://support.ccleaner.com/s/?language=en_US

Pro users file a PRIORITY SUPPORT via email support@ccleaner.com

Link to comment
Share on other sites

And I see you don't understand. I'm NOT talking about detecting IF APPLICATION EXIST. I'm talking about DETECTING APPLICATION's FOLDER

<sarcasm>Plot twist: Many programs allow you to change install path</sarcasm> <- This thread is about that situation. You install Steam to let's say D:\Steam and it doesn't matter that steam is "detected" by Detect=HKCU\Software\Valve\Steam because it won't be cleaned because CCleaner would still try to Clean folders in default location.

And your example with SuperAntiSpyware isn't good, because as you can see, all path that will be cleaned aren't in SUPErAntiSpyware's install dir. But Steam stores all it's temp files in install dir's  subfolders.

Link to comment
Share on other sites

  • Moderators
I don't fully understand the need for %ReadValue1% to tell CCleaner where Steam is located in the registry.

 

CCleaner can detect by both files and the registry, and it can also do both within one cleaning routine.

 

However if you don't install into the default expected path where a software suggests during setup you will be out luck with CCleaner detecting and cleaning that software. Edit: Or CCleaner detecting the software if for instance in the registry but not knowing where the paths are to clean.

 

I don't know if this will give you what you're wanting or not (If not ignore it), however here's an example of how it works with a DetectFile and Detect in one cleaning routine:



[Steam Big Picture Cache*]
Section=Games
Detect=HKCU\Software\Valve\Steam
DetectFile=%ProgramFiles%\Steam\Steam.exe

Edited by Andavari
Link to comment
Share on other sites

you can create your own personal entries by using the code inside winapp.ini and winapp2.ini to suit your needs

even i have my own personal entries to suit my needs

unless the dev create a way to detect custom install location, changing the entries manually will be the best

 

or you can use symbolic links

Link to comment
Share on other sites

  • Moderators

 

you can create your own personal entries by using the code inside winapp.ini and winapp2.ini to suit your needs
Especially in the case of steam; the community-based file is meant as a template you aren't really supposed to use it verbatim (though mind you I do, so not a hard rule), but instead look at the steam entry, for instance, and copy/paste/tailor-to-your-personal-use

 

ADVICE FOR USING CCleaner'S REGISTRY INTEGRITY SECTION

DON'T JUST CLEAN EVERYTHING THAT'S CHECKED OFF.

Do your Registry Cleaning in small bits (at the very least Check-mark by Check-mark)

ALWAYS BACKUP THE ENTRY, YOU NEVER KNOW WHAT YOU'LL BREAK IF YOU DON'T.

Support at https://support.ccleaner.com/s/?language=en_US

Pro users file a PRIORITY SUPPORT via email support@ccleaner.com

Link to comment
Share on other sites

 

I don't fully understand the need for %ReadValue1% to tell CCleaner where Steam is located in the registry.

 

%ReadValue1% is a temporary variable which will store Steam install path, so that FileKey1 can use it to clean it

 

However if you don't install into the default expected path where a software suggests during setup you will be out luck with CCleaner detecting and cleaning that software. Edit: Or CCleaner detecting the software if for instance in the registry but not knowing where the paths are to clean.

 

And this is the reason why I started this topic. To add functionality to CCleaner so that it can read that path from registry

 

you can create your own personal entries ...

 

Especially in the case of steam; the community-based file is meant as a template you aren't really supposed to use it verbatim (though mind you I do, so not a hard rule), but instead look at the steam entry, for instance, and copy/paste/tailor-to-your-personal-use

 

I know, I have been doing that for a long time. But it amazes me that devs are using that "stupid" way to detect Steam or perhaps any other app. It should read path from registry.

Edited by dexter86
Link to comment
Share on other sites

  • Moderators

If I've understood @dexter86 correctly, the suggestion he puts forward is to have CC use a reg key to find where an application lives.

Then using the value of this key (which contains the folder name of the install path for the application), clean that folder - which may be customised and not the default location that the current DetectFile=%ProgramFiles% assumes and uses.

 

Instead he would like DetectFile=%CustomPath% where CustomPath was found in that reg key.

 

To continue to use the Steam example;

    [Steam Big Picture Cache*]
    Section=Games
    Detect=HKCU\Software\Valve\Steam                      <=== this just determines if Steam is installed
    DetectFile=%ProgramFiles%\Steam\Steam.exe     <=== this assumes it lives in %ProgramFiles%

 

Dexter suggests;

    [Steam Big Picture Cache*]
    Section=Games
    Detect=HKCU\Software\Valve\Steam                              <=== determine if Steam is installed

    CustomPath=HKCU\Software\Valve\Steam\SteamPath   <=== find where Steam was installed to
    DetectFile=%CustomPath%\Steam\Steam.exe               <=== clean where Steam actually lives

 

 

(apologies if I have the wrong end of the steer - admittedly I'm not a big winapp2.ini user)

Backup now & backup often.
It's your digital life - protect it with a backup.
Three things are certain; Birth, Death and loss of data. You control the last.

Link to comment
Share on other sites

If I've understood @dexter86 correctly...

You are probably first person to understand ;) Yes, that is exactly what I'm trying to accomplish here. A note about your example, "DetectFile" is what the name suggest, used for detect if there is a file, for cleaning files it's FileKey1, FileKey2 etc. So that last line in your example should be something like this FileKey1=%CustomPath%\tenfoot\config\httpcache|*.*|RECURSE

 

Link to comment
Share on other sites

  • Moderators

you are correct of course, I just didn't think too hard about it.

(and to be perfectly honest, I just copied/pasted the @Andavari example - lazy I know) :D

Backup now & backup often.
It's your digital life - protect it with a backup.
Three things are certain; Birth, Death and loss of data. You control the last.

Link to comment
Share on other sites

  • Moderators

[Educated guess]The reason custom path works for browsers is they use specialkey for cleaning instead of specific plain text filekey and regkey. I believe that what you are asking would require a complete and utter rewrite of ccleaner and it's way of doing most cleaning, as well as remove the ability for plain text win*2.ini files as everything would, likely, need a special key. [/educated guess]

[Opinion and questions] On top of that, loadup of ccleaner would be much longer as it would have to check custompath of each item (where would it get/store what could amount to hundreds of locations) not every program gives it's location in the same key throughout the registry do they?

Would each location be stored in ccleaner's registry/ini file. What about the portable version, a single non-existent customlocation (say from the last computer used) might break the cleaning ability.

[/o&q]

 

All of that said,

 

[Rote statement] the developers read all suggestions though rarely (read never) comment. They often implement viable and popular ones[/rs]

 

ADVICE FOR USING CCleaner'S REGISTRY INTEGRITY SECTION

DON'T JUST CLEAN EVERYTHING THAT'S CHECKED OFF.

Do your Registry Cleaning in small bits (at the very least Check-mark by Check-mark)

ALWAYS BACKUP THE ENTRY, YOU NEVER KNOW WHAT YOU'LL BREAK IF YOU DON'T.

Support at https://support.ccleaner.com/s/?language=en_US

Pro users file a PRIORITY SUPPORT via email support@ccleaner.com

Link to comment
Share on other sites

No "utter" rewrite of the code is necessary, just add function to detect custom dir, and use it ONLY with programs that store temp files in install dir (and it's subdir). And first, detecting custom program location would only "initiate" if DetectKey would pass and ONLY if that program stores some temp files in it's subdirs So your example with browser, this doesn't apply because browsers store their temp files in %AppData% or %LocalAppData%. This custom location would only be stored in memory.
 And reading a registry key and checking if that location exist is very fast. Of course it would probably be somehow slower to start with winapp2, but it would finally detect & clean many apps that are not installed in Program Files

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.