diff --git a/UpdCheck/UpdCheck.rc b/UpdCheck/UpdCheck.rc index 671cc05..43dc9cf 100644 Binary files a/UpdCheck/UpdCheck.rc and b/UpdCheck/UpdCheck.rc differ diff --git a/UpdCheck/main.cpp b/UpdCheck/main.cpp index ab9f4a6..6c230d2 100644 --- a/UpdCheck/main.cpp +++ b/UpdCheck/main.cpp @@ -33,7 +33,7 @@ int CALLBACK WinMain(_In_ HINSTANCE hInstance, _In_ HINSTANCE hPrevInstance, _In return -1; // Initialize configuration. - wxConfigBase *cfgPrev = wxConfigBase::Set(new wxConfig(wxT(UPDATER_CFG_APPLICATION) wxT("\\Updater"), wxT(UPDATER_CFG_VENDOR))); + wxConfigBase *cfgPrev = wxConfigBase::Set(new wxConfig(wxT(PRODUCT_CFG_APPLICATION) wxT("\\Updater"), wxT(PRODUCT_CFG_VENDOR))); if (cfgPrev) wxDELETE(cfgPrev); // Initialize locale. @@ -52,7 +52,7 @@ int CALLBACK WinMain(_In_ HINSTANCE hInstance, _In_ HINSTANCE hPrevInstance, _In wxMkdir(path); // Prepare log file. - wxFFile log_file(path + wxT("Updater-") wxT(UPDATER_CFG_APPLICATION) wxT(".log"), wxT("wt")); + wxFFile log_file(path + wxT("Updater-") wxT(PRODUCT_CFG_APPLICATION) wxT(".log"), wxT("wt")); if (log_file.IsOpened()) delete wxLog::SetActiveTarget(new wxLogStderr(log_file.fp())); diff --git a/UpdPublish/UpdPublish.rc b/UpdPublish/UpdPublish.rc index 4b3622b..edb1a29 100644 Binary files a/UpdPublish/UpdPublish.rc and b/UpdPublish/UpdPublish.rc differ diff --git a/UpdPublish/main.cpp b/UpdPublish/main.cpp index 6888ba4..ba81251 100644 --- a/UpdPublish/main.cpp +++ b/UpdPublish/main.cpp @@ -85,10 +85,10 @@ void UpdaterAddDownloads(wxXmlNode *elPackage, const wxString &platformId, const void UpdaterAddPackage(wxXmlNode *elPackages, const wxString &platformId, const wxString &languageId, const wxString &url, const wxMemoryBuffer &hash) { wxXmlNode *elHex = new wxXmlNode(wxXML_ELEMENT_NODE, wxT("hex")); - elHex->AddChild(new wxXmlNode(wxXML_TEXT_NODE, wxEmptyString, wxString::Format(wxT("%08x"), UPDATER_PRODUCT_VERSION))); + elHex->AddChild(new wxXmlNode(wxXML_TEXT_NODE, wxEmptyString, wxString::Format(wxT("%08x"), PRODUCT_VERSION))); wxXmlNode *elDesc = new wxXmlNode(wxXML_ELEMENT_NODE, wxT("desc")); - elDesc->AddChild(new wxXmlNode(wxXML_TEXT_NODE, wxEmptyString, wxT(UPDATER_PRODUCT_VERSION_STR))); + elDesc->AddChild(new wxXmlNode(wxXML_TEXT_NODE, wxEmptyString, wxT(PRODUCT_VERSION_STR))); wxXmlNode *elVersion = new wxXmlNode(wxXML_ELEMENT_NODE, wxT("Version")); elVersion->AddChild(new wxXmlNode(wxXML_TEXT_NODE, wxEmptyString, wxT("\n\t\t\t"))); @@ -201,7 +201,7 @@ int _tmain(int argc, _TCHAR *argv[]) } } } - if (version != UPDATER_PRODUCT_VERSION) { + if (version != PRODUCT_VERSION) { // This package is not our version. Skip. continue; } diff --git a/UpdSignXML/UpdSignXML.rc b/UpdSignXML/UpdSignXML.rc index df8f52d..24592f2 100644 Binary files a/UpdSignXML/UpdSignXML.rc and b/UpdSignXML/UpdSignXML.rc differ diff --git a/Updater.sln b/Updater.sln index c8c1fb4..b38332a 100644 --- a/Updater.sln +++ b/Updater.sln @@ -13,6 +13,11 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "UpdPublish", "UpdPublish\Up EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Updater", "Updater\build\Updater.vcxproj", "{990D8CF9-4457-4DC0-AA18-4968EF434741}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{28F748D5-D691-4F00-9464-37AF062CF91F}" + ProjectSection(SolutionItems) = preProject + ..\include\UpdaterCfg.h = ..\include\UpdaterCfg.h + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 diff --git a/Updater/MSIBuild/Makefile b/Updater/MSIBuild/Makefile index 8aa38f9..0a91a94 100644 --- a/Updater/MSIBuild/Makefile +++ b/Updater/MSIBuild/Makefile @@ -44,10 +44,10 @@ Component ComponentId Directory_ Attributes Condition KeyPath s$(MSIBUILD_LENGTH_ID) S38 s$(MSIBUILD_LENGTH_ID) i2 S255 S$(MSIBUILD_LENGTH_ID) Component Component !IF "$(PLAT)" == "Win32" -compUpdater.dll.Win32 {F4962976-71C3-4200-B736-BC841FEE29C2} $(UPDATER_BIN_DIR) 0 fileUpdater.dll.Win32 +compUpdater.dll.Win32 {A2DD60BC-D9D1-4D22-A4BF-C28E007C0765} $(UPDATER_BIN_DIR) 0 fileUpdater.dll.Win32 !ENDIF !IF "$(PLAT)" == "x64" -compUpdater.dll.x64 {A968C387-EC14-4CAC-8406-F21C9779D3EF} $(UPDATER_BIN_DIR) 256 fileUpdater.dll.x64 +compUpdater.dll.x64 {2D45C321-2118-4ECC-975D-40991E0860C8} $(UPDATER_BIN_DIR) 256 fileUpdater.dll.x64 !ENDIF !IF "$(LANG)" == "ru_RU" compUpdater.mo.ru_RU {486A9DDF-A43B-4920-BEF9-2907DD8660AD} UPDATERLOCRURUDIR $(MSIBUILD_COMPONENT_ATTRIB_FILE) fileUpdater.mo.ru_RU @@ -91,22 +91,22 @@ s$(MSIBUILD_LENGTH_ID) s$(MSIBUILD_LENGTH_ID) l255 i4 S$(MSIBUILD_LENGTH_ID) S20 File File !IF "$(PLAT)" == "Win32" !IF "$(CFG)" == "Release" -fileUpdater.dll.Win32 compUpdater.dll.Win32 UPDATE~2.DLL|Updater10u_vc100.dll 0 0 1536 1 +fileUpdater.dll.Win32 compUpdater.dll.Win32 UPDATE~1.DLL|Updater$(UPDATER_VERSION)u_vc100.dll 0 0 1536 1 !ENDIF !IF "$(CFG)" == "Debug" -fileUpdater.dll.Win32 compUpdater.dll.Win32 UPDATE~4.DLL|Updater10ud_vc100.dll 0 0 1536 1 +fileUpdater.dll.Win32 compUpdater.dll.Win32 UPDATE~1.DLL|Updater$(UPDATER_VERSION)ud_vc100.dll 0 0 1536 1 !ENDIF !ENDIF !IF "$(PLAT)" == "x64" !IF "$(CFG)" == "Release" -fileUpdater.dll.x64 compUpdater.dll.x64 UPDATE~6.DLL|Updater10u_vc100_x64.dll 0 0 1536 1 +fileUpdater.dll.x64 compUpdater.dll.x64 UPDATE~1.DLL|Updater$(UPDATER_VERSION)u_vc100_x64.dll 0 0 1536 1 !ENDIF !IF "$(CFG)" == "Debug" -fileUpdater.dll.x64 compUpdater.dll.x64 UPDATE~8.DLL|Updater10ud_vc100_x64.dll 0 0 1536 1 +fileUpdater.dll.x64 compUpdater.dll.x64 UPDATE~1.DLL|Updater$(UPDATER_VERSION)ud_vc100_x64.dll 0 0 1536 1 !ENDIF !ENDIF !IF "$(LANG)" != "en_US" -fileUpdater.mo.$(LANG) compUpdater.mo.$(LANG) UPDATE~1.MO|Updater10.mo 0 $(MSIBUILD_LANGID) 0 1 +fileUpdater.mo.$(LANG) compUpdater.mo.$(LANG) UPDATE~1.MO|Updater$(UPDATER_VERSION).mo 0 $(MSIBUILD_LANGID) 0 1 !ENDIF < - - 10 - + ..\..\..\output\$(Platform).$(Configuration)\ diff --git a/Updater/include/Updater/common.h b/Updater/include/Updater/common.h index cb27cbd..c58bfe6 100644 --- a/Updater/include/Updater/common.h +++ b/Updater/include/Updater/common.h @@ -23,34 +23,6 @@ #include "../../../../include/UpdaterCfg.h" -// -// Product version as a single DWORD -// Note: Used for version comparison within C/C++ code. -// -#define UPDATER_VERSION 0x01000000 - -// -// Product version by components -// Note: Resource Compiler has limited preprocessing capability, -// thus we need to specify major, minor and other version components -// separately. -// -#define UPDATER_VERSION_MAJ 1 -#define UPDATER_VERSION_MIN 0 -#define UPDATER_VERSION_REV 0 -#define UPDATER_VERSION_BUILD 0 - -// -// Human readable product version and build year for UI -// -#define UPDATER_VERSION_STR "1.0" -#define UPDATER_BUILD_YEAR_STR "2016" - -// -// Updater API level -// -#define wxUpdaterVersion "10" - // // Resource IDs // diff --git a/Updater/res/Updater.rc b/Updater/res/Updater.rc index 958e3fc..5b85987 100644 Binary files a/Updater/res/Updater.rc and b/Updater/res/Updater.rc differ diff --git a/Updater/src/chkthread.cpp b/Updater/src/chkthread.cpp index 978159f..3671bb9 100644 --- a/Updater/src/chkthread.cpp +++ b/Updater/src/chkthread.cpp @@ -34,7 +34,7 @@ wxUpdCheckThread::wxUpdCheckThread(const wxString &langId, wxEvtHandler *parent) m_parent(parent), m_abort(false), m_langId(langId), - m_config(wxT(UPDATER_CFG_APPLICATION) wxT("\\Updater"), wxT(UPDATER_CFG_VENDOR)), + m_config(wxT(PRODUCT_CFG_APPLICATION) wxT("\\Updater"), wxT(PRODUCT_CFG_VENDOR)), m_cs(NULL), m_ck(NULL), m_version(0), @@ -121,14 +121,14 @@ wxUpdCheckThread::wxResult wxUpdCheckThread::DoCheckForUpdate() return wxUpdRepoUnavailable; } - if (m_version <= UPDATER_PRODUCT_VERSION) { + if (m_version <= PRODUCT_VERSION) { wxLogStatus(_("Update check complete. Your product is up to date.")); return wxUpdUpToDate; } } m_fileName = m_path; - m_fileName += wxT("Updater-") wxT(UPDATER_CFG_APPLICATION) wxT("-"); + m_fileName += wxT("Updater-") wxT(PRODUCT_CFG_APPLICATION) wxT("-"); m_fileName += m_versionStr; m_fileName += wxT(".msi"); @@ -154,7 +154,7 @@ wxXmlDocument* wxUpdCheckThread::GetCatalogue() // Load repository database. wxHTTP http; - http.SetHeader(wxS("User-Agent"), wxS("Updater/") wxS(UPDATER_VERSION_STR)); + http.SetHeader(wxS("User-Agent"), wxS("Updater/") wxS(PRODUCT_VERSION_STR)); if (!lastModified.IsEmpty()) http.SetHeader(wxS("If-Modified-Since"), lastModified); if (!http.Connect(server, UPDATER_HTTP_PORT)) { @@ -296,7 +296,7 @@ bool wxUpdCheckThread::ParseCatalogue(const wxXmlDocument &doc) } } } - if (version <= UPDATER_PRODUCT_VERSION || version < m_version) { + if (version <= PRODUCT_VERSION || version < m_version) { // This package is older than currently installed product or the superseeded package found already. continue; } @@ -463,7 +463,7 @@ bool wxUpdCheckThread::DownloadUpdatePackage() const wxString scheme = url.GetScheme(); if (scheme == wxT("http") || scheme == wxT("https")) { wxHTTP &http = (wxHTTP&)url.GetProtocol(); - http.SetHeader(wxS("User-Agent"), wxS("Updater/") wxS(UPDATER_VERSION_STR)); + http.SetHeader(wxS("User-Agent"), wxS("Updater/") wxS(PRODUCT_VERSION_STR)); } } @@ -520,7 +520,7 @@ bool wxUpdCheckThread::LaunchUpdate(WXHWND hParent, bool headless) // Logging wxString fileNameLog(m_path); - fileNameLog += wxT("Updater-") wxT(UPDATER_CFG_APPLICATION) wxT("-msiexec.log"); + fileNameLog += wxT("Updater-") wxT(PRODUCT_CFG_APPLICATION) wxT("-msiexec.log"); param += wxT(" /l* \""); param += fileNameLog;