-
Notifications
You must be signed in to change notification settings - Fork 176
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #131 from Sophia-Community/Newtonsoft.Json
Update Get-BinaryFiles.ps1
- Loading branch information
Showing
6 changed files
with
122 additions
and
116 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
Binary file not shown.
Binary file not shown.
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
$ReleaseBinDir = "$(Split-Path -Path $PSScriptRoot -Parent)\SophiApp\bin\Release\Bin" | ||
New-Item -Path (Split-Path -Path $ReleaseBinDir -Parent) -Name Bin -ItemType Directory -Force | ||
|
||
# Copy downloaded dependencies to the created Bin folder | ||
Get-ChildItem -Path "SophiApp\Binary" | Copy -Destination $ReleaseBinDir -Force |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,92 @@ | ||
<# | ||
.SYNOPSIS | ||
Download binary for SophiApp build action | ||
.NOTES | ||
https://developer.microsoft.com/ru-ru/windows/downloads/sdk-archive/ | ||
https://www.nuget.org/packages/Microsoft.Dism | ||
https://github.com/dahall/TaskScheduler | ||
https://github.com/JamesNK/Newtonsoft.Json | ||
#> | ||
|
||
New-Item -Path SophiApp\Binary -ItemType Directory -Force | ||
|
||
# https://www.nuget.org/packages/Microsoft.Dism | ||
Write-Verbose -Message Microsoft.Dism -Verbose | ||
$Parameters = @{ | ||
Uri = "https://www.nuget.org/api/v2/package/Microsoft.Dism" | ||
OutFile = "$PSScriptRoot\microsoft.dism.zip" | ||
UseBasicParsing = $true | ||
} | ||
Invoke-RestMethod @Parameters | ||
|
||
# Extract Microsoft.Dism.dll from the archive | ||
Add-Type -Assembly System.IO.Compression.FileSystem | ||
$ZIP = [IO.Compression.ZipFile]::OpenRead("$PSScriptRoot\microsoft.dism.zip") | ||
$Entries = $ZIP.Entries | Where-Object -FilterScript {$_.FullName -eq "lib/net40/Microsoft.Dism.dll"} | ||
$Entries | ForEach-Object -Process {[IO.Compression.ZipFileExtensions]::ExtractToFile($_, "SophiApp\Binary\$($_.Name)", $true)} | ||
$ZIP.Dispose() | ||
|
||
# https://www.nuget.org/packages/WiX | ||
Write-Verbose -Message Microsoft.Deployment.WindowsInstaller -Verbose | ||
$Parameters = @{ | ||
Uri = "https://www.nuget.org/api/v2/package/WiX" | ||
OutFile = "$PSScriptRoot\wix.zip" | ||
UseBasicParsing = $true | ||
} | ||
Invoke-RestMethod @Parameters | ||
|
||
# Extract Microsoft.Deployment.WindowsInstaller.dll from the archive | ||
Add-Type -Assembly System.IO.Compression.FileSystem | ||
$ZIP = [IO.Compression.ZipFile]::OpenRead("$PSScriptRoot\wix.zip") | ||
$Entries = $ZIP.Entries | Where-Object -FilterScript {$_.FullName -eq "tools/Microsoft.Deployment.WindowsInstaller.dll"} | ||
$Entries | ForEach-Object -Process {[IO.Compression.ZipFileExtensions]::ExtractToFile($_, "SophiApp\Binary\$($_.Name)", $true)} | ||
$ZIP.Dispose() | ||
|
||
# https://www.nuget.org/packages/TaskScheduler | ||
Write-Verbose -Message TaskScheduler -Verbose | ||
$Parameters = @{ | ||
Uri = "https://www.nuget.org/api/v2/package/TaskScheduler" | ||
OutFile = "$PSScriptRoot\TaskScheduler.zip" | ||
UseBasicParsing = $true | ||
} | ||
Invoke-RestMethod @Parameters | ||
|
||
# Extract Microsoft.Win32.TaskScheduler.dll from the archive | ||
Add-Type -Assembly System.IO.Compression.FileSystem | ||
$ZIP = [IO.Compression.ZipFile]::OpenRead("$PSScriptRoot\TaskScheduler.zip") | ||
$Entries = $ZIP.Entries | Where-Object -FilterScript {$_.FullName -eq "lib/net452/Microsoft.Win32.TaskScheduler.dll"} | ||
$Entries | ForEach-Object -Process {[IO.Compression.ZipFileExtensions]::ExtractToFile($_, "SophiApp\Binary\$($_.Name)", $true)} | ||
$ZIP.Dispose() | ||
|
||
# https://www.nuget.org/packages/Newtonsoft.Json | ||
Write-Verbose -Message Newtonsoft.Json -Verbose | ||
$Parameters = @{ | ||
Uri = "https://www.nuget.org/api/v2/package/Newtonsoft.Json" | ||
OutFile = "$PSScriptRoot\newtonsoft.json.zip" | ||
UseBasicParsing = $true | ||
} | ||
Invoke-RestMethod @Parameters | ||
|
||
# Extract Newtonsoft.Json.dll from the archive | ||
Add-Type -Assembly System.IO.Compression.FileSystem | ||
$ZIP = [IO.Compression.ZipFile]::OpenRead("$PSScriptRoot\newtonsoft.json.zip") | ||
$Entries = $ZIP.Entries | Where-Object -FilterScript {$_.FullName -eq "lib/net45/Newtonsoft.Json.dll"} | ||
$Entries | ForEach-Object -Process {[IO.Compression.ZipFileExtensions]::ExtractToFile($_, "SophiApp\Binary\$($_.Name)", $true)} | ||
$ZIP.Dispose() | ||
|
||
# Coping Windows.winmd | ||
Write-Verbose -Message Windows.winmd -Verbose | ||
$Parameters = @{ | ||
Path = "${env:ProgramFiles(x86)}\Windows Kits\10\UnionMetadata\10.0.19041.0\Windows.winmd" | ||
Destination = "SophiApp\Binary" | ||
} | ||
Copy-Item @Parameters | ||
|
||
# Coping System.Management.Automation.dll | ||
Write-Verbose -Message System.Management.Automation.dll -Verbose | ||
$Parameters = @{ | ||
Path = "${env:ProgramFiles(x86)}\Reference Assemblies\Microsoft\WindowsPowerShell\3.0\System.Management.Automation.dll" | ||
Destination = "SophiApp\Binary" | ||
} | ||
Copy-Item @Parameters |