The Microsoft documentation is wrong. Here is the correct key to exclude a program from PAC:
HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindows NTCurrentVersionAppCompatFlagsCompatibility AssistantExecutablesToExclude
If you use both 32-bit and 64-bit operating systems, you may need to do something like this:
If @OSArch = "X86" Then
RegWrite("HKEY_LOCAL_MACHINESoftwareMicrosoftWindows NTCurrentVersionAppCompatFlagsCompatibility Assistant", "ExecutablesToExclude", "REG_MULTI_SZ", "C:WindowsMyProgram.exe")
Else
RegWrite("HKEY_LOCAL_MACHINE64SoftwareMicrosoftWindows NTCurrentVersionAppCompatFlagsCompatibility Assistant", "ExecutablesToExclude", "REG_MULTI_SZ", "C:WindowsMyProgram.exe")
EndIf