The version of Darktable in the scoop extras bucket was very old, because of the new exe file distribution. I wanted to improve that. One of the biggest problem was to get rid of the UAC elevation asked by the NSIS installation script, which was quite useless with the use of another folder than the default one.

A google search gives as a result that you can force no UAC elevation with RunAsInvoker. Under cmd.exe it would be :

set __COMPAT_LAYER=RUNASINVOKER && start .\darktable-3.2.1-win64.exe /S /D=D:\Temp\dark

As scoop run in PowerShell, here is the PowerShell version :

$Env:__COMPAT_LAYER='RunAsInvoker'; .\darktable-3.2.1-win64.exe /S /D=D:\Temp

In the scoop script, another difficulty is to get the proper variable substitution. To do so, you will need to use Invoke-Expression :

Invoke-Expression "$dir\\$fname /S /D=$dir"

Doing so it won’t wait for the installation to be done. A simple way to wait for completion is to add a pipe to Out-Null. Indeed, with a pipe, it will force PowerShell to wait the end of the first process! So the final string, with proper quote escaping is :

"$Env:__COMPAT_LAYER='RunAsInvoker'; Invoke-Expression \"$dir\\$fname /S /D=$dir | Out-Null \""

References :