Skip to content

Commit

Permalink
Merge pull request #335 from microsoft/main
Browse files Browse the repository at this point in the history
Release - new script
  • Loading branch information
dpaulson45 authored Mar 12, 2021
2 parents 6a700e7 + a8a5734 commit 9b7d274
Show file tree
Hide file tree
Showing 9 changed files with 30,553 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .build/Build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ New-Item -Path $distFolder -ItemType Directory | Out-Null
$scriptFiles = Get-ChildItem -Path $repoRoot -Directory |
Where-Object { $_.Name -ne ".build" } |
ForEach-Object { Get-ChildItem -Path $_.FullName *.ps1 -Recurse } |
Where-Object { ! $_.Name.Contains(".Tests.ps1") }
Where-Object { -not $_.Name.Contains(".Tests.ps1") -and
-not $_.Name.Contains(".NotPublished.ps1") }
Sort-Object Name |
ForEach-Object { $_.FullName }

Expand Down
6 changes: 6 additions & 0 deletions .github/ISSUE_TEMPLATE/issue-report.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ assignees: ''

---

<!--
If this is a MISSING BASELINE issue, please comment in #313 rather than opening a new issue.
-->

**Describe the issue**
A clear and concise description of what the issue is, including what script you are seeing the error in.

Expand Down
File renamed without changes.
65 changes: 65 additions & 0 deletions Setup/CopyMissingDlls.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
[CmdletBinding()]
param(
[Parameter(Mandatory = $true, ParameterSetName = "CopyMissingDllsFromIso")]
[ValidateNotNullOrEmpty()]
[string]$IsoRoot
)

$2013mappingsFileBytes = Get-Content ".\DllMappings\2013Mappings.json" -AsByteStream -Raw
$2013mappingsFileContent = [System.Text.Encoding]::UTF8.GetString($2013mappingsFileBytes)

$2016mappingsFileBytes = Get-Content ".\DllMappings\2016Mappings.json" -AsByteStream -Raw
$2016mappingsFileContent = [System.Text.Encoding]::UTF8.GetString($2016mappingsFileBytes)

$2019mappingsFileBytes = Get-Content ".\DllMappings\2019Mappings.json" -AsByteStream -Raw
$2019mappingsFileContent = [System.Text.Encoding]::UTF8.GetString($2019mappingsFileBytes)

#Get Version installed on server
$installPath = (Get-ItemProperty -Path Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ExchangeServer\v15\Setup -ErrorAction SilentlyContinue).MsiInstallPath
$installedVersion = (Get-ItemProperty -Path Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ExchangeServer\v15\AdminTools -ErrorAction SilentlyContinue).ConfiguredVersion
#get version of ISO, verify it is the same.
$isoItemRoot = Get-Item "$IsoRoot\Setup.exe"

if (($IsoItemRoot.VersionInfo.ProductMinorPart -ne 0 -and
$IsoItemRoot.VersionInfo.ProductBuildPart -eq 1497)) {

if ($isoItemRoot.VersionInfo.ProductVersionRaw.ToString() -ne $installedVersion) {
throw "failed to determine that we are on the same version of exchange as the ISO"
}
}

if ($isoItemRoot.VersionInfo.ProductMinorPart -eq 0) {
$dllFileMappings = $2013mappingsFileContent | ConvertFrom-Json
} elseif ($isoItemRoot.VersionInfo.ProductMinorPart -eq 1) {
$dllFileMappings = $2016mappingsFileContent | ConvertFrom-Json
} elseif ($isoItemRoot.VersionInfo.ProductMinorPart -eq 2) {
$dllFileMappings = $2019mappingsFileContent | ConvertFrom-Json
} else {
throw "Can't tell what version you are on"
}

Function Receive-Output {
process {
Write-Host $_
$_ | Out-File -FilePath $scriptLogging -Append
}
}

$scriptLogging = ".\Log_CopyingMissingDlls.log"
Out-File -FilePath $scriptLogging -Force
"Found $installedVersion on the server" | Receive-Output

foreach ($directoryMatchings in $dllFileMappings) {
$serverInstallPath = "$installPath$($directoryMatchings.InstallDirectory)"
$isoPath = "$IsoRoot\$($directoryMatchings.IsoDirectory)"

foreach ($file in $directoryMatchings.DllFileNames) {
$dest = "$serverInstallPath\$file"

if (!(Test-Path $dest)) {
$copyItem = "$isoPath\$file"
"Missing Item $dest. Copying it" | Receive-Output
Copy-Item $copyItem -Destination $dest
}
}
}
Loading

0 comments on commit 9b7d274

Please sign in to comment.