diff --git a/README.md b/README.md index fa3c41a..0a2957e 100644 --- a/README.md +++ b/README.md @@ -78,8 +78,8 @@ Once the updater has been started, it: To customize the application name, organization and messages displayed by the updater: - 1. Edit the AppInfo class (in AppInfo.h, AppInfo.cpp) to set the name - of the application and associated organization. + 1. Compile passing to cmake the strings you want for the AppInfo class, for + example: `cmake .. -DDAPPINFO_APPLICATION_NAME="\"My App Name\""` 2. Replace the icons in src/resources 3. Change the product name and organization in src/resources/updater.rc 4. If you are building the updater on Windows and have a suitable Authenticode diff --git a/src/AppInfo.cpp b/src/AppInfo.cpp index 7b6f662..16727ca 100644 --- a/src/AppInfo.cpp +++ b/src/AppInfo.cpp @@ -17,7 +17,7 @@ std::string AppInfo::updateErrorMessage(const std::string& details) std::string result = "There was a problem installing the update:\n\n"; result += details; result += "\n\nYou can try downloading and installing the latest version of " - "Mendeley Desktop from http://www.mendeley.com/download-mendeley-desktop"; + APPINFO_APPLICATION_NAME " from " APPINFO_URL; return result; } diff --git a/src/AppInfo.h b/src/AppInfo.h index 3a3041c..b6e45a9 100644 --- a/src/AppInfo.h +++ b/src/AppInfo.h @@ -24,16 +24,16 @@ class AppInfo inline std::string AppInfo::name() { - return "Mendeley Updater"; + return APPINFO_UPDATER_NAME; } inline std::string AppInfo::appName() { - return "Mendeley Desktop"; + return APPINFO_APPLICATION_NAME; } inline std::string AppInfo::organizationName() { - return "Mendeley Ltd."; + return APPINFO_COMPANY_NAME; } diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 6a29bfa..a6d6897 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -21,6 +21,26 @@ endif() add_definitions(-DTIXML_USE_STL) +if (NOT DEFINED APPINFO_APPLICATION_NAME) + set(APPINFO_APPLICATION_NAME "\"Mendeley Desktop\"") +endif() +add_definitions(-DAPPINFO_APPLICATION_NAME=${APPINFO_APPLICATION_NAME}) + +if (NOT DEFINED APPINFO_COMPANY_NAME) + set(APPINFO_COMPANY_NAME "\"Mendeley Ltd.\"") +endif() +add_definitions(-DAPPINFO_COMPANY_NAME=${APPINFO_COMPANY_NAME}) + +IF (NOT DEFINED APPINFO_UPDATER_NAME) + set(APPINFO_UPDATER_NAME "\"Mendeley Updater\"") +endif() +add_definitions(-DAPPINFO_UPDATER_NAME=${APPINFO_UPDATER_NAME}) + +IF (NOT DEFINED APPINFO_URL) + set(APPINFO_URL "\"http://www.mendeley.com/download-mendeley-desktop\"") +endif() +add_definitions(-DAPPINFO_URL=${APPINFO_URL}) + set (SOURCES AppInfo.cpp DirIterator.cpp