Refactoring windows packages build (#1252)

This commit is contained in:
Semyon Bezrukov
2024-06-14 17:15:26 +03:00
committed by GitHub
parent e315df6c4a
commit 27b4a95cd0
10 changed files with 503 additions and 441 deletions

View File

@ -1,18 +0,0 @@
$PackageName = "ONLYOFFICE Desktop Editors"
$DesktopDir = "DesktopEditors"
Function BrandingAdvInstConfig {
return `
"DelFolder CUSTOM_PATH", `
"SetProductCode -langid 1029 -guid $ProductCode", `
"SetProductCode -langid 1031 -guid $ProductCode", `
"SetProductCode -langid 1033 -guid $ProductCode", `
"SetProductCode -langid 1036 -guid $ProductCode", `
"SetProductCode -langid 1041 -guid $ProductCode", `
"SetProductCode -langid 1046 -guid $ProductCode", `
"SetProductCode -langid 1049 -guid $ProductCode", `
"SetProductCode -langid 1060 -guid $ProductCode", `
"SetProductCode -langid 2070 -guid $ProductCode", `
"SetProductCode -langid 3082 -guid $ProductCode", `
"SetProperty FORMS=1"
}

View File

@ -1,42 +1,35 @@
; -- Installer Common --
#if str(_ARCH) == "64"
#define sWinArch "x64"
#define sPlatform "win_64"
#elif str(_ARCH) == "32"
#define sWinArch "x86"
#define sPlatform "win_32"
#ifndef BRANDING_DIR
#define BRANDING_DIR '.'
#endif
#include BRANDING_DIR + '\defines.iss'
#ifndef VERSION
#define VERSION '0.0.0.0'
#endif
#define sAppVerShort Copy(VERSION,1,RPos('.',VERSION)-1)
#ifndef ARCH
#define ARCH 'x64'
#endif
#ifndef BUILD_DIR
#define BUILD_DIR '.\build.' + ARCH
#endif
#ifdef PACKAGE_EDITION
#define sPackageName sPackageName + '-' + PACKAGE_EDITION
#endif
#ifndef OUTPUT_DIR
#define OUTPUT_DIR '.'
#endif
#ifndef OUTPUT_FILE
#define OUTPUT_FILE sPackageName + '-' + VERSION + '-' + ARCH
#ifdef _WIN_XP
#define OUTPUT_FILE OUTPUT_FILE + '-xp'
#endif
#ifndef _WIN_XP
#define sWinArchFull sWinArch
#define sPlatformFull sPlatform
#else
#define sWinArchFull sWinArch + "-xp"
#define sPlatformFull sPlatform + "-xp"
#endif
#ifndef sBrandingFolder
#define sBrandingFolder "..\..\.."
#endif
#include sBrandingFolder + "\win-linux\package\windows\defines.iss"
#ifndef sAppVersion
#define sAppVersion GetFileVersion(AddBackslash(DEPLOY_PATH) + NAME_EXE_OUT)
#endif
#define sAppVerShort Copy(sAppVersion, 0, 3)
#ifdef sPackageEdition
#define sPackageName sPackageName + "-" + sPackageEdition
#endif
#ifndef sOutputFileName
#define sOutputFileName sPackageName + "-" + sAppVersion + "-" + sWinArchFull
#endif
#define sBrandingFile sBrandingFolder + "\win-linux\package\windows\branding.iss"
#if FileExists(sBrandingFile)
#include sBrandingFile
#if FileExists(BRANDING_DIR + '\branding.iss')
#include BRANDING_DIR + '\branding.iss'
#endif
#define sUpgradeCode "607FEE744E0B34C449B45E9F419BB297"
@ -52,8 +45,8 @@
[Setup]
AppName ={#sAppName}
AppVerName ={#sAppName} {#sAppVerShort}
AppVersion ={#sAppVersion}
VersionInfoVersion ={#sAppVersion}
AppVersion ={#VERSION}
VersionInfoVersion ={#VERSION}
AppPublisher = {#sAppPublisher}
AppPublisherURL = {#sAppPublisherURL}
@ -73,14 +66,14 @@ DisableDirPage = auto
AllowNoIcons = yes
AlwaysShowDirOnReadyPage = yes
UninstallDisplayIcon = {app}\app.ico
UninstallDisplayName = {#sAppName} {#sAppVerShort} ({#sWinArch})
OutputDir =.\
UninstallDisplayName = {#sAppName} {#sAppVerShort} ({#ARCH})
OutputDir ={#OUTPUT_DIR}
PrivilegesRequired =admin
AppMutex ={code:getAppMutex}
ChangesEnvironment =yes
SetupMutex =ASC
#if str(_ARCH) == "64"
#if str(ARCH) == "x64"
#if Int(DecodeVer(PREPROCVER,1)) >= 6
ArchitecturesAllowed = x64 arm64
ArchitecturesInstallIn64BitMode = x64 arm64
@ -96,76 +89,77 @@ MinVersion = 6.1
MinVersion = 5.0
OnlyBelowVersion = 6.1
#endif
OutputBaseFileName = {#sOutputFileName}
OutputBaseFileName ={#OUTPUT_FILE}
#ifdef ENABLE_SIGNING
#ifdef SIGN
SignTool =byparam $p
#endif
SetupIconFile = {#sBrandingFolder}\win-linux\extras\projicons\res\icons\desktopeditors.ico
WizardImageFile = {#sBrandingFolder}\win-linux\package\windows\data\dialogpicture*.bmp
WizardSmallImageFile = {#sBrandingFolder}\win-linux\package\windows\data\dialogicon*.bmp
SetupIconFile={#BRANDING_DIR}\..\..\extras\projicons\res\icons\desktopeditors.ico
WizardImageFile={#BRANDING_DIR}\data\dialogpicture*.bmp
WizardSmallImageFile={#BRANDING_DIR}\data\dialogicon*.bmp
SolidCompression=yes
Compression=lzma2/ultra64
LZMAUseSeparateProcess=yes
[Languages]
#define sLicenseFile BRANDING_DIR + "\..\..\..\common\package\license\" + LIC_FILE + ".rtf"
#ifdef _ONLYOFFICE
Name: en; MessagesFile: compiler:Default.isl; LicenseFile: {#sBrandingFolder}\common\package\license\{#LIC_FILE}.rtf;
Name: ru; MessagesFile: compiler:Languages\Russian.isl; LicenseFile: {#sBrandingFolder}\common\package\license\{#LIC_FILE}.rtf;
Name: en; MessagesFile: compiler:Default.isl; LicenseFile: {#sLicenseFile};
Name: ru; MessagesFile: compiler:Languages\Russian.isl; LicenseFile: {#sLicenseFile};
#else
Name: ru; MessagesFile: compiler:Languages\Russian.isl; LicenseFile: {#sBrandingFolder}\common\package\license\{#LIC_FILE}.rtf;
Name: en; MessagesFile: compiler:Default.isl; LicenseFile: {#sBrandingFolder}\common\package\license\{#LIC_FILE}.rtf;
Name: ru; MessagesFile: compiler:Languages\Russian.isl; LicenseFile: {#sLicenseFile};
Name: en; MessagesFile: compiler:Default.isl; LicenseFile: {#sLicenseFile};
#endif
Name: bg; MessagesFile: compiler:Languages\Bulgarian.isl; LicenseFile: {#sBrandingFolder}\common\package\license\{#LIC_FILE}.rtf;
Name: ca; MessagesFile: compiler:Languages\Catalan.isl; LicenseFile: {#sBrandingFolder}\common\package\license\{#LIC_FILE}.rtf;
Name: cs; MessagesFile: compiler:Languages\Czech.isl; LicenseFile: {#sBrandingFolder}\common\package\license\{#LIC_FILE}.rtf;
Name: el; MessagesFile: compiler:Languages\Greek.isl; LicenseFile: {#sBrandingFolder}\common\package\license\{#LIC_FILE}.rtf;
;Name: et; MessagesFile: compiler:Languages\Estonian.isl; LicenseFile: {#sBrandingFolder}\common\package\license\{#LIC_FILE}.rtf;
Name: fi; MessagesFile: compiler:Languages\Finnish.isl; LicenseFile: {#sBrandingFolder}\common\package\license\{#LIC_FILE}.rtf;
;Name: lt; MessagesFile: compiler:Languages\Lithuanian.isl; LicenseFile: {#sBrandingFolder}\common\package\license\{#LIC_FILE}.rtf;
Name: lo; MessagesFile: compiler:Default.isl; LicenseFile: {#sBrandingFolder}\common\package\license\{#LIC_FILE}.rtf;
Name: nl; MessagesFile: compiler:Languages\Dutch.isl; LicenseFile: {#sBrandingFolder}\common\package\license\{#LIC_FILE}.rtf;
Name: de; MessagesFile: compiler:Languages\German.isl; LicenseFile: {#sBrandingFolder}\common\package\license\{#LIC_FILE}.rtf;
Name: fr; MessagesFile: compiler:Languages\French.isl; LicenseFile: {#sBrandingFolder}\common\package\license\{#LIC_FILE}.rtf;
Name: es; MessagesFile: compiler:Languages\Spanish.isl; LicenseFile: {#sBrandingFolder}\common\package\license\{#LIC_FILE}.rtf;
Name: pt_BR; MessagesFile: compiler:Languages\BrazilianPortuguese.isl; LicenseFile: {#sBrandingFolder}\common\package\license\{#LIC_FILE}.rtf;
Name: pt_PT; MessagesFile: compiler:Languages\Portuguese.isl; LicenseFile: {#sBrandingFolder}\common\package\license\{#LIC_FILE}.rtf;
Name: id; MessagesFile: compiler:Languages\Indonesian.isl; LicenseFile: {#sBrandingFolder}\common\package\license\{#LIC_FILE}.rtf;
Name: it_IT; MessagesFile: compiler:Languages\Italian.isl; LicenseFile: {#sBrandingFolder}\common\package\license\{#LIC_FILE}.rtf;
Name: pl; MessagesFile: compiler:Languages\Polish.isl; LicenseFile: {#sBrandingFolder}\common\package\license\{#LIC_FILE}.rtf;
Name: ro; MessagesFile: compiler:Languages\Romanian.isl; LicenseFile: {#sBrandingFolder}\common\package\license\{#LIC_FILE}.rtf;
Name: sk; MessagesFile: compiler:Languages\Slovak.isl; LicenseFile: {#sBrandingFolder}\common\package\license\{#LIC_FILE}.rtf;
Name: sl; MessagesFile: compiler:Languages\Slovenian.isl; LicenseFile: {#sBrandingFolder}\common\package\license\{#LIC_FILE}.rtf;
Name: sv; MessagesFile: compiler:Languages\Swedish.isl; LicenseFile: {#sBrandingFolder}\common\package\license\{#LIC_FILE}.rtf;
Name: tr; MessagesFile: compiler:Languages\Turkish.isl; LicenseFile: {#sBrandingFolder}\common\package\license\{#LIC_FILE}.rtf;
Name: bg; MessagesFile: compiler:Languages\Bulgarian.isl; LicenseFile: {#sLicenseFile};
Name: ca; MessagesFile: compiler:Languages\Catalan.isl; LicenseFile: {#sLicenseFile};
Name: cs; MessagesFile: compiler:Languages\Czech.isl; LicenseFile: {#sLicenseFile};
Name: el; MessagesFile: compiler:Languages\Greek.isl; LicenseFile: {#sLicenseFile};
;Name: et; MessagesFile: compiler:Languages\Estonian.isl; LicenseFile: {#sLicenseFile};
Name: fi; MessagesFile: compiler:Languages\Finnish.isl; LicenseFile: {#sLicenseFile};
;Name: lt; MessagesFile: compiler:Languages\Lithuanian.isl; LicenseFile: {#sLicenseFile};
Name: lo; MessagesFile: compiler:Default.isl; LicenseFile: {#sLicenseFile};
Name: nl; MessagesFile: compiler:Languages\Dutch.isl; LicenseFile: {#sLicenseFile};
Name: de; MessagesFile: compiler:Languages\German.isl; LicenseFile: {#sLicenseFile};
Name: fr; MessagesFile: compiler:Languages\French.isl; LicenseFile: {#sLicenseFile};
Name: es; MessagesFile: compiler:Languages\Spanish.isl; LicenseFile: {#sLicenseFile};
Name: pt_BR; MessagesFile: compiler:Languages\BrazilianPortuguese.isl; LicenseFile: {#sLicenseFile};
Name: pt_PT; MessagesFile: compiler:Languages\Portuguese.isl; LicenseFile: {#sLicenseFile};
Name: id; MessagesFile: compiler:Languages\Indonesian.isl; LicenseFile: {#sLicenseFile};
Name: it_IT; MessagesFile: compiler:Languages\Italian.isl; LicenseFile: {#sLicenseFile};
Name: pl; MessagesFile: compiler:Languages\Polish.isl; LicenseFile: {#sLicenseFile};
Name: ro; MessagesFile: compiler:Languages\Romanian.isl; LicenseFile: {#sLicenseFile};
Name: sk; MessagesFile: compiler:Languages\Slovak.isl; LicenseFile: {#sLicenseFile};
Name: sl; MessagesFile: compiler:Languages\Slovenian.isl; LicenseFile: {#sLicenseFile};
Name: sv; MessagesFile: compiler:Languages\Swedish.isl; LicenseFile: {#sLicenseFile};
Name: tr; MessagesFile: compiler:Languages\Turkish.isl; LicenseFile: {#sLicenseFile};
#if Int(DecodeVer(PREPROCVER,1)) < 6
Name: vi; MessagesFile: compiler:Languages\Vietnamese.islu; LicenseFile: {#sBrandingFolder}\common\package\license\{#LIC_FILE}.rtf;
Name: hy_AM; MessagesFile: compiler:Languages\Armenian.islu; LicenseFile: {#sBrandingFolder}\common\package\license\{#LIC_FILE}.rtf;
Name: vi; MessagesFile: compiler:Languages\Vietnamese.islu; LicenseFile: {#sLicenseFile};
Name: hy_AM; MessagesFile: compiler:Languages\Armenian.islu; LicenseFile: {#sLicenseFile};
#else
Name: vi; MessagesFile: compiler:Languages\Vietnamese.isl; LicenseFile: {#sBrandingFolder}\common\package\license\{#LIC_FILE}.rtf;
Name: hy_AM; MessagesFile: compiler:Languages\Armenian.isl; LicenseFile: {#sBrandingFolder}\common\package\license\{#LIC_FILE}.rtf;
Name: vi; MessagesFile: compiler:Languages\Vietnamese.isl; LicenseFile: {#sLicenseFile};
Name: hy_AM; MessagesFile: compiler:Languages\Armenian.isl; LicenseFile: {#sLicenseFile};
#endif
Name: zh_CN; MessagesFile: compiler:Languages\ChineseSimplified.isl; LicenseFile: {#sBrandingFolder}\common\package\license\{#LIC_FILE}.rtf;
;Name: hy_AM; MessagesFile: compiler:Languages\Armenian.islu; LicenseFile: {#sBrandingFolder}\common\package\license\{#LIC_FILE}.rtf;
;Name: hr; MessagesFile: compiler:Languages\Croatian.isl; LicenseFile: {#sBrandingFolder}\common\package\license\{#LIC_FILE}.rtf;
Name: da; MessagesFile: compiler:Languages\Danish.isl; LicenseFile: {#sBrandingFolder}\common\package\license\{#LIC_FILE}.rtf;
;Name: hi; MessagesFile: compiler:Languages\Hindi.islu; LicenseFile: {#sBrandingFolder}\common\package\license\{#LIC_FILE}.rtf;
Name: hu; MessagesFile: compiler:Languages\Hungarian.isl; LicenseFile: {#sBrandingFolder}\common\package\license\{#LIC_FILE}.rtf;
;Name: ga_IE; MessagesFile: compiler:Default.isl; LicenseFile: {#sBrandingFolder}\common\package\license\{#LIC_FILE}.rtf;
Name: ja; MessagesFile: compiler:Languages\Japanese.isl; LicenseFile: {#sBrandingFolder}\common\package\license\{#LIC_FILE}.rtf;
Name: ko; MessagesFile: compiler:Languages\Korean.isl; LicenseFile: {#sBrandingFolder}\common\package\license\{#LIC_FILE}.rtf;
Name: lv; MessagesFile: compiler:Languages\Latvian.isl; LicenseFile: {#sBrandingFolder}\common\package\license\{#LIC_FILE}.rtf;
Name: no; MessagesFile: compiler:Languages\Norwegian.isl; LicenseFile: {#sBrandingFolder}\common\package\license\{#LIC_FILE}.rtf;
Name: uk; MessagesFile: compiler:Languages\Ukrainian.isl; LicenseFile: {#sBrandingFolder}\common\package\license\{#LIC_FILE}.rtf;
Name: be; MessagesFile: compiler:Languages\Belarusian.isl; LicenseFile: {#sBrandingFolder}\common\package\license\{#LIC_FILE}.rtf;
Name: gl; MessagesFile: compiler:Languages\Galician.isl; LicenseFile: {#sBrandingFolder}\common\package\license\{#LIC_FILE}.rtf;
Name: si; MessagesFile: compiler:Languages\Sinhala.islu; LicenseFile: {#sBrandingFolder}\common\package\license\{#LIC_FILE}.rtf;
Name: zh_TW; MessagesFile: compiler:Languages\ChineseTraditional.isl; LicenseFile: {#sBrandingFolder}\common\package\license\{#LIC_FILE}.rtf;
Name: ar_SA; MessagesFile: compiler:Languages\Arabic.isl; LicenseFile: {#sBrandingFolder}\common\package\license\{#LIC_FILE}.rtf;
Name: sr_Latn_RS; MessagesFile: compiler:Languages\SerbianLatin.isl; LicenseFile: {#sBrandingFolder}\common\package\license\{#LIC_FILE}.rtf;
Name: sr_Cyrl_RS; MessagesFile: compiler:Languages\SerbianCyrillic.isl; LicenseFile: {#sBrandingFolder}\common\package\license\{#LIC_FILE}.rtf;
Name: zh_CN; MessagesFile: compiler:Languages\ChineseSimplified.isl; LicenseFile: {#sLicenseFile};
;Name: hy_AM; MessagesFile: compiler:Languages\Armenian.islu; LicenseFile: {#sLicenseFile};
;Name: hr; MessagesFile: compiler:Languages\Croatian.isl; LicenseFile: {#sLicenseFile};
Name: da; MessagesFile: compiler:Languages\Danish.isl; LicenseFile: {#sLicenseFile};
;Name: hi; MessagesFile: compiler:Languages\Hindi.islu; LicenseFile: {#sLicenseFile};
Name: hu; MessagesFile: compiler:Languages\Hungarian.isl; LicenseFile: {#sLicenseFile};
;Name: ga_IE; MessagesFile: compiler:Default.isl; LicenseFile: {#sLicenseFile};
Name: ja; MessagesFile: compiler:Languages\Japanese.isl; LicenseFile: {#sLicenseFile};
Name: ko; MessagesFile: compiler:Languages\Korean.isl; LicenseFile: {#sLicenseFile};
Name: lv; MessagesFile: compiler:Languages\Latvian.isl; LicenseFile: {#sLicenseFile};
Name: no; MessagesFile: compiler:Languages\Norwegian.isl; LicenseFile: {#sLicenseFile};
Name: uk; MessagesFile: compiler:Languages\Ukrainian.isl; LicenseFile: {#sLicenseFile};
Name: be; MessagesFile: compiler:Languages\Belarusian.isl; LicenseFile: {#sLicenseFile};
Name: gl; MessagesFile: compiler:Languages\Galician.isl; LicenseFile: {#sLicenseFile};
Name: si; MessagesFile: compiler:Languages\Sinhala.islu; LicenseFile: {#sLicenseFile};
Name: zh_TW; MessagesFile: compiler:Languages\ChineseTraditional.isl; LicenseFile: {#sLicenseFile};
Name: ar_SA; MessagesFile: compiler:Languages\Arabic.isl; LicenseFile: {#sLicenseFile};
Name: sr_Latn_RS; MessagesFile: compiler:Languages\SerbianLatin.isl; LicenseFile: {#sLicenseFile};
Name: sr_Cyrl_RS; MessagesFile: compiler:Languages\SerbianCyrillic.isl; LicenseFile: {#sLicenseFile};
[LangOptions]
lo.LanguageName=ພາສາລາວ
@ -1032,27 +1026,27 @@ Name: {commonappdata}\{#APP_PATH}\webdata\cloud; Flags: uninsalwaysuninstall;
[Files]
#ifndef _WIN_XP
Source: data\vcredist_{#sWinArch}.exe; DestDir: {app}; Flags: deleteafterinstall; \
AfterInstall: installVCRedist(ExpandConstant('{app}\vcredist_{#sWinArch}.exe'), ExpandConstant('{cm:InstallAdditionalComponents}')); \
Source: "data\vcredist_{#ARCH}.exe"; DestDir: {app}; Flags: deleteafterinstall; \
AfterInstall: installVCRedist(ExpandConstant('{app}\vcredist_{#ARCH}.exe'), ExpandConstant('{cm:InstallAdditionalComponents}')); \
Check: not checkVCRedist2022;
#else
Source: data\vcredist_{#sWinArch}.exe; DestDir: {app}; Flags: deleteafterinstall; \
AfterInstall: installVCRedist(ExpandConstant('{app}\vcredist_{#sWinArch}.exe'), ExpandConstant('{cm:InstallAdditionalComponents}')); \
Source: "data\vcredist_{#ARCH}.exe"; DestDir: {app}; Flags: deleteafterinstall; \
AfterInstall: installVCRedist(ExpandConstant('{app}\vcredist_{#ARCH}.exe'), ExpandConstant('{cm:InstallAdditionalComponents}')); \
Check: not checkVCRedist2019;
#endif
Source: {#sBrandingFolder}\win-linux\package\windows\data\VisualElementsManifest.xml; DestDir: {app}; DestName: {#VISEFFECTS_MANIFEST_NAME}; MinVersion: 6.3;
Source: {#sBrandingFolder}\win-linux\package\windows\data\visual_elements_icon_*; DestDir: {app}\browser; MinVersion: 6.3;
Source: "{#BRANDING_DIR}\data\VisualElementsManifest.xml"; DestDir: {app}; DestName: {#VISEFFECTS_MANIFEST_NAME}; MinVersion: 6.3;
Source: "{#BRANDING_DIR}\data\visual_elements_icon_*"; DestDir: {app}\browser; MinVersion: 6.3;
Source: {#DEPLOY_PATH}\*; DestDir: {app}; Flags: recursesubdirs;
Source: "{#BUILD_DIR}\desktop\*"; DestDir: {app}; Flags: recursesubdirs;
#if defined(_WIN_XP) | defined(EMBED_HELP)
Source: "{#DEPLOY_PATH}-Help\*"; DestDir: {app}; Flags: recursesubdirs;
Source: "{#BUILD_DIR}\help\*"; DestDir: {app}; Flags: recursesubdirs;
#endif
Source: {#DEPLOY_PATH}\*.exe; DestDir: {app}; Flags: signonce;
Source: {#DEPLOY_PATH}\*.dll; DestDir: {app}; Flags: signonce;
Source: {#DEPLOY_PATH}\converter\*.exe; DestDir: {app}\converter; Flags: signonce;
Source: {#DEPLOY_PATH}\converter\*.dll; DestDir: {app}\converter; Flags: signonce;
Source: ..\..\..\common\converter\package.config; DestDir: {app}\converter;
Source: "{#BUILD_DIR}\desktop\*.exe"; DestDir: {app}; Flags: signonce;
Source: "{#BUILD_DIR}\desktop\*.dll"; DestDir: {app}; Flags: signonce;
Source: "{#BUILD_DIR}\desktop\converter\*.exe"; DestDir: {app}\converter; Flags: signonce;
Source: "{#BUILD_DIR}\desktop\converter\*.dll"; DestDir: {app}\converter; Flags: signonce;
Source: "..\..\..\common\converter\package.config"; DestDir: {app}\converter;
[InstallDelete]
Type: filesandordirs; Name: {app}\editors\sdkjs-plugins

View File

@ -16,15 +16,11 @@
#define APP_PATH str(sIntCompanyName + "\" + sIntProductName)
#define UPD_PATH str(sIntProductName + "Updates")
#define APP_REG_PATH str("Software\" + APP_PATH)
#ifndef DEPLOY_PATH
#define DEPLOY_PATH str("..\..\..\..\build_tools\out\" + sPlatformFull + "\" + APP_PATH)
#endif
#define APP_USER_MODEL_ID "ASC.Documents.5"
#define APP_MUTEX_NAME "TEAMLAB"
#define APPWND_CLASS_NAME "DocEditorsWindowClass"
#define iconsExe "DesktopEditors.exe"
#define NAME_EXE_IN str("DesktopEditors_" + sWinArch + ".exe")
#define NAME_EXE_OUT "editors.exe"
#define VISEFFECTS_MANIFEST_NAME ChangeFileExt(iconsExe, "VisualElementsManifest.xml")
#define LIC_FILE "agpl-3.0"

View File

@ -0,0 +1,132 @@
param (
[System.Version]$Version = "0.0.0.0",
[string]$Arch = "x64",
[string]$Target,
[string]$CompanyName = "ONLYOFFICE",
[string]$ProductName = "DesktopEditors",
[string]$SourceDir,
[string]$BuildDir,
[switch]$Sign,
[string]$CertName = "Ascensio System SIA",
[string]$TimestampServer = "http://timestamp.digicert.com"
)
$ErrorActionPreference = "Stop"
Set-Location $PSScriptRoot
if (-not $SourceDir) {
$BuildPrefix = switch ($Arch) {
"x64" { "win_64" }
"x86" { "win_32" }
}
if ($Target -eq "xp") {
$BuildPrefix += "_xp"
}
$SourceDir = "$PSScriptRoot\..\..\..\..\build_tools\out\" `
+ "$BuildPrefix\$CompanyName\$ProductName" | Resolve-Path
}
if (-not (Test-Path "$SourceDir")) {
Write-Error "Path `"$SourceDir`" does not exist"
}
if (-not $BuildDir) {
$BuildDir = ".build.$Arch"
}
Write-Host @"
Version = $Version
Arch = $Arch
Target = $Target
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\desktop"
New-Item -ItemType Directory -Force -Path "$BuildDir\desktop" | Out-Null
Write-Host "CREATE DIR: $BuildDir\help"
New-Item -ItemType Directory -Force -Path "$BuildDir\help" | Out-Null
Write-Host "COPY: $SourceDir\* > $BuildDir\desktop\"
Copy-Item -Force -Recurse `
-Path "$SourceDir\*" `
-Destination "$BuildDir\desktop\"
Write-Host "MOVE: $BuildDir\desktop\editors\web-apps\apps\*\main\resources\help\* > $BuildDir\help\"
Get-ChildItem -Directory `
-Path "$BuildDir\desktop\editors\web-apps\apps\*\main\resources\help" `
| ForEach-Object {
$src = $_.FullName | Resolve-Path -Relative
$dst = $src.Replace("$BuildDir\desktop", "$BuildDir\help")
Write-Host "MOVE: $src > $dst"
New-Item -ItemType Directory -Force -Path "$dst\.." | Out-Null
Move-Item -Path "$src" -Destination "$dst"
}
# "$BuildDir\desktop: {0:0.00} MB" -f ((Get-ChildItem -Recurse `
# -Path "$BuildDir\desktop" | Measure-Object -Property Length -Sum).Sum / 1MB)
# "$BuildDir\help: {0:0.00} MB" -f ((Get-ChildItem -Recurse `
# -Path "$BuildDir\help" | Measure-Object -Property Length -Sum).Sum / 1MB)
####
Write-Host "`n[ Add visual elements ]"
Write-Host "COPY: data\VisualElementsManifest.xml > $BuildDir\desktop\DesktopEditors.VisualElementsManifest.xml"
Copy-Item -Force `
-Path "data\VisualElementsManifest.xml" `
-Destination "$BuildDir\desktop\DesktopEditors.VisualElementsManifest.xml"
Write-Host "CREATE DIR: $BuildDir\desktop\browser"
New-Item -ItemType Directory -Force -Path "$BuildDir\desktop\browser" | Out-Null
Write-Host "COPY: data\visual_elements_icon_* > $BuildDir\desktop\browser"
Copy-Item -Force `
-Path "data\visual_elements_icon_*" `
-Destination "$BuildDir\desktop\browser"
####
Write-Host "`n[ Sign files ]"
if ($Sign) {
Set-Location "$BuildDir\desktop"
$SignFiles = Get-ChildItem `
*.exe, *.dll, converter\*.exe, converter\*.dll, plugins\*\*.dll `
| Resolve-Path -Relative
# Sign
Write-Host "signtool sign /a /n $CertName /t $TimestampServer ..."
& signtool sign /a /n $CertName /t $TimestampServer /v $SignFiles
if ($LastExitCode -ne 0) { throw }
# Verify
Write-Host "signtool verify /q /pa /all ..."
& signtool verify /q /pa /all $SignFiles | Out-Null
if ($LastExitCode -ne 0) { throw }
# VLC plugin cache
Write-Host ".\vlc-cache-gen $PWD\plugins"
& .\vlc-cache-gen "$PWD\plugins"
if ($LastExitCode -ne 0) { throw }
Set-Location $PSScriptRoot
}
if (Test-Path "$BuildDir\desktop\vlc-cache-gen.exe") {
Write-Host "DELETE: $BuildDir\desktop\vlc-cache-gen.exe"
Remove-Item -Force -LiteralPath "$BuildDir\desktop\vlc-cache-gen.exe"
}

View File

@ -1,8 +1,9 @@
param (
param (
[System.Version]$Version = "0.0.0.0",
[string]$Arch = "x64",
[string]$BuildDir = "build",
[string]$BrandingDir = ".",
[string]$CompanyName = "ONLYOFFICE",
[string]$ProductName = "DesktopEditors",
[string]$BuildDir,
[switch]$Sign,
[string]$CertName = "Ascensio System SIA",
[string]$TimestampServer = "http://timestamp.digicert.com"
@ -12,54 +13,72 @@ $ErrorActionPreference = "Stop"
Set-Location $PSScriptRoot
if (Test-Path "$BrandingDir\branding.ps1") {
Import-Module "$BrandingDir\branding.ps1"
if (-not $BuildDir) {
$BuildDir = ".build.$Arch"
}
$MsiFile = "$CompanyName-$ProductName-$Version-$Arch.msi"
$VersionShort = "$($Version.Major).$($Version.Minor).$($Version.Build)"
switch ($Arch) {
"x64" { $MsiBuild = 'MsiBuild64' }
"x86" { $MsiBuild = 'MsiBuild32' }
$MsiBuild = switch ($Arch) {
"x64" { "MsiBuild64" }
"x86" { "MsiBuild32" }
}
$MD5 = New-Object -TypeName System.Security.Cryptography.MD5CryptoServiceProvider
$ASCII = New-Object -TypeName System.Text.ASCIIEncoding
[guid]$GUID = $MD5.ComputeHash($ASCII.GetBytes("$PackageName $VersionShort $Arch"))
[guid]$GUID = $MD5.ComputeHash($ASCII.GetBytes(`
"$CompanyName $ProductName $VersionShort $Arch"))
$ProductCode = "{" + $GUID.ToString().ToUpper() + "}"
Write-Host @"
PackageName = $PackageName
Version = $Version
Arch = $Arch
Sign = $Sign
CompanyName = $CompanyName
ProductName = $ProductName
BuildDir = $BuildDir
BrandingDir = $BrandingDir
Sign = $Sign
MsiFile = $MsiFile
MsiBuild = $MsiBuild
ProductCode = $ProductCode
"@
####
Write-Host "`n[ Get Advanced Installer path ]"
if ($ENV:ADVINSTPATH) {
$AdvInstPath = $ENV:ADVINSTPATH
if ($env:ADVINSTPATH) {
$AdvInstPath = $env:ADVINSTPATH
} else {
$RegPath = "HKLM:\SOFTWARE\WOW6432Node\Caphyon\Advanced Installer"
$AdvInstPath = (Get-ItemProperty $RegPath)."InstallRoot" + "bin\x86"
}
$AdvInstPath
$ENV:Path = "$AdvInstPath;$ENV:Path"
$env:Path = "$AdvInstPath;$env:Path"
####
Write-Host "`n[ Create package.config ]"
Write-Host "WRITE: $BuildDir\desktop\converter\package.config"
Write-Output "package=msi" `
| Out-File -Encoding ASCII "$BuildDir\$DesktopDir\converter\package.config"
Write-Host "$BuildDir\$DesktopDir\converter\package.config"
| Out-File -Encoding ASCII "$BuildDir\desktop\converter\package.config"
####
Write-Host "`n[ Create Advanced Installer config ]"
$AdvInstConfig = @()
$AdvInstConfig += BrandingAdvInstConfig
$AdvInstConfig = @(
"DelFolder CUSTOM_PATH", `
"SetProductCode -langid 1029 -guid $ProductCode", `
"SetProductCode -langid 1031 -guid $ProductCode", `
"SetProductCode -langid 1033 -guid $ProductCode", `
"SetProductCode -langid 1036 -guid $ProductCode", `
"SetProductCode -langid 1041 -guid $ProductCode", `
"SetProductCode -langid 1046 -guid $ProductCode", `
"SetProductCode -langid 1049 -guid $ProductCode", `
"SetProductCode -langid 1060 -guid $ProductCode", `
"SetProductCode -langid 2070 -guid $ProductCode", `
"SetProductCode -langid 3082 -guid $ProductCode", `
"SetProperty FORMS=1"
)
if ($Arch -eq "x86") {
$AdvInstConfig += `
"SetComponentAttribute -feature_name MainFeature -unset -64bit_component", `
@ -115,33 +134,40 @@ $AdvInstConfig += `
"SetProperty Version=$VersionShort", `
"SetVersion $Version -noprodcode", `
"SetCurrentFeature MainFeature", `
"UpdateFile APPDIR\DesktopEditors.exe $BuildDir\$DesktopDir\DesktopEditors.exe", `
"UpdateFile APPDIR\updatesvc.exe $BuildDir\$DesktopDir\updatesvc.exe", `
"NewSync APPDIR $BuildDir\$DesktopDir -existingfiles keep -feature Files", `
"UpdateFile APPDIR\DesktopEditors.exe $BuildDir\desktop\DesktopEditors.exe", `
"UpdateFile APPDIR\updatesvc.exe $BuildDir\desktop\updatesvc.exe", `
"NewSync APPDIR $BuildDir\desktop -existingfiles keep -feature Files", `
# "GenerateReport -buildname $MsiBuild -output_path .\report.pdf", `
"Rebuild -buildslist $MsiBuild"
$AdvInstConfig = ";aic", $AdvInstConfig
$AdvInstConfig
Write-Output $AdvInstConfig | Out-File -Encoding UTF8 "DesktopEditors.aic"
####
Write-Host "`n[ Build Advanced Installer project ]"
AdvancedInstaller.com /? | Select-Object -First 1
Write-Host "AdvancedInstaller.com /execute DesktopEditors.aip DesktopEditors.aic"
AdvancedInstaller.com /execute DesktopEditors.aip DesktopEditors.aic
& AdvancedInstaller.com /? | Select-Object -First 1
& AdvancedInstaller.com /execute DesktopEditors.aip DesktopEditors.aic
if ($LastExitCode -ne 0) { throw }
####
Write-Host "`n[ Fix Summary Information Properties ]"
Write-Host "`n[ Fix Summary Info Properties ]"
$MsiFile = (Get-ChildItem "*-$Version-$Arch.msi")[0].Name
$Template = ";1033,1049,1029,1031,3082,1036,2070,1046,1060,1041,0"
switch ($Arch) {
"x64" { $Template = "x64" + $Template }
"x86" { $Template = "Intel" + $Template }
}
Write-Host "MsiInfo $MsiFile /p $Template"
& MsiInfo $MsiFile /p $Template
if ($LastExitCode -ne 0) { throw }
& signtool sign /a /n $CertName /t $TimestampServer /v $MsiFile
if ($LastExitCode -ne 0) { throw }
if ($Sign) {
Write-Host "signtool sign /a /n $CertName /t $TimestampServer /v $MsiFile"
& signtool sign /a /n $CertName /t $TimestampServer /v $MsiFile
if ($LastExitCode -ne 0) { throw }
}

View File

@ -0,0 +1,135 @@
param (
[System.Version]$Version = "0.0.0.0",
[string]$Arch = "x64",
[string]$Target,
[string]$CompanyName = "ONLYOFFICE",
[string]$ProductName = "DesktopEditors",
[string]$BuildDir,
[string]$BrandingDir,
[switch]$Sign,
[string]$CertName = "Ascensio System SIA",
[string]$TimestampServer = "http://timestamp.digicert.com"
)
$ErrorActionPreference = "Stop"
Set-Location $PSScriptRoot
if (-not $BuildDir) {
$BuildDir = ".build.$Arch"
}
if (-not (Test-Path "$BuildDir")) {
Write-Error "Path `"$BuildDir`" does not exist"
}
$InnoFile = switch ($Target) {
"standalone" { "$CompanyName-$ProductName-Standalone-$Version-$Arch.exe" }
"xp" { "$CompanyName-$ProductName-$Version-$Arch-xp.exe" }
"update" { "$CompanyName-$ProductName-Update-$Version-$Arch.exe" }
"xp_update" { "$CompanyName-$ProductName-Update-$Version-$Arch-xp.exe" }
default { "$CompanyName-$ProductName-$Version-$Arch.exe" }
}
Write-Host @"
Version = $Version
Arch = $Arch
Target = $Target
CompanyName = $CompanyName
ProductName = $ProductName
BuildDir = $BuildDir
BrandingDir = $BrandingDir
Sign = $Sign
InnoFile = $InnoFile
"@
####
Write-Host "`n[ Get Inno Setup path ]"
if ($env:INNOPATH) {
$InnoPath = $env:INNOPATH
}
elseif ($Target -ne "xp") {
$RegPath = "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Inno Setup 6_is1"
$InnoPath = (Get-ItemProperty $RegPath)."Inno Setup: App Path"
}
elseif ($Target -eq "xp") {
$RegPath = "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Inno Setup 5_is1"
$InnoPath = (Get-ItemProperty $RegPath)."Inno Setup: App Path"
}
$InnoPath
$env:Path = "$InnoPath;$env:Path"
####
if ($Target -notlike "*update") {
Write-Host "`n[ Download VCRedist $Arch ]"
$VCRedist = "data\vcredist_$Arch.exe"
$VCRedistUrl = switch -Wildcard ("$Arch-$Target") {
"x64*" { "https://aka.ms/vs/17/release/vc_redist.x64.exe" }
"x86*" { "https://aka.ms/vs/17/release/vc_redist.x86.exe" }
# Microsoft Visual C++ 2015-2019 Redistributable - 14.27.29114
"x64-xp" { "https://download.visualstudio.microsoft.com/download/pr/722d59e4-0671-477e-b9b1-b8da7d4bd60b/591CBE3A269AFBCC025681B968A29CD191DF3C6204712CBDC9BA1CB632BA6068/VC_redist.x64.exe" }
"x86-xp" { "https://download.visualstudio.microsoft.com/download/pr/c168313d-1754-40d4-8928-18632c2e2a71/D305BAA965C9CD1B44EBCD53635EE9ECC6D85B54210E2764C8836F4E9DEFA345/VC_redist.x86.exe" }
}
if ((-not (Test-Path "$VCRedist")) -or `
(-not (Get-Item "$VCRedist").VersionInfo.ProductVersion)) {
Write-Host "DOWNLOAD: $VCRedistUrl"
$WebClient = New-Object System.Net.WebClient
$WebClient.DownloadFile($VCRedistUrl, $VCRedist)
}
Write-Host "Version: $((Get-Item $VCRedist).VersionInfo.ProductVersion)"
if (-not (Get-Item $VCRedist).VersionInfo.ProductVersion) { throw }
}
####
if ($Target -notlike "*update") {
Write-Host "`n[ Create package.config ]"
Write-Host "WRITE: $BuildDir\desktop\converter\package.config"
Write-Output "package=exe" `
| Out-File -Encoding ASCII "$BuildDir\desktop\converter\package.config"
}
####
Write-Host "`n[ Build Inno Setup project ]"
$IssFile = "common.iss"
$InnoArgs = "/Qp",
"/DVERSION=$Version",
"/DARCH=$Arch",
"/DBUILD_DIR=$BuildDir"
if ($BrandingDir) {
$InnoArgs += "/DBRANDING_DIR=$BrandingDir"
}
if ($CompanyName -eq "onlyoffice") {
$InnoArgs += "/D_ONLYOFFICE"
}
switch ($Target) {
"standalone" {
$InnoArgs += "/DEMBED_HELP", "/DPACKAGE_EDITION=Standalone"
}
"xp" {
$InnoArgs += "/D_WIN_XP"
}
"update" {
$InnoArgs += "/DTARGET_NAME=$CompanyName-$ProductName-$Version-$Arch"
$IssFile = "update_common.iss"
}
"xp_update" {
$InnoArgs += "/D_WIN_XP",
"/DTARGET_NAME=$CompanyName-$ProductName-$Version-$Arch-xp"
$IssFile = "update_common.iss"
}
}
if ($Sign) {
$InnoArgs += "/DSIGN",
"/Sbyparam=signtool sign /a /v /n `$q$CertName`$q /t $TimestampServer `$f"
}
Write-Host "iscc $InnoArgs $IssFile"
& iscc $InnoArgs $IssFile
if ($LastExitCode -ne 0) { throw }

View File

@ -1,116 +1,52 @@
param (
[Parameter(Mandatory)][string]$Target,
[string]$BuildDir = "build",
[string]$DesktopDir = "DesktopEditors",
[string]$MultimediaDir,
[string]$BrandingDir = ".",
[switch]$ExcludeHelp,
[switch]$Sign,
[string]$CertName = "Ascensio System SIA",
[string]$TimestampServer = "http://timestamp.digicert.com"
)
$ErrorActionPreference = "Stop"
Set-Location $PSScriptRoot
$Suffix = switch ( $Target )
{
"windows_x64" { "x64" }
"windows_x86" { "x86" }
"windows_x64_xp" { "x64-xp" }
"windows_x86_xp" { "x86-xp" }
}
$DesktopHelpDir = "$DesktopDir-Help"
# Check directory
if ( -Not (Test-Path $BuildDir) ) {
Write-Error "Path $BuildDir does not exist"
}
# 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 = $(Split-Path $_.FullName -Parent | Resolve-Path -Relative)
$dst = $src.Replace("\$DesktopDir\","\$DesktopHelpDir\")
Write-Host "Move: $src\help > $dst" -ForegroundColor Yellow
New-Item "$dst" -ItemType Directory | Out-Null
Move-Item -Path "$src\help" -Destination "$dst"
}
if ( $DesktopDir ) {
Set-Location "$BuildDir\$DesktopDir"
if ( $Sign ) {
$SignFiles = Get-ChildItem `
*.exe, *.dll, converter\*.exe, converter\*.dll, plugins\*\*.dll `
| Resolve-Path -Relative
# Sign
Write-Host "signtool sign /a /n $CertName /t $TimestampServer $SignFiles" -ForegroundColor Yellow
& signtool sign /a /n $CertName /t $TimestampServer /v $SignFiles
if ( $LastExitCode -ne 0 ) { throw }
# Verify
Write-Host "signtool verify /pa /all $SignFiles" -ForegroundColor Yellow
& signtool verify /pa /all $SignFiles
if ( $LastExitCode -ne 0 ) { throw }
# 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 ( $Sign ) {
$SignFiles = Get-ChildItem *.exe, *.dll, plugins\*\*.dll `
| Resolve-Path -Relative
# Sign
Write-Host "signtool sign /a /n $CertName /t $TimestampServer /v $SignFiles" -ForegroundColor Yellow
& signtool sign /a /n $CertName /t $TimestampServer /v $SignFiles
if ( $LastExitCode -ne 0 ) { throw }
# Verify
Write-Host "signtool verify /pa /all $SignFiles" -ForegroundColor Yellow
& signtool verify /pa /all $SignFiles
if ( $LastExitCode -ne 0 ) { throw }
# 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 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\$DesktopHelpDir\*" -ForegroundColor Yellow
& 7z a -y $OutFile .\$BuildDir\$DesktopHelpDir\*
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
& 7z a -y $OutFile .\$BuildDir\$MultimediaDir\*
if ( $LastExitCode -ne 0 ) { throw }
}
param (
[System.Version]$Version = "0.0.0.0",
[string]$Arch = "x64",
[string]$Target,
[string]$CompanyName = "ONLYOFFICE",
[string]$ProductName = "DesktopEditors",
[string]$BuildDir
)
$ErrorActionPreference = "Stop"
Set-Location $PSScriptRoot
if ($Target) {
$Suffix = "-$Target"
}
if (-not $BuildDir) {
$BuildDir = ".build.$Arch"
}
if (-not (Test-Path "$BuildDir")) {
Write-Error "Path `"$BuildDir`" does not exist"
}
$ZipFile = "$CompanyName-$ProductName-$Version-$Arch$Suffix.zip"
Write-Host @"
Version = $Version
Arch = $Arch
Target = $Target
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 "7z a -y $ZipFile $BuildDir\desktop\*"
& 7z a -y "$ZipFile" ".\$BuildDir\desktop\*"
if ($LastExitCode -ne 0) { throw }
if ($Target -eq "standalone" -or $Target -eq "xp") {
Write-Host "7z a -y $ZipFile $BuildDir\help\*"
& 7z a -y "$ZipFile" ".\$BuildDir\help\*"
if ($LastExitCode -ne 0) { throw }
}

View File

@ -1,49 +0,0 @@
param (
[string]$Version = "0.0.0.0",
[decimal]$Timestamp,
[string]$UpdatesUrlPrefix,
[string]$ReleaseNotesUrlPrefix,
[switch]$Multilang,
[string]$OutFile = "appcast.json"
)
$ErrorActionPreference = "Stop"
[Threading.Thread]::CurrentThread.CurrentCulture = 'en-US'
# [Threading.Thread]::CurrentThread.CurrentUICulture = 'en-US'
Set-Location $PSScriptRoot
if ( $Timestamp -eq 0 ) {
$Timestamp = [Math]::Floor([decimal](Get-Date (Get-Date).ToUniversalTime() -UFormat "%s"))
}
$Date = (New-Object -Type DateTime -ArgumentList 1970, 1, 1, 0, 0, 0, 0).AddSeconds($Timestamp)
$PubDate = Get-Date $Date -UFormat "%b %d %H:%M UTC %Y"
$Content = @"
{
"version": "${Version}",
"date": "${PubDate}",
"releaseNotes": {
"en-EN": "${ReleaseNotesUrlPrefix}/changes.html",
"@
if ( $Multilang ) {
$Content += "`n" + @"
"ru-RU": "${ReleaseNotesUrlPrefix}/changes_ru.html"
"@
}
$Content += "`n" + @"
},
"package": {
"win_64": {
"url": "${UpdatesUrlPrefix}/editors_update_x64.exe",
"installArguments": "/silent /update"
},
"win_32": {
"url": "${UpdatesUrlPrefix}/editors_update_x86.exe",
"installArguments": "/silent /update"
}
}
}
"@
$Content
Set-Content -Path $OutFile -Value $Content

View File

@ -1,83 +0,0 @@
param (
[string]$Title = "Desktop Editors",
[string]$Version = "0.0.0.0",
[decimal]$Timestamp,
[string]$UpdatesUrlPrefix,
[string]$ReleaseNotesUrlPrefix,
[switch]$Multilang,
[string]$OutFile = "appcast.xml"
)
$ErrorActionPreference = "Stop"
[Threading.Thread]::CurrentThread.CurrentCulture = 'en-US'
# [Threading.Thread]::CurrentThread.CurrentUICulture = 'en-US'
Set-Location $PSScriptRoot
if ( $Timestamp -eq 0 ) {
$Timestamp = [Math]::Floor([decimal](Get-Date (Get-Date).ToUniversalTime() -UFormat "%s"))
}
$Date = (New-Object -Type DateTime -ArgumentList 1970, 1, 1, 0, 0, 0, 0).AddSeconds($Timestamp)
$PubDate = Get-Date $Date -UFormat "%a, %d %b %Y %H:%M:%S +0000"
$Content = @"
<?xml version="1.0" encoding="UTF-8"?>
<rss
version="2.0"
xmlns:sparkle="http://www.andymatuschak.org/xml-namespaces/sparkle"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>${Title} Changelog</title>
<description>Most recent changes with links to updates.</description>
<language>en</language>
<item>
<title>Version ${Version}</title>
<pubDate>${PubDate}</pubDate>
<sparkle:releaseNotesLink>
${ReleaseNotesUrlPrefix}/changes.html
</sparkle:releaseNotesLink>
"@
if ( $Multilang ) {
$Content += "`n" + @"
<sparkle:releaseNotesLink xml:lang="ru-RU">
${ReleaseNotesUrlPrefix}/changes_ru.html
</sparkle:releaseNotesLink>
"@
}
$Content += "`n" + @"
<enclosure url="${UpdatesUrlPrefix}/editors_update_x64.exe"
sparkle:os="windows-x64"
sparkle:version="${Version}"
sparkle:shortVersionString="${Version}"
sparkle:installerArguments="/silent /update"
length="0"
type="application/octet-stream" />
</item>
<item>
<title>Version ${Version}</title>
<pubDate>${PubDate}</pubDate>
<sparkle:releaseNotesLink>
${ReleaseNotesUrlPrefix}/changes.html
</sparkle:releaseNotesLink>
"@
if ( $Multilang ) {
$Content += "`n" + @"
<sparkle:releaseNotesLink xml:lang="ru-RU">
${ReleaseNotesUrlPrefix}/changes_ru.html
</sparkle:releaseNotesLink>
"@
}
$Content += "`n" + @"
<enclosure url="${UpdatesUrlPrefix}/editors_update_x86.exe"
sparkle:os="windows-x86"
sparkle:version="${Version}"
sparkle:shortVersionString="${Version}"
sparkle:installerArguments="/silent /update"
length="0"
type="application/octet-stream" />
</item>
</channel>
</rss>
"@
$Content
Set-Content -Path $OutFile -Value $Content

View File

@ -1,44 +1,37 @@
; -- Update Common --
#if str(_ARCH) == "64"
#define sWinArch "x64"
#define sPlatform "win_64"
#elif str(_ARCH) == "32"
#define sWinArch "x86"
#define sPlatform "win_32"
#ifndef BRANDING_DIR
#define BRANDING_DIR '.'
#endif
#ifndef _WIN_XP
#define sWinArchFull sWinArch
#define sPlatformFull sPlatform
#else
#define sWinArchFull sWinArch + "_xp"
#define sPlatformFull sPlatform + "_xp"
#include BRANDING_DIR + '\defines.iss'
#ifndef VERSION
#define VERSION '0.0.0.0'
#endif
#ifndef sBrandingFolder
#define sBrandingFolder "..\..\.."
#ifndef ARCH
#define ARCH 'x64'
#endif
#ifndef OUTPUT_DIR
#define OUTPUT_DIR '.'
#endif
#ifndef OUTPUT_FILE
#define OUTPUT_FILE sPackageName + '-Update-' + VERSION + '-' + ARCH
#ifdef _WIN_XP
#define OUTPUT_FILE OUTPUT_FILE + '-xp'
#endif
#include sBrandingFolder + "\win-linux\package\windows\defines.iss"
#ifndef sAppVersion
#define sAppVersion GetFileVersion(AddBackslash(DEPLOY_PATH) + NAME_EXE_OUT)
#endif
#define sAppVerShort Copy(sAppVersion, 0, 3)
#ifndef TARGET_NAME
# define TARGET_NAME str(sPackageName + "-" + sAppVersion + "-" + sWinArchFull + ".exe")
#define TARGET_NAME sPackageName + '-' + VERSION + '-' + ARCH
#ifdef _WIN_XP
#define TARGET_NAME TARGET_NAME + '-xp'
#endif
#ifndef sOutputFileName
#define sOutputFileName str("editors_update_" + sWinArchFull)
#endif
[Setup]
AppName ={#sAppName}
AppVerName ={#sAppName} {#sAppVerShort}
AppVersion ={#sAppVersion}
VersionInfoVersion ={#sAppVersion}
AppVerName ={#sAppName} {#Copy(VERSION,1,RPos('.',VERSION)-1)}
AppVersion ={#VERSION}
VersionInfoVersion ={#VERSION}
AppPublisher ={#sAppPublisher}
AppPublisherURL ={#sAppPublisherURL}
@ -54,13 +47,13 @@ DisableReadyPage =true
;DisableWelcomePage =Yes
DefaultDirName ={pf}\{#APP_PATH}\update
OutputDir =update
OutputBaseFileName ={#sOutputFileName}
OutputDir ={#OUTPUT_DIR}
OutputBaseFileName ={#OUTPUT_FILE}
Uninstallable =false
PrivilegesRequired =lowest
#ifdef ENABLE_SIGNING
#ifdef SIGN
SignTool =byparam $p
#endif
@ -106,7 +99,7 @@ begin
end;
[Files]
Source: {#TARGET_NAME}; Flags: dontcopy;
Source: "{#TARGET_NAME}.exe"; Flags: dontcopy;
[Run]
;Filename: DesktopEditors_x64.exe; Parameters: "C:\test.txt"; Description: MyApp;