I want to use a very old app (I think it was created for Windows XP)
on Windows 11.
There are limits on what old software you can run on Windows 11.
(1) Try a VM. For software as old as Windows XP, you will need to set up a Virtual Machine and run the software in an old OS Virtual Machine.
XP Still runs as a VM - I have that here.
Windows 7 still runs as a VM - I have that here as well. The software may run in Windows 7.
You might also try a Windows 10 VM.
So that is your way forward for the software you want.
XP, Windows 7 will not run as real machines on new hardware. Windows 10 should run on modern hardware.
(2) Try Compatibility Mode: Also if the software will perform properly in Windows 10, then another approach is to try Compatibility Mode while installing. Make sure the App has been fully uninstalled, restart, install and in the install dialogue, select Compatibly Mode. That may work. Try and see.
The 2 ways outlined are the only ways I know when an App will not install natively in Windows 11