Blinue / Magpie

An all-purpose window upscaler for Windows 10/11.
GNU General Public License v3.0
9.66k stars 496 forks source link

Detecting .exe files based on filename (for portable game folders) #765

Closed BobbyMcJefferson closed 11 months ago

BobbyMcJefferson commented 12 months ago

Expected behavior 预期的功能

I'm currently trying to make some of my old games portable so I'm running Magpie with a batch file from inside my game folder via the -portable command, which successfully loads the correct profiles from the config folder. The problem is, once I copy my game folder (including Magpie) to a different location, the profiles become useless because the paths don't match anymore.

It would be great if applications could be detected based on their .exe filename (like Lossless Scaling), or if there was support for relative pathnames.

Alternative behavior (optional) 近似的功能(可选)

Support relative pathnames, like this for example:

"pathRule": "..\game.exe"

Blinue commented 12 months ago

Currently, Magpie uses the full path and window class name to identify windows. This rule is strict, but it greatly reduces the chance of recognition errors. For example, games made with RPG Maker have the same file name of "game.exe", or a program may create multiple types of windows. If only the file name is detected, it is impossible to distinguish these windows.

If you want to bundle Magpie and the game together, you might want to modify the global profile instead of creating a profile for the game.

BTW: -portable does not work, you should enable portable mode in settings page instead. The config file is not part of the public interface, please do not modify it.