Playnite
Playnite copied to clipboard
Hello, there are some bugs in {installdir} of [edit game details\Action\Action types\script]
Bug Description
When I used 【edit game details\Action\Action types\Script】 to run the game, playnite prompted me 【unable to run this command due to the following error: the system could not find the specified file...】 But in 【edit game details\Script\test Script】, the Script works.
To Reproduce
Since the proper running of the game requires writing the game's path to the registry, I had to run it in script mode.
Set-ItemProperty -Path "HKCU:\SOFTWARE\Tennenouji\Install\LD1.exe" -Name "(default)" "{InstallDir}\CHI\LD1.exe" Set-ItemProperty -Path "HKCU:\SOFTWARE\Tennenouji\Install\LD1.exe" -Name "FOLDER" "{InstallDir}\CHI" Start-Process -FilePath "{InstallDir}\CHI\LD1.exe"
in 【edit game details\Action\Action types\Script】,This is the complete startup script, and after the startup failed I saw in the Registry Editor that the Set-ItemProperty command had been executed successfully.
File structure ラッキードッグ1 ├CHI │ └LD1.exe ├JPN │ └LD1.exe
in 【edit game details\Action\Action types\Script】
Start-Process -FilePath "{InstallDir}\CHI\LD1.exe"
This is the instruction that failed at runtime. playnite prompted me 【unable to run this command due to the following error: the system could not find the specified file...】
Start-Process -FilePath "B:\ラッキードッグ1\CHI\LD1.exe"
This command sometimes starts and sometimes does not. When startup fails, playnite prompted me 【unable to run this command due to the following error: the system could not find the specified file...】
Diagnostics ID
1ec88cee-ef89-4b1a-8c89-eb68e5b33d79
Screenshots
No response
Probably this issue. We just replace {InstallDir}
with whatever string is assigned to installation folder in Playnite, what happens next is up to PowerShell itself.
Try using [System.Diagnostics.Process]::Start
from .NET instead of Start-Process cmdlet.
Probably this issue. We just replace
{InstallDir}
with whatever string is assigned to installation folder in Playnite, what happens next is up to PowerShell itself.可能是这期。我们只需将{InstallDir}
替换为分配给 Playnite 中的安装文件夹的任何字符串,接下来的操作就取决于 PowerShell 本身了。Try using
[System.Diagnostics.Process]::Start
from .NET instead of Start-Process cmdlet.尝试使用.NET 中的[System.Diagnostics.Process]::Start
代替 Start-Processcmdlet。
hi I just tried this command in 【edit game details\Action\Action types\Script】,The problem remains. But in 【edit game details\Script\test Script】, the Script works.
[System.Diagnostics.Process]::Start("{InstallDir}\JPN\LD1.exe")
This is the command I used
It doesn't look like this is the problem, the path in the registry is correct.
Hmm looks like play scripts are not having that variable expanded. I don't think there will be any update soon to fix this. In the mean time you can use $Game.InstallDirectory
instead of InstallDir variable.
Instead of Start-Process -FilePath "{InstallDir}\CHI\LD1.exe"
use Start-Process -FilePath (Join-Path $Game.InstallDirectory "CHI\LD1.exe")
Hmm looks like play scripts are not having that variable expanded. I don't think there will be any update soon to fix this. In the mean time you can use
$Game.InstallDirectory
instead of InstallDir variable.Instead of
Start-Process -FilePath "{InstallDir}\CHI\LD1.exe"
useStart-Process -FilePath (Join-Path $Game.InstallDirectory "CHI\LD1.exe")
thank you very much.