C:\Program Files on Windows.
This also works on macOS, but we don’t recommend running game updates as the root user on a Mac.
Check the repository for updates
ArepositoryCheck task decides whether the repository needs installing or updating, and routes the workflow. Here both cases go to the writable check:
Check whether the folder is writable
AdirectoryIsWritable task checks whether the launcher can write to the install folder with its current permissions. Unless the player runs it as administrator, the launcher runs as a regular user.
c:\Users\Username\Games\, the launcher updates normally. If it isn’t, such as c:\Program Files (x86)\Games\, the workflow asks for administrator rights.
Run the update elevated
AworkflowRun task with "elevated": true runs a task with administrator rights. start names the task to run in the existing workflow.
workflowRun, see Tasks.
Full example
This workflow uses a unified progress bar for two repositories and only elevates if an update is needed. Therepair task, which runs when the player clicks Repair, also elevates if needed.
workflow.json

