Current behavior:
If we want to clean user data from non-standard Mozilla browsers, we have to hardcode the locations of our Mozilla-based browser, "MagicFox".
CustomLocationX=FIREFOX|[folder path]
CustomLocation1=FIREFOX|C:\Users\USERNAME\AppData\Local\MagicFox\data
CustomLocation2=FIREFOX|C:\Users\USERNAME\AppData\Local\GeckoWow\profile\sam
Desired behavior:
Allow the flexibility of using environment variables to specify locations.
CustomLocationX=FIREFOX|[folder path]
CustomLocation1=FIREFOX|%LocalAppData%\MagicFox\data
CustomLocation2=FIREFOX|%LocalAppData%\GeckoWow\profile\sam
Why the requested enhancement?
Imagine a scenario where you're running a portable version of CCleaner from a USB stick (e.g., Z:\). In the same directory you've launched the portable CCleaner from there exists "ccleaner.ini" and you had previously added a CustomLocation rule to detect "MagicFox". Your rule looks like the following:
CustomLocation1=FIREFOX|C:\Users\Jack\AppData\Local\MagicFox\data
Then you realize you're running your portable version of CCleaner from your USB stick on Jill's computer. The location of _her_ "MagicFox" is:
C:\Users\Jill\AppData\Local\MagicFox\data
Because the user account names on Windows are different on each computer, unless I had added both these locations:
CustomLocation1=FIREFOX|C:\Users\Jack\AppData\Local\MagicFox\data
CustomLocation2=FIREFOX|C:\Users\Jill\AppData\Local\MagicFox\data
CCleaner will fail to recognize the location.
It would also fail in a scenario in which Jill's user account on Windows just happened to be named "Jack" also but Windows was installed on a non-standard drive letter (e.g., R:\), unless I had added both of these locations:
CustomLocation1=FIREFOX|C:\Users\Jack\AppData\Local\MagicFox\data
CustomLocation2=FIREFOX|R:\Users\Jack\AppData\Local\MagicFox\data
Both these issues could have easily been avoided if we were allowed to use environment variables to expand the locations.
Addendum:
Apply these same changes for cleaner.ini (Method #1[1]) and the registry (Method #2[1]) also.
References:
[1] https://www.piriform.com/docs/ccleaner/advanced-usage/ccleaner-ini-files/how-to-clean-user-data-from-non-standard-mozilla-browsers
[2] http://www.piriform.com/docs/ccleaner/advanced-usage/ccleaner-ini-files/environment-variables-and-system-variables-in-ccleaner