diff --git a/Project/Install/embARC.nsi b/Project/Install/embARC.nsi index b7b83eb..66b45a5 100644 --- a/Project/Install/embARC.nsi +++ b/Project/Install/embARC.nsi @@ -37,6 +37,11 @@ SetCompressor /FINAL /SOLID lzma !define MUI_ABORTWARNING !define MUI_ICON "..\..\icons\embARC.ico" +; Uninstaller signing +!ifdef EXPORT_UNINST + !uninstfinalize 'copy /Y "%1" "../../Release/${PRODUCT_NAME}_GUI_${PRODUCT_VERSION}_Windows_x64-uninst.exe"' +!endif + ; Language Selection Dialog Settings !define MUI_LANGDLL_REGISTRY_ROOT "${PRODUCT_UNINST_ROOT_KEY}" !define MUI_LANGDLL_REGISTRY_KEY "${PRODUCT_UNINST_KEY}" @@ -100,7 +105,11 @@ Section "SectionPrincipale" SEC01 SectionEnd Section -Post - WriteUninstaller "$INSTDIR\uninst.exe" + !if /FileExists "..\..\Release\${PRODUCT_NAME}_GUI_${PRODUCT_VERSION}_Windows_x64-uninst.exe" + File "/oname=$INSTDIR\uninst.exe" "..\..\Release\${PRODUCT_NAME}_GUI_${PRODUCT_VERSION}_Windows_x64-uninst.exe" + !else + WriteUninstaller "$INSTDIR\uninst.exe" + !endif WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\embARC.exe" WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)" WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Publisher" "${PRODUCT_PUBLISHER}" diff --git a/Release/Release_CLI_Windows_x64.ps1 b/Release/Build_CLI_Windows.ps1 similarity index 50% rename from Release/Release_CLI_Windows_x64.ps1 rename to Release/Build_CLI_Windows.ps1 index d277604..b265456 100755 --- a/Release/Release_CLI_Windows_x64.ps1 +++ b/Release/Build_CLI_Windows.ps1 @@ -8,34 +8,20 @@ $ErrorActionPreference = "Stop" #----------------------------------------------------------------------- # Setup -$release_directory = Split-Path -Parent $MyInvocation.MyCommand.Path -$version = (Get-Content (Join-Path $release_directory "..\Project\version.txt") -Raw).Trim() - -#----------------------------------------------------------------------- -# Cleanup -$artifact = Join-Path $release_directory "embARC_CLI_${version}_Windows_x64.zip" -if (Test-Path $artifact) { - Remove-Item $artifact -Force -} - -Push-Location (Split-Path $release_directory -Parent) - & ./gradlew.bat --no-daemon clean -Pop-Location +$release_directory = $PSScriptRoot +$version = (Get-Content "${release_directory}\..\Project\version.txt" -Raw).Trim() #----------------------------------------------------------------------- # Build -Push-Location (Split-Path $release_directory -Parent) +Push-Location -Path "${release_directory}\.." (Get-Content build.gradle) -replace 'com\.portalmedia\.embarc\.gui\.Launcher', 'com.portalmedia.embarc.cli.Main' | Set-Content build.gradle & ./gradlew.bat --no-daemon build -Pop-Location - -#----------------------------------------------------------------------- -# Package .exe -Push-Location (Split-Path $release_directory -Parent) + + # Generate excutable $distDir = "build/distributions/windows" New-Item -ItemType Directory -Path $distDir -Force - & jpackage --win-console ` + jpackage --win-console ` --type app-image ` --name embARC ` --input build/libs ` @@ -49,18 +35,4 @@ Push-Location (Split-Path $release_directory -Parent) # Remove ReadOnly flag from the generated executable $executable = Get-Item 'build\distributions\windows\embARC\embARC.exe' $executable.Attributes -= 'ReadOnly' - - & signtool sign ` - /fd sha256 ` - /tr http://timestamp.acs.microsoft.com ` - /td sha256 ` - /d embARC ` - /du http://mediaarea.net ` - build\distributions\windows\embARC\embARC.exe -Pop-Location - -#----------------------------------------------------------------------- -# Package cli -Push-Location (Join-Path (Split-Path $release_directory -Parent) 'build\distributions\windows\embARC') - & 7za.exe a -r -tzip ..\..\..\..\Release\embARC_CLI_${version}_Windows_x64.zip * Pop-Location diff --git a/Release/Build_GUI_Windows.ps1 b/Release/Build_GUI_Windows.ps1 new file mode 100755 index 0000000..34ddada --- /dev/null +++ b/Release/Build_GUI_Windows.ps1 @@ -0,0 +1,36 @@ +## Copyright (c) MediaArea.net SARL. All Rights Reserved. +## +## Use of this source code is governed by a BSD-style license that can +## be found in the License.html file in the root of the source tree. +## + +$ErrorActionPreference = "Stop" + +#----------------------------------------------------------------------- +# Setup +$release_directory = $PSScriptRoot +$version = (Get-Content "${release_directory}\..\Project\version.txt" -Raw).Trim() + +#----------------------------------------------------------------------- +# Build +Push-Location -Path "${release_directory}\.." + & ./gradlew.bat --no-daemon build + + # Generate excutable + $distDir = "build/distributions/windows" + New-Item -ItemType Directory -Path $distDir -Force + + jpackage --type app-image ` + --name embARC ` + --input build/libs ` + --main-jar "embARC-${version}.jar" ` + --main-class com.portalmedia.embarc.gui.Launcher ` + --dest $distDir ` + --vendor "Library of Congress" ` + --description "embARC - metadata embedded for archival content" ` + --icon "icons/embARC.ico" + + # Remove ReadOnly flag from the generated executable + $executable = Get-Item 'build\distributions\windows\embARC\embARC.exe' + $executable.Attributes -= 'ReadOnly' +Pop-Location diff --git a/Release/Release_CLI_Windows.ps1 b/Release/Release_CLI_Windows.ps1 new file mode 100755 index 0000000..df43e63 --- /dev/null +++ b/Release/Release_CLI_Windows.ps1 @@ -0,0 +1,25 @@ +## Copyright (c) MediaArea.net SARL. All Rights Reserved. +## +## Use of this source code is governed by a BSD-style license that can +## be found in the License.html file in the root of the source tree. +## + +$ErrorActionPreference = "Stop" + +#----------------------------------------------------------------------- +# Setup +$release_directory = $PSScriptRoot +$version = (Get-Content "${release_directory}\..\Project\version.txt" -Raw).Trim() + +#----------------------------------------------------------------------- +# Cleanup +$artifact = "${release_directory}\embARC_CLI_${version}_Windows_x64.zip" +if (Test-Path $artifact) { + Remove-Item $artifact -Force +} + +#----------------------------------------------------------------------- +# Package CLI +Push-Location -Path "${release_directory}\..\build\distributions\windows\embARC" + & 7za.exe a -r -tzip "${release_directory}\embARC_CLI_${version}_Windows_x64.zip" * +Pop-Location diff --git a/Release/Release_GUI_Windows.ps1 b/Release/Release_GUI_Windows.ps1 new file mode 100755 index 0000000..3f427f0 --- /dev/null +++ b/Release/Release_GUI_Windows.ps1 @@ -0,0 +1,36 @@ +## Copyright (c) MediaArea.net SARL. All Rights Reserved. +## +## Use of this source code is governed by a BSD-style license that can +## be found in the License.html file in the root of the source tree. +## + +$ErrorActionPreference = "Stop" + +#----------------------------------------------------------------------- +# Setup +$release_directory = $PSScriptRoot +$version = (Get-Content "${release_directory}\..\Project\version.txt" -Raw).Trim() + +#----------------------------------------------------------------------- +# Cleanup +$artifact = "${release_directory}\embARC_GUI_${version}_Windows_x64.zip" +if (Test-Path $artifact) { + Remove-Item $artifact -Force +} + +$artifact = "${release_directory}\embARC_GUI_${version}_Windows_x64.exe" +if (Test-Path $artifact) { + Remove-Item $artifact -Force +} + +#----------------------------------------------------------------------- +# Package GUI +Push-Location -Path "${release_directory}\..\build\distributions\windows\embARC" + & 7za.exe a -r -tzip "${release_directory}\embARC_GUI_${version}_Windows_x64.zip" * +Pop-Location + +#----------------------------------------------------------------------- +# Package installer +Push-Location -Path "${release_directory}\..\Project\Install" + makensis.exe embARC.nsi +Pop-Location diff --git a/Release/Release_GUI_Windows_x64.ps1 b/Release/Release_GUI_Windows_x64.ps1 deleted file mode 100755 index 9f581ff..0000000 --- a/Release/Release_GUI_Windows_x64.ps1 +++ /dev/null @@ -1,83 +0,0 @@ -## Copyright (c) MediaArea.net SARL. All Rights Reserved. -## -## Use of this source code is governed by a BSD-style license that can -## be found in the License.html file in the root of the source tree. -## - -$ErrorActionPreference = "Stop" - -#----------------------------------------------------------------------- -# Setup -$release_directory = Split-Path -Parent $MyInvocation.MyCommand.Path -$version = (Get-Content (Join-Path $release_directory "..\Project\version.txt") -Raw).Trim() - -#----------------------------------------------------------------------- -# Cleanup -$artifact = Join-Path $release_directory "embARC_GUI_${version}_Windows_x64.zip" -if (Test-Path $artifact) { - Remove-Item $artifact -Force -} - -$artifact = Join-Path $release_directory "embARC_GUI_${version}_Windows_x64.exe" -if (Test-Path $artifact) { - Remove-Item $artifact -Force -} - -Push-Location (Split-Path $release_directory -Parent) - & ./gradlew.bat --no-daemon clean -Pop-Location - -#----------------------------------------------------------------------- -# Build -Push-Location (Split-Path $release_directory -Parent) - & ./gradlew.bat --no-daemon build -Pop-Location - -#----------------------------------------------------------------------- -# Package .exe -Push-Location (Split-Path $release_directory -Parent) - $distDir = "build/distributions/windows" - New-Item -ItemType Directory -Path $distDir -Force - - & jpackage --type app-image ` - --name embARC ` - --input build/libs ` - --main-jar "embARC-${version}.jar" ` - --main-class com.portalmedia.embarc.gui.Launcher ` - --dest $distDir ` - --vendor "Library of Congress" ` - --description "embARC - metadata embedded for archival content" ` - --icon "icons/embARC.ico" - - # Remove ReadOnly flag from the generated executable - $executable = Get-Item 'build\distributions\windows\embARC\embARC.exe' - $executable.Attributes -= 'ReadOnly' - - & signtool sign ` - /fd sha256 ` - /tr http://timestamp.acs.microsoft.com ` - /td sha256 ` - /d embARC ` - /du http://mediaarea.net ` - build\distributions\windows\embARC\embARC.exe -Pop-Location - -#----------------------------------------------------------------------- -# Package gui -Push-Location (Join-Path (Split-Path $release_directory -Parent) 'build\distributions\windows\embARC') - & 7za.exe a -r -tzip ..\..\..\..\Release\embARC_GUI_${version}_Windows_x64.zip * -Pop-Location - -#----------------------------------------------------------------------- -# Package installer -Push-Location (Join-Path (Split-Path $release_directory -Parent) '\Project\Install') - & makensis.exe embARC.nsi - - & signtool sign ` - /fd sha256 ` - /tr http://timestamp.acs.microsoft.com ` - /td sha256 ` - /d embARC ` - /du http://mediaarea.net ` - ..\..\Release\embARC_GUI_${version}_Windows_x64.exe -Pop-Location