Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hello, there are some bugs in {installdir} of [edit game details\Action\Action types\script] #3738

Open
FErDaiif opened this issue Apr 29, 2024 · 4 comments
Labels

Comments

@FErDaiif
Copy link

FErDaiif commented Apr 29, 2024

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

@FErDaiif FErDaiif added the bug label Apr 29, 2024
@JosefNemec
Copy link
Owner

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.

@FErDaiif
Copy link
Author

FErDaiif commented Apr 29, 2024

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.

@JosefNemec
Copy link
Owner

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")

@FErDaiif
Copy link
Author

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")

thank you very much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants