Skip to content

Commit

Permalink
Fix bug 64472, fix bug 64509 (#991)
Browse files Browse the repository at this point in the history
- Include visual elements in zip update file
- Exclude vlc-cache-gen from zip update file
  • Loading branch information
heatray authored Oct 9, 2023
1 parent fe184ad commit 9c9e335
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 23 deletions.
5 changes: 2 additions & 3 deletions win-linux/package/windows/common.iss
Original file line number Diff line number Diff line change
Expand Up @@ -993,10 +993,9 @@ Source: {#sBrandingFolder}\win-linux\package\windows\data\VisualElementsManifest
Source: {#sBrandingFolder}\win-linux\package\windows\data\visual_elements_icon_150x150.png; DestDir: {app}\browser; MinVersion: 6.3;
Source: {#sBrandingFolder}\win-linux\package\windows\data\visual_elements_icon_71x71.png; DestDir: {app}\browser; MinVersion: 6.3;

#if defined(_WIN_XP) + defined(EMBED_HELP)
Source: {#DEPLOY_PATH}\*; DestDir: {app}; Flags: recursesubdirs;
#else
Source: {#DEPLOY_PATH}\*; DestDir: {app}; Excludes: "editors\web-apps\apps\*\main\resources\help"; Flags: recursesubdirs;
#if defined(_WIN_XP) | defined(EMBED_HELP)
Source: "{#DEPLOY_PATH}-Help\*"; DestDir: {app}; Flags: recursesubdirs;
#endif
Source: {#DEPLOY_PATH}\*.exe; DestDir: {app}; Flags: signonce;
Source: {#DEPLOY_PATH}\*.dll; DestDir: {app}; Flags: signonce;
Expand Down
74 changes: 54 additions & 20 deletions win-linux/package/windows/make_zip.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ param (
[string]$BuildDir = "build",
[string]$DesktopDir = "DesktopEditors",
[string]$MultimediaDir,
[string]$BrandingDir = ".",
[switch]$ExcludeHelp,
[switch]$Sign,
[string]$CertName = "Ascensio System SIA",
Expand All @@ -19,16 +20,36 @@ $Suffix = switch ( $Target )
"windows_x64_xp" { "x64-xp" }
"windows_x86_xp" { "x86-xp" }
}
$DesktopHelpDir = "$DesktopDir-Help"

# Check directory
if ( -Not (Test-Path -Path $BuildDir) ) {
if ( -Not (Test-Path $BuildDir) ) {
Write-Error "Path $BuildDir does not exist"
}

if ( $Sign ) {
if ( $DesktopDir ) {
Set-Location "$BuildDir\$DesktopDir"
# Copy VisualElements
Write-Host "Copy: $BrandingDir\data\VisualElementsManifest.xml > $BuildDir\$DesktopDir\DesktopEditors.VisualElementsManifest.xml" -ForegroundColor Yellow
Copy-Item -Path "$BrandingDir\data\VisualElementsManifest.xml" `
-Destination "$BuildDir\$DesktopDir\DesktopEditors.VisualElementsManifest.xml" `
-Force
Write-Host "Copy: $BrandingDir\data\visual_elements_icon_* > $BuildDir\$DesktopDir\browser" -ForegroundColor Yellow
New-Item "$BuildDir\$DesktopDir\browser" -ItemType Directory -Force | Out-Null
Copy-Item -Path "$BrandingDir\data\visual_elements_icon_*" `
-Destination "$BuildDir\$DesktopDir\browser" -Force

# Move Help
Get-ChildItem "$BuildDir\$DesktopDir\editors\web-apps\apps\*\main\resources\help" -Directory `
| ForEach-Object {
$src = Resolve-Path -Relative $_.FullName
$dst = $src -replace "$DesktopDir", "$DesktopHelpDir"
Write-Host "Move: $src > $dst" -ForegroundColor Yellow
New-Item $dst -ItemType Directory -Force | Out-Null
Move-Item -Path $src -Destination $dst -Force
}

if ( $DesktopDir ) {
Set-Location "$BuildDir\$DesktopDir"
if ( $Sign ) {
$SignFiles = Get-ChildItem `
*.exe, *.dll, converter\*.exe, converter\*.dll, plugins\*\*.dll `
| Resolve-Path -Relative
Expand All @@ -40,13 +61,21 @@ if ( $Sign ) {
Write-Host "signtool verify /pa /all $SignFiles" -ForegroundColor Yellow
& signtool verify /pa /all $SignFiles
if ( $LastExitCode -ne 0 ) { throw }

Set-Location $PSScriptRoot
# VLC plugin cache
Write-Host ".\vlc-cache-gen $PWD\plugins" -ForegroundColor Yellow
& .\vlc-cache-gen "$PWD\plugins"
if ( $LastExitCode -ne 0 ) { throw }
}
if ( Test-Path "vlc-cache-gen.exe" ) {
Write-Host "Delete: vlc-cache-gen.exe" -ForegroundColor Yellow
Remove-Item "vlc-cache-gen.exe" -Force
}
Set-Location $PSScriptRoot
}

if ( $MultimediaDir ) {
Set-Location "$BuildDir\$MultimediaDir"

if ( $MultimediaDir ) {
Set-Location "$BuildDir\$MultimediaDir"
if ( $Sign ) {
$SignFiles = Get-ChildItem *.exe, *.dll, plugins\*\*.dll `
| Resolve-Path -Relative
# Sign
Expand All @@ -57,23 +86,28 @@ if ( $Sign ) {
Write-Host "signtool verify /pa /all $SignFiles" -ForegroundColor Yellow
& signtool verify /pa /all $SignFiles
if ( $LastExitCode -ne 0 ) { throw }

Set-Location $PSScriptRoot
# VLC plugin cache
Write-Host ".\vlc-cache-gen $PWD\plugins" -ForegroundColor Yellow
& .\vlc-cache-gen "$PWD\plugins"
if ( $LastExitCode -ne 0 ) { throw }
}
if ( Test-Path "vlc-cache-gen.exe" ) {
Write-Host "Delete: vlc-cache-gen.exe" -ForegroundColor Yellow
Remove-Item "vlc-cache-gen.exe" -Force
}
Set-Location $PSScriptRoot
}

# Create archive

# Create archives
$OutFile = "$Env:COMPANY_NAME-$DesktopDir-$Env:PRODUCT_VERSION.$Env:BUILD_NUMBER-$Suffix.zip"
Write-Host "7z a -y $OutFile .\$BuildDir\$DesktopDir\*" -ForegroundColor Yellow
& 7z a -y $OutFile .\$BuildDir\$DesktopDir\*
if ( $LastExitCode -ne 0 ) { throw }
if ( !$ExcludeHelp ) {
Write-Host "7z a -y $OutFile .\$BuildDir\$DesktopDir\* -xr!vlc-cache-gen.exe" -ForegroundColor Yellow
& 7z a -y $OutFile .\$BuildDir\$DesktopDir\* -xr!"vlc-cache-gen.exe"
} else {
Write-Host "7z a -y $OutFile .\$BuildDir\$DesktopDir\* -xr!editors\web-apps\apps\*\main\resources\help -xr!vlc-cache-gen.exe" -ForegroundColor Yellow
& 7z a -y $OutFile .\$BuildDir\$DesktopDir\* -xr!editors\web-apps\apps\*\main\resources\help -xr!"vlc-cache-gen.exe"
Write-Host "7z a -y $OutFile .\$BuildDir\$DesktopHelpDir\*" -ForegroundColor Yellow
& 7z a -y $OutFile .\$BuildDir\$DesktopHelpDir\*
if ( $LastExitCode -ne 0 ) { throw }
}
if ( $LastExitCode -ne 0 ) { throw }

if ( $MultimediaDir ) {
$OutFile = "$Env:COMPANY_NAME-$MultimediaDir-$Env:PRODUCT_VERSION.$Env:BUILD_NUMBER-$Suffix.zip"
Write-Host "7z a -y $OutFile .\$BuildDir\$MultimediaDir\*" -ForegroundColor Yellow
Expand Down

0 comments on commit 9c9e335

Please sign in to comment.