Desktop - Installation Source - Monitor (Pro)
A player can copy your Windows, macOS, or Linux build out of a store folder and pass that copy around. This monitor reports which store the running build looks like it came from.
It only reports the store. The install source detector decides if that store is allowed.
This monitor needs the Pro version. Unity 6 and newer only.
Do you need to add it?
Most of the time, no. The Install Source Detector prefab already includes this monitor, together with the Android and iOS source monitors. That prefab is part of the predefined Anti-Cheat-Monitor prefab.
Add the DesktopPackageSourceMonitor component (namespace GUPS.AntiCheat.Monitor.Desktop) by hand only if you build your own setup, or if you only want the raw reading. Put it on the same GameObject as its detector. The detector looks for it there.
What it reports
The monitor checks once, when it starts. It then sends one DesktopSourceStatus:
public struct DesktopSourceStatus : IDesktopStatus
{
// True only when the check could not run.
public bool FailedToRetrieveData { get; }
// Steam, Epic, GOG, MicrosoftStore, or Unknown.
public EDesktopAppStore AppStoreSource { get; }
// A short label for the store. Never a full path.
public string AppStoreSourceIdentifier { get; }
}
- FailedToRetrieveData: The check could not run. The other values are not valid. "No store matched" is not a failure. That result is
Unknown. - AppStoreSource: The store:
Steam,Epic,GOG,MicrosoftStore, orUnknown. - AppStoreSourceIdentifier: A short label for the store. When more than one store matched, it names them, for example
ambiguous: Steam, Epic.
What each platform reports
| Store | Windows | macOS | Linux |
|---|---|---|---|
| Steam | Yes | Yes | Yes, including Steam installed as a Flatpak |
| Epic Games | Yes. The official launcher, Legendary, or Heroic | Yes. The official launcher, Legendary, or Heroic | Legendary or Heroic only. There is no official Epic launcher for Linux |
| GOG | Yes. GOG Galaxy or an offline installer | Yes | Yes, including minigalaxy |
| Microsoft Store | Yes, including Xbox Game Pass for PC | No | No |
The result is Unknown when:
- no store matched. That is a direct download, itch.io, Humble, or a launcher this check does not know.
- more than one store matched.
- someone copied the game folder to another place. The store no longer lists that folder.
Settings
The monitor has one field in the Inspector:
- Is Active (
isActive, bool, default true): Turns the monitor on or off.
The allowed stores are set in the project settings. The detector uses that list. Open Edit > Project Settings > GuardingPearSoftware > AntiCheat, select the Desktop tab and go to Desktop - App Store - Settings.
- Allow all installation sources: On by default. Nothing is reported until you turn it off and pick the stores you trust.
- Allow following sources: Steam, Epic Games, GOG, Microsoft Store, and Unknown. Allow Unknown when you also ship outside these stores.
Good to know
- A weaker check than on mobile: The monitor looks at the install on the player's computer. A copied folder often has no store record left, so the result is
Unknown. - Not in the Editor: The check does not run inside the Unity Editor. The project folder is not a store install.
- Development builds: Verify development builds is off by default. While it is off, the detector does not judge development builds. Turning it on does not make the monitor run in the Editor.
Platforms and requirements
Windows, macOS, and Linux player builds. There are no extra requirements.
Read it in code
You can listen to the monitor yourself. Subscribe returns an IDisposable. Dispose it when you want to stop.
using System;
using GUPS.AntiCheat.Core.Watch;
using GUPS.AntiCheat.Monitor.Desktop;
using UnityEngine;
public class DesktopSourceStatusLogger : MonoBehaviour, IObserver<IWatchedSubject>
{
private void Start()
{
var monitor = GetComponentInChildren<DesktopPackageSourceMonitor>();
monitor.Subscribe(this);
}
public void OnNext(IWatchedSubject subject)
{
if (subject is DesktopSourceStatus status)
{
if (status.FailedToRetrieveData)
{
Debug.LogWarning("Could not resolve the installation source.");
return;
}
Debug.Log($"Installed from: {status.AppStoreSource} ({status.AppStoreSourceIdentifier})");
}
}
public void OnError(Exception error) { }
public void OnCompleted() { }
}
Detect a store you do not allow
To decide if the store is allowed, use the install source detector.
Back to the Monitor overview.