X-Git-Url: https://git.josue.xyz/?a=blobdiff_plain;f=_webi%2Fwebi.ps1;h=0a1b89f9f9946db7d22ad909b2c7be79d3e3ab0c;hb=dbe04da09326ecc88b441c57259a060a88c3e33d;hp=b879673d9576cf04d06f2e166ece1c7730c14809;hpb=4fc5872ada48c597e549dbf868438a0ecbaf81b1;p=webi-installers%2F.git diff --git a/_webi/webi.ps1 b/_webi/webi.ps1 index b879673..0a1b89f 100644 --- a/_webi/webi.ps1 +++ b/_webi/webi.ps1 @@ -6,8 +6,14 @@ $ErrorActionPreference = 'Stop' # Ignore progress events from cmdlets so Invoke-WebRequest is not painfully slow $ProgressPreference = 'SilentlyContinue' -# TODO get arch -$Env:WEBI_UA = 'Windows/10 amd64' +# This is the canonical CPU arch when the process is emulated +$my_arch = "$Env:PROCESSOR_ARCHITEW6432" +IF ($my_arch -eq $null -or $my_arch -eq "") { + # This is the canonical CPU arch when the process is native + $my_arch = "$Env:PROCESSOR_ARCHITECTURE" +} +# TODO API should know to prefer x86 for windows when arm binary is not available +$Env:WEBI_UA = "Windows/10 $my_arch" $exename = $args[0] # Switch to userprofile @@ -48,9 +54,8 @@ if (!(Test-Path -Path .local\bin\pathman.exe)) } # Run pathman to set up the folder +# (using unix style path because... cmd vs powershell vs whatever) & "$Env:USERPROFILE\.local\bin\pathman.exe" add ~/.local/bin -#& "$Env:USERPROFILE\.local\bin\pathman.exe" add "$Env:USERPROFILE\.local\bin" -#& "$Env:USERPROFILE\.local\bin\pathman.exe" add %USERPROFILE%\.local\bin # {{ baseurl }} # {{ version }}