File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11@ echo off
2- :: V1.4
2+ :: V1.5
33
44
55:: # elevate with native shell by AveYo
@@ -44,7 +44,11 @@ echo Install winget
4444echo ====================== & echo .
4545
4646:: installing dependies and Winget
47- powershell -command " $ProgressPreference = 'SilentlyContinue' ; write-host " Downloading and Installing dependies" ; Invoke-WebRequest -Uri https://aka.ms/Microsoft.VCLibs.x64.14.00.Desktop.appx -OutFile .\Microsoft.VCLibs.x64.14.00.Desktop.appx ; Invoke-WebRequest -Uri https://www.nuget.org/api/v2/package/Microsoft.UI.Xaml/2.7.3 -OutFile .\microsoft.ui.xaml.2.7.3.nupkg.zip ; Expand-Archive -Path .\microsoft.ui.xaml.2.7.3.nupkg.zip -Force ; Add-AppXPackage -Path .\microsoft.ui.xaml.2.7.3.nupkg\tools\AppX\x64\Release\Microsoft.UI.Xaml.2.7.appx; Add-AppXPackage -Path .\Microsoft.VCLibs.x64.14.00.Desktop.appx ; write-host " Installing Winget" ; Invoke-WebRequest -Uri https://github.com/microsoft/winget-cli/releases/download/v1.6.2771/Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle -OutFile .\MicrosoftDesktopAppInstaller_8wekyb3d8bbwe.msixbundle ; Add-AppXPackage -Path .\MicrosoftDesktopAppInstaller_8wekyb3d8bbwe.msixbundle" 2 > nul
47+ :: check if Winget is already installed
48+ winget -v 2 > nul
49+ IF %ERRORLEVEL% NEQ 0 (
50+ powershell -command " $ProgressPreference = 'SilentlyContinue' ; write-host " Downloading and Installing dependies" ; Invoke-WebRequest -Uri https://aka.ms/Microsoft.VCLibs.x64.14.00.Desktop.appx -OutFile .\Microsoft.VCLibs.x64.14.00.Desktop.appx ; Invoke-WebRequest -Uri https://www.nuget.org/api/v2/package/Microsoft.UI.Xaml/2.7.3 -OutFile .\microsoft.ui.xaml.2.7.3.nupkg.zip ; Expand-Archive -Path .\microsoft.ui.xaml.2.7.3.nupkg.zip -Force ; Add-AppXPackage -Path .\microsoft.ui.xaml.2.7.3.nupkg\tools\AppX\x64\Release\Microsoft.UI.Xaml.2.7.appx; Add-AppXPackage -Path .\Microsoft.VCLibs.x64.14.00.Desktop.appx ; write-host " Installing Winget" ; Invoke-WebRequest -Uri https://github.com/microsoft/winget-cli/releases/download/v1.6.2771/Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle -OutFile .\MicrosoftDesktopAppInstaller_8wekyb3d8bbwe.msixbundle ; Add-AppXPackage -Path .\MicrosoftDesktopAppInstaller_8wekyb3d8bbwe.msixbundle" 2 > nul
51+ )
4852
4953cls & echo ======================
5054echo Remove packages first stage. Please Wait...
@@ -239,19 +243,9 @@ winget install --id 9MSMLRH6LZF3 --accept-source-agreements --silent --accept-pa
239243
240244
241245cls
242- CHOICE /c YN /M " Do you want to run Clean Manager"
243- if %ERRORLEVEL% == 1 (CALL :sub_Clean)
244-
245246CHOICE /c YN /M " Do you want to reboot now"
246247if %ERRORLEVEL% == 1 (shutdown -r -f -t 00)
247248
248249cls & echo Done. Thank you for using this tool. ==== Reboot is recommended ====& echo .
249250pause
250251exit
251-
252- :sub_Clean
253- echo Cleanning, Please Wait...
254- for /f " delims=" %%a in ('REG QUERY HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches /s /k /f *') do (
255- REG add " %%a " /v " StateFlags0005 " /t REG_DWORD /d 2 /f > nul 2 >& 1 )
256- CleanMgr.exe /sagerun:5
257- exit /B
You can’t perform that action at this time.
0 commit comments