Skip to content

Commit

Permalink
Make Taskbar_scroll source package install idempotent
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-revay committed Oct 11, 2023
1 parent 3f8c7b2 commit f1a53e8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
4 changes: 3 additions & 1 deletion Windows_10/run_all.ps1
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# TODO test
Set-PSDebug -Trace 1


# TODO set to break on errors
#TODO - add gh auth login

# Scripts requiring user input
Expand All @@ -10,6 +12,6 @@ Set-PSDebug -Trace 1
. $PSScriptRoot/packages_install.ps1
# ./optional_packages__install.ps1
. $PSScriptRoot/configs_install.ps1
. $PSScriptRoot/manual_packages_install.ps1
. $PSScriptRoot/source_packages_install.ps1

Set-PSDebug -Trace 0
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,17 @@ $config = @"

echo $config | Out-File -Encoding ASCII -FilePath ./dist/config.json

$exe_dir = "$PWD\dist"

# TODO - make scheduler registration idempotent
$action = New-ScheduledTaskAction -Execute "$exe_dir\scroll-desktops.exe" `
-Argument "--nowindowed --noconsole" `
-WorkingDirectory "$exe_dir"
$trigger = New-ScheduledTaskTrigger -AtLogOn
Register-ScheduledTask -TaskName 'Taskbar_scroll' `
-Action $action -Trigger $trigger -RunLevel Highest
( $res = Get-ScheduledTask "Taskbar_scroll" ) 2> $null
if ($res -eq $null) {
$exe_dir = "$PWD\dist"
$action = New-ScheduledTaskAction -Execute "$exe_dir\scroll-desktops.exe" `
-Argument "--nowindowed --noconsole" `
-WorkingDirectory "$exe_dir"
$trigger = New-ScheduledTaskTrigger -AtLogOn

Register-ScheduledTask -TaskName 'Taskbar_scroll' `
-Action $action -Trigger $trigger -RunLevel Highest
}

popd

Expand Down

0 comments on commit f1a53e8

Please sign in to comment.