Added platform architecture information to About dialog and CLogger::Out() method.

This commit is contained in:
2023-12-07 20:53:38 +03:00
parent f558df6bf9
commit b8ce96ee99
7 changed files with 22 additions and 46 deletions

View File

@@ -45,6 +45,7 @@ function makeVersionString([string]$vmaj, [string]$vmin, [string]$vbld, [string]
[string]$buildDateTime = [string]$vs = [string]$vn = [string]$intName = [string]$origName = $null [string]$buildDateTime = [string]$vs = [string]$vn = [string]$intName = [string]$origName = $null
[int]$pys = [int]$spanDays = [int]$spanSecs = $null [int]$pys = [int]$spanDays = [int]$spanSecs = $null
[int]$currentYear = [int]$currentMonth = [int]$currentDay = [int]$currentHour = [int]$currentMinute = [int]$currentSecond = $null [int]$currentYear = [int]$currentMonth = [int]$currentDay = [int]$currentHour = [int]$currentMinute = [int]$currentSecond = $null
[string]$platformArch = $args[0]
[string]$iniFile = ".\Version.ini" [string]$iniFile = ".\Version.ini"
#endregion #endregion
@@ -103,8 +104,8 @@ $currentSecond = $date.Second
$buildDateTime = "Build date: $($date.GetDateTimeFormats('u').Replace('Z', ''))" $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) $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) $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" } if ($pys -eq $currentYear) { $pcf = "Copyright (c) $pys $pa" } else { $pcf = "Copyright (c) $pys-$currentYear $pa" }
$intName = "$pn-C++" $intName = "$pn-$platformArch-C++"
$origName = "$pn.exe" $origName = "$pn.exe"
$verMajor = getValue $verMajor $verMajor = getValue $verMajor
$verMinor = getValue $verMinor $verMinor = getValue $verMinor
@@ -125,6 +126,8 @@ else {
$pnf = "$pn v$vs" $pnf = "$pn v$vs"
} }
$pnf = "$pn v$vs ($platformArch)"
#region Save all variables to file #region Save all variables to file
"// $pn" | Out-File -FilePath ".\VersionInfo.h" -Encoding unicode "// $pn" | Out-File -FilePath ".\VersionInfo.h" -Encoding unicode
"// VersionInfo.h" | Out-File -FilePath ".\VersionInfo.h" -Encoding unicode -Append "// VersionInfo.h" | Out-File -FilePath ".\VersionInfo.h" -Encoding unicode -Append
@@ -157,6 +160,7 @@ else {
# echo " verPatch: [$verPatch]" # echo " verPatch: [$verPatch]"
# echo "" # echo ""
# echo " aboutBuild: [$aboutBuild]" # echo " aboutBuild: [$aboutBuild]"
# echo " platformArch: [$platformArch]"
# echo " productNameFull: [$pnf]" # echo " productNameFull: [$pnf]"
# echo "productCopyrightFull: [$pcf]" # echo "productCopyrightFull: [$pcf]"
# echo " internalName: [$intName]" # echo " internalName: [$intName]"

View File

@@ -1,16 +1,18 @@
@ECHO OFF @ECHO OFF
REM In VisualStudio add to Pre-Build events: REM In VisualStudio add to Pre-Build events:
REM "$(SolutionDir)pre-build.cmd" "$(SolutionDir)" "$(ProjectDir)" REM "$(SolutionDir)pre-build.cmd" "$(SolutionDir)" "$(ProjectDir)" "$(PlatformTarget)"
REM Then in "Resource Includes..." add '#include "VersionInfo.rc"' into 'Compile-time Directives' REM Then in "Resource Includes..." add '#include "VersionInfo.rc"' into 'Compile-time Directives'
IF "%~1" == "" GOTO :no_args IF "%~1" == "" GOTO :no_args
IF "%~2" == "" GOTO :no_args IF "%~2" == "" GOTO :no_args
IF "%~3" == "" GOTO :no_args
SET solutionDir=%1 SET solutionDir=%1
SET projectDir=%2 SET projectDir=%2
SET platformArch=%3
CD /D %solutionDir% 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 MOVE /Y %solutionDir%VersionInfo.h %projectDir%VersionInfo.h
EXIT EXIT

View File

@@ -64,27 +64,6 @@ CLogger::CLogger(const wchar_t* _appTitle) {
Init(); 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(const wchar_t* _appTitle, const uint8_t _appPlatform) {
szAppTitle = _appTitle; szAppPlatform = std::to_wstring(_appPlatform);
szAppTitleVer = _appTitle;
szAppTitleVer.append(L" (x").append(szAppPlatform).append(L")");
Init();
}
CLogger::CLogger(const wchar_t* _appTitle, const wchar_t* _appVersion, const uint8_t _appPlatform) {
szAppTitle = _appTitle; szAppVersion = _appVersion; szAppPlatform = std::to_wstring(_appPlatform);
szAppTitleVer = _appTitle;
szAppTitleVer.append(L", v").append(_appVersion).append(L" (x").append(szAppPlatform).append(L")");
Init();
}
CLogger::~CLogger() { CLogger::~CLogger() {
if (fsLogFile) { if (fsLogFile) {
fsLogFile << GetTimeStamp() << "Stop log." << std::endl; fsLogFile << GetTimeStamp() << "Stop log." << std::endl;

View File

@@ -11,9 +11,6 @@ class CLogger
public: public:
void Out(const wchar_t*, ...); void Out(const wchar_t*, ...);
CLogger(const wchar_t*); CLogger(const wchar_t*);
CLogger(const wchar_t*, const wchar_t*);
CLogger(const wchar_t*, const uint8_t);
CLogger(const wchar_t*, const wchar_t*, const uint8_t);
~CLogger(); ~CLogger();
private: private:

View File

@@ -31,10 +31,7 @@ HMENU hMenu = NULL, hPopup = NULL;
HWND hFgWnd = NULL; HWND hFgWnd = NULL;
BOOL bKPressed = FALSE, bMPressed = FALSE, fShowIcon = TRUE, fCheckUpdates = TRUE, bWorkArea = TRUE; BOOL bKPressed = FALSE, bMPressed = FALSE, fShowIcon = TRUE, fCheckUpdates = TRUE, bWorkArea = TRUE;
BOOL bLCTRL = FALSE, bLWIN = FALSE, bKEYV = FALSE; BOOL bLCTRL = FALSE, bLWIN = FALSE, bKEYV = FALSE;
//CLogger logger(TEXT(PRODUCT_NAME), TEXT(VERSION_STR), ARCH); CLogger logger(TEXT(PRODUCT_NAME_FULL));
//CLogger logger(TEXT(PRODUCT_NAME), TEXT(VERSION_STR));
//CLogger logger(TEXT(PRODUCT_NAME), ARCH);
CLogger logger(TEXT(PRODUCT_NAME));
NOTIFYICONDATAW nid = { 0 }; NOTIFYICONDATAW nid = { 0 };
MENUITEMINFO mii = { 0 }; MENUITEMINFO mii = { 0 };

View File

@@ -112,7 +112,7 @@
</ManifestFromManagedAssembly> </ManifestFromManagedAssembly>
</Manifest> </Manifest>
<PreBuildEvent> <PreBuildEvent>
<Command>"$(SolutionDir)pre-build.cmd" "$(SolutionDir)" "$(ProjectDir)"</Command> <Command>"$(SolutionDir)pre-build.cmd" "$(SolutionDir)" "$(ProjectDir)" "$(PlatformTarget)"</Command>
</PreBuildEvent> </PreBuildEvent>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
@@ -137,7 +137,7 @@
<AdditionalManifestFiles>%(AdditionalManifestFiles)</AdditionalManifestFiles> <AdditionalManifestFiles>%(AdditionalManifestFiles)</AdditionalManifestFiles>
</Manifest> </Manifest>
<PreBuildEvent> <PreBuildEvent>
<Command>"$(SolutionDir)pre-build.cmd" "$(SolutionDir)" "$(ProjectDir)"</Command> <Command>"$(SolutionDir)pre-build.cmd" "$(SolutionDir)" "$(ProjectDir)" "$(PlatformTarget)"</Command>
</PreBuildEvent> </PreBuildEvent>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
@@ -151,13 +151,13 @@
<Link> <Link>
<SubSystem>Windows</SubSystem> <SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation> <GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies> <AdditionalDependencies>comctl32.lib;wininet.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link> </Link>
<Manifest> <Manifest>
<AdditionalManifestFiles>%(AdditionalManifestFiles)</AdditionalManifestFiles> <AdditionalManifestFiles>%(AdditionalManifestFiles)</AdditionalManifestFiles>
</Manifest> </Manifest>
<PreBuildEvent> <PreBuildEvent>
<Command>powershell -File "$(SolutionDir)Update_Version.ps1" move /y "$(SolutionDir)VersionInfo.h" "$(ProjectDir)"</Command> <Command>"$(SolutionDir)pre-build.cmd" "$(SolutionDir)" "$(ProjectDir)" "$(PlatformTarget)"</Command>
</PreBuildEvent> </PreBuildEvent>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
@@ -176,13 +176,13 @@
<EnableCOMDATFolding>true</EnableCOMDATFolding> <EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences> <OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>false</GenerateDebugInformation> <GenerateDebugInformation>false</GenerateDebugInformation>
<AdditionalDependencies>comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies> <AdditionalDependencies>comctl32.lib;wininet.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link> </Link>
<Manifest> <Manifest>
<AdditionalManifestFiles>%(AdditionalManifestFiles)</AdditionalManifestFiles> <AdditionalManifestFiles>%(AdditionalManifestFiles)</AdditionalManifestFiles>
</Manifest> </Manifest>
<PreBuildEvent> <PreBuildEvent>
<Command>powershell -File "$(SolutionDir)Update_Version.ps1" move /y "$(SolutionDir)VersionInfo.h" "$(ProjectDir)"</Command> <Command>"$(SolutionDir)pre-build.cmd" "$(SolutionDir)" "$(ProjectDir)" "$(PlatformTarget)"</Command>
</PreBuildEvent> </PreBuildEvent>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemGroup> <ItemGroup>

View File

@@ -27,27 +27,24 @@
<ClInclude Include="wCenterWindow.h"> <ClInclude Include="wCenterWindow.h">
<Filter>Header Files</Filter> <Filter>Header Files</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="logger.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="globals.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="picojson.h"> <ClInclude Include="picojson.h">
<Filter>Header Files</Filter> <Filter>Header Files</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="updater.h"> <ClInclude Include="updater.h">
<Filter>Header Files</Filter> <Filter>Header Files</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="CLogger.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClCompile Include="wCenterWindow.cpp"> <ClCompile Include="wCenterWindow.cpp">
<Filter>Source Files</Filter> <Filter>Source Files</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="logger.cpp"> <ClCompile Include="updater.cpp">
<Filter>Source Files</Filter> <Filter>Source Files</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="updater.cpp"> <ClCompile Include="CLogger.cpp">
<Filter>Source Files</Filter> <Filter>Source Files</Filter>
</ClCompile> </ClCompile>
</ItemGroup> </ItemGroup>