[ACE] Check name of running executable

Quick question on how VXA's engine handles running the Game.exe, first off, would it be possible to have multiple different Game.exes in the game's root directory? Like for example, you've got 'Part1.exe', 'Part2.exe', and so on? I'm assuming that you would also need to include 'Part1.ini' and 'Part2.ini' as well, just going off of information I found in this old thread.

Second, assuming the above is possible, is it then possible to have a script call to check to see which of the executables was launched? I've looked through the documentation, but the closest thing I can find to checking executables is the 'File.exist?(file_name)' and 'File.executable?(file_name)' commands, which unless I'm misunderstanding would only return true if the named file exists, or if the named file is an executable, and not if that particular executable is what was used to launch the game.

Any help is greatly appreciated!
You may be able to accomplish this.
The code is beyond my understanding, but I can see in a script for Blackmorning - KGC Bitmap where it looks for the window from the Win32API call.
No idea how things like that work. The weeds of windows that I never learned.
You may be able to accomplish this.
The code is beyond my understanding, but I can see in a script for Blackmorning - KGC Bitmap where it looks for the window from the Win32API call.
No idea how things like that work. The weeds of windows that I never learned.
Oh, so like, a script call that checks for the name of the game window itself?

EDIT: Looking into Win32API script calls led me to this script thread, and looking through the script I found the following code snippet:

Code:
Win32API.new('user32.dll', 'FindWindow', 'PP','N').call(0, game_title)

Assuming I have the terminology correct in my head, I could use this as a baseline to assign 'game_title' to a variable, and then check for that variable via conditional branch, correct?
No idea. Hopefully someone else with better knowledge can comment.
Bumping to keep the thread from dying, I've been reading into documentation and testing things out in my spare time but haven't had much luck.
Ruby:
# ★ RGSS Player File Name
# ★★★★★★★★★★★★★★★★★
#
# Author/s : cremno
# RGSS ver : 3

class Encoding
  UTF_16LE ||= self.find 'UTF-16LE'
  UTF_8 ||= self.find 'UTF-8'
end

module Player
  GetModuleFileName = Win32API.new 'kernel32', 'GetModuleFileNameW', 'PPL', 'L'
  MAX_PATH = 260

  def self.full_filename
    buf = "\0" * (MAX_PATH * 2)
    buf.force_encoding Encoding::UTF_16LE
    rc = GetModuleFileName.call nil, buf, MAX_PATH
    if rc == 0
      fail 'failed to get module file name'
    end
    buf.slice! rc, buf.size
    buf.encode! Encoding::UTF_8
    buf
  end

  def self.filename
    File.basename full_filename
  end

  def self.base_filename
    File.basename full_filename, '.*'
  end

end
Example:
Ruby:
msgbox Player.filename  # => ゲーム.exe
@cremnophobia

Thank you for your help! I haven't had a lot of free time to test out your script until today, and I just had some questions. I tried running the msgbox script and it works, but I can't seem to figure out how to use it in a conditional branch.

Here's a snapshot of my test event:

filenamegetError1.png


And here's the error message I'm getting when I try to run it.
filenamegetError2.png


The error message comes up regardless of how I've named the Game exe, ini, and rvproj2 files.
The error message comes up regardless of how I've named the Game exe, ini, and rvproj2 files.
Two things
1. put in quotes
2. use double equal signs in ruby (==)

Player.filename == "Game.exe"

A single = means set to this value.
and since you didn't have it in quotes the game interpreter is looking for a method called Game.exe
Two things
1. put in quotes
2. use double equal signs in ruby (==)

Player.filename == "Game.exe"

A single = means set to this value.
and since you didn't have it in quotes the game interpreter is looking for a method called Game.exe
Thank you! I had the = and == confused, I thought == was what set it to a value. It's working perfectly in my test project now, so hopefully I'm able to figure out a way to make it work in my final game project!

Original thread: https://forums.rpgmakerweb.com/threads/ace-check-name-of-running-executable.144795/