topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Tuesday December 3, 2024, 3:20 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: SquidGirlCleaner: open source superseded update (re)mover - testers wanted!  (Read 19113 times)

ConstanceJill

  • Supporting Member
  • Joined in 2012
  • **
  • Posts: 243
    • View Profile
    • Donate to Member
Hello there :)

As some of you may be aware, Windows' "C:\Windows\Installer" folder tends to grow increasingly larger as time passes and more updates get applied to programs which rely on Windows Installer — especially if you've had the same version of Microsoft Office for a few years and let Windows Update do its thing automatically.
There are various solutions to this problem such as:

  • reinstalling the system from scratch: huh, overkill much?
  • completely uninstalling the big programs/software suites that had multiple updates in the past, and reinstalling them (if still needed) with only the latest, current patches: while less overkill than a complete system reinstall, it's still not a very practical solution
  • moving the folder to a different drive and making a hard link to it: may not always be feasible, especially if you have a laptop with no room to add another internal storage drive… also, while that's kind of clever, it's only a workaround that doesn't really address the main problem
  • using a dedicated cleaning tool such as PatchCleaner: IMHO, that appears to be the best option

However, some people may have trust issues with PatchCleaner because it is closed source.

So, since I was curious about how that worked, I tried to figure out how to identify superseded patches and started to script my own, open source (it's a .bat file, not obfuscated) solution that should give similar results — albeit with a much less sexy interface and less options, but the more suspicious people can actually inspect the code!

A few words of caution, though:
  • I've only tested it on a few computers so far, all running the same version of Windows (7)
  • while I've not noticed any issue after using my script to "clean up" those (again very few) computers I did test it on, and had no problem applying the august 2019 security updates for MS Office 2010/2013 on them, I cannot tell for sure if there won't be issues later on
  • I'm not even a programmer, which I guess increases the probability for this script to not be extremely reliable ^^'

This is why I need testers, preferably technically inclined ones for now, so that if my script causes an issue, they're more likely to be able to clearly explain it and maybe even solve it by themselves.

With that being said, the script is in the attachment.

Feel free to reply with any constructive criticism!
« Last Edit: January 28, 2020, 01:43 PM by ConstanceJill, Reason: Newer version attached. »

nickodemos

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 145
    • View Profile
    • Donate to Member
Found three orphans at 78MB in total.

ConstanceJill

  • Supporting Member
  • Joined in 2012
  • **
  • Posts: 243
    • View Profile
    • Donate to Member
That's not much. Was your system installed recently? Do you perhaps not have MS Office on it? Or maybe you used another cleaning tool already which may have removed most of the unneeded updates?

nickodemos

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 145
    • View Profile
    • Donate to Member
Installed around ten months back.

No MS office installed. I have not had a need for it since I graduated from college.

And yes the system has been cleaned before.

ConstanceJill

  • Supporting Member
  • Joined in 2012
  • **
  • Posts: 243
    • View Profile
    • Donate to Member
Hmm while re-reading my own code, I noticed a bug in one of the functions (regread): while attempting to optimize it after debugging it, I went a bit overzealous and removed the line that set the "Value" variable, which would have been used if we tried to read the data from any registry value with 1 or more spaces in its name.

However none of the registry values we need to read has any, which is why it has no effect on the outcome of the script, so that alone is not worth publishing an updated version for. Still, it will be fixed in the "final" version.

Edit: found another minor bug: if the script was called by double clicking it instead of from an already opened command prompt, the script's window closes at the end, while it should stay open and pause to let the user read the statistics.
Again, it doesn't seem worth publishing an update yet, but will be fixed.
« Last Edit: August 16, 2019, 04:27 AM by ConstanceJill »

Shades

  • Member
  • Joined in 2006
  • **
  • Posts: 2,939
    • View Profile
    • Donate to Member
Same here. 3 Year old Win 10 installation with Office 2010 on it.

But in my case, I go out of my way to use portable applications and if not available, I'll try to make the application 'portable' myself and if that doesn't work, the application will be removed. Having said the above, it does require me to install stuff on a semi-regular basis, so I thought your script to be useful in finding out how much crap remains, even after software has been removed (using Revo UnInstaller). But that is the extent of cleaning I have done on this particular computer.

If it is of any help, your script returned 2 orphans, one of them was: ccc-utility64. The other: Microsoft SQL Server Data-Tier Application Framework (x86).

ConstanceJill

  • Supporting Member
  • Joined in 2012
  • **
  • Posts: 243
    • View Profile
    • Donate to Member
OK, thank you for letting me know the results :)

Hmm I don't know if it's an effect of the summer vacation or if I should have tried to scare people a bit less, but only 2 answers in 2 days seems a bit low. I also didn't expect the testers to have such clean systems already xD

Deozaan

  • Charter Member
  • Joined in 2006
  • ***
  • Points: 1
  • Posts: 9,774
    • View Profile
    • Read more about this member.
    • Donate to Member
I downloaded it and was going to test it, but the warning scared me off. :D

ConstanceJill

  • Supporting Member
  • Joined in 2012
  • **
  • Posts: 243
    • View Profile
    • Donate to Member
Hmm perhaps I should replace the message with something like "it's advised to make a backup or your system before you use this script", and maybe remove the red background, then? ^^'

ConstanceJill

  • Supporting Member
  • Joined in 2012
  • **
  • Posts: 243
    • View Profile
    • Donate to Member
Alright, I have news: I made a new version, which is significantly faster than the previous one.

The speed change is mostly due to a major change in the algorithm: instead of starting from the list of files in %windir%\Installer and, for each and every one of them, searching for a match through potentially hundreds of registry keys, we start by looking at the registry and creating lists of known files, and patches with their current state. Then we work with those lists' contents.

The new version is attached to this post. I'm not sure if I should (or even can) change the attachment to the initial post (?)
« Last Edit: August 27, 2019, 04:39 PM by ConstanceJill, Reason: Older version deleted »

ConstanceJill

  • Supporting Member
  • Joined in 2012
  • **
  • Posts: 243
    • View Profile
    • Donate to Member
OK, so it seems that there can indeed be issues after using my script when you try to update or uninstall Adobe Acrobat Reader (and possibly Adobe Acrobat "not Reader" too).

I had to use the Adobe Reader and Acrobat Cleaner Tool on one computer (running Windows 10, not sure if that makes a difference or not) because update 19.012.20040 wouldn't install and the program wouldn't uninstall either using Programs and Features :/ … I guess that's why PatchCleaner has it in its exclusion filter.

Edit: I updated Adobe Reader without issue on several computers where I had previously ran my script, all of them running Windows 7.
But on another one that runs Windows 10, I had the issue too.
So I guess the problem is somehow related to how msiexec works on Windows 10 (and perhaps 8, but I don't have access to any computer running this version).

I'll try to figure out a way to fix that. According to the error code (1646), seems likely to be related to the "Uninstallable" value for the last remaining patch, which is usually set to 0 instead of 1 for Adobe Reader patches.

Edited again: seems like it can also happen on machines running 7 after all, as it did on one of my home ones. Changing the data of the "Uninstallable" value of the latest successfully installed patch from "0" to "1" did allow the newest patch to install at the next attempt.
« Last Edit: August 26, 2019, 03:21 PM by ConstanceJill »

ConstanceJill

  • Supporting Member
  • Joined in 2012
  • **
  • Posts: 243
    • View Profile
    • Donate to Member
Hello again to the 3 or so people who are following this thread :D

I've made an updated version again, which should (hopefully) prevent the issue of updating Adobe Reader, at least for the next update. Unfortunately I can not tell for sure that it won't crop up again for the second update after running the script :/

If a previous version of the script has already been ran on a system and Adobe Reader can't be updated or uninstalled any more because of it, running the new version should also fix it, as it will change the 'Uninstallable' value for the current patch(es) even if it doesn't clear any superseded one.

That new version shall be attached to the first post within a few seconds after the posting of this message.

ConstanceJill

  • Supporting Member
  • Joined in 2012
  • **
  • Posts: 243
    • View Profile
    • Donate to Member
Hi there, a new version is available.
Here is what's new:

Version 2019-12-15 :
* New features:
 - added "Analyse" mode, which neither moves nor deletes anything
 - added "Delete" mode, which straight up deletes files instead of moving them
 - the logs directory and backup directory are now distinct and can be specified as command line parameters (see the Read Me file for details)
 - added changelog, license and "read me" files

* Bug fixes:
 - running a previous version of the script could lead to some patch entries with no information appearing on the "installed Updates" page of the Programs and Features control panel, due to left over values referencing deleted patch SQUIDs in the product SQUID's Patches subkey under "HKLM\SOFTWARE\Classes\Installer\Products\...". This shouldn't happen any more starting with this version.
 - the Undo script should now work even when ran by right clicking it and selecting "Run as an administrator" when UAC is enabled
 - some files could be mistakenly considered to be orphan files by previous versions due to not being referenced under HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18 but under another key at the same level

* Other improvements and notable changes:
 - the logs now report an approximation of the total disk space used by the superseded updates and orphan files
 - the script's version number is now included in the log files it generates
 - the script now populates a complete list of which files and registry entries are considered to be unneeded before it attempts any change: thus the code lines relevant to making those changes are regrouped in a block, which made it much easier to debug (and allowed to implement Analyse and Delete modes)
 - the default folder where the logs are stored is now "%computername%.SGC" instead of "SquidGirlCleaner %computername%", and it should be within %userprofile%\desktop instead of a subfolder of where the script itself is

* Warning: if you already used the script in unattended mode before, you should know that the meaning of the values for possible exit codes have changed since the previous version. See the "Read Me" file.

nickodemos

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 145
    • View Profile
    • Donate to Member
No download link for new program.

tomos

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 11,964
    • View Profile
    • Donate to Member
^ link in first post above
Tom

nickodemos

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 145
    • View Profile
    • Donate to Member
* SquidGirlCleaner v2019-12-15.zip

Sorry was thrown off by the date. Thought you would have named it todays date.

* Statistics: *

* Count of unique patch SQUIDs: 2
* Count of superseded patch SQUIDs: 0
* Orphan file(s) found: 0
* The estimate total size of the files that were deemed unnecessary by the script is: 0 KiB.
(disclaimer: due to batch limitations, any single file bigger than 2 GiB may not be counted).

Completed with no error and 0 warning(s).

* No significant change was made.

* SquidGirlCleaner finished running on Tue 01/28/2020 at 23:29:30.43 *
Press any key to continue . . .     

ConstanceJill

  • Supporting Member
  • Joined in 2012
  • **
  • Posts: 243
    • View Profile
    • Donate to Member
Yeah the date is a bit in the past because I wanted to test it for a while, then got busy with other things at work and kind of forgot about it ^^'