mirror of
https://github.com/mRemoteNG/mRemoteNG.git
synced 2026-02-17 22:11:48 +08:00
64 lines
2.3 KiB
PowerShell
64 lines
2.3 KiB
PowerShell
param (
|
|
[string]
|
|
[Parameter(Mandatory=$true)]
|
|
$SolutionDir,
|
|
|
|
[string]
|
|
[Parameter(Mandatory=$true)]
|
|
$TargetDir,
|
|
|
|
[string]
|
|
[Parameter(Mandatory=$true)]
|
|
$ConfigurationName
|
|
)
|
|
|
|
Write-Output "===== Beginning $($PSCmdlet.MyInvocation.MyCommand) ====="
|
|
|
|
if(-not [string]::IsNullOrEmpty($Env:APPVEYOR_BUILD_FOLDER)) {
|
|
Write-Output "Too early to run via Appveyor - artifacts don't get generated properly. Exiting"
|
|
Exit
|
|
}
|
|
|
|
Write-Output "Solution Dir: '$($SolutionDir)'"
|
|
Write-Output "Target Dir: '$($TargetDir)'"
|
|
$ConfigurationName = $ConfigurationName.Trim()
|
|
Write-Output "Config Name (tirmmed): '$($ConfigurationName)'"
|
|
|
|
|
|
# Windows Sysinternals Sigcheck from http://technet.microsoft.com/en-us/sysinternals/bb897441
|
|
$SIGCHECK="$($SolutionDir)Tools\exes\sigcheck.exe"
|
|
$SEVENZIP="$($SolutionDir)Tools\7zip\7za.exe"
|
|
|
|
# Package Zip
|
|
if ($ConfigurationName -eq "Release Portable") {
|
|
Write-Output "Packaging Release Portable ZIP"
|
|
|
|
$version = & $SIGCHECK /accepteula -q -n "$($SolutionDir)mRemoteNG\bin\$($ConfigurationName)\mRemoteNG.exe"
|
|
|
|
Write-Output "Version is $($version)"
|
|
|
|
$PortableZip="$($SolutionDir)Release\mRemoteNG-Portable-$($version).zip"
|
|
|
|
$tempFolderPath = Join-Path -Path $SolutionDir -ChildPath "mRemoteNG\bin\package"
|
|
Remove-Item -Recurse $tempFolderPath -ErrorAction SilentlyContinue | Out-Null
|
|
New-Item $tempFolderPath -ItemType "directory" | Out-Null
|
|
|
|
Copy-Item "$($SolutionDir)mRemoteNG\Resources\PuTTYNG.exe" -Destination $tempFolderPath
|
|
|
|
#Write-Output "$($SolutionDir)mRemoteNG\bin\$ConfigurationName"
|
|
#Write-Output "$($SolutionDir)mRemoteNG\bin\package"
|
|
Copy-Item "$($SolutionDir)mRemoteNG\bin\$ConfigurationName\*" -Destination $tempFolderPath -Recurse -Force
|
|
# Delete any PDB files that accidentally get copied into the temp folder
|
|
Get-ChildItem -Path $tempFolderPath -Filter "*.pdb" | Remove-Item
|
|
Copy-Item "$($SolutionDir)*.txt" -Destination $tempFolderPath
|
|
|
|
Write-Output "Creating portable ZIP file $($PortableZip)"
|
|
Remove-Item -Force $PortableZip -ErrorAction SilentlyContinue
|
|
Compress-Archive (Join-Path -Path $tempFolderPath -ChildPath "*.*") $PortableZip
|
|
#& $SEVENZIP a -bt -mx=9 -tzip -y $PortableZip "$($SolutionDir)*.TXT"
|
|
}
|
|
else {
|
|
Write-Output "We will not zip anything - this isnt a portable release build."
|
|
}
|
|
|
|
Write-Output "" |