From 1cfa87b4a6b2950af3dc9de3c5405d3f8e50e357 Mon Sep 17 00:00:00 2001 From: Aleksandr Chebotov Date: Tue, 17 Mar 2020 10:54:05 +0300 Subject: [PATCH 01/17] remove boost binaries from path --- images/win/Windows2016-Azure.json | 9 ++---- images/win/Windows2019-Azure.json | 6 ++-- .../win/scripts/Installers/Install-Boost.ps1 | 8 ----- .../win/scripts/Installers/Validate-Boost.ps1 | 29 +------------------ 4 files changed, 6 insertions(+), 46 deletions(-) diff --git a/images/win/Windows2016-Azure.json b/images/win/Windows2016-Azure.json index 0ad1e3f4..ed318c65 100644 --- a/images/win/Windows2016-Azure.json +++ b/images/win/Windows2016-Azure.json @@ -30,8 +30,7 @@ "image_os": "win16", "github_feed_token": "{{env `GITHUB_FEED_TOKEN`}}", "go_versions": "1.9, 1.10, 1.11, 1.12, 1.13, 1.14", - "go_default": "1.14", - "boost_default": "1.69.0" + "go_default": "1.14" }, "sensitive-variables": ["install_password", "ssh_password", "client_secret", "github_feed_token"], "builders": [ @@ -517,8 +516,7 @@ { "type": "powershell", "environment_vars": [ - "ROOT_FOLDER={{user `root_folder`}}", - "BOOST_DEFAULT={{user `boost_default`}}" + "ROOT_FOLDER={{user `root_folder`}}" ], "scripts":[ "{{ template_dir }}/scripts/Installers/Install-Boost.ps1" @@ -652,8 +650,7 @@ { "type": "powershell", "environment_vars": [ - "ROOT_FOLDER={{user `root_folder`}}", - "BOOST_DEFAULT={{user `boost_default`}}" + "ROOT_FOLDER={{user `root_folder`}}" ], "scripts":[ "{{ template_dir }}/scripts/Installers/Validate-Boost.ps1" diff --git a/images/win/Windows2019-Azure.json b/images/win/Windows2019-Azure.json index 2023be50..0441f91f 100644 --- a/images/win/Windows2019-Azure.json +++ b/images/win/Windows2019-Azure.json @@ -30,8 +30,7 @@ "image_os": "win19", "github_feed_token": "{{env `GITHUB_FEED_TOKEN`}}", "go_versions": "1.9, 1.10, 1.11, 1.12, 1.13, 1.14", - "go_default": "1.14", - "boost_default": "1.72.0" + "go_default": "1.14" }, "sensitive-variables": ["install_password", "ssh_password", "client_secret", "github_feed_token"], "builders": [ @@ -498,8 +497,7 @@ { "type": "powershell", "environment_vars": [ - "ROOT_FOLDER={{user `root_folder`}}", - "BOOST_DEFAULT={{user `boost_default`}}" + "ROOT_FOLDER={{user `root_folder`}}" ], "scripts":[ "{{ template_dir }}/scripts/Installers/Install-Boost.ps1" diff --git a/images/win/scripts/Installers/Install-Boost.ps1 b/images/win/scripts/Installers/Install-Boost.ps1 index 0931fb25..d46a150c 100644 --- a/images/win/scripts/Installers/Install-Boost.ps1 +++ b/images/win/scripts/Installers/Install-Boost.ps1 @@ -9,7 +9,6 @@ Import-Module -Name ImageHelpers $SoftwareName = "Boost" $BoostDirectory = Join-Path -Path $env:AGENT_TOOLSDIRECTORY -ChildPath $SoftwareName $BoostVersions = (Get-ToolsByName -SoftwareName $SoftwareName).Versions | Foreach-Object {"{0}.0" -f $_} -$BoostDefault = $env:BOOST_DEFAULT foreach($BoostVersion in $BoostVersions) { @@ -17,11 +16,4 @@ foreach($BoostVersion in $BoostVersions) $EnvBoostPath = "BOOST_ROOT_{0}" -f ($BoostVersion.Replace('.', '_')) setx $EnvBoostPath $BoostInstallationDir /M | Out-Null - - if ($BoostVersion -eq $BoostDefault) - { - Write-Host "Adding Boost $BoostVersion to the path..." - # Add the Boost binaries to the path - Add-MachinePathItem $BoostInstallationDir | Out-Null - } } diff --git a/images/win/scripts/Installers/Validate-Boost.ps1 b/images/win/scripts/Installers/Validate-Boost.ps1 index 6289e165..e9b7554e 100644 --- a/images/win/scripts/Installers/Validate-Boost.ps1 +++ b/images/win/scripts/Installers/Validate-Boost.ps1 @@ -18,7 +18,6 @@ function Validate-BoostVersion if (Test-Path "$ReleasePath\b2.exe") { Write-Host "Boost.Build $BoostRelease is successfully installed" - return } @@ -26,17 +25,6 @@ function Validate-BoostVersion exit 1 } -# Verify that Boost is on the path -if (Get-Command -Name 'b2') -{ - Write-Host "Boost is on the path" -} -else -{ - Write-Host "Boost is not on the path" - exit 1 -} - # Adding description of the software to Markdown $tmplMark = @" #### {0} [{2}] @@ -46,14 +34,6 @@ _Environment:_ "@ -$tmplMarkRoot = @" -#### {0} [{2}] - -_Environment:_ -* PATH: contains the location of Boost version {0} -* {1}: root directory of the Boost version {0} installation -"@ - $Description = New-Object System.Text.StringBuilder $SoftwareName = 'Boost' $BoostRootDirectory = Join-Path -Path $env:AGENT_TOOLSDIRECTORY -ChildPath $SoftwareName @@ -68,14 +48,7 @@ foreach ($BoostTool in $BoostTools) Validate-BoostVersion -BoostRootPath $BoostRootDirectory -BoostRelease $BoostVersion $BoostVersionTag = "BOOST_ROOT_{0}" -f $BoostVersion.Replace('.', '_') - if($BoostVersion -eq $env:BOOST_DEFAULT) - { - $null = $Description.AppendLine(($tmplMarkRoot -f $BoostVersion, $BoostVersionTag, $BoostToolsetName)) - } - else - { - $null = $Description.AppendLine(($tmplMark -f $BoostVersion, $BoostVersionTag, $BoostToolsetName)) - } + $null = $Description.AppendLine(($tmplMark -f $BoostVersion, $BoostVersionTag, $BoostToolsetName)) } } From b7714ce050888355c6ac0611539afc190ffd8b1d Mon Sep 17 00:00:00 2001 From: Nikita Bykov Date: Thu, 19 Mar 2020 15:37:31 +0300 Subject: [PATCH 02/17] added Win10 SDK to 2019 env --- images/win/scripts/Installers/Windows2019/Install-VS2019.ps1 | 1 + 1 file changed, 1 insertion(+) diff --git a/images/win/scripts/Installers/Windows2019/Install-VS2019.ps1 b/images/win/scripts/Installers/Windows2019/Install-VS2019.ps1 index a9658fd7..1ccd5c42 100644 --- a/images/win/scripts/Installers/Windows2019/Install-VS2019.ps1 +++ b/images/win/scripts/Installers/Windows2019/Install-VS2019.ps1 @@ -121,6 +121,7 @@ $WorkLoads = '--allWorkloads --includeRecommended ' + ` '--add Microsoft.VisualStudio.Component.VC.v141.MFC.ARM.Spectre ' + ` '--add Microsoft.VisualStudio.Component.VC.v141.MFC.ARM64.Spectre ' + ` '--add Microsoft.VisualStudio.Component.VC.v141.MFC.Spectre ' + ` + '--add Microsoft.VisualStudio.Component.Windows10SDK.14393 ' + ` '--add Microsoft.VisualStudio.Component.Windows10SDK.16299 ' + ` '--add Microsoft.VisualStudio.Component.Windows10SDK.17134 ' + ` '--add Microsoft.VisualStudio.Component.Windows10SDK.17763 ' + ` From 231b522b32c2618e052a847b6f8340955ef2cd8d Mon Sep 17 00:00:00 2001 From: Marco Mansi Date: Thu, 19 Mar 2020 16:20:32 +0100 Subject: [PATCH 03/17] Solve error with Set-ExecutionPolicy --- images/win/Windows2016-Azure.json | 3 ++- images/win/Windows2019-Azure.json | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/images/win/Windows2016-Azure.json b/images/win/Windows2016-Azure.json index 0ad1e3f4..16d9cea8 100644 --- a/images/win/Windows2016-Azure.json +++ b/images/win/Windows2016-Azure.json @@ -101,7 +101,8 @@ ], "scripts":[ "{{ template_dir }}/scripts/Installers/Windows2016/Initialize-VM.ps1" - ] + ], + "execution_policy": "unrestricted" }, { "type": "powershell", diff --git a/images/win/Windows2019-Azure.json b/images/win/Windows2019-Azure.json index 2023be50..8c9aa7a2 100644 --- a/images/win/Windows2019-Azure.json +++ b/images/win/Windows2019-Azure.json @@ -101,7 +101,8 @@ ], "scripts":[ "{{ template_dir }}/scripts/Installers/Windows2019/Initialize-VM.ps1" - ] + ], + "execution_policy": "unrestricted" }, { "type": "powershell", From a4c66572ab7d009b024edc907c89cd2f8620291f Mon Sep 17 00:00:00 2001 From: Michael Mainer Date: Fri, 20 Mar 2020 01:14:49 -0700 Subject: [PATCH 04/17] Update Install-PHP.ps1 to include Composer 1. Install Composer from Chocolatey. PHP needs its dependency manager. 2. Enable php_openssl.dll - believe this is necessary in the case someone wants to update Composer. **Reference** https://chocolatey.org/packages/composer https://github.com/actions/virtual-environments/issues/587 https://superuser.com/questions/1010080/the-openssl-extension-is-missing-on-windows-while-installing-composer --- images/win/scripts/Installers/Install-PHP.ps1 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/images/win/scripts/Installers/Install-PHP.ps1 b/images/win/scripts/Installers/Install-PHP.ps1 index 02d38931..72db2ee2 100644 --- a/images/win/scripts/Installers/Install-PHP.ps1 +++ b/images/win/scripts/Installers/Install-PHP.ps1 @@ -10,8 +10,11 @@ Import-Module -Name ImageHelpers $installDir = "c:\tools\php" choco install php -y --force --params "/InstallDir:$installDir" -# update path to extensions and enable curl and mbstring extensions -((Get-Content -path $installDir\php.ini -Raw) -replace ';extension=curl','extension=curl' -replace ';extension=mbstring','extension=mbstring' -replace ';extension_dir = "ext"','extension_dir = "ext"') | Set-Content -Path $installDir\php.ini +# Install latest Composer in chocolatey +choco install composer --ia "/DEV=$installDir /PHP=$installDir" + +# update path to extensions and enable curl and mbstring extensions, and enable php openssl extensions. +((Get-Content -path $installDir\php.ini -Raw) -replace ';extension=curl','extension=curl' -replace ';extension=mbstring','extension=mbstring' -replace ';extension_dir = "ext"','extension_dir = "ext"' -replace 'extension=";php_openssl.dll"','extension_dir = "php_openssl.dll"') | Set-Content -Path $installDir\php.ini # Set the PHPROOT environment variable. setx PHPROOT $installDir /M From 030197e844770f3fe5bc46c0544499f43655f9aa Mon Sep 17 00:00:00 2001 From: Michael Mainer Date: Fri, 20 Mar 2020 01:50:21 -0700 Subject: [PATCH 05/17] Update Validate-PHP.ps1 Add validation for composer install --- .../win/scripts/Installers/Validate-PHP.ps1 | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/images/win/scripts/Installers/Validate-PHP.ps1 b/images/win/scripts/Installers/Validate-PHP.ps1 index a8663617..f2f26a52 100644 --- a/images/win/scripts/Installers/Validate-PHP.ps1 +++ b/images/win/scripts/Installers/Validate-PHP.ps1 @@ -33,6 +33,32 @@ else exit 1 } +# Verify that composer.exe is on the path +if(Get-Command -Name 'composer') +{ + Write-Host "$(composer --version) is on the path." +} +else +{ + Write-Host "composer is not on the path." + exit 1 +} + +# Get the composer version. +$composerVersion = $(composer --version) + +# Add composer version details in Markdown +$SoftwareName = "Composer" +$Description = @" +#### $composerVersion + +_Environment:_ +* PATH: contains the location of composer.exe version $composerVersion +* PHPROOT: root directory of the Composer $composerVersion installation +"@ + +Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description + # Get available versions of PHP $phpVersionOnPath = Get-PHPVersion -phpRootPath "C:\tools\php72" From 2123c3ae499326998b351ca1838be3d56207a57c Mon Sep 17 00:00:00 2001 From: Maxim Lobanov Date: Fri, 20 Mar 2020 13:46:12 +0300 Subject: [PATCH 06/17] Update templates --- .github/PULL_REQUEST_TEMPLATE/bug-fixing.md | 17 +++++++++++ .../PULL_REQUEST_TEMPLATE/new-tool-adding.md | 29 +++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 .github/PULL_REQUEST_TEMPLATE/bug-fixing.md create mode 100644 .github/PULL_REQUEST_TEMPLATE/new-tool-adding.md diff --git a/.github/PULL_REQUEST_TEMPLATE/bug-fixing.md b/.github/PULL_REQUEST_TEMPLATE/bug-fixing.md new file mode 100644 index 00000000..751c1075 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE/bug-fixing.md @@ -0,0 +1,17 @@ +--- +name: Bug fixing and improvements +about: Fix existing bug with images or code improvements +title: '' +labels: '' +assignees: '' + +--- + +**Description** + +Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. + +**Check list** +- [ ] non-breaking change which fixes an issue +- [ ] breaking change / regression +- [ ] Related images are successfully generated \ No newline at end of file diff --git a/.github/PULL_REQUEST_TEMPLATE/new-tool-adding.md b/.github/PULL_REQUEST_TEMPLATE/new-tool-adding.md new file mode 100644 index 00000000..86b282d9 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE/new-tool-adding.md @@ -0,0 +1,29 @@ +--- +name: Add new tool +about: Add a new tool or update the existing one +title: Update/Add [tool name] +labels: '' +assignees: '' + +--- + +**Tool information** +- Tool name: +- URL for tool's homepage: +- Installation time: +- Total size: +- Related issue: + +**Virtual environments affected** +- [ ] macOS 10.15 +- [ ] Ubuntu 16.04 LTS +- [ ] Ubuntu 18.04 LTS +- [ ] Windows Server 2016 R2 +- [ ] Windows Server 2019 + +**Check list** +- [ ] Installation time is provided +- [ ] Tool size is provided +- [ ] Tests are written +- [ ] Documentation is added +- [ ] Related images are successfully generated \ No newline at end of file From c826d5af2625c3aaa36331dc9a1589676ef0a01b Mon Sep 17 00:00:00 2001 From: Maxim Lobanov Date: Fri, 20 Mar 2020 14:06:42 +0300 Subject: [PATCH 07/17] try --- .github/PULL_REQUEST_TEMPLATE/bug-fixing.md | 17 ----------------- ...-tool-adding.md => pull_request_template.md} | 9 ++------- 2 files changed, 2 insertions(+), 24 deletions(-) delete mode 100644 .github/PULL_REQUEST_TEMPLATE/bug-fixing.md rename .github/{PULL_REQUEST_TEMPLATE/new-tool-adding.md => pull_request_template.md} (75%) diff --git a/.github/PULL_REQUEST_TEMPLATE/bug-fixing.md b/.github/PULL_REQUEST_TEMPLATE/bug-fixing.md deleted file mode 100644 index 751c1075..00000000 --- a/.github/PULL_REQUEST_TEMPLATE/bug-fixing.md +++ /dev/null @@ -1,17 +0,0 @@ ---- -name: Bug fixing and improvements -about: Fix existing bug with images or code improvements -title: '' -labels: '' -assignees: '' - ---- - -**Description** - -Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. - -**Check list** -- [ ] non-breaking change which fixes an issue -- [ ] breaking change / regression -- [ ] Related images are successfully generated \ No newline at end of file diff --git a/.github/PULL_REQUEST_TEMPLATE/new-tool-adding.md b/.github/pull_request_template.md similarity index 75% rename from .github/PULL_REQUEST_TEMPLATE/new-tool-adding.md rename to .github/pull_request_template.md index 86b282d9..c4074af8 100644 --- a/.github/PULL_REQUEST_TEMPLATE/new-tool-adding.md +++ b/.github/pull_request_template.md @@ -1,11 +1,6 @@ ---- -name: Add new tool -about: Add a new tool or update the existing one -title: Update/Add [tool name] -labels: '' -assignees: '' +**Description** ---- +Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. **Tool information** - Tool name: From 14e4c3e0413d6fad46cde60e6ff4454dbc2b8419 Mon Sep 17 00:00:00 2001 From: Maxim Lobanov Date: Mon, 23 Mar 2020 12:44:41 +0300 Subject: [PATCH 08/17] update template --- .github/pull_request_template.md | 30 +++++++++--------------------- 1 file changed, 9 insertions(+), 21 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index c4074af8..f6474e24 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,24 +1,12 @@ -**Description** +**Description** +New tool, Bug fixing, or Improvement? +Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. +For new tools, provide total size and installation time. -Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. - -**Tool information** -- Tool name: -- URL for tool's homepage: -- Installation time: -- Total size: -- Related issue: - -**Virtual environments affected** -- [ ] macOS 10.15 -- [ ] Ubuntu 16.04 LTS -- [ ] Ubuntu 18.04 LTS -- [ ] Windows Server 2016 R2 -- [ ] Windows Server 2019 +**Related issue:** **Check list** -- [ ] Installation time is provided -- [ ] Tool size is provided -- [ ] Tests are written -- [ ] Documentation is added -- [ ] Related images are successfully generated \ No newline at end of file +- [ ] Related issue / work item is attached +- [ ] Tests are written (if applicable) +- [ ] Documentation is updated (if applicable) +- [ ] Changes are tested and related VM images are succefully generated From 144081916b0180245c4fd1ff84cf7efcbc92b25d Mon Sep 17 00:00:00 2001 From: Maxim Lobanov Date: Mon, 23 Mar 2020 12:48:02 +0300 Subject: [PATCH 09/17] Update pull_request_template.md --- .github/pull_request_template.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index f6474e24..9c65c9a7 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,11 +1,11 @@ -**Description** +**Description:** New tool, Bug fixing, or Improvement? -Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. +Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. For new tools, provide total size and installation time. **Related issue:** -**Check list** +**Check list:** - [ ] Related issue / work item is attached - [ ] Tests are written (if applicable) - [ ] Documentation is updated (if applicable) From 60cfda73991c462ac484c2fb6c926c452777cc4e Mon Sep 17 00:00:00 2001 From: Maxim Lobanov Date: Mon, 23 Mar 2020 13:03:46 +0300 Subject: [PATCH 10/17] correct words --- .github/pull_request_template.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 9c65c9a7..2ee51fcc 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,7 +1,7 @@ **Description:** New tool, Bug fixing, or Improvement? -Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. -For new tools, provide total size and installation time. +Please include a summary of the change and which issue is fixed. Also include relevant motivation and context. +For new tools, please provide total size and installation time. **Related issue:** From dae1aa3be4f0b424b56b717a401c58bade51904f Mon Sep 17 00:00:00 2001 From: Maxim Lobanov Date: Mon, 23 Mar 2020 20:18:05 +0300 Subject: [PATCH 11/17] Update based on SergeyAkh comments --- .github/pull_request_template.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 2ee51fcc..e645fafc 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,11 +1,11 @@ -**Description:** +# Description New tool, Bug fixing, or Improvement? Please include a summary of the change and which issue is fixed. Also include relevant motivation and context. -For new tools, please provide total size and installation time. +**For new tools, please provide total size and installation time.** -**Related issue:** +#### Related issue: -**Check list:** +## Check list - [ ] Related issue / work item is attached - [ ] Tests are written (if applicable) - [ ] Documentation is updated (if applicable) From 62164dd90dc9d483aa1a329947398a60e615bdb7 Mon Sep 17 00:00:00 2001 From: Maxim Lobanov Date: Tue, 24 Mar 2020 08:09:54 +0300 Subject: [PATCH 12/17] fix spelling --- .github/pull_request_template.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index e645fafc..54085c9b 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -9,4 +9,4 @@ Please include a summary of the change and which issue is fixed. Also include re - [ ] Related issue / work item is attached - [ ] Tests are written (if applicable) - [ ] Documentation is updated (if applicable) -- [ ] Changes are tested and related VM images are succefully generated +- [ ] Changes are tested and related VM images are successfully generated From 9b3924a23d947d636da1691f70b26230d174ddae Mon Sep 17 00:00:00 2001 From: Dibir Magomedsaygitov <61747324+dibir-magomedsaygitov@users.noreply.github.com> Date: Tue, 24 Mar 2020 09:17:38 +0300 Subject: [PATCH 13/17] Move "Run-Antivirus" step outside of image-generation (#574) * Move "Run-Antivirus" step outside of image-generation Co-authored-by: Dibir Magomedsaygitov --- images/win/Windows2016-Azure.json | 12 +++++++- images/win/Windows2019-Azure.json | 12 +++++++- .../Installers/Configure-Antivirus.ps1 | 2 ++ .../win/scripts/Installers/Run-Antivirus.ps1 | 30 +++++++++++++++++++ .../Installers/Windows2016/Run-Antivirus.ps1 | 19 ------------ .../Installers/Windows2019/Run-Antivirus.ps1 | 27 ----------------- 6 files changed, 54 insertions(+), 48 deletions(-) create mode 100644 images/win/scripts/Installers/Configure-Antivirus.ps1 create mode 100644 images/win/scripts/Installers/Run-Antivirus.ps1 delete mode 100644 images/win/scripts/Installers/Windows2016/Run-Antivirus.ps1 delete mode 100644 images/win/scripts/Installers/Windows2019/Run-Antivirus.ps1 diff --git a/images/win/Windows2016-Azure.json b/images/win/Windows2016-Azure.json index 16d9cea8..2d5f86f0 100644 --- a/images/win/Windows2016-Azure.json +++ b/images/win/Windows2016-Azure.json @@ -15,6 +15,7 @@ "virtual_network_subnet_name": "{{env `VNET_SUBNET`}}", "private_virtual_network_with_public_ip": "{{env `PRIVATE_VIRTUAL_NETWORK_WITH_PUBLIC_IP`}}", "vm_size": "Standard_DS4_v2", + "run_scan_antivirus": "false", "root_folder": "C:", "image_folder": "C:\\image", @@ -876,8 +877,17 @@ }, { "type": "powershell", + "environment_vars":[ + "RUN_SCAN_ANTIVIRUS={{user `run_scan_antivirus`}}" + ], "scripts":[ - "{{ template_dir }}/scripts/Installers/Windows2016/Run-Antivirus.ps1" + "{{ template_dir }}/scripts/Installers/Run-Antivirus.ps1" + ] + }, + { + "type": "powershell", + "scripts":[ + "{{ template_dir }}/scripts/Installers/Configure-Antivirus.ps1" ] }, { diff --git a/images/win/Windows2019-Azure.json b/images/win/Windows2019-Azure.json index 8c9aa7a2..5c7be897 100644 --- a/images/win/Windows2019-Azure.json +++ b/images/win/Windows2019-Azure.json @@ -15,6 +15,7 @@ "virtual_network_subnet_name": "{{env `VNET_SUBNET`}}", "private_virtual_network_with_public_ip": "{{env `PRIVATE_VIRTUAL_NETWORK_WITH_PUBLIC_IP`}}", "vm_size": "Standard_DS4_v2", + "run_scan_antivirus": "false", "root_folder": "C:", "image_folder": "C:\\image", @@ -869,8 +870,17 @@ }, { "type": "powershell", + "environment_vars":[ + "RUN_SCAN_ANTIVIRUS={{user `run_scan_antivirus`}}" + ], "scripts":[ - "{{ template_dir }}/scripts/Installers/Windows2019/Run-Antivirus.ps1" + "{{ template_dir }}/scripts/Installers/Run-Antivirus.ps1" + ] + }, + { + "type": "powershell", + "scripts":[ + "{{ template_dir }}/scripts/Installers/Configure-Antivirus.ps1" ] }, { diff --git a/images/win/scripts/Installers/Configure-Antivirus.ps1 b/images/win/scripts/Installers/Configure-Antivirus.ps1 new file mode 100644 index 00000000..650d3a98 --- /dev/null +++ b/images/win/scripts/Installers/Configure-Antivirus.ps1 @@ -0,0 +1,2 @@ +Write-Host "Set antivirus parameters" +Set-MpPreference -ScanAvgCPULoadFactor 5 -ExclusionPath "D:\", "C:\" \ No newline at end of file diff --git a/images/win/scripts/Installers/Run-Antivirus.ps1 b/images/win/scripts/Installers/Run-Antivirus.ps1 new file mode 100644 index 00000000..7993146a --- /dev/null +++ b/images/win/scripts/Installers/Run-Antivirus.ps1 @@ -0,0 +1,30 @@ +################################################################################ +## File: Run-Antivirus.ps1 +## Desc: Run a full antivirus scan. +## Run right after cleanup before we sysprep +################################################################################ + +if ($env:run_scan_antivirus -eq $true) { + try { + Update-MpSignature + } + catch { + Write-Host "Some error was found" + Write-Host $_ + } + + Write-Host "Make sure windefend is going to start" + Start-Service windefend -ErrorAction Continue + Write-Host "Waiting for windefend to report as running" + $service = Get-Service "Windefend" + $service.WaitForStatus("Running","00:10:00") + + Write-Host "Run antivirus" + # Tell Defender to use 100% of the CPU during the scan + Set-MpPreference -ScanAvgCPULoadFactor 100 + # Full Scan + Start-Process -FilePath "C:\Program Files\Windows Defender\MpCmdRun.exe" -ArgumentList ("-Scan","-ScanType", 2) -Wait +} +else { + Write-Host "Scanning process has been skipped" +} \ No newline at end of file diff --git a/images/win/scripts/Installers/Windows2016/Run-Antivirus.ps1 b/images/win/scripts/Installers/Windows2016/Run-Antivirus.ps1 deleted file mode 100644 index 77b3b2bc..00000000 --- a/images/win/scripts/Installers/Windows2016/Run-Antivirus.ps1 +++ /dev/null @@ -1,19 +0,0 @@ -################################################################################ -## File: Run-Antivirus.ps1 -## Desc: Run a full antivirus scan. -## Run right after cleanup before we sysprep -################################################################################ - -Write-Host "Run antivirus" -Push-Location "C:\Program Files\Windows Defender" - -# Tell Defender to use 100% of the CPU during the scan -Set-MpPreference -ScanAvgCPULoadFactor 100 - -# Full Scan -.\MpCmdRun.exe -Scan -ScanType 2 -Pop-Location - -Write-Host "Set antivirus parmeters" -Set-MpPreference -ScanAvgCPULoadFactor 5 ` - -ExclusionPath "D:\", "C:\" diff --git a/images/win/scripts/Installers/Windows2019/Run-Antivirus.ps1 b/images/win/scripts/Installers/Windows2019/Run-Antivirus.ps1 deleted file mode 100644 index e38126af..00000000 --- a/images/win/scripts/Installers/Windows2019/Run-Antivirus.ps1 +++ /dev/null @@ -1,27 +0,0 @@ -################################################################################ -## File: Run-Antivirus.ps1 -## Desc: Run a full antivirus scan. -## Run right after cleanup before we sysprep -################################################################################ - -Write-Host "Make sure windefend is going to start" -Start-Service windefend -ErrorAction Continue - -Write-Host "Waiting for windefend to report as running" -$service = Get-Service "Windefend" -$service.WaitForStatus("Running","00:10:00") - -Write-Host "Run antivirus" -Push-Location "C:\Program Files\Windows Defender" - -# Tell Defender to use 100% of the CPU during the scan -Set-MpPreference -ScanAvgCPULoadFactor 100 - -# Full Scan -.\MpCmdRun.exe -Scan -ScanType 2 -Pop-Location - -Update-MpSignature -Write-Host "Set antivirus parmeters" -Set-MpPreference -ScanAvgCPULoadFactor 5 ` - -ExclusionPath "D:\", "C:\" From 444ab15a64baa452e031f462b9696e72add44ca5 Mon Sep 17 00:00:00 2001 From: Lzu Tao Date: Mon, 23 Mar 2020 07:54:11 +0700 Subject: [PATCH 14/17] rust: Use rustup's minimal profile --- images/linux/scripts/installers/rust.sh | 8 +++----- images/win/scripts/Installers/Install-Rust.ps1 | 8 +++----- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/images/linux/scripts/installers/rust.sh b/images/linux/scripts/installers/rust.sh index 571538a3..850868a4 100644 --- a/images/linux/scripts/installers/rust.sh +++ b/images/linux/scripts/installers/rust.sh @@ -12,16 +12,14 @@ set -e export RUSTUP_HOME=/usr/share/rust/.rustup export CARGO_HOME=/usr/share/rust/.cargo -curl https://sh.rustup.rs -sSf | sh -s -- -y +curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain=stable --profile=minimal # Initialize environment variables source $CARGO_HOME/env # Install common tools -rustup component add rustfmt -rustup component add clippy -cargo install bindgen -cargo install cbindgen +rustup component add rustfmt clippy +cargo install bindgen cbindgen echo "Test installation of the Rust toochain" diff --git a/images/win/scripts/Installers/Install-Rust.ps1 b/images/win/scripts/Installers/Install-Rust.ps1 index e19cd4c1..61588a86 100644 --- a/images/win/scripts/Installers/Install-Rust.ps1 +++ b/images/win/scripts/Installers/Install-Rust.ps1 @@ -14,7 +14,7 @@ $env:CARGO_HOME="C:\Rust\.cargo" Invoke-WebRequest -UseBasicParsing -Uri "https://win.rustup.rs/x86_64" -OutFile rustup-init.exe # Install Rust by running rustup-init.exe (disabling the confirmation prompt with -y) -.\rustup-init.exe -y +.\rustup-init.exe -y --default-toolchain=stable --profile=minimal # Delete rustup-init.exe when it's no longer needed Remove-Item -Path .\rustup-init.exe @@ -24,10 +24,8 @@ Add-MachinePathItem "$env:CARGO_HOME\bin" $env:Path = Get-MachinePath # Install common tools -rustup component add rustfmt -rustup component add clippy -cargo install bindgen -cargo install cbindgen +rustup component add rustfmt clippy +cargo install bindgen cbindgen # Run script at startup for all users $cmdRustSymScript = @" From 8399806f3c02ba492d60f85cb083935fdbebc83e Mon Sep 17 00:00:00 2001 From: Maxim Lobanov Date: Tue, 24 Mar 2020 13:23:57 +0300 Subject: [PATCH 15/17] Fix NSIS documentation (#604) --- images/win/scripts/Installers/Validate-NSIS.ps1 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/images/win/scripts/Installers/Validate-NSIS.ps1 b/images/win/scripts/Installers/Validate-NSIS.ps1 index b38624e7..276eb139 100644 --- a/images/win/scripts/Installers/Validate-NSIS.ps1 +++ b/images/win/scripts/Installers/Validate-NSIS.ps1 @@ -28,5 +28,4 @@ $Description = @" _Version:_ $Version
"@ -#Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description -Write-Host $description +Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description From 6e34be02e45564cb165fceec60412ad69d270e18 Mon Sep 17 00:00:00 2001 From: FrankZ <10498090+frankzo@users.noreply.github.com> Date: Wed, 25 Mar 2020 17:54:03 +0100 Subject: [PATCH 16/17] Removeboostenv (#619) * remove BOOST_DEFAULT from 2019 * refrain from format changes Co-authored-by: Frank Zomer --- images/win/Windows2019-Azure.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/images/win/Windows2019-Azure.json b/images/win/Windows2019-Azure.json index 3ebbea24..c93f79e7 100644 --- a/images/win/Windows2019-Azure.json +++ b/images/win/Windows2019-Azure.json @@ -639,8 +639,7 @@ { "type": "powershell", "environment_vars": [ - "ROOT_FOLDER={{user `root_folder`}}", - "BOOST_DEFAULT={{user `boost_default`}}" + "ROOT_FOLDER={{user `root_folder`}}" ], "scripts":[ "{{ template_dir }}/scripts/Installers/Validate-Boost.ps1" From cef6c2e54c2915719a6f3131f9cabb3382c091a5 Mon Sep 17 00:00:00 2001 From: Aleksandr Chebotov <47745270+al-cheb@users.noreply.github.com> Date: Wed, 25 Mar 2020 22:31:01 +0300 Subject: [PATCH 17/17] fix clang-8 installation --- images/linux/scripts/installers/clang.sh | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/images/linux/scripts/installers/clang.sh b/images/linux/scripts/installers/clang.sh index 1ca4cde2..631be190 100644 --- a/images/linux/scripts/installers/clang.sh +++ b/images/linux/scripts/installers/clang.sh @@ -12,13 +12,11 @@ function InstallClang { version=$1 echo "Installing clang-$version..." - # Clang 6.0 is not supported by automatic installation script (`llvm.sh`) - # Thus we have to install it explicitly - if [[ $version == 6* ]]; then - apt-get install -y "clang-$version" "lldb-$version" "lld-$version" - else + if [[ $version =~ 9 ]]; then ./llvm.sh $version apt-get install -y "clang-format-$version" + else + apt-get install -y "clang-$version" "lldb-$version" "lld-$version" "clang-format-$version" fi # Run tests to determine that the software installed as expected @@ -35,11 +33,6 @@ function InstallClang { DocumentInstalledItem "Clang $version ($(clang-$version --version | head -n 1 | cut -d ' ' -f 3 | cut -d '-' -f 1))" } -# Install Clang compiler -wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - -apt-add-repository "deb http://apt.llvm.org/$(lsb_release -cs)/ llvm-toolchain-$(lsb_release -cs)-6.0 main" -apt-get update -y - # Download script for automatic installation wget https://apt.llvm.org/llvm.sh chmod +x llvm.sh