Moving dotnet installation to Autounattend.xml

This commit is contained in:
Chan9390 2017-07-26 14:41:37 +05:30
parent aa15bc9c95
commit 181f3e733b
No known key found for this signature in database
GPG Key ID: 6CC28422F21ED4FA
3 changed files with 30 additions and 0 deletions

View File

@ -259,6 +259,11 @@
<CommandLine>cmd.exe /c C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -File a:\install_netfx.ps1 -AutoStart</CommandLine>
<Description>Install .NET 4.0</Description>
<Order>27</Order>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<CommandLine>cmd.exe /c C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -File a:\install-dotnet-451.ps1 -AutoStart</CommandLine>
<Order>98</Order>
<Description>Install .NET 4.5.1</Description>
</SynchronousCommand>
<!--WITHOUT WINDOWS UPDATES -->
<SynchronousCommand wcm:action="add">

View File

@ -0,0 +1,23 @@
$Logfile = "C:\Windows\Temp\dotnet-install.log"
function LogWrite {
Param ([string]$logstring)
$now = Get-Date -format s
Add-Content $Logfile -value "$now $logstring"
Write-Host $logstring
}
LogWrite "Downloading dotNet 4.5.1"
try {
(New-Object System.Net.WebClient).DownloadFile('http://download.microsoft.com/download/1/6/7/167F0D79-9317-48AE-AEDB-17120579F8E2/NDP451-KB2858728-x86-x64-AllOS-ENU.exe', 'C:\Windows\Temp\dotnet.exe')
} catch {
LogWrite $_.Exception | Format-List -force
LogWrite "Failed to download file."
}
LogWrite "Starting installation process..."
try {
Start-Process -FilePath "C:\Windows\Temp\dotnet.exe" -ArgumentList "/I /q /norestart" -Wait -PassThru
} catch {
LogWrite $_.Exception | Format-List -force
LogWrite "Exception during install process."
}

View File

@ -21,6 +21,7 @@
"./scripts/configs/win-updates.ps1",
"./scripts/installs/openssh.ps1",
"./scripts/installs/install_netfx.ps1",
"./scripts/installs/install_dotnet45.ps1",
"./resources/certs/oracle-cert.cer",
"./resources/certs/gdig2.crt",
"./resources/certs/comodorsadomainvalidationsecureserverca.crt",
@ -64,6 +65,7 @@
"./scripts/configs/win-updates.ps1",
"./scripts/installs/openssh.ps1",
"./scripts/installs/install_netfx.ps1",
"./scripts/installs/install_dotnet45.ps1",
"./resources/certs/oracle-cert.cer",
"./resources/certs/gdig2.crt",
"./resources/certs/comodorsadomainvalidationsecureserverca.crt",