Skip to content

Commit 688fcbd

Browse files
authored
Merge pull request #81 from MediaArea/sign
Update build scripts
2 parents 45924d5 + 0268d72 commit 688fcbd

6 files changed

Lines changed: 113 additions & 118 deletions

File tree

Project/Install/embARC.nsi

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ SetCompressor /FINAL /SOLID lzma
3737
!define MUI_ABORTWARNING
3838
!define MUI_ICON "..\..\icons\embARC.ico"
3939

40+
; Uninstaller signing
41+
!ifdef EXPORT_UNINST
42+
!uninstfinalize 'copy /Y "%1" "../../Release/${PRODUCT_NAME}_GUI_${PRODUCT_VERSION}_Windows_x64-uninst.exe"'
43+
!endif
44+
4045
; Language Selection Dialog Settings
4146
!define MUI_LANGDLL_REGISTRY_ROOT "${PRODUCT_UNINST_ROOT_KEY}"
4247
!define MUI_LANGDLL_REGISTRY_KEY "${PRODUCT_UNINST_KEY}"
@@ -100,7 +105,11 @@ Section "SectionPrincipale" SEC01
100105
SectionEnd
101106

102107
Section -Post
103-
WriteUninstaller "$INSTDIR\uninst.exe"
108+
!if /FileExists "..\..\Release\${PRODUCT_NAME}_GUI_${PRODUCT_VERSION}_Windows_x64-uninst.exe"
109+
File "/oname=$INSTDIR\uninst.exe" "..\..\Release\${PRODUCT_NAME}_GUI_${PRODUCT_VERSION}_Windows_x64-uninst.exe"
110+
!else
111+
WriteUninstaller "$INSTDIR\uninst.exe"
112+
!endif
104113
WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\embARC.exe"
105114
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)"
106115
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Publisher" "${PRODUCT_PUBLISHER}"
Lines changed: 6 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -8,34 +8,20 @@ $ErrorActionPreference = "Stop"
88

99
#-----------------------------------------------------------------------
1010
# Setup
11-
$release_directory = Split-Path -Parent $MyInvocation.MyCommand.Path
12-
$version = (Get-Content (Join-Path $release_directory "..\Project\version.txt") -Raw).Trim()
13-
14-
#-----------------------------------------------------------------------
15-
# Cleanup
16-
$artifact = Join-Path $release_directory "embARC_CLI_${version}_Windows_x64.zip"
17-
if (Test-Path $artifact) {
18-
Remove-Item $artifact -Force
19-
}
20-
21-
Push-Location (Split-Path $release_directory -Parent)
22-
& ./gradlew.bat --no-daemon clean
23-
Pop-Location
11+
$release_directory = $PSScriptRoot
12+
$version = (Get-Content "${release_directory}\..\Project\version.txt" -Raw).Trim()
2413

2514
#-----------------------------------------------------------------------
2615
# Build
27-
Push-Location (Split-Path $release_directory -Parent)
16+
Push-Location -Path "${release_directory}\.."
2817
(Get-Content build.gradle) -replace 'com\.portalmedia\.embarc\.gui\.Launcher', 'com.portalmedia.embarc.cli.Main' | Set-Content build.gradle
2918
& ./gradlew.bat --no-daemon build
30-
Pop-Location
31-
32-
#-----------------------------------------------------------------------
33-
# Package .exe
34-
Push-Location (Split-Path $release_directory -Parent)
19+
20+
# Generate excutable
3521
$distDir = "build/distributions/windows"
3622
New-Item -ItemType Directory -Path $distDir -Force
3723

38-
& jpackage --win-console `
24+
jpackage --win-console `
3925
--type app-image `
4026
--name embARC `
4127
--input build/libs `
@@ -49,18 +35,4 @@ Push-Location (Split-Path $release_directory -Parent)
4935
# Remove ReadOnly flag from the generated executable
5036
$executable = Get-Item 'build\distributions\windows\embARC\embARC.exe'
5137
$executable.Attributes -= 'ReadOnly'
52-
53-
& signtool sign `
54-
/fd sha256 `
55-
/tr http://timestamp.acs.microsoft.com `
56-
/td sha256 `
57-
/d embARC `
58-
/du http://mediaarea.net `
59-
build\distributions\windows\embARC\embARC.exe
60-
Pop-Location
61-
62-
#-----------------------------------------------------------------------
63-
# Package cli
64-
Push-Location (Join-Path (Split-Path $release_directory -Parent) 'build\distributions\windows\embARC')
65-
& 7za.exe a -r -tzip ..\..\..\..\Release\embARC_CLI_${version}_Windows_x64.zip *
6638
Pop-Location

Release/Build_GUI_Windows.ps1

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
## Copyright (c) MediaArea.net SARL. All Rights Reserved.
2+
##
3+
## Use of this source code is governed by a BSD-style license that can
4+
## be found in the License.html file in the root of the source tree.
5+
##
6+
7+
$ErrorActionPreference = "Stop"
8+
9+
#-----------------------------------------------------------------------
10+
# Setup
11+
$release_directory = $PSScriptRoot
12+
$version = (Get-Content "${release_directory}\..\Project\version.txt" -Raw).Trim()
13+
14+
#-----------------------------------------------------------------------
15+
# Build
16+
Push-Location -Path "${release_directory}\.."
17+
& ./gradlew.bat --no-daemon build
18+
19+
# Generate excutable
20+
$distDir = "build/distributions/windows"
21+
New-Item -ItemType Directory -Path $distDir -Force
22+
23+
jpackage --type app-image `
24+
--name embARC `
25+
--input build/libs `
26+
--main-jar "embARC-${version}.jar" `
27+
--main-class com.portalmedia.embarc.gui.Launcher `
28+
--dest $distDir `
29+
--vendor "Library of Congress" `
30+
--description "embARC - metadata embedded for archival content" `
31+
--icon "icons/embARC.ico"
32+
33+
# Remove ReadOnly flag from the generated executable
34+
$executable = Get-Item 'build\distributions\windows\embARC\embARC.exe'
35+
$executable.Attributes -= 'ReadOnly'
36+
Pop-Location

Release/Release_CLI_Windows.ps1

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
## Copyright (c) MediaArea.net SARL. All Rights Reserved.
2+
##
3+
## Use of this source code is governed by a BSD-style license that can
4+
## be found in the License.html file in the root of the source tree.
5+
##
6+
7+
$ErrorActionPreference = "Stop"
8+
9+
#-----------------------------------------------------------------------
10+
# Setup
11+
$release_directory = $PSScriptRoot
12+
$version = (Get-Content "${release_directory}\..\Project\version.txt" -Raw).Trim()
13+
14+
#-----------------------------------------------------------------------
15+
# Cleanup
16+
$artifact = "${release_directory}\embARC_CLI_${version}_Windows_x64.zip"
17+
if (Test-Path $artifact) {
18+
Remove-Item $artifact -Force
19+
}
20+
21+
#-----------------------------------------------------------------------
22+
# Package CLI
23+
Push-Location -Path "${release_directory}\..\build\distributions\windows\embARC"
24+
& 7za.exe a -r -tzip "${release_directory}\embARC_CLI_${version}_Windows_x64.zip" *
25+
Pop-Location

Release/Release_GUI_Windows.ps1

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
## Copyright (c) MediaArea.net SARL. All Rights Reserved.
2+
##
3+
## Use of this source code is governed by a BSD-style license that can
4+
## be found in the License.html file in the root of the source tree.
5+
##
6+
7+
$ErrorActionPreference = "Stop"
8+
9+
#-----------------------------------------------------------------------
10+
# Setup
11+
$release_directory = $PSScriptRoot
12+
$version = (Get-Content "${release_directory}\..\Project\version.txt" -Raw).Trim()
13+
14+
#-----------------------------------------------------------------------
15+
# Cleanup
16+
$artifact = "${release_directory}\embARC_GUI_${version}_Windows_x64.zip"
17+
if (Test-Path $artifact) {
18+
Remove-Item $artifact -Force
19+
}
20+
21+
$artifact = "${release_directory}\embARC_GUI_${version}_Windows_x64.exe"
22+
if (Test-Path $artifact) {
23+
Remove-Item $artifact -Force
24+
}
25+
26+
#-----------------------------------------------------------------------
27+
# Package GUI
28+
Push-Location -Path "${release_directory}\..\build\distributions\windows\embARC"
29+
& 7za.exe a -r -tzip "${release_directory}\embARC_GUI_${version}_Windows_x64.zip" *
30+
Pop-Location
31+
32+
#-----------------------------------------------------------------------
33+
# Package installer
34+
Push-Location -Path "${release_directory}\..\Project\Install"
35+
makensis.exe embARC.nsi
36+
Pop-Location

Release/Release_GUI_Windows_x64.ps1

Lines changed: 0 additions & 83 deletions
This file was deleted.

0 commit comments

Comments
 (0)