-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch release/v8.3.0 into master
- Loading branch information
Showing
5 changed files
with
185 additions
and
32 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
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
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,75 @@ | ||
param ( | ||
[System.Version]$Version = "0.0.0.0", | ||
[string]$Arch = "x64", | ||
[string]$CompanyName = "ONLYOFFICE", | ||
[string]$ProductName = "DocumentBuilder", | ||
[string]$SourceDir, | ||
[string]$BuildDir = "build", | ||
[switch]$Sign | ||
) | ||
$ErrorActionPreference = "Stop" | ||
|
||
Set-Location $PSScriptRoot | ||
|
||
if (-not $SourceDir) { | ||
$BuildPrefix = switch ($Arch) { | ||
"x64" { "win_64" } | ||
"x86" { "win_32" } | ||
} | ||
$SourceDir = "$PSScriptRoot\..\build_tools\out\" ` | ||
+ "$BuildPrefix\$CompanyName\$ProductName" | Resolve-Path | ||
} | ||
if (-not (Test-Path "$SourceDir")) { | ||
Write-Error "Path `"$SourceDir`" does not exist" | ||
} | ||
|
||
Write-Host @" | ||
Version $Version | ||
Arch $Arch | ||
CompanyName $CompanyName | ||
ProductName $ProductName | ||
SourceDir $SourceDir | ||
BuildDir $BuildDir | ||
Sign $Sign | ||
"@ | ||
|
||
#### | ||
|
||
Write-Host "`n[ Prepare build directory ]" | ||
|
||
if (Test-Path "$BuildDir") { | ||
Write-Host "REMOVE DIR: $BuildDir" | ||
Remove-Item -Force -Recurse -LiteralPath "$BuildDir" | ||
} | ||
|
||
Write-Host "CREATE DIR: $BuildDir" | ||
New-Item -ItemType Directory -Force -Path "$BuildDir" | Out-Null | ||
|
||
Write-Host "COPY: $SourceDir\* > $BuildDir\" | ||
Copy-Item -Force -Recurse ` | ||
-Path "$SourceDir\*" ` | ||
-Destination "$BuildDir\" | ||
|
||
#### | ||
|
||
Write-Host "`n[ Sign files ]" | ||
|
||
if ($Sign) { | ||
Set-Location "$BuildDir" | ||
|
||
$CertName = $(if ($env:WINDOWS_CERTIFICATE_NAME) { ` | ||
$env:WINDOWS_CERTIFICATE_NAME } else { "Ascensio System SIA" }) | ||
$TimestampServer = "http://timestamp.digicert.com" | ||
$SignFiles = Get-ChildItem *.exe, *.dll | Resolve-Path -Relative | ||
$SignFiles | ||
|
||
Write-Host "signtool sign /a /n $CertName /t $TimestampServer /v ..." | ||
& signtool sign /a /n $CertName /t $TimestampServer /v $SignFiles | ||
if (-not $?) { throw "Exited with code $LastExitCode" } | ||
|
||
Write-Host "signtool verify /q /pa /all ..." | ||
& signtool verify /q /pa /all $SignFiles | Out-Null | ||
if (-not $?) { throw "Exited with code $LastExitCode" } | ||
|
||
Set-Location $PSScriptRoot | ||
} |
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 |
---|---|---|
@@ -1,46 +1,62 @@ | ||
param ( | ||
param ( | ||
[System.Version]$Version = "0.0.0.0", | ||
[string]$Arch = "x64", | ||
[string]$Version = "1.0.0", | ||
[string]$Build = "1", | ||
[string]$CompanyName = "ONLYOFFICE", | ||
[string]$ProductName = "DocumentBuilder", | ||
[string]$BuildDir = "build", | ||
[string]$Branding, | ||
[switch]$Sign = $false, | ||
[string]$CertName = "Ascensio System SIA", | ||
[string]$TimestampServer = "http://timestamp.digicert.com" | ||
[switch]$Sign | ||
) | ||
|
||
$ErrorActionPreference = "Stop" | ||
|
||
Set-Location $PSScriptRoot | ||
|
||
# Check app directory | ||
if ( -Not (Test-Path -Path "build\app") ) { | ||
Write-Error "Path build\app does not exist" | ||
if ( -Not (Test-Path -Path "$BuildDir") ) { | ||
Write-Error "Path `"$BuildDir`" does not exist" | ||
} | ||
|
||
# ISCC path | ||
if ( $env:INNOPATH ) { | ||
Write-Host @" | ||
Version $Version | ||
Arch $Arch | ||
CompanyName $CompanyName | ||
ProductName $ProductName | ||
BuildDir $BuildDir | ||
Branding $Branding | ||
Sign $Sign | ||
"@ | ||
|
||
#### | ||
|
||
Write-Host "`n[ Get Inno Setup path ]" | ||
|
||
if ($env:INNOPATH) { | ||
$InnoPath = $env:INNOPATH | ||
} | ||
else | ||
{ | ||
$InnoPath = (Get-ItemProperty "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Inno Setup 6_is1")."Inno Setup: App Path" | ||
else { | ||
$RegPath = "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Inno Setup 6_is1" | ||
$InnoPath = (Get-ItemProperty $RegPath)."Inno Setup: App Path" | ||
} | ||
$InnoPath | ||
$env:Path = "$InnoPath;$env:Path" | ||
|
||
# ISCC args | ||
$InnoArgs = "/DAPP_DIR=..\build\app", | ||
"/DOUTPUT_DIR=..\build", | ||
"/DARCH=$Arch", | ||
"/DVERSION=$Version.$Build" | ||
if ( $Branding ) { | ||
#### | ||
|
||
Write-Host "`n[ Build Inno Setup project ]" | ||
|
||
$InnoArgs = "/DARCH=$Arch", | ||
"/DVERSION=$Version" | ||
if ($Branding) { | ||
$InnoArgs += "/DBRANDING_DIR=$Branding" | ||
} | ||
if ( $Sign ) { | ||
if ($Sign) { | ||
$CertName = $(if ($env:WINDOWS_CERTIFICATE_NAME) { ` | ||
$env:WINDOWS_CERTIFICATE_NAME } else { "Ascensio System SIA" }) | ||
$TimestampServer = "http://timestamp.digicert.com" | ||
$InnoArgs += "/DSIGN" | ||
$InnoArgs += "/Sbyparam=signtool.exe sign /a /v /n `$q$CertName`$q /t $TimestampServer `$f" | ||
$InnoArgs += "/Sbyparam=signtool sign /a /v /n `$q$CertName`$q /t $TimestampServer `$f" | ||
} | ||
|
||
# Build | ||
Write-Host "ISCC $InnoArgs exe\builder.iss" -ForegroundColor Yellow | ||
Write-Host "ISCC $InnoArgs exe\builder.iss" | ||
& ISCC $InnoArgs exe\builder.iss | ||
Exit $LastExitCode | ||
if (-not $?) { throw "Exited with code $LastExitCode" } |
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,41 @@ | ||
param ( | ||
[System.Version]$Version = "0.0.0.0", | ||
[string]$Arch = "x64", | ||
[string]$CompanyName = "ONLYOFFICE", | ||
[string]$ProductName = "DocumentBuilder", | ||
[string]$BuildDir = "build" | ||
) | ||
|
||
$ErrorActionPreference = "Stop" | ||
|
||
Set-Location $PSScriptRoot | ||
|
||
if (-not (Test-Path "$BuildDir")) { | ||
Write-Error "Path `"$BuildDir`" does not exist" | ||
} | ||
$ZipFile = "zip\$CompanyName-$ProductName-$Version-$Arch.zip" | ||
|
||
Write-Host @" | ||
Version = $Version | ||
Arch = $Arch | ||
CompanyName = $CompanyName | ||
ProductName = $ProductName | ||
BuildDir = $BuildDir | ||
ZipFile = $ZipFile | ||
"@ | ||
|
||
#### | ||
|
||
Write-Host "`n[ Create archive ]" | ||
|
||
if (Test-Path "$ZipFile") { | ||
Write-Host "DELETE: $ZipFile" | ||
Remove-Item -Force -LiteralPath "$ZipFile" | ||
} | ||
|
||
Write-Host "CREATE DIR: zip" | ||
New-Item -ItemType Directory -Force -Path "zip" | Out-Null | ||
|
||
Write-Host "7z a -y $ZipFile .\$BuildDir\*" | ||
& 7z a -y "$ZipFile" ".\$BuildDir\*" | ||
if (-not $?) { throw "Exited with code $LastExitCode" } |