Mention version number in title bar

This commit is contained in:
Floris Bos 2020-03-10 17:43:48 +01:00
parent b269d0b522
commit bd37916527
8 changed files with 42 additions and 12 deletions

View file

@ -7,6 +7,12 @@ set(CMAKE_OSX_DEPLOYMENT_TARGET "10.13" CACHE STRING "" FORCE)
endif()
project(rpi-imager LANGUAGES CXX)
set(IMAGER_VERSION_MAJOR 1)
set(IMAGER_VERSION_MINOR 2)
set(IMAGER_VERSION_STR "${IMAGER_VERSION_MAJOR}.${IMAGER_VERSION_MINOR}")
set(IMAGER_VERSION_CSV "${IMAGER_VERSION_MAJOR},${IMAGER_VERSION_MINOR},0,0")
add_definitions(-DIMAGER_VERSION_STR="${IMAGER_VERSION_STR}")
add_definitions(-DIMAGER_VERSION_CSV=${IMAGER_VERSION_CSV})
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
@ -57,7 +63,6 @@ set(SOURCES "main.cpp" "imagewriter.cpp" "networkaccessmanagerfactory.cpp"
"driveformatthread.cpp" "powersaveblocker.cpp" "qml.qrc")
if (WIN32)
set(CMAKE_CXX_FLAGS "-s -O2")
# Adding WIN32 prevents a console window being opened on Windows
add_executable(${PROJECT_NAME} WIN32 ${SOURCES} ${HEADERS} ${DEPENDENCIES})
else()
@ -103,6 +108,11 @@ if (WIN32)
add_subdirectory(dependencies/fat32format)
add_dependencies(${PROJECT_NAME} fat32format)
# Strip debug symbols
add_custom_command(TARGET ${PROJECT_NAME}
POST_BUILD
COMMAND ${CMAKE_STRIP} "${CMAKE_BINARY_DIR}/${PROJECT_NAME}.exe")
# Code signing
find_program(SIGNTOOL "signtool.exe" PATHS "c:/Program Files (x86)/Microsoft SDKs/ClickOnce/SignTool")
if (NOT SIGNTOOL)
@ -137,11 +147,10 @@ if (WIN32)
"${Qt5_DIR}/../../../bin/libssl-1_1.dll" "${Qt5_DIR}/../../../bin/libcrypto-1_1.dll"
"${CMAKE_BINARY_DIR}/deploy")
add_custom_command(TARGET ${PROJECT_NAME}
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy
"${CMAKE_CURRENT_SOURCE_DIR}/windows/rpi-imager.nsi"
"${CMAKE_BINARY_DIR}")
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/windows/rpi-imager.nsi.in"
"${CMAKE_CURRENT_BINARY_DIR}/rpi-imager.nsi"
@ONLY)
add_custom_command(TARGET ${PROJECT_NAME}
POST_BUILD

6
debian/changelog vendored
View file

@ -1,3 +1,9 @@
rpi-imager (1.2) unstable; urgency=medium
* Mention version number in title bar.
-- Floris Bos <bos@je-eigen-domein.nl> Tue, 10 Mar 2020 17:08:11 +0100
rpi-imager (1.1) unstable; urgency=medium
* Fix verification on images that are uncompressed or have

View file

@ -288,6 +288,12 @@ QUrl ImageWriter::constantOsListUrl() const
return _repo;
}
/* Function to return version */
QString ImageWriter::constantVersion() const
{
return IMAGER_VERSION_STR;
}
void ImageWriter::setCustomOsListUrl(const QUrl &url)
{
_repo = url;

View file

@ -59,6 +59,9 @@ public:
/* Function to return OS list URL */
Q_INVOKABLE QUrl constantOsListUrl() const;
/* Function to return version */
Q_INVOKABLE QString constantVersion() const;
/* Set custom repository */
Q_INVOKABLE void setCustomOsListUrl(const QUrl &url);

View file

@ -107,7 +107,13 @@ int main(int argc, char *argv[])
}
else if (args[i] == "--help")
{
cerr << args[0] << " [--debug] [--repo <repository URL>] [<image file to write>]" << endl;
cerr << args[0] << " [--debug] [--version] [--repo <repository URL>] [<image file to write>]" << endl;
return 0;
}
else if (args[i] == "--version")
{
cerr << args[0] << " version " << imageWriter.constantVersion() << endl;
cerr << "Repository: " << imageWriter.constantOsListUrl().toString() << endl;
return 0;
}
else

View file

@ -20,7 +20,7 @@ ApplicationWindow {
minimumHeight: 420
maximumHeight: 420
title: qsTr("Raspberry Pi Imager")
title: qsTr("Raspberry Pi Imager v%1").arg(imageWriter.constantVersion())
FontLoader {id: roboto; source: "fonts/Roboto-Regular.ttf"}
FontLoader {id: robotoLight; source: "fonts/Roboto-Light.ttf"}

View file

@ -12,7 +12,7 @@
!define APP_NAME "Raspberry Pi Imager"
!define COMP_NAME "Raspberry Pi"
#!define WEB_SITE "https://www.raspberrypi.org/"
!define VERSION "01.01.00.00"
!define VERSION "@IMAGER_VERSION_STR@"
!define COPYRIGHT "Raspberry Pi"
!define DESCRIPTION "Raspberry Pi Imager"
!define MAIN_APP_EXE "rpi-imager.exe"
@ -23,7 +23,7 @@
######################################################################
VIProductVersion "${VERSION}"
VIProductVersion "@IMAGER_VERSION_MAJOR@.@IMAGER_VERSION_MINOR@.0.0"
VIAddVersionKey "ProductName" "${APP_NAME}"
VIAddVersionKey "CompanyName" "${COMP_NAME}"
VIAddVersionKey "LegalCopyright" "${COPYRIGHT}"

View file

@ -4,8 +4,8 @@ IDI_ICON1 ICON DISCARDABLE "../icons/rpi-imager.ico"
CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "rpi-imager.manifest"
1 VERSIONINFO
FILEVERSION 1,1,0,0
PRODUCTVERSION 1,1,0,0
FILEVERSION IMAGER_VERSION_CSV
PRODUCTVERSION IMAGER_VERSION_CSV
{
BLOCK "StringFileInfo"
{