I am running Windows 11 Pro 64-bit 24H2. When I press WIN+C (the shortcut to show Copilot), I get this screen asking me to sign in Copilot.
This IMO shows that Copilot is installed on my machine.
Now I need to check this programmatically. For this purpose, I have created this unit in Delphi 12.2:
unit CopilotUtils;
// (c) 2025 - A reusable utility unit for interacting with Microsoft Copilot on Windows.
interface
// --- Public Interface ---
// Detects if Copilot is installed by checking its ActivatableClassId in the registry.
function IsCopilotInstalled: Boolean;
// Launches the Copilot sidebar.
procedure LaunchCopilot;
implementation
// --- Implementation Details ---
uses
System.SysUtils,
System.Win.Registry,
Winapi.Windows,
Winapi.ShellAPI;
// --- Private Constants ---
const
// The definitive registry key for Copilot's core component, discovered through user investigation.
COPILOT_ACTIVATABLE_CLASS_KEY = 'SOFTWARE\Microsoft\WindowsRuntime\ActivatableClassId\WindowsUdk.UI.Shell.WindowsCopilot';
// The custom URI protocol used to launch Copilot.
COPILOT_URI_SCHEME = 'ms-copilot://';
// --- Function Implementations ---
function IsCopilotInstalled: Boolean;
var
Registry: TRegistry;
begin
Result := False;
Registry := TRegistry.Create;
try
Registry.RootKey := HKEY_LOCAL_MACHINE;
// **THE CRUCIAL FIX for a 32-bit app on 64-bit Windows:**
// This flag forces our 32-bit application to access the native 64-bit
// registry view, bypassing the Wow6432Node redirection. This is required
// to see the registry keys of modern 64-bit applications like Copilot.
Registry.Access := KEY_READ or KEY_WOW64_64KEY;
// Now, we check for the specific, correct ActivatableClassId key.
Result := Registry.KeyExists(COPILOT_ACTIVATABLE_CLASS_KEY);
finally
Registry.Free;
end;
end;
procedure LaunchCopilot;
var
SEInfo: TShellExecuteInfo;
begin
FillChar(SEInfo, SizeOf(SEInfo), 0);
SEInfo.cbSize := SizeOf(SEInfo);
SEInfo.fMask := SEE_MASK_FLAG_NO_UI; // Don't show an error dialog if launch fails.
SEInfo.lpVerb := 'open';
SEInfo.lpFile := PChar(COPILOT_URI_SCHEME);
SEInfo.nShow := SW_SHOWNORMAL;
ShellExecuteEx(@SEInfo);
end;
end.
Upon execution, IsCopilotInstalled returns TRUE as expected. But I am not sure whether this works on any other Windows machine.
Question: What is the official Delphi method for detecting if Copilot is installed?
HKEY_CLASSES_ROOT\PROTOCOLS\Handler(andHKEY_CLASSES_ROOT\Wow6432Node\PROTOCOLS\Handler) and maybe inHKEY_CURRENT_USER\Software\Microsoft\Windows\Shell\Associations\UrlAssociations.HKCR, egHKEY_CLASSES_ROOT\<scheme>by adding aURL Protocolvalue in it, and aShellsubkey to invoke an action. I don't have CoPilot installed so I can't verify if it uses this approach, but it is something to check as well.mailto. I weighted my comment on where I found the not unimportantmailtoprotocol/scheme.