diff --git a/Tools/create_upg_chk_files.ps1 b/Tools/create_upg_chk_files.ps1 index 47531398..257b664f 100644 --- a/Tools/create_upg_chk_files.ps1 +++ b/Tools/create_upg_chk_files.ps1 @@ -97,8 +97,7 @@ function Resolve-UpdateCheckFileName { Write-Output $fileName } - -Write-Output "Begin create_upg_chk_files.ps1" +Write-Output "===== Begin create_upg_chk_files.ps1 =====" # determine update channel if ($env:APPVEYOR_PROJECT_NAME -match "(Nightly)") { @@ -119,7 +118,8 @@ if ($env:APPVEYOR_PROJECT_NAME -match "(Nightly)") { $buildFolder = Join-Path -Path $PSScriptRoot -ChildPath "..\mRemoteNG\bin\x64\Release" -Resolve -ErrorAction Ignore -if ($UpdateChannel -ne "" -and $buildFolder -ne "") { +if ($UpdateChannel -ne "" -and $buildFolder -ne "" -and $WebsiteTargetOwner -and $WebsiteTargetRepository) { + $releaseFolder = Join-Path -Path $PSScriptRoot -ChildPath "..\Release" -Resolve $msiFile = Get-ChildItem -Path "$buildFolder\*.msi" | Sort-Object LastWriteTime | Select-Object -last 1 if (![string]::IsNullOrEmpty($msiFile)) { diff --git a/Tools/postbuild_installer.ps1 b/Tools/postbuild_installer.ps1 index d12826ed..79c6dff0 100644 --- a/Tools/postbuild_installer.ps1 +++ b/Tools/postbuild_installer.ps1 @@ -46,11 +46,11 @@ Format-Table -AutoSize -Wrap -InputObject @{ & "$PSScriptRoot\rename_and_copy_installer.ps1" -SolutionDir $SolutionDir -BuildConfiguration $ConfigurationName.Trim() -if (![string]::IsNullOrEmpty($CURRENT_GITHUB_USER)) { +if ( ![string]::IsNullOrEmpty($env:WEBSITE_TARGET_OWNER) -and ![string]::IsNullOrEmpty($env:WEBSITE_TARGET_REPOSITORY) ) { - & "$PSScriptRoot\create_upg_chk_files.ps1" -WebsiteTargetOwner $CURRENT_GITHUB_USER -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" -WebsiteTargetOwner $CURRENT_GITHUB_USER -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" diff --git a/Tools/postbuild_mremoteng.ps1 b/Tools/postbuild_mremoteng.ps1 index d9654280..87f62e46 100644 --- a/Tools/postbuild_mremoteng.ps1 +++ b/Tools/postbuild_mremoteng.ps1 @@ -67,11 +67,11 @@ Format-Table -AutoSize -Wrap -InputObject @{ & "$PSScriptRoot\zip_files.ps1" -SolutionDir $SolutionDir -TargetDir $TargetDir -ConfigurationName $ConfigurationName -if (![string]::IsNullOrEmpty($CURRENT_GITHUB_USER)) { +if ( ![string]::IsNullOrEmpty($env:WEBSITE_TARGET_OWNER) -and ![string]::IsNullOrEmpty($env:WEBSITE_TARGET_REPOSITORY) ) { - & "$PSScriptRoot\create_upg_chk_files.ps1" -WebsiteTargetOwner $CURRENT_GITHUB_USER -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" -WebsiteTargetOwner $CURRENT_GITHUB_USER -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 } diff --git a/Tools/rename_and_copy_installer.ps1 b/Tools/rename_and_copy_installer.ps1 index 1612e676..b77bbc69 100644 --- a/Tools/rename_and_copy_installer.ps1 +++ b/Tools/rename_and_copy_installer.ps1 @@ -5,12 +5,29 @@ $BuildConfiguration ) +Write-Output "===== Begin rename_and_copy_installer.ps1 =====" $targetVersionedFile = "$SolutionDir\mRemoteNG\bin\x64\$BuildConfiguration\mRemoteNG.exe" #$fileversion = &"$SolutionDir\Tools\exes\sigcheck.exe" /accepteula -q -n $targetVersionedFile -$prodversion = ((Get-Item -Path $targetVersionedFile).VersionInfo | Select-Object -Property ProductVersion)."ProductVersion" -$src = $SolutionDir + "mRemoteNGInstaller\Installer\bin\x64\$BuildConfiguration\en-US\mRemoteNG-Installer.msi" -$dst = $SolutionDir + "mRemoteNG\bin\x64\$BuildConfiguration\mRemoteNG-Installer-" + $prodversion + ".msi" +#$prodversion = ((Get-Item -Path $targetVersionedFile).VersionInfo | Select-Object -Property ProductVersion)."ProductVersion" +$fileversion = ((Get-Item -Path $targetVersionedFile).VersionInfo | Select-Object -Property FileVersion)."FileVersion" +$msiversion = $fileversion + +# determine update channel +if ($env:APPVEYOR_PROJECT_NAME -match "(Nightly)") { + write-host "UpdateChannel = Nightly" + $msiversion = "$msiversion-NB" +} elseif ($env:APPVEYOR_PROJECT_NAME -match "(Preview)") { + write-host "UpdateChannel = Preview" + $msiversion = "$msiversion-PB" +} elseif ($env:APPVEYOR_PROJECT_NAME -match "(Stable)") { + write-host "UpdateChannel = Stable" +} else { +} + +$srcMsi = $SolutionDir + "mRemoteNGInstaller\Installer\bin\x64\$BuildConfiguration\en-US\mRemoteNG-Installer*.msi" +$dstMsi = $SolutionDir + "mRemoteNG\bin\x64\$BuildConfiguration\mRemoteNG-Installer-" + $msiversion + ".msi" # Copy file -Copy-Item $src -Destination $dst -Force +Copy-Item $srcMsi -Destination $dstMsi -Force + diff --git a/Tools/update_and_upload_website_release_json_file.ps1 b/Tools/update_and_upload_website_release_json_file.ps1 index d9fbd9b8..194aca76 100644 --- a/Tools/update_and_upload_website_release_json_file.ps1 +++ b/Tools/update_and_upload_website_release_json_file.ps1 @@ -22,7 +22,7 @@ param ( ) -Write-Output "Begin create_website_release_json_file.ps1" +Write-Output "===== Begin update_and_upload_website_release_json_file.ps1 =====" # determine update channel @@ -44,7 +44,7 @@ if ($env:APPVEYOR_PROJECT_NAME -match "(Nightly)") { $buildFolder = Join-Path -Path $PSScriptRoot -ChildPath "..\mRemoteNG\bin\x64\Release" -Resolve -ErrorAction Ignore -if ($UpdateChannel -ne "" -and $buildFolder -ne "") { +if ($UpdateChannel -ne "" -and $buildFolder -ne "" -and $WebsiteTargetOwner -and $WebsiteTargetRepository) { $releaseFolder = Join-Path -Path $PSScriptRoot -ChildPath "..\Release" -Resolve $published_at = (Get-Date).ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ssZ") @@ -165,4 +165,4 @@ if ($UpdateChannel -ne "" -and $buildFolder -ne "") { } -Write-Output "End create_website_release_json_file.ps1" +Write-Output "End update_and_upload_website_release_json_file.ps1"