mirror of
https://github.com/actions/runner-images.git
synced 2026-01-08 11:30:49 +08:00
[Windows] Apply code style rules to Windows scripts (#8957)
* Apply code style rules to Windows scripts * Fix typo * Fix configure-toolset script * Fix parameters in Msys2 installation script * Improve log readability * Remove broken exit code validation
This commit is contained in:
committed by
GitHub
parent
76d6f0f574
commit
7fe65a2204
@@ -9,17 +9,23 @@
|
||||
#
|
||||
|
||||
Write-Host "Warmup 'devenv.exe /updateconfiguration'"
|
||||
|
||||
$vsInstallRoot = (Get-VisualStudioInstance).InstallationPath
|
||||
$devEnvPath = "$vsInstallRoot\Common7\IDE\devenv.exe"
|
||||
|
||||
cmd.exe /c "`"$devEnvPath`" /updateconfiguration"
|
||||
cmd.exe /c "`"$vsInstallRoot\Common7\IDE\devenv.exe`" /updateconfiguration"
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
throw "Failed to warmup 'devenv.exe /updateconfiguration'"
|
||||
}
|
||||
|
||||
# we are fine if some file is locked and cannot be copied
|
||||
Copy-Item ${env:USERPROFILE}\AppData\Local\Microsoft\VisualStudio -Destination c:\users\default\AppData\Local\Microsoft\VisualStudio -Recurse -ErrorAction SilentlyContinue
|
||||
|
||||
reg.exe load HKLM\DEFAULT c:\users\default\ntuser.dat
|
||||
Mount-RegistryHive `
|
||||
-FileName "C:\Users\Default\NTUSER.DAT" `
|
||||
-SubKey "HKLM\DEFAULT"
|
||||
|
||||
reg.exe copy HKCU\Software\Microsoft\VisualStudio HKLM\DEFAULT\Software\Microsoft\VisualStudio /s
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
throw "Failed to copy HKCU\Software\Microsoft\VisualStudio to HKLM\DEFAULT\Software\Microsoft\VisualStudio"
|
||||
}
|
||||
|
||||
# disable TSVNCache.exe
|
||||
$registryKeyPath = 'HKCU:\Software\TortoiseSVN'
|
||||
@@ -27,8 +33,12 @@ if (-not(Test-Path -Path $registryKeyPath)) {
|
||||
New-Item -Path $registryKeyPath -ItemType Directory -Force
|
||||
}
|
||||
|
||||
New-ItemProperty -Path $RegistryKeyPath -Name CacheType -PropertyType DWORD -Value 0
|
||||
New-ItemProperty -Path $registryKeyPath -Name CacheType -PropertyType DWORD -Value 0
|
||||
reg.exe copy HKCU\Software\TortoiseSVN HKLM\DEFAULT\Software\TortoiseSVN /s
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
throw "Failed to copy HKCU\Software\TortoiseSVN to HKLM\DEFAULT\Software\TortoiseSVN"
|
||||
}
|
||||
|
||||
Dismount-RegistryHive "HKLM\DEFAULT"
|
||||
|
||||
reg.exe unload HKLM\DEFAULT
|
||||
Write-Host "Configure-User.ps1 - completed"
|
||||
|
||||
Reference in New Issue
Block a user