mirror of
https://github.com/rapid7/metasploitable3.git
synced 2024-06-28 15:55:47 +02:00
Moving dotnet installation to Autounattend.xml
This commit is contained in:
parent
aa15bc9c95
commit
181f3e733b
|
@ -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">
|
||||
|
|
23
scripts/installs/install_dotnet45.ps1
Normal file
23
scripts/installs/install_dotnet45.ps1
Normal 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."
|
||||
}
|
|
@ -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",
|
||||
|
|
Loading…
Reference in New Issue
Block a user