Skip to content

Commit

Permalink
fixes #14
Browse files Browse the repository at this point in the history
  • Loading branch information
Nonary committed Sep 28, 2024
1 parent bd2fd2a commit 36f9ac9
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions WatcherUI.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ class ApplicationInfo {
[string]$cmd
[string]$detached
[string]$imagePath
[string]$waitAll
[string]$autoDetach
[string]$exitTimeout
}

# To minimize prompts, we will only warn the user once about admin rights.
Expand Down Expand Up @@ -67,8 +70,11 @@ function SaveChanges($configPath, $updatedApps) {
}

$jsonApp = [PSCustomObject]@{
'image-path' = $app.imagePath
name = $app.applicationName
'image-path' = $app.imagePath
name = $app.applicationName
'wait-all' = $app.waitAll
'exit-timeout' = $app.exitTimeout
'auto-detach' = $app.autoDetach
}
if ($app.cmd -ne "") {
$jsonApp | Add-Member -MemberType NoteProperty -Name "cmd" -Value $app.cmd -Force
Expand Down Expand Up @@ -99,6 +105,9 @@ function ParseGames($configPath) {
$app.imagePath = $_.'image-path'
$app.cmd = $_.cmd
$app.detached = $_.detached
$app.exitTimeout = if ($_. 'exit-timeout') { $_.'exit-timeout' } else { "5" }
$app.waitAll = if ($_. 'wait-all') { $_.'wait-all' } else { "false" }
$app.autoDetach = if ($_. 'auto-detach') { $_.'auto-detach' } else { "false" }

$apps += $app
}
Expand Down Expand Up @@ -233,6 +242,9 @@ $window.FindName("InstallButton").Add_Click({
imagePath = "$scriptPath\playnite-boxart.png"
cmd = "powershell.exe -executionpolicy bypass -windowstyle hidden -file `"$scriptPath\PlayniteWatcher.ps1`" FullScreen"
detached = ""
waitAll = "false"
autoDetach = "false"
exitTimeout = "5"
} + $updatedApps


Expand Down

0 comments on commit 36f9ac9

Please sign in to comment.