Playnite Forums
  • Playnite Web
  • Rules
  • Members
  • Team
  • Search
  • Register
  • Login
  • Home
  • Members
  • Help
  • Search
Playnite Forums Playnite Support and Troubleshooting Using {PlayniteDir} in emulator config fields

Using {PlayniteDir} in emulator config fields
whoozwah
Offline

#1
11-12-2021, 09:37 PM (This post was last modified: 11-12-2021, 09:40 PM by whoozwah.)
I would like to make my Playnite install completely portable so that I can use it from a flash drive and have made an emulators folder inside of playnite with subfolders for my emulators. However when I edit the installation path of my emulators to read, for example:

{PlayniteDir}\Emulators\Retroarch

That doesn't work. I get an error that the emulator cannot be found. Is there a way to define emulator exe locations using relative paths?

Edit: I discovered the solution. Instead of using {PlayniteDir} variable, I used a period. So the correct relative path is

.\Emulators\Retroarch

I didn't realize Playnite respects windows relative path arguments as well as it's own internally defined variables. I will leave this thread up for others that may find it useful.
Crow
Offline

Administrator
#2
11-13-2021, 09:53 AM
Looks like a bug, it should be working, I'll look into it. It's just emulator installation folder that didn't work with it?

Using {PlayniteDir} is definitely preferable because .\ will break if something starts Playnite with different working directory.
Mitsie
Offline

#3
03-07-2022, 08:31 PM (This post was last modified: 03-08-2022, 10:05 AM by Mitsie.)
I use Playnite on a portable Hard drive and use it alongside emulators for portability. It is flawless in every other respect, apart from not being able to use {PlayniteDir} in the emulator auto configurator.
Using .\ works as whoozwah points out in his OP.

But then comes another problem, if you use a standard directory on the drive like C:/Games and not a relative path everything works as intended.

Using static drive paths is fine when not using playnite for portability, as a USB hard drive could be E:/ on one machine, then G:/ on another so will break the library and break the portability.

If you use the relative path .\ when playnite does a library update for the Emulator, it looks at the path and never matches the already existing games, so it duplicates the same games, even if nothing has changed.

The only way around this, for example, if you want to add one game to your collection. You must delete all the games for that platform and then let Playnite find them all again. This can turn a 2 minute library update into a 8 hour job of re-editing all of your titles, artwork and correcting "how long to beat" mismatches etc.

Is there any chance the {PlayniteDir} can be added to work in the emulator auto-configuration tab, or alternatively, playnite to detect already existing games for using a relative path .\ so it doesn't create duplicates of every game on every emulator library update. Either or would be good.

It's great,because I can pick up my portable hard drive and take my massive game collection and library with me.
Crow
Offline

Administrator
#4
03-08-2022, 07:25 AM
{PlayniteDir} and {EmulatorDir} variables not working properly in emulation related fields is being fixed in Pplaynite 10.
Mitsie
Offline

#5
03-08-2022, 10:03 AM
(03-08-2022, 07:25 AM)Crow Wrote: {PlayniteDir} and {EmulatorDir} variables not working properly in emulation related fields is being fixed in Pplaynite 10.

Good Stuff..  Big Grin
Mitsie
Offline

#6
10-20-2022, 04:51 AM (This post was last modified: 10-20-2022, 04:54 AM by Mitsie.)
Hi Just a quick update on this, Im not sure if its an error in the coding, I can now use {PlayniteDir} or {EmulatorDir} as well as .\ in the emulator auto scan configuration fields, but when I rescan the Emulator, it doesn't detect the already existing games and ignore the update.

Im guessing for example the script is finding the autoconfiguration field as:
{PlayniteDir}\..\Roms\NintendoSwitch\

Then it must compile the full directory to update the games e.g:
E:\Roms\NintendoSwitch\

Then tries to match the two directories and doesn't find a match

if( "{PlayniteDir}\..\Roms\NintendoSwitch\" == "E:\Roms\NintendoSwitch\" ){
// skips adding this game to the library as it already exists
return;
}

So it is doing a false match. as when it uses full directory paths it finds a match and skips the game and doesn't create duplicate games for the system:

So if I set the full directory In the auto-configuration "Scan Folder":
E:\Roms\NintendoSwitch\

When I run another auto scan because Ive added one new game, it skips all the duplicates and just adds the one new game, so I'm guessing its running something like this:

if( "E:\Roms\NintendoSwitch\" == "E:\Roms\NintendoSwitch\" ){
// skips adding this game to the library as it already exists
return;
}

This would match TRUE as the two fields are the same and skip the duplicates.

I've obviously replaced the variables with the full fields for example purposes.

It is only a guess of what is happening, but that seems to be what is happening in the background in my opinion.
Crow
Offline

Administrator
#7
10-23-2022, 10:30 AM
I'll look into it.
Crow
Offline

Administrator
#8
10-24-2022, 11:24 AM
What is the exact use case for you? {PlayniteDir} or {EmulatorDir} is currently not supported in scan configurations so I have no idea how are you actually reproducing this issues. Please provide exact examples of paths assigned to actual games, emulator config and scan config.
« Next Oldest | Next Newest »



  • View a Printable Version
  • Subscribe to this thread

© Designed by D&D - Powered by MyBB

Linear Mode
Threaded Mode