mirror of
https://github.com/mRemoteNG/mRemoteNG.git
synced 2026-02-17 14:07:46 +08:00
appveyor build automation
bulk of the changes for appveyor automation
This commit is contained in:
@@ -97,69 +97,72 @@ function Resolve-UpdateCheckFileName {
|
|||||||
Write-Output $fileName
|
Write-Output $fileName
|
||||||
}
|
}
|
||||||
|
|
||||||
Write-Output "===== Begin create_upg_chk_files.ps1 ====="
|
Write-Output ""
|
||||||
|
Write-Output "===== Begin $($PSCmdlet.MyInvocation.MyCommand) ====="
|
||||||
|
|
||||||
# determine update channel
|
# determine update channel
|
||||||
if ($env:APPVEYOR_PROJECT_NAME -match "(Nightly)") {
|
if ($env:APPVEYOR_PROJECT_NAME -match "(Nightly)") {
|
||||||
write-host "UpdateChannel = Nightly"
|
Write-Output "UpdateChannel = Nightly"
|
||||||
$UpdateChannel = "Nightly"
|
$UpdateChannel = "Nightly"
|
||||||
$ModifiedTagName = "$PreTagName-$TagName-NB"
|
$ModifiedTagName = "$PreTagName-$TagName-NB"
|
||||||
} elseif ($env:APPVEYOR_PROJECT_NAME -match "(Preview)") {
|
} elseif ($env:APPVEYOR_PROJECT_NAME -match "(Preview)") {
|
||||||
write-host "UpdateChannel = Preview"
|
Write-Output "UpdateChannel = Preview"
|
||||||
$UpdateChannel = "Preview"
|
$UpdateChannel = "Preview"
|
||||||
$ModifiedTagName = "v$TagName-PB"
|
$ModifiedTagName = "v$TagName-PB"
|
||||||
} elseif ($env:APPVEYOR_PROJECT_NAME -match "(Stable)") {
|
} elseif ($env:APPVEYOR_PROJECT_NAME -match "(Stable)") {
|
||||||
write-host "UpdateChannel = Stable"
|
Write-Output "UpdateChannel = Stable"
|
||||||
$UpdateChannel = "Stable"
|
$UpdateChannel = "Stable"
|
||||||
$ModifiedTagName = "v" + $TagName.Split("-")[0]
|
$ModifiedTagName = "v" + $TagName.Split("-")[0]
|
||||||
} else {
|
} else {
|
||||||
$UpdateChannel = ""
|
$UpdateChannel = ""
|
||||||
}
|
}
|
||||||
|
|
||||||
$buildFolder = Join-Path -Path $PSScriptRoot -ChildPath "..\mRemoteNG\bin\x64\Release" -Resolve -ErrorAction Ignore
|
#$buildFolder = Join-Path -Path $PSScriptRoot -ChildPath "..\mRemoteNG\bin\x64\Release" -Resolve -ErrorAction Ignore
|
||||||
|
$ReleaseFolder = Join-Path -Path $PSScriptRoot -ChildPath "..\Release" -Resolve
|
||||||
|
|
||||||
if ($UpdateChannel -ne "" -and $buildFolder -ne "" -and $WebsiteTargetOwner -ne "" -and $WebsiteTargetRepository -ne "" ) {
|
if ($UpdateChannel -ne "" -and $ReleaseFolder -ne "" -and $WebsiteTargetOwner -and $WebsiteTargetRepository) {
|
||||||
|
|
||||||
$releaseFolder = Join-Path -Path $PSScriptRoot -ChildPath "..\Release" -Resolve
|
$msiFile = Get-ChildItem -Path "$ReleaseFolder\*.msi" -Exclude "*-symbols-*.zip" | Sort-Object LastWriteTime | Select-Object -last 1
|
||||||
$msiFile = Get-ChildItem -Path "$buildFolder\*.msi" | Sort-Object LastWriteTime | Select-Object -last 1
|
|
||||||
if (![string]::IsNullOrEmpty($msiFile)) {
|
if (![string]::IsNullOrEmpty($msiFile)) {
|
||||||
$msiUpdateContents = New-MsiUpdateFileContent -MsiFile $msiFile -TagName $ModifiedTagName
|
$msiUpdateContents = New-MsiUpdateFileContent -MsiFile $msiFile -TagName $ModifiedTagName
|
||||||
$msiUpdateFileName = Resolve-UpdateCheckFileName -UpdateChannel $UpdateChannel -Type Normal
|
$msiUpdateFileName = Resolve-UpdateCheckFileName -UpdateChannel $UpdateChannel -Type Normal
|
||||||
Write-Output "`n`nMSI Update Check File Contents ($msiUpdateFileName)`n------------------------------"
|
Write-Output "`n`nMSI Update Check File Contents ($msiUpdateFileName)`n------------------------------"
|
||||||
Tee-Object -InputObject $msiUpdateContents -FilePath "$releaseFolder\$msiUpdateFileName"
|
Tee-Object -InputObject $msiUpdateContents -FilePath "$ReleaseFolder\$msiUpdateFileName"
|
||||||
write-host "msiUpdateFileName $releaseFolder\$msiUpdateFileName"
|
|
||||||
|
|
||||||
# commit msi update txt file
|
# commit msi update txt file
|
||||||
if ($env:WEBSITE_UPDATE_ENABLED.ToLower() -eq "true") {
|
if ($env:WEBSITE_UPDATE_ENABLED.ToLower() -eq "true") {
|
||||||
if ((Test-Path -Path "$releaseFolder\$msiUpdateFileName") -and (-not [string]::IsNullOrEmpty($WebsiteTargetRepository))) {
|
if ((Test-Path -Path "$ReleaseFolder\$msiUpdateFileName") -and (-not [string]::IsNullOrEmpty($WebsiteTargetRepository))) {
|
||||||
Write-Output "Publish $msiUpdateFileName to $WebsiteTargetRepository"
|
Write-Output "Publish Update File $msiUpdateFileName to $WebsiteTargetRepository"
|
||||||
$update_file_content_string = Get-Content "$releaseFolder\$msiUpdateFileName" | Out-String
|
$update_file_content_string = Get-Content "$ReleaseFolder\$msiUpdateFileName" | Out-String
|
||||||
Set-GitHubContent -OwnerName $WebsiteTargetOwner -RepositoryName $WebsiteTargetRepository -Path $msiUpdateFileName -CommitMessage "Build $ModifiedTagName" -Content $update_file_content_string -BranchName main
|
Set-GitHubContent -OwnerName $WebsiteTargetOwner -RepositoryName $WebsiteTargetRepository -Path $msiUpdateFileName -CommitMessage "Build $ModifiedTagName" -Content $update_file_content_string -BranchName main
|
||||||
|
} else {
|
||||||
|
Write-Warning "WARNING: Update file does not exist: $ReleaseFolder\$msiUpdateFileName"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# build zip update file
|
# build zip update file
|
||||||
$releaseFolder = Join-Path -Path $PSScriptRoot -ChildPath "..\Release" -Resolve
|
$zipFile = Get-ChildItem -Path "$ReleaseFolder\*.zip" -Exclude "*-symbols-*.zip" | Sort-Object LastWriteTime | Select-Object -last 1
|
||||||
$zipFile = Get-ChildItem -Path "$releaseFolder\*.zip" -Exclude "*-symbols-*.zip" | Sort-Object LastWriteTime | Select-Object -last 1
|
|
||||||
if (![string]::IsNullOrEmpty($zipFile)) {
|
if (![string]::IsNullOrEmpty($zipFile)) {
|
||||||
$zipUpdateContents = New-ZipUpdateFileContent -ZipFile $zipFile -TagName $ModifiedTagName
|
$zipUpdateContents = New-ZipUpdateFileContent -ZipFile $zipFile -TagName $ModifiedTagName
|
||||||
$zipUpdateFileName = Resolve-UpdateCheckFileName -UpdateChannel $UpdateChannel -Type Portable
|
$zipUpdateFileName = Resolve-UpdateCheckFileName -UpdateChannel $UpdateChannel -Type Portable
|
||||||
Write-Output "`n`nZip Update Check File Contents ($zipUpdateFileName)`n------------------------------"
|
Write-Output "`n`nZip Update Check File Contents ($zipUpdateFileName)`n------------------------------"
|
||||||
Tee-Object -InputObject $zipUpdateContents -FilePath "$releaseFolder\$zipUpdateFileName"
|
Tee-Object -InputObject $zipUpdateContents -FilePath "$ReleaseFolder\$zipUpdateFileName"
|
||||||
write-host "zipUpdateFileName $releaseFolder\$zipUpdateFileName"
|
|
||||||
|
|
||||||
# commit zip update txt file
|
# commit zip update txt file
|
||||||
if ($env:WEBSITE_UPDATE_ENABLED.ToLower() -eq "true") {
|
if ($env:WEBSITE_UPDATE_ENABLED.ToLower() -eq "true") {
|
||||||
if ((Test-Path -Path "$releaseFolder\$zipUpdateFileName") -and (-not [string]::IsNullOrEmpty($WebsiteTargetRepository))) {
|
if ((Test-Path -Path "$ReleaseFolder\$zipUpdateFileName") -and (-not [string]::IsNullOrEmpty($WebsiteTargetRepository))) {
|
||||||
Write-Output "Publish $zipUpdateFileName to $WebsiteTargetRepository"
|
Write-Output "Publish Update File $zipUpdateFileName to $WebsiteTargetRepository"
|
||||||
$update_file_content_string = Get-Content "$releaseFolder\$zipUpdateFileName" | Out-String
|
$update_file_content_string = Get-Content "$ReleaseFolder\$zipUpdateFileName" | Out-String
|
||||||
Set-GitHubContent -OwnerName $WebsiteTargetOwner -RepositoryName $WebsiteTargetRepository -Path $zipUpdateFileName -CommitMessage "Build $ModifiedTagName" -Content $update_file_content_string -BranchName main
|
Set-GitHubContent -OwnerName $WebsiteTargetOwner -RepositoryName $WebsiteTargetRepository -Path $zipUpdateFileName -CommitMessage "Build $ModifiedTagName" -Content $update_file_content_string -BranchName main
|
||||||
|
} else {
|
||||||
|
Write-Warning "WARNING: Update file does not exist: $ReleaseFolder\$zipUpdateFileName"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
write-host "BuildFolder not found"
|
Write-Output "ReleaseFolder not found"
|
||||||
}
|
}
|
||||||
|
|
||||||
Write-Output "End create_upg_chk_files.ps1"
|
Write-Output "End $($PSCmdlet.MyInvocation.MyCommand)"
|
||||||
|
Write-Output ""
|
||||||
|
|||||||
@@ -23,10 +23,9 @@ function EditBinCertificateIsValid() {
|
|||||||
"97221B97098F37A135DCC212E2B41E452BCE51F2"
|
"97221B97098F37A135DCC212E2B41E452BCE51F2"
|
||||||
)
|
)
|
||||||
$file_signature = Get-AuthenticodeSignature -FilePath $Path
|
$file_signature = Get-AuthenticodeSignature -FilePath $Path
|
||||||
write-host "Path: $Path"
|
|
||||||
Write-Host "file_signature.SignerCertificate.Thumbprint: $($file_signature.SignerCertificate.Thumbprint)"
|
|
||||||
if (($file_signature.Status -ne "Valid") -or ($valid_microsoft_cert_thumbprints -notcontains $file_signature.SignerCertificate.Thumbprint)) {
|
if (($file_signature.Status -ne "Valid") -or ($valid_microsoft_cert_thumbprints -notcontains $file_signature.SignerCertificate.Thumbprint)) {
|
||||||
Write-Warning "Could not validate the signature of $Path"
|
Write-Warning "Could not validate the signature of $Path"
|
||||||
|
Write-Output "file_signature.SignerCertificate.Thumbprint: $($file_signature.SignerCertificate.Thumbprint)"
|
||||||
return $false
|
return $false
|
||||||
} else {
|
} else {
|
||||||
return $true
|
return $true
|
||||||
|
|||||||
@@ -2,9 +2,10 @@ $githubUrl = 'https://api.github.com'
|
|||||||
# GitHub doesn't support the default powershell protocol (TLS 1.0)
|
# GitHub doesn't support the default powershell protocol (TLS 1.0)
|
||||||
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
|
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
|
||||||
|
|
||||||
#$ConfigurationName = $ConfigurationName.Trim()
|
$IsAppVeyor = !([string]::IsNullOrEmpty($Env:APPVEYOR_BUILD_FOLDER))
|
||||||
if (![string]::IsNullOrEmpty($env:APPVEYOR_REPO_NAME)) {
|
|
||||||
$CURRENT_GITHUB_USER = $env:APPVEYOR_REPO_NAME.Split("/")[0]
|
if ($IsAppVeyor) {
|
||||||
|
#$CURRENT_GITHUB_USER = $env:APPVEYOR_REPO_NAME.Split("/")[0]
|
||||||
Install-Module -Name PowerShellForGitHub -Scope CurrentUser
|
Install-Module -Name PowerShellForGitHub -Scope CurrentUser
|
||||||
Set-GitHubConfiguration -DisableTelemetry
|
Set-GitHubConfiguration -DisableTelemetry
|
||||||
$PSDefaultParameterValues["*-GitHub*:AccessToken"] = "$env:ACCESS_TOKEN"
|
$PSDefaultParameterValues["*-GitHub*:AccessToken"] = "$env:ACCESS_TOKEN"
|
||||||
@@ -248,4 +249,4 @@ function New-GitHubReleaseRequestBody {
|
|||||||
|
|
||||||
$json_body = ConvertTo-Json -InputObject $body_params -Compress
|
$json_body = ConvertTo-Json -InputObject $body_params -Compress
|
||||||
Write-Output $json_body
|
Write-Output $json_body
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ param (
|
|||||||
|
|
||||||
. "$PSScriptRoot\github_functions.ps1"
|
. "$PSScriptRoot\github_functions.ps1"
|
||||||
|
|
||||||
|
Write-Output ""
|
||||||
Write-Output "+===========================================================================================+"
|
Write-Output "+===========================================================================================+"
|
||||||
Write-Output "| Beginning mRemoteNG Installer Post Build |"
|
Write-Output "| Beginning mRemoteNG Installer Post Build |"
|
||||||
Write-Output "+===========================================================================================+"
|
Write-Output "+===========================================================================================+"
|
||||||
@@ -46,11 +47,12 @@ Format-Table -AutoSize -Wrap -InputObject @{
|
|||||||
|
|
||||||
& "$PSScriptRoot\rename_and_copy_installer.ps1" -SolutionDir $SolutionDir -BuildConfiguration $ConfigurationName.Trim()
|
& "$PSScriptRoot\rename_and_copy_installer.ps1" -SolutionDir $SolutionDir -BuildConfiguration $ConfigurationName.Trim()
|
||||||
|
|
||||||
if ( ![string]::IsNullOrEmpty($env:MAIN_REPOSITORY) -and ![string]::IsNullOrEmpty($env:WEBSITE_TARGET_OWNER) -and ![string]::IsNullOrEmpty($env:WEBSITE_TARGET_REPOSITORY) ) {
|
if ( ![string]::IsNullOrEmpty($env:WEBSITE_TARGET_OWNER) -and ![string]::IsNullOrEmpty($env:WEBSITE_TARGET_REPOSITORY) ) {
|
||||||
|
|
||||||
& "$PSScriptRoot\create_upg_chk_files.ps1" -WebsiteTargetOwner $env:WEBSITE_TARGET_OWNER -WebsiteTargetRepository $env:WEBSITE_TARGET_REPOSITORY -PreTagName $env:NightlyBuildTagName -TagName $env:APPVEYOR_BUILD_VERSION -ProjectName $env:APPVEYOR_PROJECT_NAME
|
& "$PSScriptRoot\create_upg_chk_files.ps1" -WebsiteTargetOwner $env:WEBSITE_TARGET_OWNER -WebsiteTargetRepository $env:WEBSITE_TARGET_REPOSITORY -PreTagName $env:NightlyBuildTagName -TagName $env:APPVEYOR_BUILD_VERSION -ProjectName $env:APPVEYOR_PROJECT_NAME
|
||||||
|
|
||||||
& "$PSScriptRoot\update_and_upload_website_release_json_file.ps1" -MainRepository $env:MAIN_REPOSITORY -WebsiteTargetOwner $env:WEBSITE_TARGET_OWNER -WebsiteTargetRepository $env:WEBSITE_TARGET_REPOSITORY -PreTagName $env:NightlyBuildTagName -TagName $env:APPVEYOR_BUILD_VERSION -ProjectName $env:APPVEYOR_PROJECT_NAME
|
& "$PSScriptRoot\update_and_upload_website_release_json_file.ps1" -WebsiteTargetOwner $env:WEBSITE_TARGET_OWNER -WebsiteTargetRepository $env:WEBSITE_TARGET_REPOSITORY -PreTagName $env:NightlyBuildTagName -TagName $env:APPVEYOR_BUILD_VERSION -ProjectName $env:APPVEYOR_PROJECT_NAME
|
||||||
}
|
}
|
||||||
|
|
||||||
Write-Output "End mRemoteNG Installer Post Build"
|
Write-Output "End mRemoteNG Installer Post Build"
|
||||||
|
Write-Output ""
|
||||||
|
|||||||
@@ -27,8 +27,9 @@ param (
|
|||||||
|
|
||||||
. "$PSScriptRoot\github_functions.ps1"
|
. "$PSScriptRoot\github_functions.ps1"
|
||||||
|
|
||||||
|
Write-Output ""
|
||||||
Write-Output "+===========================================================================================+"
|
Write-Output "+===========================================================================================+"
|
||||||
Write-Output "| Beginning mRemoteNG Post Build |"
|
Write-Output "| Beginning mRemoteNG Portable Post Build |"
|
||||||
Write-Output "+===========================================================================================+"
|
Write-Output "+===========================================================================================+"
|
||||||
Format-Table -AutoSize -Wrap -InputObject @{
|
Format-Table -AutoSize -Wrap -InputObject @{
|
||||||
"SolutionDir" = $SolutionDir
|
"SolutionDir" = $SolutionDir
|
||||||
@@ -57,7 +58,7 @@ Format-Table -AutoSize -Wrap -InputObject @{
|
|||||||
|
|
||||||
# Currently targeting x64, shouldn't need to manually set LargeAddressAware...
|
# Currently targeting x64, shouldn't need to manually set LargeAddressAware...
|
||||||
#& "$PSScriptRoot\set_LargeAddressAware.ps1" -TargetDir $TargetDir -TargetFileName $TargetFileName
|
#& "$PSScriptRoot\set_LargeAddressAware.ps1" -TargetDir $TargetDir -TargetFileName $TargetFileName
|
||||||
& "$PSScriptRoot\verify_LargeAddressAware.ps1" -TargetDir $TargetDir -TargetFileName $TargetFileName
|
#& "$PSScriptRoot\verify_LargeAddressAware.ps1" -TargetDir $TargetDir -TargetFileName $TargetFileName
|
||||||
|
|
||||||
& "$PSScriptRoot\tidy_files_for_release.ps1" -TargetDir $TargetDir -ConfigurationName $ConfigurationName
|
& "$PSScriptRoot\tidy_files_for_release.ps1" -TargetDir $TargetDir -ConfigurationName $ConfigurationName
|
||||||
|
|
||||||
@@ -67,12 +68,13 @@ Format-Table -AutoSize -Wrap -InputObject @{
|
|||||||
|
|
||||||
& "$PSScriptRoot\zip_files.ps1" -SolutionDir $SolutionDir -TargetDir $TargetDir -ConfigurationName $ConfigurationName
|
& "$PSScriptRoot\zip_files.ps1" -SolutionDir $SolutionDir -TargetDir $TargetDir -ConfigurationName $ConfigurationName
|
||||||
|
|
||||||
if ( ![string]::IsNullOrEmpty($env:MAIN_REPOSITORY) -and ![string]::IsNullOrEmpty($env:WEBSITE_TARGET_OWNER) -and ![string]::IsNullOrEmpty($env:WEBSITE_TARGET_REPOSITORY) ) {
|
if ( ![string]::IsNullOrEmpty($env:WEBSITE_TARGET_OWNER) -and ![string]::IsNullOrEmpty($env:WEBSITE_TARGET_REPOSITORY) ) {
|
||||||
|
|
||||||
& "$PSScriptRoot\create_upg_chk_files.ps1" -WebsiteTargetOwner $env:WEBSITE_TARGET_OWNER -WebsiteTargetRepository $env:WEBSITE_TARGET_REPOSITORY -PreTagName $env:NightlyBuildTagName -TagName $env:APPVEYOR_BUILD_VERSION -ProjectName $env:APPVEYOR_PROJECT_NAME
|
& "$PSScriptRoot\create_upg_chk_files.ps1" -WebsiteTargetOwner $env:WEBSITE_TARGET_OWNER -WebsiteTargetRepository $env:WEBSITE_TARGET_REPOSITORY -PreTagName $env:NightlyBuildTagName -TagName $env:APPVEYOR_BUILD_VERSION -ProjectName $env:APPVEYOR_PROJECT_NAME
|
||||||
|
|
||||||
& "$PSScriptRoot\update_and_upload_website_release_json_file.ps1" -MainRepository $env:MAIN_REPOSITORY -WebsiteTargetOwner $env:WEBSITE_TARGET_OWNER -WebsiteTargetRepository $env:WEBSITE_TARGET_REPOSITORY -PreTagName $env:NightlyBuildTagName -TagName $env:APPVEYOR_BUILD_VERSION -ProjectName $env:APPVEYOR_PROJECT_NAME
|
& "$PSScriptRoot\update_and_upload_website_release_json_file.ps1" -WebsiteTargetOwner $env:WEBSITE_TARGET_OWNER -WebsiteTargetRepository $env:WEBSITE_TARGET_REPOSITORY -PreTagName $env:NightlyBuildTagName -TagName $env:APPVEYOR_BUILD_VERSION -ProjectName $env:APPVEYOR_PROJECT_NAME
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Write-Output "End mRemoteNG Post Build"
|
Write-Output "End mRemoteNG Portable Post Build"
|
||||||
|
Write-Output ""
|
||||||
@@ -5,6 +5,7 @@
|
|||||||
$BuildConfiguration
|
$BuildConfiguration
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Write-Output ""
|
||||||
Write-Output "===== Begin rename_and_copy_installer.ps1 ====="
|
Write-Output "===== Begin rename_and_copy_installer.ps1 ====="
|
||||||
|
|
||||||
$targetVersionedFile = "$SolutionDir\mRemoteNG\bin\x64\$BuildConfiguration\mRemoteNG.exe"
|
$targetVersionedFile = "$SolutionDir\mRemoteNG\bin\x64\$BuildConfiguration\mRemoteNG.exe"
|
||||||
@@ -15,19 +16,24 @@ $msiversion = $fileversion
|
|||||||
|
|
||||||
# determine update channel
|
# determine update channel
|
||||||
if ($env:APPVEYOR_PROJECT_NAME -match "(Nightly)") {
|
if ($env:APPVEYOR_PROJECT_NAME -match "(Nightly)") {
|
||||||
write-host "UpdateChannel = Nightly"
|
Write-Output "UpdateChannel = Nightly"
|
||||||
$msiversion = "$msiversion-NB"
|
$msiversion = "$msiversion-NB"
|
||||||
} elseif ($env:APPVEYOR_PROJECT_NAME -match "(Preview)") {
|
} elseif ($env:APPVEYOR_PROJECT_NAME -match "(Preview)") {
|
||||||
write-host "UpdateChannel = Preview"
|
Write-Output "UpdateChannel = Preview"
|
||||||
$msiversion = "$msiversion-PB"
|
$msiversion = "$msiversion-PB"
|
||||||
} elseif ($env:APPVEYOR_PROJECT_NAME -match "(Stable)") {
|
} elseif ($env:APPVEYOR_PROJECT_NAME -match "(Stable)") {
|
||||||
write-host "UpdateChannel = Stable"
|
Write-Output "UpdateChannel = Stable"
|
||||||
} else {
|
} else {
|
||||||
}
|
}
|
||||||
|
|
||||||
$srcMsi = $SolutionDir + "mRemoteNGInstaller\Installer\bin\x64\$BuildConfiguration\en-US\mRemoteNG-Installer*.msi"
|
$srcMsi = $SolutionDir + "mRemoteNGInstaller\Installer\bin\x64\$BuildConfiguration\en-US\mRemoteNG-Installer*.msi"
|
||||||
$dstMsi = $SolutionDir + "mRemoteNG\bin\x64\$BuildConfiguration\mRemoteNG-Installer-" + $msiversion + ".msi"
|
$dstMsi = $SolutionDir + "Release\mRemoteNG-Installer-" + $msiversion + ".msi"
|
||||||
|
$srcSymbols = $SolutionDir + "mRemoteNGInstaller\Installer\bin\x64\$BuildConfiguration\en-US\mRemoteNG-Installer-Symbols*.zip"
|
||||||
|
$dstSymbols = $SolutionDir + "Release\mRemoteNG-Installer-Symbols-" + $msiversion + ".zip"
|
||||||
|
|
||||||
# Copy file
|
# Copy files
|
||||||
Copy-Item $srcMsi -Destination $dstMsi -Force
|
Copy-Item $srcMsi -Destination $dstMsi -Force
|
||||||
|
Copy-Item $srcSymbols -Destination $dstSymbols -Force
|
||||||
|
|
||||||
|
Write-Output "End rename_and_copy_installer.ps1"
|
||||||
|
Write-Output ""
|
||||||
|
|||||||
@@ -24,16 +24,17 @@ param (
|
|||||||
$SolutionDir
|
$SolutionDir
|
||||||
)
|
)
|
||||||
|
|
||||||
Write-Output "===== Beginning $($PSCmdlet.MyInvocation.MyCommand) ====="
|
Write-Output ""
|
||||||
|
Write-Output "===== Begin $($PSCmdlet.MyInvocation.MyCommand) ====="
|
||||||
|
|
||||||
$timeserver = "http://timestamp.verisign.com/scripts/timstamp.dll"
|
$timeserver = "http://timestamp.verisign.com/scripts/timstamp.dll"
|
||||||
|
|
||||||
|
$IsAppVeyor = !([string]::IsNullOrEmpty($Env:APPVEYOR_BUILD_FOLDER))
|
||||||
|
|
||||||
# validate release versions and if the certificate value was passed
|
# validate release versions and if the certificate value was passed
|
||||||
if ($ConfigurationName -match "Release" -And ($CertificatePath)) {
|
if ($ConfigurationName -match "Release" -And ($CertificatePath)) {
|
||||||
|
|
||||||
if(-Not ([string]::IsNullOrEmpty($Env:APPVEYOR_BUILD_FOLDER)) ) {
|
if($IsAppVeyor) {
|
||||||
$CertificatePath = Join-Path -Path $SolutionDir -ChildPath $CertificatePath
|
$CertificatePath = Join-Path -Path $SolutionDir -ChildPath $CertificatePath
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -77,7 +78,7 @@ if ($ConfigurationName -match "Release" -And ($CertificatePath)) {
|
|||||||
|
|
||||||
|
|
||||||
# Release certificate
|
# Release certificate
|
||||||
if ($cert -ne $null) {
|
if ($null -ne $cert) {
|
||||||
$cert.Dispose()
|
$cert.Dispose()
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -85,4 +86,4 @@ if ($ConfigurationName -match "Release" -And ($CertificatePath)) {
|
|||||||
Write-Output "Config: $($ConfigurationName)`tCertPath: $($CertificatePath)"
|
Write-Output "Config: $($ConfigurationName)`tCertPath: $($CertificatePath)"
|
||||||
}
|
}
|
||||||
|
|
||||||
Write-Output ""
|
Write-Output ""
|
||||||
|
|||||||
@@ -28,4 +28,6 @@ Write-Output "Signable files count: $($signableFiles.Count)"
|
|||||||
|
|
||||||
foreach ($file in $signableFiles) {
|
foreach ($file in $signableFiles) {
|
||||||
Set-AuthenticodeSignature -Certificate $cert -TimestampServer $timeserver -IncludeChain all -FilePath $file.FullName
|
Set-AuthenticodeSignature -Certificate $cert -TimestampServer $timeserver -IncludeChain all -FilePath $file.FullName
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Write-Output ""
|
||||||
|
|||||||
@@ -7,12 +7,12 @@ param (
|
|||||||
[Parameter(Mandatory=$true)]
|
[Parameter(Mandatory=$true)]
|
||||||
$ConfigurationName
|
$ConfigurationName
|
||||||
)
|
)
|
||||||
|
|
||||||
Write-Output ""
|
Write-Output ""
|
||||||
Write-Output "===== Beginning $($PSCmdlet.MyInvocation.MyCommand) ====="
|
Write-Output "===== Begin $($PSCmdlet.MyInvocation.MyCommand) ====="
|
||||||
|
|
||||||
# Remove unnecessary files from Release versions
|
# Remove unnecessary files from Release versions
|
||||||
if ($ConfigurationName -match "Release")
|
if ($ConfigurationName -match "Release") {
|
||||||
{
|
|
||||||
$test = Join-Path -Path $TargetDir -ChildPath "app.publish"
|
$test = Join-Path -Path $TargetDir -ChildPath "app.publish"
|
||||||
if (Test-Path $test -PathType Container)
|
if (Test-Path $test -PathType Container)
|
||||||
{
|
{
|
||||||
@@ -29,19 +29,18 @@ if ($ConfigurationName -match "Release")
|
|||||||
) -Exclude @(
|
) -Exclude @(
|
||||||
"mRemoteNG.VisualElementsManifest.xml"
|
"mRemoteNG.VisualElementsManifest.xml"
|
||||||
)
|
)
|
||||||
|
|
||||||
if ($filesToDelete)
|
if ($filesToDelete)
|
||||||
{
|
{
|
||||||
Write-Output "Unnecessary files are detected and will be removed"
|
Write-Output "Unnecessary files are detected and will be removed"
|
||||||
Remove-Item -Path $filesToDelete.FullName
|
Remove-Item -Path $filesToDelete.FullName
|
||||||
Write-Output $filesToDelete.FullName
|
Write-Output $filesToDelete.FullName
|
||||||
} else
|
} else {
|
||||||
{
|
|
||||||
Write-Output " No unnecessary files are detected"
|
Write-Output " No unnecessary files are detected"
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
Write-Output "We will not remove anything - this is not a release build."
|
Write-Output "We will not remove anything - this is not a release build."
|
||||||
}
|
}
|
||||||
|
|
||||||
Write-Output ""
|
Write-Output "End $($PSCmdlet.MyInvocation.MyCommand)"
|
||||||
|
Write-Output ""
|
||||||
|
|||||||
@@ -1,9 +1,5 @@
|
|||||||
#Requires -Version 4.0
|
#Requires -Version 4.0
|
||||||
param (
|
param (
|
||||||
[string]
|
|
||||||
[Parameter(Mandatory=$true)]
|
|
||||||
$MainRepository,
|
|
||||||
|
|
||||||
[string]
|
[string]
|
||||||
[Parameter(Mandatory=$true)]
|
[Parameter(Mandatory=$true)]
|
||||||
$WebsiteTargetOwner,
|
$WebsiteTargetOwner,
|
||||||
@@ -26,43 +22,45 @@ param (
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
Write-Output "===== Begin update_and_upload_website_release_json_file.ps1 ====="
|
Write-Output ""
|
||||||
|
Write-Output "===== Begin $($PSCmdlet.MyInvocation.MyCommand) ====="
|
||||||
|
|
||||||
|
$MainRepository = $Env:APPVEYOR_REPO_NAME.Split("/\")[1]
|
||||||
|
|
||||||
# determine update channel
|
# determine update channel
|
||||||
if ($env:APPVEYOR_PROJECT_NAME -match "(Nightly)") {
|
if ($env:APPVEYOR_PROJECT_NAME -match "(Nightly)") {
|
||||||
write-host "UpdateChannel = Nightly"
|
Write-Output "UpdateChannel = Nightly"
|
||||||
$UpdateChannel = "Nightly"
|
$UpdateChannel = "Nightly"
|
||||||
$ModifiedTagName = "$PreTagName-$TagName-NB"
|
$ModifiedTagName = "$PreTagName-$TagName-NB"
|
||||||
} elseif ($env:APPVEYOR_PROJECT_NAME -match "(Preview)") {
|
} elseif ($env:APPVEYOR_PROJECT_NAME -match "(Preview)") {
|
||||||
write-host "UpdateChannel = Preview"
|
Write-Output "UpdateChannel = Preview"
|
||||||
$UpdateChannel = "Preview"
|
$UpdateChannel = "Preview"
|
||||||
$ModifiedTagName = "v$TagName-PB"
|
$ModifiedTagName = "v$TagName-PB"
|
||||||
} elseif ($env:APPVEYOR_PROJECT_NAME -match "(Stable)") {
|
} elseif ($env:APPVEYOR_PROJECT_NAME -match "(Stable)") {
|
||||||
write-host "UpdateChannel = Stable"
|
Write-Output "UpdateChannel = Stable"
|
||||||
$UpdateChannel = "Stable"
|
$UpdateChannel = "Stable"
|
||||||
$ModifiedTagName = "v" + $TagName.Split("-")[0]
|
$ModifiedTagName = "v" + $TagName.Split("-")[0]
|
||||||
} else {
|
} else {
|
||||||
$UpdateChannel = ""
|
$UpdateChannel = ""
|
||||||
}
|
}
|
||||||
|
|
||||||
$buildFolder = Join-Path -Path $PSScriptRoot -ChildPath "..\mRemoteNG\bin\x64\Release" -Resolve -ErrorAction Ignore
|
#$buildFolder = Join-Path -Path $PSScriptRoot -ChildPath "..\mRemoteNG\bin\x64\Release" -Resolve -ErrorAction Ignore
|
||||||
|
$ReleaseFolder = Join-Path -Path $PSScriptRoot -ChildPath "..\Release" -Resolve
|
||||||
|
|
||||||
if ($UpdateChannel -ne "" -and $buildFolder -ne "" -and $MainRepository -ne "" -and $WebsiteTargetOwner -ne "" -and $WebsiteTargetRepository -ne "" ) {
|
if ($UpdateChannel -ne "" -and $ReleaseFolder -ne "" -and $MainRepository -ne "" -and $WebsiteTargetOwner -ne "" -and $WebsiteTargetRepository -ne "" ) {
|
||||||
|
|
||||||
$releaseFolder = Join-Path -Path $PSScriptRoot -ChildPath "..\Release" -Resolve
|
|
||||||
$published_at = (Get-Date).ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ssZ")
|
$published_at = (Get-Date).ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ssZ")
|
||||||
|
|
||||||
#$websiteJsonReleaseFile = Join-Path -Path $PSScriptRoot -ChildPath "..\..\mRemoteNG.github.io\_data\releases.json" -Resolve
|
|
||||||
|
|
||||||
# get releases.json from github
|
# get releases.json from github
|
||||||
$releases_json = Get-GitHubContent -OwnerName $WebsiteTargetOwner -RepositoryName $WebsiteTargetRepository -Path _data\releases.json
|
$releases_json = Get-GitHubContent -OwnerName $WebsiteTargetOwner -RepositoryName $WebsiteTargetRepository -Path _data\releases.json
|
||||||
ConvertFrom-Base64($releases_json.content) | Out-File -FilePath "$releaseFolder\releases.json"
|
ConvertFrom-Base64($releases_json.content) | Out-File -FilePath "$ReleaseFolder\releases.json"
|
||||||
$websiteJsonReleaseFile = Get-ChildItem -Path "$releaseFolder\releases.json"
|
$websiteJsonReleaseFile = Get-ChildItem -Path "$ReleaseFolder\releases.json"
|
||||||
|
|
||||||
# installer
|
# installer
|
||||||
$msiFile = Get-ChildItem -Path "$buildFolder\*.msi" | Sort-Object LastWriteTime | Select-Object -last 1
|
$msiFile = Get-ChildItem -Path "$ReleaseFolder\*.msi" | Sort-Object LastWriteTime | Select-Object -last 1
|
||||||
if (![string]::IsNullOrEmpty($msiFile)) {
|
if (![string]::IsNullOrEmpty($msiFile)) {
|
||||||
|
Write-Output "UpdateChannel: $UpdateChannel"
|
||||||
|
Write-Output "msiFile: $msiFile"
|
||||||
$checksum = (Get-FileHash $msiFile -Algorithm SHA512).Hash
|
$checksum = (Get-FileHash $msiFile -Algorithm SHA512).Hash
|
||||||
$file_size = (Get-ChildItem $msiFile).Length
|
$file_size = (Get-ChildItem $msiFile).Length
|
||||||
$a = Get-Content $websiteJsonReleaseFile | ConvertFrom-Json
|
$a = Get-Content $websiteJsonReleaseFile | ConvertFrom-Json
|
||||||
@@ -71,7 +69,7 @@ if ($UpdateChannel -ne "" -and $buildFolder -ne "" -and $MainRepository -ne "" -
|
|||||||
$GithubTag = "$((Get-Date).ToUniversalTime().ToString("yyyyMMdd"))-$TagName-NB"
|
$GithubTag = "$((Get-Date).ToUniversalTime().ToString("yyyyMMdd"))-$TagName-NB"
|
||||||
$html_url = "https://github.com/$WebsiteTargetOwner/$MainRepository/releases/tag/$GithubTag"
|
$html_url = "https://github.com/$WebsiteTargetOwner/$MainRepository/releases/tag/$GithubTag"
|
||||||
$browser_download_url = "https://github.com/$WebsiteTargetOwner/$MainRepository/releases/download/$GithubTag/$($msiFile.Name)"
|
$browser_download_url = "https://github.com/$WebsiteTargetOwner/$MainRepository/releases/download/$GithubTag/$($msiFile.Name)"
|
||||||
$a.nightlybuild.name = "v$TagName"
|
$a.nightlybuild.name = "v$TagName-NB"
|
||||||
$a.nightlybuild.published_at = $published_at
|
$a.nightlybuild.published_at = $published_at
|
||||||
$a.nightlybuild.html_url = $html_url
|
$a.nightlybuild.html_url = $html_url
|
||||||
$a.nightlybuild.assets.installer.browser_download_url = $browser_download_url
|
$a.nightlybuild.assets.installer.browser_download_url = $browser_download_url
|
||||||
@@ -83,7 +81,7 @@ if ($UpdateChannel -ne "" -and $buildFolder -ne "" -and $MainRepository -ne "" -
|
|||||||
$GithubTag = "$TagName-PB"
|
$GithubTag = "$TagName-PB"
|
||||||
$html_url = "https://github.com/$WebsiteTargetOwner/$MainRepository/releases/tag/$GithubTag"
|
$html_url = "https://github.com/$WebsiteTargetOwner/$MainRepository/releases/tag/$GithubTag"
|
||||||
$browser_download_url = "https://github.com/$WebsiteTargetOwner/$MainRepository/releases/download/$GithubTag/$($msiFile.Name)"
|
$browser_download_url = "https://github.com/$WebsiteTargetOwner/$MainRepository/releases/download/$GithubTag/$($msiFile.Name)"
|
||||||
$a.prerelease.name = "v$TagName"
|
$a.prerelease.name = "v$TagName-PB"
|
||||||
$a.prerelease.published_at = $published_at
|
$a.prerelease.published_at = $published_at
|
||||||
$a.prerelease.html_url = $html_url
|
$a.prerelease.html_url = $html_url
|
||||||
$a.prerelease.assets.installer.browser_download_url = $browser_download_url
|
$a.prerelease.assets.installer.browser_download_url = $browser_download_url
|
||||||
@@ -108,8 +106,10 @@ if ($UpdateChannel -ne "" -and $buildFolder -ne "" -and $MainRepository -ne "" -
|
|||||||
|
|
||||||
|
|
||||||
# portable
|
# portable
|
||||||
$zipFile = Get-ChildItem -Path "$releaseFolder\*.zip" -Exclude "*-symbols-*.zip" | Sort-Object LastWriteTime | Select-Object -last 1
|
$zipFile = Get-ChildItem -Path "$ReleaseFolder\*.zip" -Exclude "*-symbols-*.zip" | Sort-Object LastWriteTime | Select-Object -last 1
|
||||||
if (![string]::IsNullOrEmpty($zipFile)) {
|
if (![string]::IsNullOrEmpty($zipFile)) {
|
||||||
|
Write-Output "UpdateChannel: $UpdateChannel"
|
||||||
|
Write-Output "zipFile: $zipFile"
|
||||||
$checksum = (Get-FileHash $zipFile -Algorithm SHA512).Hash
|
$checksum = (Get-FileHash $zipFile -Algorithm SHA512).Hash
|
||||||
$file_size = (Get-ChildItem $zipFile).Length
|
$file_size = (Get-ChildItem $zipFile).Length
|
||||||
$a = Get-Content $websiteJsonReleaseFile | ConvertFrom-Json
|
$a = Get-Content $websiteJsonReleaseFile | ConvertFrom-Json
|
||||||
@@ -118,7 +118,7 @@ if ($UpdateChannel -ne "" -and $buildFolder -ne "" -and $MainRepository -ne "" -
|
|||||||
$GithubTag = "$((Get-Date).ToUniversalTime().ToString("yyyyMMdd"))-$TagName-NB"
|
$GithubTag = "$((Get-Date).ToUniversalTime().ToString("yyyyMMdd"))-$TagName-NB"
|
||||||
$html_url = "https://github.com/$WebsiteTargetOwner/$MainRepository/releases/tag/$GithubTag"
|
$html_url = "https://github.com/$WebsiteTargetOwner/$MainRepository/releases/tag/$GithubTag"
|
||||||
$browser_download_url = "https://github.com/$WebsiteTargetOwner/$MainRepository/releases/download/$GithubTag/$($zipFile.Name)"
|
$browser_download_url = "https://github.com/$WebsiteTargetOwner/$MainRepository/releases/download/$GithubTag/$($zipFile.Name)"
|
||||||
$a.nightlybuild.name = "v$TagName"
|
$a.nightlybuild.name = "v$TagName-NB"
|
||||||
$a.nightlybuild.published_at = $published_at
|
$a.nightlybuild.published_at = $published_at
|
||||||
$a.nightlybuild.html_url = $html_url
|
$a.nightlybuild.html_url = $html_url
|
||||||
$a.nightlybuild.assets.portable.browser_download_url = $browser_download_url
|
$a.nightlybuild.assets.portable.browser_download_url = $browser_download_url
|
||||||
@@ -130,7 +130,7 @@ if ($UpdateChannel -ne "" -and $buildFolder -ne "" -and $MainRepository -ne "" -
|
|||||||
$GithubTag = "$TagName-PB"
|
$GithubTag = "$TagName-PB"
|
||||||
$html_url = "https://github.com/$WebsiteTargetOwner/$MainRepository/releases/tag/$GithubTag"
|
$html_url = "https://github.com/$WebsiteTargetOwner/$MainRepository/releases/tag/$GithubTag"
|
||||||
$browser_download_url = "https://github.com/$WebsiteTargetOwner/$MainRepository/releases/download/$GithubTag/$($zipFile.Name)"
|
$browser_download_url = "https://github.com/$WebsiteTargetOwner/$MainRepository/releases/download/$GithubTag/$($zipFile.Name)"
|
||||||
$a.prerelease.name = "v$TagName"
|
$a.prerelease.name = "v$TagName-PB"
|
||||||
$a.prerelease.published_at = $published_at
|
$a.prerelease.published_at = $published_at
|
||||||
$a.prerelease.html_url = $html_url
|
$a.prerelease.html_url = $html_url
|
||||||
$a.prerelease.assets.portable.browser_download_url = $browser_download_url
|
$a.prerelease.assets.portable.browser_download_url = $browser_download_url
|
||||||
@@ -153,20 +153,21 @@ if ($UpdateChannel -ne "" -and $buildFolder -ne "" -and $MainRepository -ne "" -
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$a | ConvertTo-Json -Depth 10 | set-content $websiteJsonReleaseFile
|
$a | ConvertTo-Json -Depth 10 | Set-Content $websiteJsonReleaseFile
|
||||||
|
|
||||||
# commit releases.json change
|
# commit releases.json change
|
||||||
if ($env:WEBSITE_UPDATE_ENABLED.ToLower() -eq "true") {
|
if ($env:WEBSITE_UPDATE_ENABLED.ToLower() -eq "true") {
|
||||||
Write-Output "publish releases.json"
|
Write-Output "publish releases.json"
|
||||||
if (Test-Path -Path "$releaseFolder\releases.json") {
|
if (Test-Path -Path "$ReleaseFolder\releases.json") {
|
||||||
$releases_json_string = Get-Content "$releaseFolder\releases.json" | Out-String
|
$releases_json_string = Get-Content "$ReleaseFolder\releases.json" | Out-String
|
||||||
Set-GitHubContent -OwnerName $WebsiteTargetOwner -RepositoryName $WebsiteTargetRepository -Path _data\releases.json -CommitMessage "Updated for $UpdateChannel $ModifiedTagName" -Content $releases_json_string -BranchName main
|
Set-GitHubContent -OwnerName $WebsiteTargetOwner -RepositoryName $WebsiteTargetRepository -Path _data\releases.json -CommitMessage "Updated for $UpdateChannel $ModifiedTagName" -Content $releases_json_string -BranchName main
|
||||||
|
Write-Output "publish completed"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
write-host "BuildFolder not found"
|
Write-Output "ReleaseFolder not found"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Write-Output "End update_and_upload_website_release_json_file.ps1"
|
Write-Output "End $($PSCmdlet.MyInvocation.MyCommand)"
|
||||||
|
Write-Output ""
|
||||||
|
|||||||
@@ -5,7 +5,13 @@ param (
|
|||||||
$FullPath
|
$FullPath
|
||||||
)
|
)
|
||||||
|
|
||||||
$validMSCertThumbprints = @("3BDA323E552DB1FDE5F4FBEE75D6D5B2B187EEDC", "108E2BA23632620C427C570B6D9DB51AC31387FE", "98ED99A67886D020C564923B7DF25E9AC019DF26", "5EAD300DC7E4D637948ECB0ED829A072BD152E17")
|
$validMSCertThumbprints = @(
|
||||||
|
"3BDA323E552DB1FDE5F4FBEE75D6D5B2B187EEDC",
|
||||||
|
"108E2BA23632620C427C570B6D9DB51AC31387FE",
|
||||||
|
"98ED99A67886D020C564923B7DF25E9AC019DF26",
|
||||||
|
"5EAD300DC7E4D637948ECB0ED829A072BD152E17",
|
||||||
|
"97221B97098F37A135DCC212E2B41E452BCE51F2"
|
||||||
|
)
|
||||||
$exeSignature = Get-AuthenticodeSignature -FilePath $FullPath
|
$exeSignature = Get-AuthenticodeSignature -FilePath $FullPath
|
||||||
$baseErrorMsg = "Could not validate the certificate of $FullPath. "
|
$baseErrorMsg = "Could not validate the certificate of $FullPath. "
|
||||||
|
|
||||||
@@ -14,4 +20,4 @@ if ($exeSignature.Status -ne "Valid") {
|
|||||||
}
|
}
|
||||||
elseif ($validMSCertThumbprints -notcontains $exeSignature.SignerCertificate.Thumbprint) {
|
elseif ($validMSCertThumbprints -notcontains $exeSignature.SignerCertificate.Thumbprint) {
|
||||||
Write-Error -Message ($baseErrorMsg+"The certificate thumbprint ($($exeSignature.SignerCertificate.Thumbprint)) is not trusted.") -ErrorAction Stop
|
Write-Error -Message ($baseErrorMsg+"The certificate thumbprint ($($exeSignature.SignerCertificate.Thumbprint)) is not trusted.") -ErrorAction Stop
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,8 @@ param (
|
|||||||
$TargetFileName
|
$TargetFileName
|
||||||
)
|
)
|
||||||
|
|
||||||
Write-Output "===== Beginning $($PSCmdlet.MyInvocation.MyCommand) ====="
|
Write-Output ""
|
||||||
|
Write-Output "===== Begin $($PSCmdlet.MyInvocation.MyCommand) ====="
|
||||||
|
|
||||||
$path_dumpBin = Join-Path -Path $PSScriptRoot -ChildPath "exes\dumpbin.exe"
|
$path_dumpBin = Join-Path -Path $PSScriptRoot -ChildPath "exes\dumpbin.exe"
|
||||||
$path_outputExe = Join-Path -Path $TargetDir -ChildPath $TargetFileName
|
$path_outputExe = Join-Path -Path $TargetDir -ChildPath $TargetFileName
|
||||||
@@ -18,7 +19,7 @@ $path_outputExe = Join-Path -Path $TargetDir -ChildPath $TargetFileName
|
|||||||
# Dump exe header
|
# Dump exe header
|
||||||
$output = & "$path_dumpBin" /NOLOGO /HEADERS "$path_outputExe" | Select-String large
|
$output = & "$path_dumpBin" /NOLOGO /HEADERS "$path_outputExe" | Select-String large
|
||||||
|
|
||||||
if ($output -eq $null)
|
if ($null -eq $output)
|
||||||
{
|
{
|
||||||
Write-Warning "Could not validate LargeAddressAware"
|
Write-Warning "Could not validate LargeAddressAware"
|
||||||
}
|
}
|
||||||
@@ -27,4 +28,5 @@ else
|
|||||||
Write-Output $output.ToString().TrimStart(" ")
|
Write-Output $output.ToString().TrimStart(" ")
|
||||||
}
|
}
|
||||||
|
|
||||||
Write-Output ""
|
Write-Output "End $($PSCmdlet.MyInvocation.MyCommand)"
|
||||||
|
Write-Output ""
|
||||||
|
|||||||
@@ -18,13 +18,15 @@ param (
|
|||||||
$SolutionDir
|
$SolutionDir
|
||||||
)
|
)
|
||||||
|
|
||||||
Write-Output "===== Beginning $($PSCmdlet.MyInvocation.MyCommand) ====="
|
Write-Output ""
|
||||||
|
Write-Output "===== Begin $($PSCmdlet.MyInvocation.MyCommand) ====="
|
||||||
|
|
||||||
|
$IsAppVeyor = !([string]::IsNullOrEmpty($Env:APPVEYOR_BUILD_FOLDER))
|
||||||
|
|
||||||
# validate release versions and if the certificate value was passed
|
# validate release versions and if the certificate value was passed
|
||||||
if ($ConfigurationName -match "Release" -And ($CertificatePath)) {
|
if ($ConfigurationName -match "Release" -And ($CertificatePath)) {
|
||||||
|
|
||||||
if(-Not ([string]::IsNullOrEmpty($Env:APPVEYOR_BUILD_FOLDER)) ) {
|
if($IsAppVeyor) {
|
||||||
$CertificatePath = Join-Path -Path $SolutionDir -ChildPath $CertificatePath
|
$CertificatePath = Join-Path -Path $SolutionDir -ChildPath $CertificatePath
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -37,9 +39,10 @@ if ($ConfigurationName -match "Release" -And ($CertificatePath)) {
|
|||||||
|
|
||||||
Write-Output "Verifying signature of binaries"
|
Write-Output "Verifying signature of binaries"
|
||||||
Write-Output "Getting files from path: $TargetDir"
|
Write-Output "Getting files from path: $TargetDir"
|
||||||
$signableFiles = Get-ChildItem -Path $TargetDir -Recurse | ?{$_.Extension -match "dll|exe|msi"}
|
$signableFiles = Get-ChildItem -Path $TargetDir -Recurse | Where-Object {$_.Extension -match "dll|exe|msi"}
|
||||||
Write-Output "Signable files count: $($signableFiles.Count)"
|
Write-Output "Signable files count: $($signableFiles.Count)"
|
||||||
$badSignatureFound = $false
|
$badSignatureFound = $false
|
||||||
|
|
||||||
foreach ($file in $signableFiles) {
|
foreach ($file in $signableFiles) {
|
||||||
$signature = Get-AuthenticodeSignature -FilePath $file.FullName
|
$signature = Get-AuthenticodeSignature -FilePath $file.FullName
|
||||||
if ($signature.Status -ne "Valid") {
|
if ($signature.Status -ne "Valid") {
|
||||||
@@ -47,6 +50,7 @@ if ($ConfigurationName -match "Release" -And ($CertificatePath)) {
|
|||||||
$badSignatureFound = $true
|
$badSignatureFound = $true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($badSignatureFound) {
|
if ($badSignatureFound) {
|
||||||
Write-Output "One or more files were improperly signed."
|
Write-Output "One or more files were improperly signed."
|
||||||
} else {
|
} else {
|
||||||
@@ -57,4 +61,5 @@ if ($ConfigurationName -match "Release" -And ($CertificatePath)) {
|
|||||||
Write-Output "Config: $($ConfigurationName)`tCertPath: $($CertificatePath)"
|
Write-Output "Config: $($ConfigurationName)`tCertPath: $($CertificatePath)"
|
||||||
}
|
}
|
||||||
|
|
||||||
Write-Output ""
|
Write-Output "End $($PSCmdlet.MyInvocation.MyCommand)"
|
||||||
|
Write-Output ""
|
||||||
|
|||||||
@@ -13,7 +13,9 @@
|
|||||||
)
|
)
|
||||||
|
|
||||||
Write-Output ""
|
Write-Output ""
|
||||||
Write-Output "===== Beginning $($PSCmdlet.MyInvocation.MyCommand) ====="
|
Write-Output "===== Begin $($PSCmdlet.MyInvocation.MyCommand) ====="
|
||||||
|
|
||||||
|
$IsAppVeyor = !([string]::IsNullOrEmpty($Env:APPVEYOR_BUILD_FOLDER))
|
||||||
|
|
||||||
$ConfigurationName = $ConfigurationName.Trim()
|
$ConfigurationName = $ConfigurationName.Trim()
|
||||||
Write-Output "Config Name (trimmed): '$($ConfigurationName)'"
|
Write-Output "Config Name (trimmed): '$($ConfigurationName)'"
|
||||||
@@ -21,38 +23,52 @@ $exe = Join-Path -Path $TargetDir -ChildPath $TargetFileName
|
|||||||
$version = ((Get-Item -Path $exe).VersionInfo | Select-Object -Property ProductVersion)."ProductVersion"
|
$version = ((Get-Item -Path $exe).VersionInfo | Select-Object -Property ProductVersion)."ProductVersion"
|
||||||
Write-Output "Version is $($version)"
|
Write-Output "Version is $($version)"
|
||||||
|
|
||||||
|
# determine update channel
|
||||||
|
if ($env:APPVEYOR_PROJECT_NAME -match "(Nightly)") {
|
||||||
|
Write-Output "UpdateChannel = Nightly"
|
||||||
|
$ModifiedVersion = "$version-NB"
|
||||||
|
} elseif ($env:APPVEYOR_PROJECT_NAME -match "(Preview)") {
|
||||||
|
Write-Output "UpdateChannel = Preview"
|
||||||
|
$ModifiedVersion = "$version-PB"
|
||||||
|
} elseif ($env:APPVEYOR_PROJECT_NAME -match "(Stable)") {
|
||||||
|
Write-Output "UpdateChannel = Stable"
|
||||||
|
$ModifiedVersion = $version
|
||||||
|
} else {
|
||||||
|
}
|
||||||
|
|
||||||
# Fix for AppVeyor
|
# Fix for AppVeyor
|
||||||
if(!([string]::IsNullOrEmpty($Env:APPVEYOR_BUILD_FOLDER))) {
|
if($IsAppVeyor) {
|
||||||
if(!(test-path "Release")) {
|
if(!(Test-Path "Release")) {
|
||||||
New-Item -ItemType Directory -Force -Path "Release" | Out-Null
|
New-Item -ItemType Directory -Force -Path "Release" | Out-Null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# Package debug symbols zip file
|
# Package debug symbols zip file
|
||||||
if ($ConfigurationName -match "Release") {
|
if ($ConfigurationName -match "Release") {
|
||||||
|
|
||||||
Write-Output "Packaging debug symbols"
|
Write-Output "Packaging debug symbols"
|
||||||
|
|
||||||
if ($ConfigurationName -match "Portable") {
|
if ($ConfigurationName -match "Portable") {
|
||||||
$zipFilePrefix = "mRemoteNG-Portable-symbols"
|
$zipFilePrefix = "mRemoteNG-Portable-symbols"
|
||||||
} else {
|
} else {
|
||||||
$zipFilePrefix = "mRemoteNG-symbols"
|
$zipFilePrefix = "mRemoteNG-Installer-symbols"
|
||||||
}
|
}
|
||||||
|
|
||||||
$debugFile = Join-Path -Path $TargetDir -ChildPath "mRemoteNG.pdb"
|
$debugFile = Join-Path -Path $TargetDir -ChildPath "mRemoteNG.pdb"
|
||||||
|
|
||||||
# AppVeyor build
|
# AppVeyor build
|
||||||
if(!([string]::IsNullOrEmpty($Env:APPVEYOR_BUILD_FOLDER))) {
|
if ($IsAppVeyor) {
|
||||||
$outputZipPath = Join-Path -Path $SolutionDir -ChildPath "Release\$zipFilePrefix-$($version).zip"
|
$outputZipPath = Join-Path -Path $SolutionDir -ChildPath "Release\$zipFilePrefix-$($ModifiedVersion).zip"
|
||||||
7z a $outputZipPath $debugFile
|
7z a $outputZipPath $debugFile
|
||||||
}
|
}
|
||||||
# Local build
|
# Local build
|
||||||
else {
|
else {
|
||||||
if (!(Test-Path -Path $debugFile -PathType Leaf))
|
if (!(Test-Path -Path $debugFile -PathType Leaf))
|
||||||
{
|
{
|
||||||
$outputZipPath = "$($SolutionDir)Release\$zipFilePrefix-$($version).zip"
|
$outputZipPath = "$($SolutionDir)Release\$zipFilePrefix-$($ModifiedVersion).zip"
|
||||||
Compress-Archive $debugFile $outputZipPath -Force
|
Compress-Archive $debugFile $outputZipPath -Force
|
||||||
} else {
|
} else {
|
||||||
write-host "File do not exist:" $debugFile", nothing to compress"
|
Write-Output "File do not exist:" $debugFile", nothing to compress"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -64,20 +80,21 @@ if ($ConfigurationName -eq "Release Portable") {
|
|||||||
Write-Output "Packaging portable ZIP file"
|
Write-Output "Packaging portable ZIP file"
|
||||||
|
|
||||||
# AppVeyor build
|
# AppVeyor build
|
||||||
if(!([string]::IsNullOrEmpty($Env:APPVEYOR_BUILD_FOLDER))) {
|
if ($IsAppVeyor) {
|
||||||
$outputZipPath = Join-Path -Path $SolutionDir -ChildPath "Release\mRemoteNG-Portable-$($version).zip"
|
$outputZipPath = Join-Path -Path $SolutionDir -ChildPath "Release\mRemoteNG-Portable-$($ModifiedVersion).zip"
|
||||||
7z a -bt -bd -bb1 -mx=9 -tzip -y -r $outputZipPath $TargetDir\*
|
7z a -bt -bd -bb1 -mx=9 -tzip -y -r $outputZipPath $TargetDir\*
|
||||||
}
|
}
|
||||||
# Local build
|
# Local build
|
||||||
else {
|
else {
|
||||||
if ($Source)
|
if ($Source)
|
||||||
{
|
{
|
||||||
$outputZipPath="$($SolutionDir)\Release\mRemoteNG-Portable-$($version).zip"
|
$outputZipPath="$($SolutionDir)\Release\mRemoteNG-Portable-$($ModifiedVersion).zip"
|
||||||
Compress-Archive $Source $outputZipPath -Force
|
Compress-Archive $Source $outputZipPath -Force
|
||||||
} else {
|
} else {
|
||||||
write-host "File do not exist:" $Source", nothing to compress"
|
Write-Output "File do not exist:" $Source", nothing to compress"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Write-Output ""
|
Write-Output "End $($PSCmdlet.MyInvocation.MyCommand)"
|
||||||
|
Write-Output ""
|
||||||
|
|||||||
@@ -480,7 +480,7 @@
|
|||||||
<Exec Command="echo $(ConfigurationName) > buildenv.tmp
"$(DevEnvDir)TextTransform.exe" -a !!BuildConfiguration!"$(Configuration)" "$(ProjectDir)Properties\AssemblyInfo.tt"" />
|
<Exec Command="echo $(ConfigurationName) > buildenv.tmp
"$(DevEnvDir)TextTransform.exe" -a !!BuildConfiguration!"$(Configuration)" "$(ProjectDir)Properties\AssemblyInfo.tt"" />
|
||||||
</Target>
|
</Target>
|
||||||
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
|
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
|
||||||
<Exec Command=":: When passing paths to powershell scripts, check if the path ends with a backslash "\"
:: If it does, then the backslash may be interpreted as an escape character. Add another backslash to cancel the first one.

powershell -noprofile -command "sleep 2"

set /p buildenv=<buildenv.tmp

:: Manual builds, set the cert password and uncomment below.
:: IF "%25APPVEYOR_BUILD_FOLDER"=="" ( set cert_pwd= )

:: Call the post build powershell script
powershell.exe -ExecutionPolicy Bypass -File "$(SolutionDir)Tools\postbuild_mremoteng.ps1" -SolutionDir "$(SolutionDir)\" -TargetDir "$(TargetDir)\" -TargetFileName "mRemoteNG.exe" -ConfigurationName "%25buildenv%25" -CertificatePath "$(CertPath)" -CertificatePassword "$(CertPassword)" -ExcludeFromSigning "PuTTYNG.exe"" />
|
<Exec Command=":: When passing paths to powershell scripts, check if the path ends with a backslash "\"
:: If it does, then the backslash may be interpreted as an escape character. Add another backslash to cancel the first one.

powershell -noprofile -command "sleep 2"

set /p buildenv=<buildenv.tmp

:: Manual builds, set the cert password and uncomment below.
:: IF "%25APPVEYOR_BUILD_FOLDER"=="" ( set cert_pwd= )

:: Call the post build powershell script
powershell.exe -ExecutionPolicy Bypass -File "$(SolutionDir)Tools\postbuild_portable.ps1" -SolutionDir "$(SolutionDir)\" -TargetDir "$(TargetDir)\" -TargetFileName "mRemoteNG.exe" -ConfigurationName "%25buildenv%25" -CertificatePath "$(CertPath)" -CertificatePassword "$(CertPassword)" -ExcludeFromSigning "PuTTYNG.exe"" />
|
||||||
</Target>
|
</Target>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\ExternalConnectors\ExternalConnectors.csproj" />
|
<ProjectReference Include="..\ExternalConnectors\ExternalConnectors.csproj" />
|
||||||
|
|||||||
Reference in New Issue
Block a user