Clicky

20201219

CCleaner update script

I am a longtime fan of CCleaner (former CrapCleaner). There is a "free" and a paid version. One difference between free and paid is an automated update of the application. In the newer versions there is an auto update in the free version, but that will show you nag screens.

The next Powershell script checks for a new version on the CCleaner website and when a newer version is available, it will download and install. You run the script manually or by Scheduled Task.


$ccleanserVersion = Get-ItemProperty -Path HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\* | Where-Object DisplayName -eq CCleaner | Select -ExpandProperty "DisplayVersion"
write-host "*** Currently installed version: $ccleanserVersion"
$ver = $ccleanserVersion.replace(".","")

$latestVersion = Invoke-WebRequest -UseBasicParsing "https://www.ccleaner.com/ccleaner/download/standard" | Select -ExpandProperty "RawContent"
$versionMatch = $latestVersion -Match "https://download.ccleaner.com/ccsetup$ver.exe"

if (!$versionMatch) {
    write-host "*** Download and install new CCleaner app..."

    $latestVersion = $latestVersion -Match "https://download.ccleaner.com/ccsetup\d{3}.exe"
    $url = $Matches[0]   
    $intallerFile = "c:\temp\ccsetup.exe"

    Import-Module BitsTransfer
    Start-BitsTransfer -Source $url -Destination $intallerFile
    
    write-Output "*** Installing CCleaner..."
    & "C:\Windows\system32\cmd.exe" "/c" "start" "/wait" "$intallerFile" "/S"

    $ccleanserVersion = Get-ItemProperty -Path HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\* | Where-Object DisplayName -eq CCleaner | Select -ExpandProperty "DisplayVersion"
    write-host "*** New version: $ccleanserVersion"   
    
}
    ELSE
{
    write-Output "*** No newer version available."
}

The update looks like this:


20201202

Tweakers paywall configuration

Update: 7-Apr-2021 b

Maybe you are aware that Tweakers will deploy a paywall for "Premium" articles. For those who are not interested in T.net links to paywalled articles, you may configure this rule in your favorite content filter:

!Tweakers Plus articles
tweakers.net##.plus
tweakers.net##tr:has(td:has(div.plus))

! Email subscription option on the front page, in the news overview
tweakers.net##.top.frontpage.mainColumn > .darkBlock

! Job offers on the front page
tweakers.net##.bottom.frontpage.secondColumn > .darkBlock

! Advertisements in news articles
tweakers.net##div#layout div#contentArea > div.wrap > div:nth-child(1):has(img[referrerpolicy="unsafe-url"])
tweakers.net##div#top > div#entity > div:nth-child(1) > div:nth-child(1)

! Requests for feedback in news articles
tweakers.net##.usabilla-survey.usabilla-trigger

! Delayed advertisements loaded through JavaScript
@@||tweakers.net^$ghide

This will result in showing "public" links only. Make sure you do not suppress adds, because that is not allowed!

Real Time Web Analytics