mirror of
https://github.com/jazir555/GamesDows.git
synced 2025-06-06 07:37:24 +02:00
buildtoolsinstallerfixed
This commit is contained in:
parent
fe0cc868e8
commit
6c3db27515
@ -20,17 +20,27 @@ if %errorlevel% neq 0 (
|
|||||||
set exe_name=CustomLogonUI.exe
|
set exe_name=CustomLogonUI.exe
|
||||||
set cpp_code=CustomLogonUI.cpp
|
set cpp_code=CustomLogonUI.cpp
|
||||||
set src_path=%~dp0
|
set src_path=%~dp0
|
||||||
|
set log_file=%~dp0modify_winlogon.log
|
||||||
set dst_path=C:\Windows\System32
|
set dst_path=C:\Windows\System32
|
||||||
set backup_logonui=logonui_backup.exe
|
set backup_logonui=logonui_backup.exe
|
||||||
set temp_dir=C:\Temp
|
set temp_dir=C:\Temp
|
||||||
set installer=%temp_dir%\vs_buildtools.exe
|
set installer=%temp_dir%\vs_buildtools.exe
|
||||||
|
set vs_install_log=%temp_dir%\vs_buildtools_install.log
|
||||||
|
set vs_install_error_log=%temp_dir%\vs_buildtools_install_error.log
|
||||||
|
echo Script started at %date% %time% > %log_file%
|
||||||
|
echo Script started at %date% %time%
|
||||||
|
|
||||||
:: Step 1: Ensure Temp Directory Exists and has Correct Permissions
|
:: Ensure Temp Directory Exists and has Correct Permissions
|
||||||
echo Ensuring temp directory exists and has correct permissions... >> %log_file%
|
echo Ensuring temp directory exists and has correct permissions... >> %log_file%
|
||||||
if not exist "%temp_dir%" (
|
if not exist "%temp_dir%" (
|
||||||
mkdir "%temp_dir%"
|
mkdir "%temp_dir%"
|
||||||
)
|
)
|
||||||
icacls "%temp_dir%" /grant Everyone:(F) >> %log_file% 2>&1
|
icacls "%temp_dir%" /grant Everyone:(F) >> %log_file% 2>&1
|
||||||
|
if %errorlevel% neq 0 (
|
||||||
|
echo Failed to set permissions for the temp directory. >> %log_file%
|
||||||
|
pause
|
||||||
|
exit /b
|
||||||
|
)
|
||||||
echo Temp directory permissions set. >> %log_file%
|
echo Temp directory permissions set. >> %log_file%
|
||||||
|
|
||||||
:: Step 2: Install .NET Framework 4.8 (NetFx4-AdvSrvs)
|
:: Step 2: Install .NET Framework 4.8 (NetFx4-AdvSrvs)
|
||||||
@ -118,30 +128,31 @@ if %errorlevel% neq 0 (
|
|||||||
echo Visual Studio Community installed successfully. >> %log_file%
|
echo Visual Studio Community installed successfully. >> %log_file%
|
||||||
echo Visual Studio Community installed successfully.
|
echo Visual Studio Community installed successfully.
|
||||||
|
|
||||||
:: Step 3: Check for Visual Studio Build Tools
|
:: Download Visual Studio Build Tools Installer
|
||||||
echo Checking for Visual Studio Build Tools... >> %log_file%
|
set installer=%temp_dir%\vs_buildtools.exe
|
||||||
reg query "HKLM\SOFTWARE\Microsoft\VisualStudio\SxS\VS7" >nul 2>&1
|
echo Downloading Visual Studio Build Tools... >> %log_file%
|
||||||
|
powershell -Command "Invoke-WebRequest -Uri 'https://aka.ms/vs/16/release/vs_buildtools.exe' -OutFile '%installer%'" >> %log_file% 2>&1
|
||||||
if %errorlevel% neq 0 (
|
if %errorlevel% neq 0 (
|
||||||
echo Visual Studio Build Tools not found. Downloading... >> %log_file%
|
echo Failed to download Visual Studio Build Tools installer. >> %log_file%
|
||||||
powershell -Command "$installer='%temp_dir%\vs_buildtools.exe'; Invoke-WebRequest -Uri https://aka.ms/vs/16/release/vs_buildtools.exe -OutFile $installer; Start-Process -Wait -FilePath $installer -ArgumentList '--add Microsoft.VisualStudio.Workload.VCTools --includeRecommended --passive --norestart'; Remove-Item -Force $installer"
|
pause
|
||||||
if %errorlevel% neq 0 (
|
exit /b
|
||||||
echo Failed to download Visual Studio Build Tools installer. >> %log_file%
|
|
||||||
echo Failed to download Visual Studio Build Tools installer.
|
|
||||||
pause
|
|
||||||
exit /b
|
|
||||||
)
|
|
||||||
echo Running Visual Studio Build Tools installer... >> %log_file%
|
|
||||||
start /wait "" "%installer%" --add Microsoft.VisualStudio.Workload.VCTools --includeRecommended --passive --norestart >> %log_file% 2>&1
|
|
||||||
if %errorlevel% neq 0 (
|
|
||||||
echo Failed to install Visual Studio Build Tools. >> %log_file%
|
|
||||||
echo Failed to install Visual Studio Build Tools.
|
|
||||||
pause
|
|
||||||
exit /b
|
|
||||||
)
|
|
||||||
echo Visual Studio Build Tools installed successfully. >> %log_file%
|
|
||||||
) else (
|
|
||||||
echo Visual Studio Build Tools are already installed. >> %log_file%
|
|
||||||
)
|
)
|
||||||
|
echo Visual Studio Build Tools installer downloaded successfully. >> %log_file%
|
||||||
|
|
||||||
|
:: Run Visual Studio Build Tools Installer
|
||||||
|
echo Running Visual Studio Build Tools installer... >> %log_file%
|
||||||
|
powershell -Command "Start-Process -Wait -FilePath '%installer%' -ArgumentList '--add Microsoft.VisualStudio.Workload.VCTools --includeRecommended --passive --norestart' -RedirectStandardOutput '%vs_install_log%' -RedirectStandardError '%vs_install_error_log%' -NoNewWindow" >> %log_file% 2>&1
|
||||||
|
if %errorlevel% neq 0 (
|
||||||
|
echo Failed to install Visual Studio Build Tools. >> %log_file%
|
||||||
|
echo Check the install log for details: %vs_install_log% and %vs_install_error_log% >> %log_file%
|
||||||
|
pause
|
||||||
|
exit /b
|
||||||
|
)
|
||||||
|
echo Visual Studio Build Tools installed successfully. >> %log_file%
|
||||||
|
|
||||||
|
:: Indicate end of script
|
||||||
|
echo Script completed successfully. >> %log_file%
|
||||||
|
pause
|
||||||
|
|
||||||
:: Step 5: Create the C++ source file using PowerShell
|
:: Step 5: Create the C++ source file using PowerShell
|
||||||
echo Creating C++ source file using PowerShell... >> %log_file%
|
echo Creating C++ source file using PowerShell... >> %log_file%
|
||||||
|
Loading…
x
Reference in New Issue
Block a user