-
Notifications
You must be signed in to change notification settings - Fork 151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Install-Prerequisites.ps1 #833
base: develop
Are you sure you want to change the base?
Conversation
improves the check if the winget in preview version is installed download only one package of dependencies and not separate for VCLibs / UI.Xaml links are hard-coded, which may pose a problem in the future Microsoft Visual C++ Redistributable latest supported downloads another method to check if MSVCR is installed via Get-CimInstance -ClassName "Win32_Product" link "https://aka.ms/vs/17/release/VC_redist.$OSArch.exe" more elegant method install via winget at end of this script / function improve Invoke-WebRequest don't show progressbar $ProgressPreference = "SilentlyContinue" $ProgressPreference = "Continue" -UseBasicParsing / deprecated why reinstall winget if the installed version is lower when it can update itself? what is the point of reset the source if winget is already installed. you don't know if other important sources have been added. please add comments and write to log. I don't know what makes sense or if there are too many. Thank you
Hey @sEb05mAr86,
I may and most likely will sound like an a-hole but.. |
Hey @AndrewDemski-ad-gmail-com, you do not need a Microsoft Visual C++ 2015 Redistributable for winget MsVC++ 2015R is installed after winget has been installed. The dependencies are only checked and installed if winget is not present. If winget is present then the dependencies should already be installed. If all packages are available in an older version, they can all be updated via winget. |
order changed
This happens on Windows Sandbox:
Adding After that VC doesn't install and creates a log error every time (Prerequisites checked failed) |
Hi @KnifMelti I've not tested it in sandbox mode. The pull request is a draft, it should not be merched 1-to-1.
I can't say if this is necessary PS5
PS7
|
@sEb05mAr86 |
it was a suggestion. You are the program developers and need to consider more dependencies. |
I'd start from considering the execution times. if ($env:PROCESSOR_ARCHITECTURE -eq "ARM64") {
$OSArch = "arm64"
}
elseif ($env:PROCESSOR_ARCHITECTURE -like "*64*") {
$OSArch = "x64"
}
else {
$OSArch = "x86"
}
Measure-Command -Expression {
Get-CimInstance -ClassName "Win32_Product" |
Where-Object Name -Like "Microsoft Visual C++ * $OSArch*"
} On a relatively fast machine it takes over half a minute to see the results. Measure-Command -Expression {
Get-AppxPackage -Name 'Microsoft.VCLibs.140.00.UWPDesktop' -AllUsers
} Existing method is much faster, it takes less than 1s to do that. |
Aren't these different packages?
You're right, it's not the fastest method |
Yes, I wish that one day winget will be shipped as a standalone package, with zero external dependencies. |
Proposed Changes
improves the check if the winget in preview version is installed
previewVersion -> v1.10.40-preview
old
(& $WingetCmd -v).Replace("v", "").trim()
new
(& $Cmd -v | Select-String -Pattern '[\d\.]+').Matches.Value
but no longer necessary as it only checks whether it is installed or not
download only one package of dependencies and not separate for VCLibs / UI.Xaml
links are hard-coded, which may pose a problem in the future
Microsoft Visual C++ Redistributable
another method to check if MSVCR is installed via
Get-CimInstance -ClassName "Win32_Product"
downloads
link "https://aka.ms/vs/17/release/VC_redist.$OSArch.exe"
more elegant method install via winget at end of this script / function
winget install --id "Microsoft.VCRedist.2015+.$OSArch"
improve
Invoke-WebRequest
-UseBasicParsing
/ deprecateddon't show progressbar
$ProgressPreference = "SilentlyContinue"
$ProgressPreference = "Continue"
why reinstall winget if the installed version is lower when it can update itself?
winget upgrade --id Microsoft.AppInstaller
what is the point of reset the source if winget is already installed. you don't know if other important sources have been added.
& $WingetCmd source reset --force
please can you add comments and write to log.
I don't know what makes sense or if there are too many. Thank you