Skip to content

Instantly share code, notes, and snippets.

@ayan4m1
Last active February 2, 2023 01:00
Show Gist options
  • Save ayan4m1/eaede665be5f78be658f99e3787c22a0 to your computer and use it in GitHub Desktop.
Save ayan4m1/eaede665be5f78be658f99e3787c22a0 to your computer and use it in GitHub Desktop.
How to build Redis Desktop Manager - https://github.com/uglide/RedisDesktopManager

Redis Desktop Manager for Windows

Yes, it's been done already. No, it's still not particularly easy. You do not need to use either Qt Creator or VS2015.

I am building on information found here, here, and here. Thanks to these folks and the contributors to RDM.

With this document, I sought to "trim the fat" from these other guides and prove that VS2015 itself was not in fact necessary - just its tooling.

Prerequisites

  • VS2017 Community
    • Workloads: "Desktop development with C++"
    • Individual components:
      • MSBuild
      • VC++ 2015 v14.00 (v140) toolset for desktop
      • Windows 10 SDK (10.0.14393)
      • Windows 10 SDK (10.0.17763)
      • Windows 8.1 SDK
  • Qt 5.9.x
  • 32-bit CMake 3.x
  • Python 2.7 - make sure the path to python.exe is in your Windows %PATH%
  • NSIS - only needed if you want to build an installer

Clone

From a Bash shell:

git clone --recursive https://github.com/uglide/RedisDesktopManager.git -b 0.9.9
cd RedisDesktopManager/3rdparty/qredisclient/3rdparty/hiredis
git apply ../hiredis-win.patch

Build

NOTE: Replace %BASEDIR% below with the path to the RedisDesktopManager directory you just cloned.

Now, find "Qt 5.9.7 32-bit for Desktop (MSVC 2015)" in your Start menu. Run it, and execute the following commands in the resulting terminal:

"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat"
set BASEDIR="C:\code\RedisDesktopManager"

cd %BASEDIR%
.\build\utils\set_version.py "0.9.9" > .\src\version.h

cd %BASEDIR%\src
C:\Qt\5.9.7\msvc2015\bin\qmake CONFIG+=release
nmake /NOLOGO release

cd %BASEDIR%
C:\Qt\5.9.7\msvc2015\bin\windeployqt --no-angle --no-opengl-sw --no-compiler-runtime --no-translations --release --force --qmldir .\src\qml .\bin\windows\release\rdm.exe

If you don't want or need an installer, then your binaries are in %BASEDIR%\bin\windows\release. If you are unlucky enough to need that... read on.

Installer

From the Qt terminal you used in the previous section:

cd %BASEDIR%\bin\windows\release
rmdir /s /q .\platforminputcontexts .\qmltooling .\QtGraphicalEffects
del /q .\imageformats\qjpeg.dll .\imageformats\qwebp.dll

cd %BASEDIR%\3rdparty\crashreporter
C:\Qt\5.9.7\msvc2015\bin\qmake CONFIG+=release
notepad Makefile.Release

Prepend the following to the DEFINES= on or around line 14: -DAPP_NAME=\"RedisDesktopManager\" -DAPP_VERSION=\""0.9.9"\" -DCRASH_SERVER_URL=\"https://oops.redisdesktop.com/crash-report\"

It shoud look like:

DEFINES       = -DAPP_NAME=\"RedisDesktopManager\" -DAPP_VERSION=\""0.9.9"\" -DCRASH_SERVER_URL=\"https://oops.redisdesktop.com/crash-report\" -DUNICODE -D_UNICODE -DWIN32 -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DNDEBUG

Then, back in the terminal:

nmake /NOLOGO release
cd %BASEDIR%\bin\windows\release
rmdir /s /q .\obj
del rdm.map rdm.pdb
xcopy * %BASEDIR%\build\windows\installer\resources\ /s /e /y
cd %BASEDIR%
"C:\Program Files (x86)\NSIS\makensis" /V1 /DVERSION="0.9.9" .\build\windows\installer\installer.nsi

There should now be a redis-desktop-manager-0.9.9.exe in %BASEDIR%\build\windows\installer.

Wasn't that fun?

@pnascimento3mpk
Copy link

Dope! Thx!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment