Skip to content

Commit

Permalink
AU: 2 updated - win10mct windows10-media-creation-tool
Browse files Browse the repository at this point in the history
  • Loading branch information
Chocolatey committed Jan 11, 2018
1 parent 4894f04 commit b14c4ea
Show file tree
Hide file tree
Showing 7 changed files with 112 additions and 111 deletions.
2 changes: 1 addition & 1 deletion automatic/win10mct/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# <img src="https://cdn.rawgit.com/chocolatey/chocolatey-coreteampackages/icons/win10mct.png" width="48" height="48"/> [win10mct](https://chocolatey.org/packages/win10mct)
# <img src="https://cdn.rawgit.com/chocolatey/chocolatey-coreteampackages/15cb498f3d11b3687c99e98d077031ad85a62c96/icons/win10mct.png" width="48" height="48"/> [win10mct](https://chocolatey.org/packages/win10mct)

This will allow you to Create Windows 10 installation media
To get started, you will first need to have a license to install Windows 10.
Expand Down
2 changes: 1 addition & 1 deletion automatic/win10mct/info
Original file line number Diff line number Diff line change
@@ -1 +1 @@
"7554daff3039d31:0"|10.0.16299.15
|10.0.16299.15
2 changes: 1 addition & 1 deletion automatic/win10mct/tools/chocolateyInstall.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ $toolsDir = Split-Path -Parent $MyInvocation.MyCommand.Definition
$packageArgs = @{
PackageName = $env:chocolateyinstall
FileFullPath = "$toolsDir\$exeName"
Url = ''
Url = 'https://download.microsoft.com/download/A/B/E/ABEE70FE-7DE8-472A-8893-5F69947DE0B1/MediaCreationTool.exe'
Checksum = ''
ChecksumType = ''
}
Expand Down
72 changes: 36 additions & 36 deletions automatic/win10mct/update.ps1
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
import-module au
Import-Module "$PSScriptRoot\..\..\scripts\au_extensions.psm1"
. "$PSScriptRoot\..\win10mct\update_helper.ps1"

function global:au_SearchReplace {
@{
".\tools\chocolateyInstall.ps1" = @{
"(?i)^(\s*url\s*=\s*)'.*'" = "`${1}'$($Latest.URL32)'"
"(?i)^(\s*checksum\s*=\s*)'.*'" = "`${1}'$($Latest.Checksum32)'"
"(?i)^(\s*checksumType\s*=\s*)'.*'" = "`${1}'$($Latest.ChecksumType32)'"
}
}
}

function global:au_AfterUpdate {
"$($Latest.ETAG)|$($Latest.Version)" | Out-File "$PSScriptRoot\info" -Encoding utf8
}

function global:au_GetLatest {
$url32 = Get-RedirectedUrl 'https://go.microsoft.com/fwlink/?LinkId=691209'
$etag = GetETagIfChanged $url32
if ($etag) {
$result = GetResultInformation $url32
$result["ETAG"] = $etag
}
else {
$result = @{
URL32 = $url32
Version = Get-Content "$PSScriptRoot\info" -Encoding UTF8 | select -First 1 | % { $_ -split '\|' } | select -Last 1
}
}

return $result
}

update -ChecksumFor none
import-module au
Import-Module "$PSScriptRoot\..\..\scripts\au_extensions.psm1"
. "$PSScriptRoot\..\win10mct\update_helper.ps1"

function global:au_SearchReplace {
@{
".\tools\chocolateyInstall.ps1" = @{
"(?i)^(\s*url\s*=\s*)'.*'" = "`${1}'$($Latest.URL32)'"
"(?i)^(\s*checksum\s*=\s*)'.*'" = "`${1}'$($Latest.Checksum32)'"
"(?i)^(\s*checksumType\s*=\s*)'.*'" = "`${1}'$($Latest.ChecksumType32)'"
}
}
}

function global:au_AfterUpdate {
"$($Latest.ETAG)|$($Latest.Version)" | Out-File "$PSScriptRoot\info" -Encoding utf8
}

function global:au_GetLatest {
$url32 = Get-RedirectedUrl 'https://go.microsoft.com/fwlink/?LinkId=691209'
$etag = GetETagIfChanged $url32
if ($etag) {
$result = GetResultInformation $url32
$result["ETAG"] = $etag
}
else {
$result = @{
URL32 = $url32
Version = Get-Content "$PSScriptRoot\info" -Encoding UTF8 | select -First 1 | % { $_ -split '\|' } | select -Last 1
}
}

return $result
}

update -ChecksumFor none
66 changes: 33 additions & 33 deletions automatic/win10mct/update_helper.ps1
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@

function GetETagIfChanged() {
param([string]$url)

if (($global:au_Force -ne $true) -and (Test-Path $PSScriptRoot\info)) {
$existingETag = Get-Content "$PSScriptRoot\info" -Encoding UTF8 | select -first 1 | % { $_ -split '\|' } | select -First 1
}
else {
$existingETag = $null
}

$etag = Invoke-WebRequest -Method Head -Uri $url -UseBasicParsing
$etag = $etag | % { $_.Headers.ETag }
if ($etag -eq $existingETag) { return $null }

return $etag
}

function GetResultInformation() {
param([string]$url32)

$dest = "$env:TEMP\w10mct.exe"
Invoke-WebRequest -UseBasicParsing -Uri $url32 -OutFile $dest
$version = Get-Item $dest | % { $_.VersionInfo.ProductVersion -replace '^(\d+(\.[\d]+){1,3}).*', '$1' }

$result = @{
URL32 = $url32
Version = $version
Checksum32 = Get-FileHash $dest -Algorithm SHA512 | % Hash
ChecksumType32 = 'sha512'
}
Remove-Item -Force $dest
return $result

function GetETagIfChanged() {
param([string]$url)

if (($global:au_Force -ne $true) -and (Test-Path $PSScriptRoot\info)) {
$existingETag = Get-Content "$PSScriptRoot\info" -Encoding UTF8 | select -first 1 | % { $_ -split '\|' } | select -First 1
}
else {
$existingETag = $null
}

$etag = Invoke-WebRequest -Method Head -Uri $url -UseBasicParsing
$etag = $etag | % { $_.Headers.ETag }
if ($etag -eq $existingETag) { return $null }

return $etag
}

function GetResultInformation() {
param([string]$url32)

$dest = "$env:TEMP\w10mct.exe"
Invoke-WebRequest -UseBasicParsing -Uri $url32 -OutFile $dest
$version = Get-Item $dest | % { $_.VersionInfo.ProductVersion -replace '^(\d+(\.[\d]+){1,3}).*', '$1' }

$result = @{
URL32 = $url32
Version = $version
Checksum32 = Get-FileHash $dest -Algorithm SHA512 | % Hash
ChecksumType32 = 'sha512'
}
Remove-Item -Force $dest
return $result
}
13 changes: 7 additions & 6 deletions automatic/win10mct/win10mct.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,26 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>win10mct</id>
<version>0.0</version>
<version>10.0.16299.15</version>
<title>Windows 10 Media Creation Tool</title>
<authors>Microsoft</authors>
<owners>DarwinJS, chocolatey</owners>
<projectUrl>https://www.microsoft.com/en-us/software-download/windows10</projectUrl>
<iconUrl>https://cdn.rawgit.com/chocolatey/chocolatey-coreteampackages/icons/windows10-media-creation-tool.png</iconUrl>
<iconUrl>https://cdn.rawgit.com/chocolatey/chocolatey-coreteampackages/15cb498f3d11b3687c99e98d077031ad85a62c96/icons/win10mct.png</iconUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>This will allow you to Create Windows 10 installation media
<description><![CDATA[This will allow you to Create Windows 10 installation media
To get started, you will first need to have a license to install Windows 10.
You can then download and run the media creation tool. For more information on how to use the tool, see the instructions below.
##Features
## Features
- Using the tool to upgrade this PC to Windows 10 (click to show more or less information)
- Using the tool to create installation media (USB flash drive, DVD, or ISO file) to install Windows 10 on a different PC
- Using the media creation tool to re-install Windows 10 Pro for Workstations
- More download options or information can be found at https://www.microsoft.com/en-us/software-download/windows10
##Notes
- Does not support Windows 10 Enterprise.</description>
## Notes
- Does not support Windows 10 Enterprise.
]]></description>
<summary>Create a bootable ISO or Flashdrive to apply the free Windows 10 upgrade with a clean install (from scratch install).</summary>
<copyright>Microsoft</copyright>
<tags>portable windows10 media-creation-tool freeware</tags>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
<?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>win10mct</id>
<version>0.0</version>
<title>Windows 10 Media Creation Tool</title>
<authors>Microsoft</authors>
<owners>DarwinJS, chocolatey</owners>
<projectUrl>https://www.microsoft.com/en-us/software-download/windows10</projectUrl>
<iconUrl>https://cdn.rawgit.com/chocolatey/chocolatey-coreteampackages/tree/master/icons/win10mct.png</iconUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description><![CDATA[This will allow you to Create Windows 10 installation media
To get started, you will first need to have a license to install Windows 10.
You can then download and run the media creation tool. For more information on how to use the tool, see the instructions below.
## Features
- Using the tool to upgrade this PC to Windows 10 (click to show more or less information)
- Using the tool to create installation media (USB flash drive, DVD, or ISO file) to install Windows 10 on a different PC
- Using the media creation tool to re-install Windows 10 Pro for Workstations
- More download options or information can be found at https://www.microsoft.com/en-us/software-download/windows10
## Notes
- Does not support Windows 10 Enterprise.
]]></description>
<summary>Create a bootable ISO or Flashdrive to apply the free Windows 10 upgrade with a clean install (from scratch install).</summary>
<copyright>Microsoft</copyright>
<tags>portable windows10 media-creation-tool freeware</tags>
<packageSourceUrl>https://github.com/chocolatey/chocolatey-coreteampackages/tree/master/automatic/win10mct</packageSourceUrl>
<dependencies>
<dependency id="win10mct" version="0.0" />
</dependencies>
</metadata>
</package>
<?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>windows10-media-creation-tool</id>
<version>10.0.16299.15</version>
<title>Windows 10 Media Creation Tool</title>
<authors>Microsoft</authors>
<owners>DarwinJS, chocolatey</owners>
<projectUrl>https://www.microsoft.com/en-us/software-download/windows10</projectUrl>
<iconUrl>https://cdn.rawgit.com/chocolatey/chocolatey-coreteampackages/15cb498f3d11b3687c99e98d077031ad85a62c96/icons/win10mct.png</iconUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description><![CDATA[This will allow you to Create Windows 10 installation media
To get started, you will first need to have a license to install Windows 10.
You can then download and run the media creation tool. For more information on how to use the tool, see the instructions below.
## Features
- Using the tool to upgrade this PC to Windows 10 (click to show more or less information)
- Using the tool to create installation media (USB flash drive, DVD, or ISO file) to install Windows 10 on a different PC
- Using the media creation tool to re-install Windows 10 Pro for Workstations
- More download options or information can be found at https://www.microsoft.com/en-us/software-download/windows10
## Notes
- Does not support Windows 10 Enterprise.
]]></description>
<summary>Create a bootable ISO or Flashdrive to apply the free Windows 10 upgrade with a clean install (from scratch install).</summary>
<copyright>Microsoft</copyright>
<tags>portable windows10 media-creation-tool freeware</tags>
<packageSourceUrl>https://github.com/chocolatey/chocolatey-coreteampackages/tree/master/automatic/win10mct</packageSourceUrl>
<dependencies>
<dependency id="win10mct" version="10.0.16299.15" />
</dependencies>
</metadata>
</package>

0 comments on commit b14c4ea

Please sign in to comment.