mirror of
https://github.com/mRemoteNG/mRemoteNG.git
synced 2026-02-26 12:08:37 +08:00
the installer project now uses a powershell script for post build actions
This commit is contained in:
@@ -127,19 +127,16 @@ REM Convert the license file "COPYING.TXT" to "License.rtf" to be shown in the i
|
||||
call "$(ProjectDir)Resources\Pandoc\pandoc.exe" -s -t rtf -o "$(ProjectDir)\Resources\License.rtf" "$(SolutionDir)COPYING.TXT"</PreBuildEvent>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent>set /p buildenv=<buildenv.tmp
|
||||
<PostBuildEvent>:: 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.
|
||||
|
||||
REM Sign MSI
|
||||
IF EXIST C:\mRemoteNG_code_signing_cert.pfx (
|
||||
IF %25buildenv: Portable=%25==Release (
|
||||
powershell -File "$(SolutionDir)Tools\signfiles.ps1" -PathToSignableFiles %25cd%25
|
||||
)
|
||||
)
|
||||
powershell -noprofile -command "sleep 2"
|
||||
set /p buildenv=<buildenv.tmp
|
||||
set solutionDir=$(SolutionDir)\
|
||||
set targetDir=%25cd%25
|
||||
set psScriptsDir=$(SolutionDir)Tools
|
||||
|
||||
REM Rename MSI to include version number
|
||||
powershell -ExecutionPolicy Bypass -File "$(SolutionDir)Tools\rename_installer_with_version.ps1" -SolutionDir $(SolutionDir)
|
||||
|
||||
REM Copy MSI to Release folder
|
||||
IF %25buildenv: Portable=%25==Release (powershell -ExecutionPolicy Bypass -File "$(SolutionDir)Tools\copy_release_installer.ps1" -SourcePath $(TargetDir) -DestinationDir $(SolutionDir)Release)</PostBuildEvent>
|
||||
:: Call the post build powershell script
|
||||
powershell.exe -ExecutionPolicy Bypass -File "%25psScriptsDir%25\postbuild_installer.ps1" -SolutionDir "%25solutionDir%25" -TargetDir "%25targetDir%25" -TargetFileName "mRemoteNG.exe" -ConfigurationName "%25buildenv%25"</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -16,23 +16,13 @@ param (
|
||||
$ConfigurationName
|
||||
)
|
||||
|
||||
$certificatePath = "C:\mRemoteNG_code_signing_cert.pfx"
|
||||
$path_signFilesScript = Join-Path -Path $SolutionDir -ChildPath "Tools\signfiles.ps1"
|
||||
$path_installerRenameScript = Join-Path -Path $SolutionDir -ChildPath "Tools\rename_installer_with_version.ps1"
|
||||
$path_copyToReleaseScript = Join-Path -Path $SolutionDir -ChildPath "Tools\copy_release_installer.ps1"
|
||||
Write-Output "+=================================================================+"
|
||||
Write-Output "| Beginning mRemoteNG Installer Post Build |"
|
||||
Write-Output "+=================================================================+"
|
||||
Write-Output ([pscustomobject]$PSBoundParameters) | Format-Table -AutoSize -Wrap
|
||||
|
||||
|
||||
# Sign MSI if we are building a release version and the certificate is available
|
||||
if (($ConfigurationName -match "Release") -and (Test-Path -Path $certificatePath -PathType Leaf)) {
|
||||
powershell.exe -ExecutionPolicy Bypass -File $path_signFilesScript $TargetDir
|
||||
}
|
||||
|
||||
|
||||
# Rename MSI to include version number
|
||||
powershell.exe -ExecutionPolicy Bypass -File $path_installerRenameScript -SolutionDir $SolutionDir
|
||||
|
||||
|
||||
# Copy MSI to Release folder
|
||||
if ($ConfigurationName -match "Release") {
|
||||
powershell.exe -ExecutionPolicy Bypass -File $path_copyToReleaseScript -SourcePath $TargetDir -DestinationDir (Join-Path -Path $SolutionDir -ChildPath "Release")
|
||||
}
|
||||
& "$PSScriptRoot\sign_binaries.ps1" -SolutionDir $SolutionDir -TargetDir $TargetDir -ConfigurationName $ConfigurationName
|
||||
& "$PSScriptRoot\verify_binary_signatures.ps1" -TargetDir $TargetDir -ConfigurationName $ConfigurationName
|
||||
& "$PSScriptRoot\rename_installer_with_version.ps1" -SolutionDir $SolutionDir
|
||||
& "$PSScriptRoot\copy_release_installer.ps1" -SourcePath $TargetDir -DestinationDir (Join-Path -Path $SolutionDir -ChildPath "Release")
|
||||
Reference in New Issue
Block a user