Checking your downloads
=======================

Two checks, a minute each: the checksum tells you the file is exactly the one
that was published, and a virus scan tells you it is safe to run. Do both
before you run HolySnailPlayer.exe for the first time.


1. The SHA-256 checksum
=======================

Every Holy Snail Player download has a SHA-256 checksum published next to it:
a 64-character code computed from the file's exact contents. If even one byte
of the file is different (a damaged download, or a file someone has changed),
the code is completely different. Checking it takes a minute and tells you
that the file you have is exactly the one that was published.

The checksums are published in two forms, with the same codes:

  SHA256SUMS.txt                   one line per download
  <download name>.sha256           one file per download, for example
                                   HolySnailPlayer.exe.sha256

Each line is the checksum, two spaces, and the file name:

  3f2a...9c01  HolySnailPlayer.exe

Get the checksums from the same page as the downloads, and compare with the
file you downloaded, not with a copy someone sent you.


With PowerShell (Windows 10 and 11)
-----------------------------------
1. Open the folder that holds the download in File Explorer.
2. Right-click an empty spot in the folder and choose "Open in Terminal" (on
   Windows 10: hold Shift, right-click, and choose "Open PowerShell window
   here").
3. Type, using the name of the file you downloaded:

     Get-FileHash .\HolySnailPlayer.exe

4. Compare the long code under "Hash" with the published checksum. Capital
   and small letters don't matter; every character must match.

To have PowerShell do the comparison, paste the published code in place of
<checksum>:

  (Get-FileHash .\HolySnailPlayer.exe).Hash -eq '<checksum>'

It answers True when the file is genuine and False when it is not.


With the Command Prompt
-----------------------
  certutil -hashfile HolySnailPlayer.exe SHA256

The second line of the output is the checksum, in small letters. Compare it
with the published one.


Checking all downloads at once
------------------------------
Put SHA256SUMS.txt in the folder with the downloads, open PowerShell there
(steps 1 and 2 above) and paste:

  Get-Content .\SHA256SUMS.txt | ForEach-Object {
      $sum, $name = $_ -split '\s+', 2
      if (Test-Path $name) {
          $ok = (Get-FileHash $name).Hash -eq $sum
          '{0}  {1}' -f $(if ($ok) { 'OK      ' } else { 'MISMATCH' }), $name
      }
  }

Each download in the folder is listed with OK or MISMATCH. Downloads you
didn't take are skipped.


If the checksum doesn't match
-----------------------------
Delete the file and download it again. If it still doesn't match, don't run
it, and write to contact@holysnail.org.


For developers: checking the exe against the source
---------------------------------------------------
Release builds are reproducible: building the source download with the tools
named in DEVELOPERS.txt gives an exe with exactly the published checksum.
DEVELOPERS.txt, "Checking the published exe", explains how.


2. A virus scan
===============

Every download was scanned with Microsoft Defender before it was published.
You can scan it yourself; it is a good habit for any program you download.


With Microsoft Defender (built into Windows)
--------------------------------------------
In File Explorer, right-click the file and choose "Scan with Microsoft
Defender" (on Windows 11, choose "Show more options" first). Windows Security
opens and shows the result; "No current threats" means the scan found
nothing.

Or with PowerShell, in the folder that holds the download:

  & "$env:ProgramFiles\Windows Defender\MpCmdRun.exe" -Scan -ScanType 3 -File "$PWD\HolySnailPlayer.exe"

It ends with "found no threats" when the file is clean. The zips can be
scanned the same way; Defender looks inside them.


With VirusTotal (many scanners at once)
---------------------------------------
VirusTotal (https://www.virustotal.com) checks a file with about 70 antivirus
engines. You don't need to upload anything: paste the published SHA-256
checksum into the search box on its front page, and it shows the results for
that exact file if someone has checked it before. If it has never been
checked, you can upload the file there instead.


If a scanner flags the file
---------------------------
Holy Snail Player is new and its exe is not code-signed, and a few antivirus
engines distrust any new, unsigned program. So an occasional warning from one
or two lesser-known engines, often with a vague name such as "Generic",
"Heuristic" or "ML", while Microsoft Defender and the other engines report the
file clean, is most likely a false alarm.

If Microsoft Defender flags it, if many engines do, or if the checksum
doesn't match: don't run it, delete it, and write to contact@holysnail.org
with the scanner's name and the detection name.
