diff --git a/CMakeLists.txt b/CMakeLists.txt index 88d64cac..1f00a3ab 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -62,19 +62,21 @@ elseif(${CMAKE_SYSTEM_NAME} MATCHES Windows) "${CMAKE_BINARY_DIR}/cmake/deploy-qt-windows.cmake" @ONLY) set(CPACK_PRE_BUILD_SCRIPTS ${CMAKE_BINARY_DIR}/cmake/deploy-qt-windows.cmake) set(CPACK_IFW_ROOT "C:/Qt/Tools/QtInstallerFramework/4.5") + set(CPACK_IFW_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/icons/favicon.ico") elseif(${CMAKE_SYSTEM_NAME} MATCHES Darwin) find_program(MACDEPLOYQT macdeployqt HINTS ${_qt_bin_dir}) configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/deploy-qt-mac.cmake.in" "${CMAKE_BINARY_DIR}/cmake/deploy-qt-mac.cmake" @ONLY) set(CPACK_PRE_BUILD_SCRIPTS ${CMAKE_BINARY_DIR}/cmake/deploy-qt-mac.cmake) set(CPACK_IFW_ROOT "~/Qt/Tools/QtInstallerFramework/4.5") + set(CPACK_IFW_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/icons/favicon.icns") endif() set(CPACK_PACKAGE_VERSION_MAJOR "0") set(CPACK_PACKAGE_VERSION_MINOR "1") SET(CPACK_PACKAGE_VERSION_PATCH "0") set(CPACK_PACKAGE_HOMEPAGE_URL "https://gpt4all.io") -set(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/icons/logo.svg") +set(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/icons/logo-48.png") set(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE) set(CPACK_RESOURCE_FILE_README ${CMAKE_CURRENT_SOURCE_DIR}/README.md) set(CPACK_PACKAGE_EXECUTABLES "GPT4All Chat") @@ -84,7 +86,8 @@ 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_WINDOW_ICON "${CMAKE_CURRENT_SOURCE_DIR}/icons/logo.svg") +set(CPACK_IFW_PACKAGE_LOGO "${CMAKE_CURRENT_SOURCE_DIR}/icons/logo-32.png") +set(CPACK_IFW_PACKAGE_WINDOW_ICON "${CMAKE_CURRENT_SOURCE_DIR}/icons/logo-32.png") set(CPACK_IFW_PACKAGE_WIZARD_SHOW_PAGE_LIST OFF) include(CPack) @@ -92,6 +95,7 @@ include(CPackIFW) cpack_add_component(${COMPONENT_NAME_MAIN} DOWNLOADED) cpack_ifw_configure_component(${COMPONENT_NAME_MAIN} ESSENTIAL FORCED_INSTALLATION) cpack_ifw_configure_component(${COMPONENT_NAME_MAIN} LICENSES "GPL-3.0 LICENSE" ${CPACK_RESOURCE_FILE_LICENSE}) +cpack_ifw_configure_component(${COMPONENT_NAME_MAIN} SCRIPT "${CMAKE_CURRENT_SOURCE_DIR}/cmake/installer-script.qs") if(${CMAKE_SYSTEM_NAME} MATCHES Linux) cpack_ifw_add_repository("GPT4AllRepository" URL "https://gpt4all.io/installer_repos/linux/repository") diff --git a/cmake/installerscript.qs b/cmake/installerscript.qs new file mode 100644 index 00000000..e6e0462b --- /dev/null +++ b/cmake/installerscript.qs @@ -0,0 +1,39 @@ +function Component() +{ + // default constructor +} + +Component.prototype.createOperations = function() +{ + try { + // call the base create operations function + component.createOperations(); + + if (systemInfo.productType === "windows") { + try { + var userProfile = installer.environmentVariable("USERPROFILE"); + installer.setValue("UserProfile", userProfile); + component.addOperation("CreateShortcut", + "@TargetDir@/chat.exe", + "@UserProfile@/Desktop/chat.lnk", + "workingDirectory=@TargetDir@", + "iconPath=%SystemRoot%/system32/SHELL32.dll", + "iconId=2", "description=Open GPT4All Chat"); + } catch (e) { + print("ERROR: creating desktop shortcut" + e); + } + component.addOperation("CreateShortcut", + "@TargetDir@/chat.exe", + "@StartMenuDir@/chat.lnk", + "workingDirectory=@TargetDir@", + "iconPath=%SystemRoot%/system32/SHELL32.dll", + "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"); + } + } catch (e) { + print("ERROR: creating desktop/startmenu shortcuts" + e); + } +} \ No newline at end of file diff --git a/icons/16.png b/icons/16.png deleted file mode 100644 index 6e36987f..00000000 Binary files a/icons/16.png and /dev/null differ diff --git a/icons/favicon.icns b/icons/favicon.icns new file mode 100644 index 00000000..7bf08144 Binary files /dev/null and b/icons/favicon.icns differ diff --git a/icons/favicon.ico b/icons/favicon.ico new file mode 100644 index 00000000..3d045e24 Binary files /dev/null and b/icons/favicon.ico differ diff --git a/icons/logo-16.png b/icons/logo-16.png new file mode 100644 index 00000000..14a50370 Binary files /dev/null and b/icons/logo-16.png differ diff --git a/icons/logo-32.png b/icons/logo-32.png new file mode 100644 index 00000000..51d4f62c Binary files /dev/null and b/icons/logo-32.png differ diff --git a/icons/logo-48.png b/icons/logo-48.png new file mode 100644 index 00000000..3b5c55eb Binary files /dev/null and b/icons/logo-48.png differ diff --git a/icons/logo.svg b/icons/logo.svg index 0bf279df..b6750df2 100644 --- a/icons/logo.svg +++ b/icons/logo.svg @@ -1,20 +1,28 @@ - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + GPT + 4ALL +