Skip to content

Commit

Permalink
fix application icon on Windows #52, add more WIX customizations
Browse files Browse the repository at this point in the history
  • Loading branch information
Neverous committed Feb 26, 2023
1 parent 92cb9e2 commit 6d3bab1
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 2 deletions.
25 changes: 23 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ if(NOT ("$ENV{BUILD_VERSION}" STREQUAL ""))
string(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+" VERSION $ENV{BUILD_VERSION})
endif()

string(REGEX MATCH "([0-9]+)\\.([0-9]+)\\.([0-9]+)" _version_match ${VERSION})
set(VERSION_MAJOR ${CMAKE_MATCH_1})
set(VERSION_MINOR ${CMAKE_MATCH_2})
set(VERSION_PATCH ${CMAKE_MATCH_3})

project(efibooteditor
VERSION ${VERSION}
DESCRIPTION "Boot Editor for (U)EFI based systems."
Expand All @@ -14,6 +19,7 @@ project(efibooteditor
set(PROJECT_NAME_CAPITALIZED "EFIBootEditor")
set(PROJECT_HOMEPAGE_URL "https://github.com/Neverous/efibooteditor")
set(APPLICATION_NAME "EFI Boot Editor")
set(APPLICATION_ICON "${CMAKE_SOURCE_DIR}/icons/Tango/256/categories/preferences-system.ico")

set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
Expand Down Expand Up @@ -79,9 +85,13 @@ endif()
target_compile_definitions(${PROJECT_NAME} PRIVATE
APPLICATION_NAME="${APPLICATION_NAME}"
VERSION="${VERSION}"
VERSION_MAJOR=${VERSION_MAJOR}
VERSION_MINOR=${VERSION_MINOR}
VERSION_PATCH=${VERSION_PATCH}
PROJECT_NAME="${PROJECT_NAME}"
PROJECT_DESCRIPTION="${PROJECT_DESCRIPTION}"
PROJECT_HOMEPAGE_URL="${PROJECT_HOMEPAGE_URL}"
APPLICATION_ICON="${APPLICATION_ICON}"
QT_DEPRECATED_WARNINGS
QT_DISABLE_DEPRECATED_BEFORE=0xFFFFFF
)
Expand Down Expand Up @@ -200,6 +210,7 @@ if(WIN32)
src/efivar-lite.c
src/efivar-lite.common.h
src/efivar-lite.win32.c
windows.rc
)
endif()

Expand Down Expand Up @@ -311,13 +322,21 @@ if(WIN32)
install(DIRECTORY "${CMAKE_BINARY_DIR}/qt/"
TYPE BIN
COMPONENT Runtime
PATTERN "*.pdb" EXCLUDE
)

if(("${CMAKE_BUILD_TYPE}" STREQUAL "Debug") OR ("${CMAKE_BUILD_TYPE}" STREQUAL "RelWithDebInfo"))
install(FILES "$<TARGET_PDB_FILE:${PROJECT_NAME}>"
TYPE BIN
COMPONENT Debug
)

install(DIRECTORY "${CMAKE_BINARY_DIR}/qt/"
TYPE BIN
COMPONENT Debug
FILES_MATCHING
PATTERN "*.pdb"
)
endif()

elseif(APPLE)
Expand Down Expand Up @@ -356,12 +375,12 @@ set(CPACK_PACKAGE_DIRECTORY dist)
set(CPACK_PACKAGE_EXECUTABLES ${PROJECT_NAME} "${PROJECT_NAME_CAPITALIZED}")
set(CPACK_PACKAGE_HOMEPAGE_URL ${PROJECT_HOMEPAGE_URL})
set(CPACK_PACKAGE_INSTALL_DIRECTORY "${PROJECT_NAME_CAPITALIZED}")
set(CPACK_PACKAGE_NAME "${PROJECT_NAME_CAPITALIZED}")
set(CPACK_PACKAGE_NAME "${APPLICATION_NAME}")
set(CPACK_PACKAGE_VENDOR ${PROJECT_NAME_CAPITALIZED})
set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE.txt")
set(CPACK_RESOURCE_FILE_README "${CMAKE_SOURCE_DIR}/README.md")
set(CPACK_PACKAGE_ICON "${CMAKE_SOURCE_DIR}/icons/Tango/scalable/categories/preferences-desktop.svg")
set(CPACK_PACKAGE_ICON "${APPLICATION_ICON}")

if("${CMAKE_BUILD_TYPE}" STREQUAL "Release")
set(CPACK_STRIP_FILES TRUE)
Expand All @@ -373,6 +392,8 @@ if(WIN32)

set(CPACK_WIX_LIGHT_EXTRA_FLAGS "-dcl:high")
set(CPACK_WIX_PRODUCT_ICON ${CPACK_PACKAGE_ICON})
set(CPACK_WIX_UI_BANNER "${CMAKE_SOURCE_DIR}/misc/wix_banner.png")
set(CPACK_WIX_UI_DIALOG "${CMAKE_SOURCE_DIR}/misc/wix_dialog.png")
set(CPACK_WIX_PROPERTY_ARPHELPLINK "${CPACK_PACKAGE_HOMEPAGE_URL}")
set(CPACK_WIX_PROPERTY_ARPURLINFOABOUT "${CPACK_PACKAGE_HOMEPAGE_URL}")
set(CPACK_WIX_ROOT_FEATURE_DESCRIPTION "${CPACK_PACKAGE_DESCRIPTION_SUMMARY}")
Expand Down
Binary file added icons/Tango/256/categories/preferences-system.ico
Binary file not shown.
Binary file added misc/wix_banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added misc/wix_dialog.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 28 additions & 0 deletions windows.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#include <windows.h>

IDI_ICON1 ICON DISCARDABLE APPLICATION_ICON

VS_VERSION_INFO VERSIONINFO
FILEVERSION VERSION_MAJOR,VERSION_MINOR,VERSION_PATCH,0
PRODUCTVERSION VERSION_MAJOR,VERSION_MINOR,VERSION_PATCH,0
{
BLOCK "StringFileInfo"
{
// U.S. English - Windows, Multilingual
BLOCK "040904E4"
{
VALUE "ProductName", APPLICATION_NAME
VALUE "CompanyName", APPLICATION_NAME
VALUE "ProductVersion", VERSION
VALUE "FileDescription", PROJECT_DESCRIPTION
VALUE "FileVersion", VERSION
VALUE "InternalName", PROJECT_NAME
VALUE "LegalCopyright", APPLICATION_NAME
VALUE "OriginalFilename", PROJECT_NAME
}
}
BLOCK "VarFileInfo"
{
VALUE "Translation", 0x409, 1252 // 1252 = 0x04E4
}
}

0 comments on commit 6d3bab1

Please sign in to comment.