Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Package Issue]: Piriform.CCleaner - Manual installation being converted to Piriform.CCleaner.ProTrial #150484

Open
2 tasks done
aisgbnok opened this issue Apr 22, 2024 · 8 comments
Labels
Help-Wanted This is a good candidate work item from the community. Issue-Bug It either shouldn't be doing this or needs an investigation. Package-Update This package needs to be updated

Comments

@aisgbnok
Copy link
Contributor

aisgbnok commented Apr 22, 2024

Please confirm these before moving forward

  • I have searched for my issue and not found a work-in-progress/duplicate/resolved issue.
  • I have not been informed if the issue is resolved in a preview version of the winget client.

Category of the issue

Other

Brief description of your issue

When installing CCleaner Free (Piriform.CCleaner) manually, Winget will attempt to update/convert the package to Piriform.CCleaner.ProTrial when a higher version number is available.

I believe this is because, while Piriform.CCleaner and Piriform.CCleaner.ProTrial use different installers, they both write the same ARP entries.

Steps to reproduce

  1. Downloaded the previous release of Piriform.CCleaner.
    In this case, 6.22.
    winget download Piriform.CCleaner --version 6.22
  2. Manually install Piriform.CCleaner onto the system.
    Run the downloaded installer: follow interactive prompts, or use /S for silent.
  3. Check for updates using Winget.
    Because we downloaded/installed the previous version, we should find a new version of Piriform.CCleaner. In this case, 6.23.
    winget update
  4. Instead, Winget finds an update for the Piriform.CCleaner.ProTrial package.
    Name     Id                         Version        Available    Source
    ----------------------------------------------------------------------
    CCleaner Piriform.CCleaner.ProTrial < 6.23.0.11010 6.23.0.11010 winget
    1 upgrades available.
    

Example:
Final Result

Note

This is not the case if you install using Winget. Only manual installations have the issue.

> winget install Piriform.CCleaner --version 6.22
Found CCleaner [Piriform.CCleaner] Version 6.22
This application is licensed to you by its owner.
Microsoft is not responsible for, nor does it grant any licenses to, third-party packages.
Downloading https://download.ccleaner.com/ccsetup622.exe
  ██████████████████████████████  79.5 MB / 79.5 MB
Successfully verified installer hash
Starting package install...
Successfully installed
> winget update
Name     Id                Version Available Source
---------------------------------------------------
CCleaner Piriform.CCleaner 6.22    6.23      winget
1 upgrades available.

WinGet-InstallOld.log
WinGet-UpdateCorrect.log
Working correctly using winget install and update. No manual install.

Actual behavior

Winget is mistaking Piriform.CCleaner and Piriform.CCleaner.ProTrial when installed manually.

I have only noticed believing Piriform.CCleaner is Piriform.CCleaner.ProTrial, not the reverse. However, I have not done any testing for the reverse, so I cannot rule that out.

Expected behavior

Winget should be able to differentiate between Piriform.CCleaner and Piriform.CCleaner.ProTrial when they are manually installed outside of winget. Specifically, winget should update 6.22 Piriform.CCleaner to 6.23 Piriform.CCleaner, NOT update/convert to 6.23.0.11010 Piriform.CCleaner.ProTrial.

Environment

Windows Package Manager v1.7.10861
Copyright (c) Microsoft Corporation. All rights reserved.

Windows: Windows.Desktop v10.0.26100.1
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.22.10861.0

Winget Directories                 
-----------------------------------------------------------------------------------------------------------------------
Logs                               %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\Diag…
User Settings                      %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\sett…
Portable Links Directory (User)    %LOCALAPPDATA%\Microsoft\WinGet\Links
Portable Links Directory (Machine) C:\Program Files\WinGet\Links
Portable Package Root (User)       %LOCALAPPDATA%\Microsoft\WinGet\Packages
Portable Package Root              C:\Program Files\WinGet\Packages
Portable Package Root (x86)        C:\Program Files (x86)\WinGet\Packages
Installer Downloads                %USERPROFILE%\Downloads

Links               
---------------------------------------------------------------------------
Privacy Statement   https://aka.ms/winget-privacy
License Agreement   https://aka.ms/winget-license
Third Party Notices https://aka.ms/winget-3rdPartyNotice
Homepage            https://aka.ms/winget
Windows Store Terms https://www.microsoft.com/en-us/storedocs/terms-of-sale

Admin Setting                             State
--------------------------------------------------
LocalManifestFiles                        Disabled
BypassCertificatePinningForMicrosoftStore Disabled
InstallerHashOverride                     Disabled
LocalArchiveMalwareScanOverride           Disabled

Screenshots and Logs

No response

@aisgbnok aisgbnok added the Issue-Bug It either shouldn't be doing this or needs an investigation. label Apr 22, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs-Triage This work item needs to be triaged by a member of the core team. label Apr 22, 2024
@aisgbnok
Copy link
Contributor Author

aisgbnok commented Apr 22, 2024

This is related to #103664, but the original author does not want to re-open the issue. #103664 (comment)

@aisgbnok
Copy link
Contributor Author

For a moment I thought this might have just been cosmetic because winget update Piriform.CCleaner works, but unfortunately winget update --all converts the package to Piriform.CCleaner.ProTrial.

Manual Update

Even though winget list incorrectly lists Piriform.CCleaner as Piriform.CCleaner.ProTrial, you can still stop the conversion by manually updating:

> winget download Piriform.CCleaner --version 6.22
Found CCleaner [Piriform.CCleaner] Version 6.22
This application is licensed to you by its owner.
Microsoft is not responsible for, nor does it grant any licenses to, third-party packages.
Downloading https://download.ccleaner.com/ccsetup622.exe
  ██████████████████████████████  79.5 MB / 79.5 MB
Successfully verified installer hash
Installer downloaded: C:\Users\Sandy\Downloads\Piriform.CCleaner_6.22\CCleaner_6.22_Machine_X64_nullsoft_en-US.exe
> winget list -q ccleaner
Name     Id                         Version        Available    Source
----------------------------------------------------------------------
CCleaner Piriform.CCleaner.ProTrial < 6.23.0.11010 6.23.0.11010 winget
> winget update
Name     Id                         Version        Available    Source
----------------------------------------------------------------------
CCleaner Piriform.CCleaner.ProTrial < 6.23.0.11010 6.23.0.11010 winget
1 upgrades available.
> winget update Piriform.CCleaner
Found CCleaner [Piriform.CCleaner] Version 6.23
This application is licensed to you by its owner.
Microsoft is not responsible for, nor does it grant any licenses to, third-party packages.
Downloading https://download.ccleaner.com/ccsetup623.exe
  ██████████████████████████████  79.7 MB / 79.7 MB
Successfully verified installer hash
Starting package install...
Successfully installed
> winget list -q ccleaner
Name     Id                Version Source
------------------------------------------
CCleaner Piriform.CCleaner 6.23    winget

winget download Piriform.CCleaner --version 6.22.log
winget list -q ccleaner.log
winget update.log
winget update Piriform.CCleaner.log
winget list -q ccleaner (final).log

Automatic/Recursive Update

When you use winget update --all (recursive update), winget chooses to convert Piriform.CCleaner to Piriform.CCleaner.ProTrial.

> winget download Piriform.CCleaner --version 6.22
Found CCleaner [Piriform.CCleaner] Version 6.22
This application is licensed to you by its owner.
Microsoft is not responsible for, nor does it grant any licenses to, third-party packages.
Downloading https://download.ccleaner.com/ccsetup622.exe
  ██████████████████████████████  79.5 MB / 79.5 MB
Successfully verified installer hash
Installer downloaded: C:\Users\Sandy\Downloads\Piriform.CCleaner_6.22\CCleaner_6.22_Machine_X64_nullsoft_en-US.exe
> winget list -q ccleaner
Name     Id                         Version        Available    Source
----------------------------------------------------------------------
CCleaner Piriform.CCleaner.ProTrial < 6.23.0.11010 6.23.0.11010 winget
> winget update
Name     Id                         Version        Available    Source
----------------------------------------------------------------------
CCleaner Piriform.CCleaner.ProTrial < 6.23.0.11010 6.23.0.11010 winget
1 upgrades available.
> winget update --all
Name     Id                         Version        Available    Source
----------------------------------------------------------------------
CCleaner Piriform.CCleaner.ProTrial < 6.23.0.11010 6.23.0.11010 winget
1 upgrades available.

(1/1) Found CCleaner Professional Trial [Piriform.CCleaner.ProTrial] Version 6.23.0.11010
This application is licensed to you by its owner.
Microsoft is not responsible for, nor does it grant any licenses to, third-party packages.
Downloading https://download.ccleaner.com/cctrialsetup.exe
  ██████████████████████████████  79.4 MB / 79.4 MB
Successfully verified installer hash
Starting package install...
Successfully installed
> winget list -q ccleaner
Name     Id                         Version      Source
--------------------------------------------------------
CCleaner Piriform.CCleaner.ProTrial 6.23.0.11010 winget

winget download Piriform.CCleaner --version 6.22.log
winget list -q ccleaner.log
winget update.log
winget update --all.log
winget list -q ccleaner (final).log

@aisgbnok
Copy link
Contributor Author

I believe the installers use the same ARP entries, which is causing the issue?

Piriform CCleaner
winget install Piriform.CCleaner.log
Piriform CCleaner ProTrial
winget install Piriform.CCleaner.ProTrial.log

I'm unsure if/how this can be resolved in the individual packages.

@stephengillie stephengillie added Help-Wanted This is a good candidate work item from the community. Package-Update This package needs to be updated and removed Needs-Triage This work item needs to be triaged by a member of the core team. labels Apr 22, 2024
@Trenly
Copy link
Contributor

Trenly commented Apr 23, 2024

I believe the installers use the same ARP entries, which is causing the issue?

Piriform CCleaner winget install Piriform.CCleaner.log Piriform CCleaner ProTrial winget install Piriform.CCleaner.ProTrial.log

I'm unsure if/how this can be resolved in the individual packages.

@mdanish-kh - I'm away from my PC this week, but perhaps this is a case where InstalltionMetadata and using the file hash might help?

@aisgbnok
Copy link
Contributor Author

aisgbnok commented Apr 23, 2024

@Trenly, I just compared the installations in a VM. The difference between Piriform.CCleaner and Piriform.CCleaner.ProTrial is that ProTrial has an autotrial.dat and branding.dll file as well as the uninst.exe is slightly different. By simply copying the branding.dll into the "Free" version's installation directory, it will brand itself and act like the ProTrial. As soon as branding.dll is removed it goes back to the normal "Free" version.

Note that autotrial.dat is removed/modified upon first run and acceptance of the trial.

I am not familiar with InstallationMetadata, but would adding something like this to Piriform.CCleaner.ProTrial work?

InstallationMetadata:
  DefaultInstallLocation: "%ProgramFiles%\\CCleaner"
  Files:
    - RelativeFilePath: "branding.dll"
      FileSha256: 5208D07AA3B05D7EA34653C5EB4EBB1A1C992D12F9F125D0E1022FE5968595E4

Would something else have to be done to Piriform.CCleaner as well, or is that enough to get winget to properly differentiate? Thanks.

image

@Trenly
Copy link
Contributor

Trenly commented Apr 23, 2024

@Trenly, I just compared the installations in a VM. The difference between Piriform.CCleaner and Piriform.CCleaner.ProTrial is that ProTrial has an autotrial.dat and branding.dll file as well as the uninst.exe is slightly different. By simply copying the branding.dll into the "Free" version's installation directory, it will brand itself and act like the ProTrial. As soon as branding.dll is removed it goes back to the normal "Free" version.

Note that autotrial.dat is removed/modified upon first run and acceptance of the trial.

I am not familiar with InstallationMetadata, but would adding something like this to Piriform.CCleaner.ProTrial work?

InstallationMetadata:
  DefaultInstallLocation: "%ProgramFiles%\\CCleaner"
  Files:
    - RelativeFilePath: "branding.dll"
      FileSha256: 5208D07AA3B05D7EA34653C5EB4EBB1A1C992D12F9F125D0E1022FE5968595E4

Would something else have to be done to Piriform.CCleaner as well, or is that enough to get winget to properly differentiate? Thanks.

image

That looks right, but I would also add the uninst.exe to the file list and ensure the FileType is set.

I beleive the InstallationMetadata should then also be set for the normal ccleaner, with just the uninst.exe.

I'm still trying to work out the details of exactly how InstallationMetadata works, since there isn’t really any documentation, but based on conversations I've had with the engineering team I think that it might help in this scenario

@mdanish-kh
Copy link
Contributor

@aisgbnok Are you planning to make this into a PR?

@aisgbnok
Copy link
Contributor Author

aisgbnok commented Apr 23, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Help-Wanted This is a good candidate work item from the community. Issue-Bug It either shouldn't be doing this or needs an investigation. Package-Update This package needs to be updated
Projects
None yet
Development

No branches or pull requests

4 participants