diff --git a/Update_Version.ps1 b/Update_Version.ps1 index 0a4ea7f..0be41ac 100644 --- a/Update_Version.ps1 +++ b/Update_Version.ps1 @@ -67,6 +67,7 @@ function makeVersionString([string]$vmaj, [string]$vmin, [string]$vbld, [string] [string]$buildDateTime = [string]$vs = [string]$vn = [string]$intName = [string]$origName = $null [int]$pys = [int]$spanDays = [int]$spanSecs = $null [int]$currentYear = [int]$currentMonth = [int]$currentDay = [int]$currentHour = [int]$currentMinute = [int]$currentSecond = $null +[string]$platformArch = $args[0] [string]$iniFile = ".\Version.ini" #endregion @@ -125,8 +126,8 @@ $currentSecond = $date.Second $buildDateTime = "Build date: $($date.GetDateTimeFormats('u').Replace('Z', ''))" $spanDays = [math]::Round((New-TimeSpan -Start $(Get-Date -Month 1 -Day 1 -Year 2000) -End $date).TotalDays) $spanSecs = [math]::Round((New-TimeSpan -Start $($date.Date) -End $($date.DateTime)).TotalSeconds) -if ($pys -eq $currentYear) { $pcf = "Copyright (C) $pys by $pa" } else { $pcf = "Copyright (C) $pys-$currentYear by $pa" } -$intName = "$pn-C++" +if ($pys -eq $currentYear) { $pcf = "Copyright (c) $pys $pa" } else { $pcf = "Copyright (c) $pys-$currentYear $pa" } +$intName = "$pn-$platformArch-C++" $origName = "$pn.exe" $verMajor = getValue $verMajor $verMinor = getValue $verMinor @@ -147,6 +148,8 @@ else { $pnf = "$pn v$vs" } +$pnf = "$pn v$vs ($platformArch)" + #region Save all variables to file "// $pn" | Out-File -FilePath ".\VersionInfo.h" -Encoding unicode "// VersionInfo.h" | Out-File -FilePath ".\VersionInfo.h" -Encoding unicode -Append @@ -179,6 +182,7 @@ else { # echo " verPatch: [$verPatch]" # echo "" # echo " aboutBuild: [$aboutBuild]" +# echo " platformArch: [$platformArch]" # echo " productNameFull: [$pnf]" # echo "productCopyrightFull: [$pcf]" # echo " internalName: [$intName]" diff --git a/pre-build.cmd b/pre-build.cmd index dfebaf1..de6f5a6 100644 --- a/pre-build.cmd +++ b/pre-build.cmd @@ -1,5 +1,4 @@ @ECHO OFF - :: MIT License :: :: Copyright (c) 2023 W0LF aka 'dreamforce' @@ -26,13 +25,19 @@ :: "$(SolutionDir)pre-build.cmd" "$(SolutionDir)" "$(ProjectDir)" :: Then in "Resource Includes..." add '#include "VersionInfo.rc"' into 'Compile-time Directives' +REM In VisualStudio add to Pre-Build events: +REM "$(SolutionDir)pre-build.cmd" "$(SolutionDir)" "$(ProjectDir)" "$(PlatformTarget)" +REM Then in "Resource Includes..." add '#include "VersionInfo.rc"' into 'Compile-time Directives' + IF "%~1" == "" GOTO :no_args IF "%~2" == "" GOTO :no_args +IF "%~3" == "" GOTO :no_args SET solutionDir=%1 SET projectDir=%2 +SET platformArch=%3 CD /D %solutionDir% -powershell -ExecutionPolicy RemoteSigned -File Update_Version.ps1 +powershell -ExecutionPolicy RemoteSigned -File Update_Version.ps1 %platformArch% MOVE /Y %solutionDir%VersionInfo.h %projectDir%VersionInfo.h EXIT diff --git a/wCenterWindow/CLogger.cpp b/wCenterWindow/CLogger.cpp index 4b140c2..9bcc9a6 100644 --- a/wCenterWindow/CLogger.cpp +++ b/wCenterWindow/CLogger.cpp @@ -24,6 +24,7 @@ // CLogger.cpp #include "CLogger.h" +#include #include #include @@ -86,13 +87,6 @@ CLogger::CLogger(const wchar_t* _appTitle) { Init(); } -CLogger::CLogger(const wchar_t* _appTitle, const wchar_t* _appVersion) { - szAppTitle = _appTitle; szAppVersion = _appVersion; - szAppTitleVer = _appTitle; - szAppTitleVer.append(L", v").append(_appVersion); - Init(); -} - CLogger::~CLogger() { if (fsLogFile) { fsLogFile << GetTimeStamp() << "Stop log." << std::endl; diff --git a/wCenterWindow/CLogger.h b/wCenterWindow/CLogger.h index 4b8e65b..a057ad4 100644 --- a/wCenterWindow/CLogger.h +++ b/wCenterWindow/CLogger.h @@ -34,7 +34,6 @@ class CLogger public: void Out(const wchar_t*, ...); CLogger(const wchar_t*); - CLogger(const wchar_t*, const wchar_t*); ~CLogger(); private: @@ -47,6 +46,7 @@ private: std::wofstream fsLogFile; std::wstring szAppTitle{ 0 }; std::wstring szAppVersion{ 0 }; + std::wstring szAppPlatform{ 0 }; std::wstring szAppTitleVer{ 0 }; inline wchar_t* GetTimeStamp(); diff --git a/wCenterWindow/wCenterWindow.cpp b/wCenterWindow/wCenterWindow.cpp index 46875c7..6fbeae3 100644 --- a/wCenterWindow/wCenterWindow.cpp +++ b/wCenterWindow/wCenterWindow.cpp @@ -51,7 +51,7 @@ HMENU hMenu = NULL, hPopup = NULL; HWND hFgWnd = NULL; BOOL bKPressed = FALSE, bMPressed = FALSE, fShowIcon = TRUE, fCheckUpdates = TRUE, bWorkArea = TRUE; BOOL bLCTRL = FALSE, bLWIN = FALSE, bKEYV = FALSE; -CLogger logger(TEXT(PRODUCT_NAME), TEXT(VERSION_STR)); +CLogger logger(TEXT(PRODUCT_NAME_FULL)); NOTIFYICONDATAW nid = { 0 }; MENUITEMINFO mii = { 0 }; diff --git a/wCenterWindow/wCenterWindow.h b/wCenterWindow/wCenterWindow.h index 9f6813a..5ab7a45 100644 --- a/wCenterWindow/wCenterWindow.h +++ b/wCenterWindow/wCenterWindow.h @@ -30,6 +30,12 @@ #define T1 60 #define T2 86400 +#ifdef _WIN64 +#define ARCH 64 +#else +#define ARCH 86 +#endif + #define MAX_LOADSTRING 50 // Windows Header Files diff --git a/wCenterWindow/wCenterWindow.vcxproj b/wCenterWindow/wCenterWindow.vcxproj index 2365b79..0140ef7 100644 --- a/wCenterWindow/wCenterWindow.vcxproj +++ b/wCenterWindow/wCenterWindow.vcxproj @@ -112,7 +112,7 @@ - "$(SolutionDir)pre-build.cmd" "$(SolutionDir)" "$(ProjectDir)" + "$(SolutionDir)pre-build.cmd" "$(SolutionDir)" "$(ProjectDir)" "$(PlatformTarget)" @@ -137,7 +137,7 @@ %(AdditionalManifestFiles) - "$(SolutionDir)pre-build.cmd" "$(SolutionDir)" "$(ProjectDir)" + "$(SolutionDir)pre-build.cmd" "$(SolutionDir)" "$(ProjectDir)" "$(PlatformTarget)" @@ -151,13 +151,13 @@ Windows true - comctl32.lib;%(AdditionalDependencies) + comctl32.lib;wininet.lib;%(AdditionalDependencies) %(AdditionalManifestFiles) - powershell -File "$(SolutionDir)Update_Version.ps1" move /y "$(SolutionDir)VersionInfo.h" "$(ProjectDir)" + "$(SolutionDir)pre-build.cmd" "$(SolutionDir)" "$(ProjectDir)" "$(PlatformTarget)" @@ -176,13 +176,13 @@ true true false - comctl32.lib;%(AdditionalDependencies) + comctl32.lib;wininet.lib;%(AdditionalDependencies) %(AdditionalManifestFiles) - powershell -File "$(SolutionDir)Update_Version.ps1" move /y "$(SolutionDir)VersionInfo.h" "$(ProjectDir)" + "$(SolutionDir)pre-build.cmd" "$(SolutionDir)" "$(ProjectDir)" "$(PlatformTarget)" diff --git a/wCenterWindow/wCenterWindow.vcxproj.filters b/wCenterWindow/wCenterWindow.vcxproj.filters index d44e6e5..ec656a6 100644 --- a/wCenterWindow/wCenterWindow.vcxproj.filters +++ b/wCenterWindow/wCenterWindow.vcxproj.filters @@ -27,27 +27,24 @@ Header Files - - Header Files - - - Header Files - Header Files Header Files + + Header Files + Source Files - + Source Files - + Source Files