JosefNemec / Playnite

Video game library manager with support for wide range of 3rd party libraries and game emulation support, providing one unified interface for your games.
https://playnite.link
MIT License
9.38k stars 502 forks source link

Path names with [ ] will not launch #1641

Closed mrcrowley666 closed 4 years ago

mrcrowley666 commented 4 years ago

Global script action execution failed Cannot find path'K:\Wii\New\wbfs\Cars Mater-National [RC2E78]' because it does not exist

K:\Wii\New\wbfs\Cars Mater-National [RC2E78] The path does exist and works fine when launched straight from the emulator or even dragging the rom directly to the emulator. Also if I remove [ ] from path playnite is then able to execute the rom so pretty sure its the [ ] thats the problem.

Running Windows 10 Pro installed 11/01/2020 Before this I ran Windows 10 ltsc and don't remember having this problem so I suspect its something they've changed in Windows.

Thanks for the awesome launcher! pn

JosefNemec commented 4 years ago

This is an error from the script action, you need to check the script you are using. Playnite doesn't do anything with paths in the script actions, we only pass it to scripting runtime and run it.

mrcrowley666 commented 4 years ago

I'm not quite sure what you are saying is at fault. Dolphin emulator has been added to playnite using the the "Import Emulators" button (I have not edited the default arguments or added anything else). All roms in the library have been added using the Emulated game option and then selecting the matching emulator/system. All dolphin roms are loading fine when launched by playnite except the ones with [ ] in the path. It also happens with cemu roms, although I've not tested it extensively with anything else.

JosefNemec commented 4 years ago

You have some global game script configured in application settings (under Scripts section) and that script is what's failing and preventing game from starting.

JosefNemec commented 4 years ago

Also try looking into %appdata%\playnite\playnite.log, it should show exact script line that's failing (I'll be adding that info to error dialog from you screenshot in next update).

mrcrowley666 commented 4 years ago

Hi I have Start-Process Powershell D:\Docs\tweak.bat in the scripts section Execute before running game. The bat is set to look for a bunch of running instances eg Dolphin.exe and set cpu priority to realtime. It shouldn't effect commands sent to the emulator.

In any case heres the contents of the bat

::Set some apps to realtime @echo off

timeout /t 2 /nobreak wmic process where name="cemu.exe" call setpriority 256 wmic process where name="DS4Windows.exe" call setpriority 256 wmic process where name="citra-qt.exe" call setpriority 256 wmic process where name="Dolphin.exe" call setpriority 256 wmic process where name="mednafen.exe" call setpriority 256 wmic process where name="EMULATOR.EXE" call setpriority 256 wmic process where name="yabasanshiro.exe" call setpriority 256 wmic process where name="sonic.exe" call setpriority 256

echo Done. TIMEOUT 1 exit

mrcrowley666 commented 4 years ago

2020-02-02 10:23:10.4481|ERROR:Start-Process D:\Docs\tweak.bat 2020-02-02 10:31:29.1775|INFO:Application started from 'D:\Games\playnite', with '' arguments. 2020-02-02 10:31:29.2225|INFO:Executing command "Focus" from pipe with arguments "" 2020-02-02 10:31:29.2535|INFO:Application already running, shutting down. 2020-02-02 10:31:29.2535|INFO:Application 6.5.0.23433 started 2020-02-02 10:31:29.2635|DEBUG:Releasing Playnite resources... 2020-02-02 10:31:31.3471|INFO:Starting Cars Mater-National Championship, 8a7cedb1-c93d-46cb-8963-5f449fddc8ff, b9118b9e-fc4a-4209-a96a-2080d74a4e31, 00000000-0000-0000-0000-000000000000 2020-02-02 10:31:31.3471|INFO:Using generic controller start the game. 2020-02-02 10:31:31.3471|INFO:Executing script action in PowerShell runtime. 2020-02-02 10:31:31.3721|ERROR:Failed to execute global pre-script action.System.Management.Automation.ItemNotFoundException: Cannot find path 'K:\Wii\New\wbfs\Cars Mater-National [RC2E78]' because it does not exist. at System.Management.Automation.SessionStateInternal.SetLocation(String path, CmdletProviderContext context) at Playnite.Scripting.PowerShell.PowerShellRuntime.Execute(String script, Dictionary`2 variables, String workDir) at Playnite.Scripting.PowerShell.PowerShellRuntime.Execute(String script, String workDir) at Playnite.GamesEditor.ExecuteScriptAction(ScriptLanguage language, String script, Game game) at Playnite.GamesEditor.PlayGame(Game game) 2020-02-02 10:31:31.3721|ERROR:Start-Process D:\Docs\tweak.bat 2020-02-02 10:47:35.7856|INFO:Application started from 'D:\Games\playnite', with '' arguments. 2020-02-02 10:47:35.8306|INFO:Executing command "Focus" from pipe with arguments "" 2020-02-02 10:47:35.8576|INFO:Application already running, shutting down. 2020-02-02 10:47:35.8576|INFO:Application 6.5.0.23433 started 2020-02-02 10:47:35.8576|DEBUG:Releasing Playnite resources... 2020-02-02 12:24:06.2093|INFO:Application started from 'D:\Games\playnite', with '' arguments. 2020-02-02 12:24:06.2553|INFO:Executing command "Focus" from pipe with arguments "" 2020-02-02 12:24:06.2663|INFO:Application already running, shutting down. 2020-02-02 12:24:06.2663|INFO:Application 6.5.0.23433 started 2020-02-02 12:24:06.2773|DEBUG:Releasing Playnite resources...

mrcrowley666 commented 4 years ago

The script only fails when there is [ ] in the rom paths even though its a completely seperate instance. seems confusing.

JosefNemec commented 4 years ago

Thanks for the logs. I've found where the issue is and it will be fixed in next update.

Also I'm sorry about misinformation about the issue being in your custom script. The error message from screenshot confused me.

JosefNemec commented 4 years ago

Fixed in devel7.

Cloneg commented 3 years ago

Error: Cannot perform operation because the wildcard path.

This happens when there is a script with a game with an installation directory with [ ]. The game starts but the script not. Showing the error mesasge in the pic. Tried to replicate this in another emulator and is the same error.

Installation Directory: C:\Users\JOSE\Documents\Emuladores\Wii U\Wii U Games\Captain_Toad_TreasureTracker[AKBP0101]\code\

Rom path: C:\Users\JOSE\Documents\Emuladores\Wii U\Wii U Games SSD\Captain_Toad_TreasureTracker[AKBP0101]\code\Kinopio.rpx

Script: Start-Process "C:\Users\JOSE\Documents\Portable\Playnite\Scripts\empty.txt"

Same behavior as stated by op, the path does exist and works fine when launched straight from the emulator. Also if I remove [ ] from ROM folder playnite is then able to execute the rom and script.

I thinks there is a problem with powershell and the way it handles the installation directory, even if the script doesn't use this installation directory as shown in this case.

Shomething odd, If any character fom installation directory is removed and original rom path keeping [ ], playnite is then able to execute the rom and script.

Example of New Installation Directory (removed C from Captain): C:\Users\JOSE\Documents\Emuladores\Wii U\Wii U Games\aptain_Toad_TreasureTracker[AKBP0101]\code\

Log:

28-01 19:22:51.478|INFO|GamesEditor:Starting Captain Toad: Treasure Tracker, e290146d-291e-4daf-85ee-b478d2fb6352, 2859f867-facb-49a0-a2a9-06a30e56f8c2, 00000000-0000-0000-0000-000000000000 28-01 19:22:51.478|INFO|GamesEditor:Using generic controller start the game. 28-01 19:22:51.501|INFO|GameActionActivator:Activating game task Emulator: 0ca6e783-1d63-4da1-8327-08abe874a81b, 1176ab86-70d4-4f11-905a-3122bc589bee, False, 28-01 19:22:51.501|DEBUG|ProcessStarter:Starting process: C:\Users\JOSE\Documents\Emuladores\Wii U\cemu\Cemu.exe, -g "C:\Users\JOSE\Documents\Emuladores\Wii U\Wii U Games\Captain_Toad_TreasureTracker[AKBP0101]\code\Kinopio.rpx" -f, C:\Users\JOSE\Documents\Emuladores\Wii U\cemu, False 28-01 19:22:51.510|INFO|GamesEditor:Started Captain Toad: Treasure Tracker game. 28-01 19:22:51.510|INFO|GamesEditor:Executing script action in PowerShell runtime. 28-01 19:22:51.542|ERROR|GamesEditor:Failed to execute game's game-started action. Playnite.SDK.Exceptions.ScriptRuntimeException: Cannot perform operation because the wildcard path C:\Users\JOSE\Documents\Emuladores\Wii U\Wii U Games\Captain_Toad_TreasureTracker[AKBP0101]\code did not resolve to a file. at Playnite.Scripting.PowerShell.PowerShellRuntime.Execute(String script, Dictionary`2 variables, String workDir) in E:\Devel\Playnite\source\Playnite\Scripting\PowerShell\PowerShell.cs:line 86 at Playnite.Scripting.PowerShell.PowerShellRuntime.Execute(String script, String workDir) in E:\Devel\Playnite\source\Playnite\Scripting\PowerShell\PowerShell.cs:line 55 at Playnite.GamesEditor.ExecuteScriptAction(ScriptLanguage language, String script, Game game) in E:\Devel\Playnite\source\Playnite\GamesEditor.cs:line 1133 at Playnite.GamesEditor.Controllers_Started(Object sender, GameControllerEventArgs args) in E:\Devel\Playnite\source\Playnite\GamesEditor.cs:line 862 28-01 19:22:51.542|ERROR|GamesEditor:Start-Process "C:\Users\JOSE\Documents\Portable\Playnite\Scripts\empty.txt" 28-01 19:23:40.530|INFO|GamesEditor:Game Captain Toad: Treasure Tracker stopped after 49 seconds.

Screenshot (312) Screenshot 2021-01-29 124449 Screenshot (314) playnitesnoscriptscript.log playnitechangeonlydirectory.log

JosefNemec commented 3 years ago

@Josegg0 Open new issue for it.