-
Notifications
You must be signed in to change notification settings - Fork 384
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
AU: 2 updated - win10mct windows10-media-creation-tool
- Loading branch information
Chocolatey
committed
Jan 11, 2018
1 parent
4894f04
commit b14c4ea
Showing
7 changed files
with
112 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
"7554daff3039d31:0"|10.0.16299.15 | ||
|10.0.16299.15 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 33 additions & 33 deletions
66
automatic/windows10-media-creation-tool/windows10-media-creation-tool.nuspec
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |