From f998d678e60bf3ac56fe6ca3575adad4838c4677 Mon Sep 17 00:00:00 2001 From: Adam Treat Date: Wed, 12 Apr 2023 22:12:01 -0400 Subject: [PATCH] Desktop logos/shortcuts. --- CMakeLists.txt | 9 ++++++--- cmake/deploy-qt-linux.cmake.in | 10 ++++++++-- cmake/deploy-qt-mac.cmake.in | 6 ++++++ cmake/deploy-qt-windows.cmake.in | 6 ++++++ cmake/installerscript.qs | 12 ++++++++---- 5 files changed, 34 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b6da938d..bed979fd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.16) -project(gpt4all-chat VERSION 0.1 LANGUAGES CXX) +project(gpt4all VERSION 0.1 LANGUAGES CXX) set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) @@ -27,6 +27,9 @@ qt_add_qml_module(chat icons/regenerate.svg icons/logo.svg icons/copy.svg + icons/logo-16.png + icons/logo-32.png + icons/logo-48.png ) set_target_properties(chat PROPERTIES @@ -44,7 +47,7 @@ target_link_libraries(chat target_link_libraries(chat PRIVATE ggml ggml_utils) -set(COMPONENT_NAME_MAIN "gpt4all-chat") +set(COMPONENT_NAME_MAIN ${PROJECT_NAME}) set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/install) install(TARGETS chat DESTINATION bin COMPONENT ${COMPONENT_NAME_MAIN}) @@ -86,7 +89,7 @@ set(CPACK_IFW_PACKAGE_TITLE "GPT4All Chat Installer") set(CPACK_IFW_PACKAGE_PUBLISHER "Adam Treat") set(CPACK_IFW_PRODUCT_URL "https://github.com/manyoso/gpt4all-chat") set(CPACK_IFW_PACKAGE_WIZARD_STYLE "Aero") -set(CPACK_IFW_PACKAGE_LOGO "${CMAKE_CURRENT_SOURCE_DIR}/icons/logo-32.png") +set(CPACK_IFW_PACKAGE_LOGO "${CMAKE_CURRENT_SOURCE_DIR}/icons/logo-48.png") set(CPACK_IFW_PACKAGE_WINDOW_ICON "${CMAKE_CURRENT_SOURCE_DIR}/icons/logo-32.png") set(CPACK_IFW_PACKAGE_WIZARD_SHOW_PAGE_LIST OFF) diff --git a/cmake/deploy-qt-linux.cmake.in b/cmake/deploy-qt-linux.cmake.in index b01ce327..3f047207 100644 --- a/cmake/deploy-qt-linux.cmake.in +++ b/cmake/deploy-qt-linux.cmake.in @@ -2,5 +2,11 @@ set(LINUXDEPLOYQT "@LINUXDEPLOYQT@") set(COMPONENT_NAME_MAIN "@COMPONENT_NAME_MAIN@") set(CMAKE_CURRENT_SOURCE_DIR "@CMAKE_CURRENT_SOURCE_DIR@") execute_process(COMMAND ${LINUXDEPLOYQT} ${CPACK_TEMPORARY_INSTALL_DIRECTORY}/packages/${COMPONENT_NAME_MAIN}/data/bin/chat -qmldir=${CMAKE_CURRENT_SOURCE_DIR} -verbose=2) -file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/models/ggml-gpt4all-j.bin - DESTINATION ${CPACK_TEMPORARY_INSTALL_DIRECTORY}/packages/${COMPONENT_NAME_MAIN}/data/bin) +#file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/models/ggml-gpt4all-j.bin +# DESTINATION ${CPACK_TEMPORARY_INSTALL_DIRECTORY}/packages/${COMPONENT_NAME_MAIN}/data/bin) +file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/icons/logo-16.png" + DESTINATION ${CPACK_TEMPORARY_INSTALL_DIRECTORY}/packages/${COMPONENT_NAME_MAIN}/data) +file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/icons/logo-32.png" + DESTINATION ${CPACK_TEMPORARY_INSTALL_DIRECTORY}/packages/${COMPONENT_NAME_MAIN}/data) +file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/icons/logo-48.png" + DESTINATION ${CPACK_TEMPORARY_INSTALL_DIRECTORY}/packages/${COMPONENT_NAME_MAIN}/data) diff --git a/cmake/deploy-qt-mac.cmake.in b/cmake/deploy-qt-mac.cmake.in index 59553266..a6613873 100644 --- a/cmake/deploy-qt-mac.cmake.in +++ b/cmake/deploy-qt-mac.cmake.in @@ -4,3 +4,9 @@ set(CMAKE_CURRENT_SOURCE_DIR "@CMAKE_CURRENT_SOURCE_DIR@") execute_process(COMMAND ${MACDEPLOYQT} ${CPACK_TEMPORARY_INSTALL_DIRECTORY}/packages/${COMPONENT_NAME_MAIN}/data/bin/chat.app -qmldir=${CMAKE_CURRENT_SOURCE_DIR} -verbose=2) file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/models/ggml-gpt4all-j.bin DESTINATION ${CPACK_TEMPORARY_INSTALL_DIRECTORY}/packages/${COMPONENT_NAME_MAIN}/data/bin/chat.app/Contents/MacOS) +file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/icons/logo-16.png" + DESTINATION ${CPACK_TEMPORARY_INSTALL_DIRECTORY}/packages/${COMPONENT_NAME_MAIN}/data/bin) +file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/icons/logo-32.png" + DESTINATION ${CPACK_TEMPORARY_INSTALL_DIRECTORY}/packages/${COMPONENT_NAME_MAIN}/data/bin) +file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/icons/logo-48.png" + DESTINATION ${CPACK_TEMPORARY_INSTALL_DIRECTORY}/packages/${COMPONENT_NAME_MAIN}/data/bin) diff --git a/cmake/deploy-qt-windows.cmake.in b/cmake/deploy-qt-windows.cmake.in index 9a19edbe..0dfdaafd 100644 --- a/cmake/deploy-qt-windows.cmake.in +++ b/cmake/deploy-qt-windows.cmake.in @@ -4,3 +4,9 @@ set(CMAKE_CURRENT_SOURCE_DIR "@CMAKE_CURRENT_SOURCE_DIR@") execute_process(COMMAND ${WINDEPLOYQT} --qmldir ${CMAKE_CURRENT_SOURCE_DIR} ${CPACK_TEMPORARY_INSTALL_DIRECTORY}/packages/${COMPONENT_NAME_MAIN}/data/bin) file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/models/ggml-gpt4all-j.bin DESTINATION ${CPACK_TEMPORARY_INSTALL_DIRECTORY}/packages/${COMPONENT_NAME_MAIN}/data/bin) +file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/icons/logo-16.png" + DESTINATION ${CPACK_TEMPORARY_INSTALL_DIRECTORY}/packages/${COMPONENT_NAME_MAIN}/data/bin) +file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/icons/logo-32.png" + DESTINATION ${CPACK_TEMPORARY_INSTALL_DIRECTORY}/packages/${COMPONENT_NAME_MAIN}/data/bin) +file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/icons/logo-48.png" + DESTINATION ${CPACK_TEMPORARY_INSTALL_DIRECTORY}/packages/${COMPONENT_NAME_MAIN}/data/bin) diff --git a/cmake/installerscript.qs b/cmake/installerscript.qs index e6e0462b..b95e8db5 100644 --- a/cmake/installerscript.qs +++ b/cmake/installerscript.qs @@ -17,7 +17,7 @@ Component.prototype.createOperations = function() "@TargetDir@/chat.exe", "@UserProfile@/Desktop/chat.lnk", "workingDirectory=@TargetDir@", - "iconPath=%SystemRoot%/system32/SHELL32.dll", + "iconPath=@TargetDir@/logo-48.png", "iconId=2", "description=Open GPT4All Chat"); } catch (e) { print("ERROR: creating desktop shortcut" + e); @@ -26,12 +26,16 @@ Component.prototype.createOperations = function() "@TargetDir@/chat.exe", "@StartMenuDir@/chat.lnk", "workingDirectory=@TargetDir@", - "iconPath=%SystemRoot%/system32/SHELL32.dll", + "iconPath=@TargetDir@/logo-48.png", "iconId=2", "description=Open GPT4All Chat"); } else if (systemInfo.productType === "osx") { } else { // linux - component.addOperation("CreateDesktopEntry", "/usr/share/applications/GPT4AllChat.desktop", "Version=0.1.0\nType=Application\nTerminal=false\nExec=@TargetDir@/chat\nName=GPT4All-Chat\nIcon=@TargetDir@YourApp_icon.png\nName[en_US]=GPT4All-Chat"); - component.addElevatedOperation("Copy", "/usr/share/applications/GPT4AllChat.desktop", "@HomeDir@/Desktop/GPT4AllChat.desktop"); + component.addOperation("CreateDesktopEntry", + "/usr/share/applications/GPT4AllChat.desktop", + "Type=Application\nTerminal=false\nExec=@TargetDir@/bin/chat\nName=GPT4All-Chat\nIcon=@TargetDir@/logo-48.png\nName[en_US]=GPT4All-Chat"); + component.addElevatedOperation("Copy", + "/usr/share/applications/GPT4AllChat.desktop", + "@HomeDir@/Desktop/GPT4AllChat.desktop"); } } catch (e) { print("ERROR: creating desktop/startmenu shortcuts" + e);