Skip to content

Commit

Permalink
About: Remove commit hash (rainmeter#253)
Browse files Browse the repository at this point in the history
  • Loading branch information
poiru authored Feb 10, 2021
1 parent cd49cb1 commit b4bfe31
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 34 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion .github/workflows/official-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
3 changes: 0 additions & 3 deletions Build/Build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down Expand Up @@ -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%;
Expand Down
2 changes: 1 addition & 1 deletion Docs/Building.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
21 changes: 0 additions & 21 deletions Library/DialogAbout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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"<Local build>");
#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(),
Expand Down Expand Up @@ -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"<Local build>");
#endif // COMMIT_HASH

text += tmpSz;

_snwprintf_s(
tmpSz,
_TRUNCATE,
Expand Down
1 change: 0 additions & 1 deletion Library/DialogAbout.h
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ class DialogAbout : public Dialog
Id_VersionLabel,
Id_LanguageLabel,
Id_TimestampLabel,
Id_BuildHashLabel,
Id_HomeLink,
Id_LicenseLink,
Id_WinVerLabel,
Expand Down
6 changes: 0 additions & 6 deletions Library/Rainmeter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"<Local build>");
#endif // COMMIT_HASH

LogNoticeF(L"%s - %s (%hu)",
Platform::GetPlatformFriendlyName().c_str(),
Platform::GetPlatformUserLanguage().c_str(),
Expand Down

0 comments on commit b4bfe31

Please sign in to comment.