From b4bfe319c40baa388491a6020d52bd2a5333e15c Mon Sep 17 00:00:00 2001 From: Biru Mohanathas Date: Wed, 10 Feb 2021 11:50:25 +0200 Subject: [PATCH] About: Remove commit hash (#253) --- .github/workflows/build.yml | 2 +- .github/workflows/official-build.yml | 2 +- Build/Build.bat | 3 --- Docs/Building.md | 2 +- Library/DialogAbout.cpp | 21 --------------------- Library/DialogAbout.h | 1 - Library/Rainmeter.cpp | 6 ------ 7 files changed, 3 insertions(+), 34 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e7fdb5c4b..c54ef8a31 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,5 +19,5 @@ jobs: - name: Run Build.bat run: | cd Build - Build.bat beta 0 0 0 0 %GITHUB_SHA% + Build.bat beta 0 0 0 0 shell: cmd diff --git a/.github/workflows/official-build.yml b/.github/workflows/official-build.yml index 3e7e324ce..cc88f37e9 100644 --- a/.github/workflows/official-build.yml +++ b/.github/workflows/official-build.yml @@ -31,7 +31,7 @@ jobs: - name: Run Build.bat run: | cd Build - Build.bat %RAINMETER_BUILD_TYPE% %RAINMETER_BUILD_VERSION:.= % %GITHUB_SHA% + Build.bat %RAINMETER_BUILD_TYPE% %RAINMETER_BUILD_VERSION:.= % shell: cmd env: RAINMETER_BUILD_TYPE: ${{ github.event.inputs.type }} diff --git a/Build/Build.bat b/Build/Build.bat index 02a6c3d8e..085d62ba1 100644 --- a/Build/Build.bat +++ b/Build/Build.bat @@ -7,7 +7,6 @@ set /A VERSION_MAJOR=%2 set /A VERSION_MINOR=%3 set /A VERSION_SUBMINOR=%4 set /A VERSION_REVISION=%5 -set COMMIT_HASH=%6 if "%BUILD_TYPE%" == "beta" set ISBETA=true & goto BUILD_TYPE_OK if "%BUILD_TYPE%" == "final" set ISBETA=false & goto BUILD_TYPE_OK @@ -19,7 +18,6 @@ if "%VERSION_MAJOR%" == "" echo ERROR: VERSION_MAJOR parameter missing & exit /b if "%VERSION_MINOR%" == "" echo ERROR: VERSION_MINOR parameter missing & exit /b 1 if "%VERSION_SUBMINOR%" == "" echo ERROR: VERSION_SUBMINOR parameter missing & exit /b 1 if "%VERSION_REVISION%" == "" echo ERROR: VERSION_REVISION parameter missing & exit /b 1 -if "%COMMIT_HASH%" == "" echo ERROR: COMMIT_HASH parameter missing & exit /b 1 :: Visual Studio no longer creates the |%VSxxxCOMNTOOLS%| environment variable during install, so link :: directly to the default location of "vcvarsall.bat" (Visual Studio 2019 Communnity) @@ -66,7 +64,6 @@ if not "%VERSION_SUBMINOR%" == "0" set VERSION_SHORT=!VERSION_SHORT!.%VERSION_SU echo #define STRPRODUCTVER STRFILEVER echo #define APPVERSION L"%VERSION_MAJOR%.%VERSION_MINOR%.%VERSION_SUBMINOR%" echo #define RAINMETER_VERSION ((%VERSION_MAJOR% * 1000000^) + (%VERSION_MINOR% * 1000^) + %VERSION_SUBMINOR%^) - echo #define COMMIT_HASH L"%COMMIT_HASH%" echo #define BUILD_TIME L"%BUILD_TIME%" echo const int revision_number = %VERSION_REVISION%; echo const bool revision_beta = %ISBETA%; diff --git a/Docs/Building.md b/Docs/Building.md index a8d196a8e..bfcdec2b1 100644 --- a/Docs/Building.md +++ b/Docs/Building.md @@ -18,7 +18,7 @@ Rainmeter can be built using any version of Visual Studio 2019. If you don't alr First, download and install [NSIS 3](http://nsis.sourceforge.net) or later. -Then, in the Build directory, run e.g. `Build.bat beta 1 2 3 4 abc` to build the beta 1.2.3 r4 with commit hash abc. +Then, in the Build directory, run e.g. `Build.bat beta 1 2 3 4` to build the beta 1.2.3 r4. If you see any "not found" errors, check that the paths in the `set` commands at the top of the file match your environment. diff --git a/Library/DialogAbout.cpp b/Library/DialogAbout.cpp index e9c743810..3e5e19aab 100644 --- a/Library/DialogAbout.cpp +++ b/Library/DialogAbout.cpp @@ -1690,9 +1690,6 @@ void DialogAbout::TabVersion::Create(HWND owner) CT_LABEL(Id_TimestampLabel, 0, 190, 34, 380, 9, WS_VISIBLE, 0), - CT_LABEL(Id_BuildHashLabel, 0, - 190, 47, 380, 9, - WS_VISIBLE, 0), CT_LABEL(Id_WinVerLabel, 0, 190, 70, 380, 9, @@ -1758,16 +1755,6 @@ void DialogAbout::TabVersion::Initialize() item = GetControl(Id_TimestampLabel); SetWindowText(item, tmpSz); - // Build.bat will write to the COMMIT_HASH macro when the installer is created. - // For local builds, add some text indicating a local build. -#ifdef COMMIT_HASH - _snwprintf_s(tmpSz, _TRUNCATE, L"Commit Hash: %s", COMMIT_HASH); -#else - _snwprintf_s(tmpSz, _TRUNCATE, L"Commit Hash: %s", L""); -#endif // COMMIT_HASH - item = GetControl(Id_BuildHashLabel); - SetWindowText(item, tmpSz); - _snwprintf_s(tmpSz, _TRUNCATE, L"%s - %s (%hu)", Platform::GetPlatformFriendlyName().c_str(), Platform::GetPlatformUserLanguage().c_str(), @@ -1842,14 +1829,6 @@ INT_PTR DialogAbout::TabVersion::OnCommand(WPARAM wParam, LPARAM lParam) std::wstring text(tmpSz, len); -#ifdef COMMIT_HASH - _snwprintf_s(tmpSz, _TRUNCATE, L"Commit Hash: %s\n", COMMIT_HASH); -#else - _snwprintf_s(tmpSz, _TRUNCATE, L"Commit Hash: %s\n", L""); -#endif // COMMIT_HASH - - text += tmpSz; - _snwprintf_s( tmpSz, _TRUNCATE, diff --git a/Library/DialogAbout.h b/Library/DialogAbout.h index 679f83730..e3eeba834 100644 --- a/Library/DialogAbout.h +++ b/Library/DialogAbout.h @@ -145,7 +145,6 @@ class DialogAbout : public Dialog Id_VersionLabel, Id_LanguageLabel, Id_TimestampLabel, - Id_BuildHashLabel, Id_HomeLink, Id_LicenseLink, Id_WinVerLabel, diff --git a/Library/Rainmeter.cpp b/Library/Rainmeter.cpp index eab78645c..dd7126eae 100644 --- a/Library/Rainmeter.cpp +++ b/Library/Rainmeter.cpp @@ -399,12 +399,6 @@ int Rainmeter::Initialize(LPCWSTR iniPath, LPCWSTR layout, bool safeStart) LogNoticeF(L"Language: %s (%lu)", lang, m_ResourceLCID); LogNoticeF(L"Build time: %s", m_BuildTime.c_str()); -#ifdef COMMIT_HASH - LogNoticeF(L"Commit Hash: %s", COMMIT_HASH); -#else - LogNoticeF(L"Commit Hash: %s", L""); -#endif // COMMIT_HASH - LogNoticeF(L"%s - %s (%hu)", Platform::GetPlatformFriendlyName().c_str(), Platform::GetPlatformUserLanguage().c_str(),