Skip to content

Fix: Run EXE installers from their directory in sideload dialog#5394

Open
BrandowLucas wants to merge 5 commits intoHeroic-Games-Launcher:mainfrom
BrandowLucas:fix-sideload-working-dir
Open

Fix: Run EXE installers from their directory in sideload dialog#5394
BrandowLucas wants to merge 5 commits intoHeroic-Games-Launcher:mainfrom
BrandowLucas:fix-sideload-working-dir

Conversation

@BrandowLucas
Copy link
Copy Markdown

The "Run Installer First" button in the sideload dialog wasn't setting the working directory properly, causing DLL dependencies to not be found. Wine needs the working dir as a Windows path, not Linux path. Changes:

  • Added getDirname IPC helper to get directory from file path
  • In runWineCommand, convert Linux cwd to Windows path and use cmd /c cd /d to change directory before running
  • SideloadDialog now passes the EXE's directory as startFolder

Use the following Checklist if you have changed something on the Backend or Frontend:

  • Tested the feature and it's working on a current and clean install.
  • Tested the main App features and they are still working on a current and clean install. (Login, Install, Play, Uninstall, Move games, etc.)
  • Created / Updated Tests (If necessary)
  • Created / Updated documentation (If necessary)

The "Run Installer First" button in the sideload dialog wasn't setting
the working directory properly, causing DLL dependencies to not be found.
Wine needs the working dir as a Windows path, not Linux path.
Changes:
- Added getDirname IPC helper to get directory from file path
- In runWineCommand, convert Linux cwd to Windows path and use
  cmd /c cd /d to change directory before running
- SideloadDialog now passes the EXE's directory as startFolder
@flavioislima
Copy link
Copy Markdown
Member

flavioislima commented Mar 5, 2026

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@BrandowLucas
Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

@BrandowLucas
Copy link
Copy Markdown
Author

recheck

"Run EXE on Prefix" wasn't pulling the correct WINEPREFIX.

Removed unnecessary path conversion code (cmd /c cd /d trick).

Added some useful debug logs
@CommandMC
Copy link
Copy Markdown
Member

Could you clarify what exactly this change achieves? I understand we're not setting the working directory correctly, but DLLs are first searched for in the folder containing the application. The CWD is searched through, but only in a lower priority (reference)

If possible, please provide steps to verify the original issue

@BrandowLucas
Copy link
Copy Markdown
Author

BrandowLucas commented Mar 15, 2026

Could you clarify what exactly this change achieves? I understand we're not setting the working directory correctly, but DLLs are first searched for in the folder containing the application. The CWD is searched through, but only in a lower priority (reference)

If possible, please provide steps to verify the original issue

I’m not at home right now, so I can’t provide screenshots. However, without this 5-line patch, selecting the run installer first option causes my mounted DVD game Need for Speed Most Wanted autorun.exe to fail with a DLL error, preventing the setup from continuing.

After applying the patch, the autorun.exe installer launches correctly and proceeds with the installation without any issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants