Commit Graph

6551 Commits

Author SHA1 Message Date
Mikkel Krautz
5bbd804ec3 Merge PR #2835: installer: don't ship dbghelp.dll anymore. 2017-02-10 00:14:56 +01:00
Mikkel Krautz
81f36bbf41 Merge PR #2817: installer: use WiX from buildenv. 2017-02-10 00:14:23 +01:00
Mikkel Krautz
18caa17256 installer: don't ship dbghelp.dll anymore.
Only older versions of dbghelp.dll are redistributable by themselves.
Newer versions only allow redistribution via MSI files, which are
useless for us.

To sidestep this problem, we'll simply go back to relying on the OSes
version of dbghelp.dll. Shipping an outdated version of dbghelp.dll
isn't sensible. We're better off allowing Windows 10 to use a modern
(its own) version of dbghelp.dll than using a year-old version.

To give some context on how we use dbghelp.dll:

In Mumble, we use dbghelp.dll for writing our Minidumps.

In Murmur, Ice uses it for symbolicating stack traces in
Ice exceptions.
2017-02-10 00:02:45 +01:00
Mikkel Krautz
3315e01e8d Merge PR #2830: mumble_proto.pro: fix protoc invocation for out-of-tree builds 2017-02-09 17:14:12 +01:00
Davide Beatrici
00f81cb0f4 mumble_proto.pro: fix protoc invocation for out-of-tree builds
This fixes the invocation of protoc in mumble_proto.pro to be compatible with out-of-tree builds. For example, this is how Qt Creator builds Mumble by default.

For out-of-tree builds, our include path flags to protoc aren't sufficient. This is because protoc requires that the .proto file it is building is part of the include path. To fix this for out-of-tree builds, we add the absolute path to the directory that contains the .proto file.

This allows protoc to work for out-of-tree builds.

For reference, the error we got (before this commit) from protoc in out-of-tree builds was:
"File does not reside within any path specified using --proto_path (or -I). You must specify a --proto_path which encompasses this file. Note that the proto_path must be an exact prefix of the .proto file names -- protoc is too dumb to figure out when two paths (e.g. absolute and relative) are equivalent (it's harder than you think)."
2017-02-09 16:52:50 +01:00
Mikkel Krautz
7ebabdaf4d Merge PR #2833: Transifex translation update 2017-02-09 14:59:05 +01:00
MumbleTransifexBot
eab16cfa75 Transifex translation update
Mode: default
Minimum percent translated: 0
Matched 41 languages
2017-02-09 01:27:35 +00:00
Mikkel Krautz
4eef649e20 Merge PR #2828: minhook-build.pro: Fix paths 2017-02-08 11:05:58 +01:00
Davide Beatrici
2dee4ea3ed minhook-build.pro: Fix paths
- Rename "HDE" folder to "hde", the name was changed in 28338f33fa

- Use "$$SOURCEDIR" instead of manually specifying the folder name
2017-02-08 10:42:53 +01:00
Mikkel Krautz
d15c3f9001 Merge PR #2821: Murmur: fix bad interaction with QDBus and fork(). 2017-02-07 22:47:38 +01:00
Mikkel Krautz
1e9d2b3c10 Murmur: fix bad interaction with QDBus and fork().
Qt 5.6 changed QDBus to use a thread, QDBusConnectionManager,
for managing DBus connections.

This caused a bad interaction with Murmur. It turns out that, prior
to this commit, the QDBusConnectionManager in Murmur was launched at
program start, because of a global static QDBusConnection in DBus.cpp.

This meant that there would be a QDBusConnectionManager thread around,
waiting to manage DBus connections. ...Until Murmur calls fork().

After fork()ing, the QDBusConnectionManager thread is gone -- fork only
keeps a 'main' thread, and isn't generally compatible with multi-threaded
programs.

Ouch!

Fortunately, the static global QDBusConnection (MurmurDBus::qdbc) was
only initialized this way because it worked in the past. Also, because
QDBusConnection has no default constructor, the 'qdbc' QDBusConnection
was statically initialized as a QDBusConnection to 'mainbus' on each
program launch. This wasn't strictly necessary -- it was only done because
QDBusConnection had no default constructor. However, there is no such thing
as an 'empty' QDBusConnection, so there not being a default constructor
does make sense.

To avoid the static global QDBusConnection, this commit changes MurmuDBus::qdbc
from a value to a pointer.

This allows us to defer the creation of the QDBusConnectionManager thread
until the first 'real' QDBusConnection is created -- after Murmur has forked.
This avoids the global static 'fake' QDBusConnection, and ensures the
QDBusConnectionManager thread is created after Murmur has forked.

Additionally, this commit also moves the registration of the 'MetaDBus'
object into the '!Meta::mp.qsDBus.isEmpty()' check in main.cpp.
This ensures the MetaDBus object is only registered if the user has
enabled DBus in murmur.ini. Without this change, the code would be
dereferencing a null MurmurDBus::qdbc.

Fixes mumble-voip/mumble#2820
2017-02-07 22:36:04 +01:00
Mikkel Krautz
ef5f0826ea Merge PR #2826: 3rdparty/minhook-src: update MinHook to v1.3.3. 2017-02-07 21:49:42 +01:00
Mikkel Krautz
b005b71851 3rdparty/minhook-src: update MinHook to v1.3.3.
Primarily to get MinGW support.
2017-02-07 21:19:40 +01:00
Mikkel Krautz
2fb5ee7091 Merge PR #2825: Revert 91dc3d39f0 ('Move counter variable in processMsg into Opus condition.'). 2017-02-07 20:04:42 +01:00
Mikkel Krautz
a9330a48f7 Revert 91dc3d39f0 ('Move counter variable in processMsg into Opus condition.').
This comit (full SHA-1 is 91dc3d39f0) is
obviously flawed.

So revert it.
2017-02-07 20:03:31 +01:00
Mikkel Krautz
4400a807d0 Merge PR #2823: GlobalShortcut_win.cpp: Fix MinGW compilation warnings 2017-02-06 17:25:38 +01:00
Davide Beatrici
7e72e7799b GlobalShortcut_win.cpp: Fix MinGW compilation warnings
GlobalShortcut_win.h: In constructor 'GlobalShortcutWin::GlobalShortcutWin()':
GlobalShortcut_win.h:77:7: warning: 'GlobalShortcutWin::nxboxinput' will be initialized after [-Wreorder]
   int nxboxinput;
       ^~~~~~~~~~
GlobalShortcut_win.h:61:16: warning:   'unsigned int GlobalShortcutWin::uiHardwareDevices' [-Wreorder]
   unsigned int uiHardwareDevices;
                ^~~~~~~~~~~~~~~~~
GlobalShortcut_win.cpp:44:1: warning:   when initialized here [-Wreorder]
 GlobalShortcutWin::GlobalShortcutWin()
 ^~~~~~~~~~~~~~~~~
GlobalShortcut_win.cpp: In member function 'virtual void GlobalShortcutWin::run()':
GlobalShortcut_win.cpp:85:85: warning: passing NULL to non-pointer argument 3 of 'LONG RegOpenKeyExA(HKEY, LPCSTR, DWORD, REGSAM, PHKEY)' [-Wconversion-null]
  if (RegOpenKeyExA(HKEY_CURRENT_USER, "Control Panel\\Desktop", NULL, KEY_READ, &key) == ERROR_SUCCESS) {
                                                                                     ^
GlobalShortcut_win.cpp:88:85: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'DWORD {aka long unsigned int}' [-Wformat=]
    qWarning("GlobalShortcutWin: Found LowLevelHooksTimeout with value = 0x%x", value);
                                                                                     ^
GlobalShortcut_win.cpp:92:129: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'LONG {aka long int}' [-Wformat=]
    qWarning("GlobalShortcutWin: Error looking up LowLevelHooksTimeout. (Error: 0x%x, Type: 0x%x, Value: 0x%x)", err, type, value);
                                                                                                                                 ^
GlobalShortcut_win.cpp:92:129: warning: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'DWORD {aka long unsigned int}' [-Wformat=]
GlobalShortcut_win.cpp:92:129: warning: format '%x' expects argument of type 'unsigned int', but argument 5 has type 'DWORD {aka long unsigned int}' [-Wformat=]
GlobalShortcut_win.cpp: In static member function 'static BOOL GlobalShortcutWin::EnumDeviceObjectsCallback(LPCDIDEVICEOBJECTINSTANCE, LPVOID)':
GlobalShortcut_win.cpp:378:28: warning: format '%x' expects argument of type 'unsigned int', but argument 5 has type 'DWORD {aka long unsigned int}' [-Wformat=]
            qPrintable(name));
                            ^
GlobalShortcut_win.cpp: In static member function 'static BOOL GlobalShortcutWin::EnumDevicesCB(LPCDIDEVICEINSTANCE, LPVOID)':
GlobalShortcut_win.cpp:463:29: warning: format '%x' expects argument of type 'unsigned int', but argument 8 has type 'DWORD {aka long unsigned int}' [-Wformat=]
             pdidi->dwDevType);
                             ^
GlobalShortcut_win.cpp:529:51: warning: format '%x' expects argument of type 'unsigned int', but argument 7 has type 'DWORD {aka long unsigned int}' [-Wformat=]
            qPrintable(id->vguidproduct.toString()));
                                                   ^
2017-02-06 14:00:36 +01:00
Mikkel Krautz
012429cb21 Merge PR #2818: installer: ship app-local copies of UCRT DLLs. 2017-02-05 19:21:00 +01:00
Mikkel Krautz
c895dad889 installer: ship app-local copies of UCRT DLLs.
MSVC2015 uses a new CRT called the Universal CRT.

This CRT is distributed in different ways, depending on your
OS.

For Windows XP, the official distribution is a VCRedist installer.
(Or, for Windows XP only -- merge modules).

For Vista through 8.1, UCRT is distributed via Windows Update.

For Windows 10, it's shipped as part of Windows.

This commit amends our installer to install an app-local copy of
the Universal CRT. This is the sanest way for us to distribute the
Universal CRT across all supported targets.

Even if we could drop Windows XP support, the fact that earlier
Windows versions deploy the Universal CRT through Windows Update
makes it a hard pill to swallow. People's hacked up machines might
not be able to get the update from Windows Update for whatever reason.
(Maybe they disabled the Windows Update service for performance reasons,
because a guide on the web told them to?)

So, for now, this is what we'll do. Perhaps it makes more sense to
statically link the UCRT instead of this massive soup of DLLs. But
this is a quick fix to keep our snapshots going until we can work
out the details for statically linking UCRT.

Note: Because Murmur is outside the versioned root-dir, we ship a
separate CRT copy for Murmur. Now that we have to ship the UCRT as
well, that's suddenly a lot more files we'll have to carry. That's
also an unfortunate side-effect of the UCRT. But if you look at it
from the perspective that shipping the VCRUNTIME+UCRT on MSVC2015
"the same thing" as shipping MSVCRT on MSVC2013, we're not really
doing anything much different. Except, we're being "punished" by
the fact that Microsoft decided to split up the CRT into tiny pieces.

Future work: Ideally, we wouldn't include these .wxi files in the
repo, and instead depend on gen-ucrt.py being run before building
the installer. However, that would require buildenv changes, and
require us to redeploy buildenvs, which takes time. To get the UCRT
fix out into a snapshot, let's add them to the repo for now, and we
can clean it up later.
2017-02-05 19:20:34 +01:00
Mikkel Krautz
e4fe8fb0fd installer: use WiX from buildenv.
This uses the mechanism documented at
http://wixtoolset.org/documentation/manual/v3/msbuild/daily_builds.html
to use a local copy of WiX instead of using the WiX MSI package.

Previously, we required people to install WiX globally.
That's yet another tedious dependency required in order to build Mumble.

We'll now be distributing WiX in our buildenvs, so tell our .wixproj
to use that version.
2017-02-05 16:28:10 +01:00
Mikkel Krautz
4ca6f2cb9c Merge PR #2810: DirectSound.cpp: Fix MinGW compilation warnings 2017-02-05 15:40:58 +01:00
Davide Beatrici
6afeca63fc DirectSound.cpp: Fix MinGW compilation warnings
DirectSound.cpp:548:40: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     if (static_cast<int>(dwReadyBytes) < sizeof(short) * iFrameSize) {
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
DirectSound.cpp:563:44: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    } while (static_cast<int>(dwReadyBytes) < sizeof(short) * iFrameSize);
             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
DirectSound.cpp:571:120: warning: format '%d' expects argument of type 'int', but argument 4 has type 'long long unsigned int' [-Wformat=]
      qWarning("DXAudioInput: Lock from %ld (%d bytes) failed: hr=0x%08lx",dwLastReadPos, sizeof(short) * iFrameSize, hr);
                                                                                                                        ^
2017-02-05 15:39:15 +01:00
Mikkel Krautz
cef2324812 Merge PR #2812: GKey.cpp: Fix MinGW compilation warnings 2017-02-05 12:37:50 +01:00
Davide Beatrici
e8c8220187 GKey.cpp: Fix MinGW compilation warnings
GKey.cpp:89:95: warning: passing NULL to non-pointer argument 3 of 'LONG RegOpenKeyExW(HKEY, LPCWSTR, DWORD, REGSAM, PHKEY)' [-Wconversion-null]
  if (RegOpenKeyEx(GKEY_LOGITECH_DLL_REG_HKEY, GKEY_LOGITECH_DLL_REG_PATH, NULL, KEY_READ, &key) == ERROR_SUCCESS) {
                                                                                               ^
GKey.cpp:93:111: warning: format '%d' expects argument of type 'int', but argument 4 has type 'DWORD {aka long unsigned int}' [-Wformat=]
    qWarning("GKeyLibrary: Found ServerBinary with libLocation = \"%s\", len = %d", qPrintable(qsLocation), len);
                                                                                                               ^
GKey.cpp:96:108: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'LONG {aka long int}' [-Wformat=]
    qWarning("GKeyLibrary: Error looking up ServerBinary (Error: 0x%x, Type: 0x%x, len: %d)", err, type, len);
                                                                                                            ^
GKey.cpp:96:108: warning: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'DWORD {aka long unsigned int}' [-Wformat=]
GKey.cpp:96:108: warning: format '%d' expects argument of type 'int', but argument 5 has type 'DWORD {aka long unsigned int}' [-Wformat=]
2017-02-05 12:36:28 +01:00
Mikkel Krautz
78ff4fc27f Merge PR #2816: LCD: drop workaround for Qt >= 5.6.2. 2017-02-05 12:31:51 +01:00
Mikkel Krautz
7a0790be37 LCD: drop workaround for Qt >= 5.6.2.
This drops the workaround we added in c04aa4e8 (see also
mumble-voip/mumble#2429). There was a Qt regression in
early 5.6 versions that caused our previously working
monochrome bitmap drawing code to break.

To be fair, our original code was not exactly correct
per the Qt docs, but it did produce correct results before
Qt 5.6.

Qt accepted the bug as a regression, and restored the old
behavior, so we can now keep using the old behavior.

We should re-visit this soon, because the drawing code
isn't actually correct according to the Qt docs.

But it works. At least until Qt 6.

Fixes mumble-voip/mumble#2815
2017-02-05 12:16:13 +01:00
Davide Beatrici
b817d3fdd7 Merge PR #2811: Fix MinGW compilation warning 2017-02-04 21:16:40 +01:00
Davide Beatrici
aee146988e Overlay_win.cpp: Fix MinGW compilation warning
Overlay_win.cpp:184:9: warning: enumeration value 'UnknownError' not handled in switch [-Wswitch]
  switch (processError) {
         ^
2017-02-04 21:03:25 +01:00
Stefan Hacker
43109d10ea Fix linking mumble client in static debug mode 2017-02-04 16:10:40 +01:00
Stefan Hacker
1773dc714e Integrate review comments on getenvQString
* Use correct size in second _wgetenv_s call
* Rely on zero termination being present in buffer to get rid of some code
2017-02-04 16:10:40 +01:00
Mikkel Krautz
11f92440c5 MumbleApplication: introduce getenvQString and use it in applicationVersionRoot.
When built against the MSVC2015 CRT, we can't mix-and-match non-wide and
wide environment variables anymore.

Prior to this commit, MumbleApplication::applicationVersionRoot() used
Qt's qgetenv().

However, because of our change to MSVC2015, we can't use Qt's function
anymore.

Instead, we introduce getenvQString (a static function, local to
MumbleApplication -- for now). This function uses _wgetenv_s on
Windows to retrieve environment variables (expecting that they're all
UTF-16). On non-Windows systems, it uses getenv (and expects keys and
values to be UTF-8).

Fixes mumble-voip/mumble#2806
2017-02-04 16:10:40 +01:00
Mikkel Krautz
487e032d63 Merge PR #2807: Fix usage of QFileInfo for Qt4 2017-02-03 23:03:05 +01:00
Jan Klass
52662d71c3 Fix usage of QFileInfo for Qt4 2017-02-03 22:13:08 +01:00
Mikkel Krautz
d871f34f49 Merge PR #2793: Show fallback icon on missing country flag icon 2017-02-03 18:13:04 +01:00
Mikkel Krautz
4886268bd9 Merge PR #2804: OSInfo.cpp: Fix MinGW compilation warnings 2017-02-03 18:05:07 +01:00
Davide Beatrici
625d1ceef5 OSInfo.cpp: Fix MinGW compilation warnings
../OSInfo.cpp:74:113: warning: passing NULL to non-pointer argument 3 of 'LONG RegOpenKeyExW(HKEY, LPCWSTR, DWORD, REGSAM, PHKEY)' [-Wconversion-null]
  err = RegOpenKeyEx(HKEY_LOCAL_MACHINE, L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", NULL, KEY_READ, &key);
                                                                                                                 ^
../OSInfo.cpp: In static member function 'static QString OSInfo::getOSVersion()':
../OSInfo.cpp:197:135: warning: format '%d' expects argument of type 'int', but argument 3 has type 'DWORD {aka long unsigned int}' [-Wformat=]
  os.sprintf("%d.%d.%d.%d", ovi.dwMajorVersion, ovi.dwMinorVersion, ovi.dwBuildNumber, (ovi.wProductType == VER_NT_WORKSTATION) ? 1 : 0);
                                                                                                                                       ^
../OSInfo.cpp:197:135: warning: format '%d' expects argument of type 'int', but argument 4 has type 'DWORD {aka long unsigned int}' [-Wformat=]
../OSInfo.cpp:197:135: warning: format '%d' expects argument of type 'int', but argument 5 has type 'DWORD {aka long unsigned int}' [-Wformat=]
../OSInfo.cpp: In static member function 'static QString OSInfo::getOSDisplayableVersion()':
../OSInfo.cpp:466:86: warning: format '%d' expects argument of type 'int', but argument 3 has type 'DWORD {aka long unsigned int}' [-Wformat=]
  osv.sprintf(" - %d.%d.%d", ovi.dwMajorVersion, ovi.dwMinorVersion, ovi.dwBuildNumber);
                                                                                      ^
../OSInfo.cpp:466:86: warning: format '%d' expects argument of type 'int', but argument 4 has type 'DWORD {aka long unsigned int}' [-Wformat=]
../OSInfo.cpp:466:86: warning: format '%d' expects argument of type 'int', but argument 5 has type 'DWORD {aka long unsigned int}' [-Wformat=]
2017-02-03 16:35:45 +01:00
Mikkel Krautz
077cbfd9c5 Merge PR #2796: VoiceRecorder.cpp: Use braces to avoid ambiguous "else" 2017-02-02 20:34:35 +01:00
Mikkel Krautz
51bb441c75 Merge PR #2797: os_win.cpp: Fix PATH_MAX redefinition warning 2017-02-02 20:33:48 +01:00
Jan Klass
95c7b5e39c Show fallback icon on missing country flag icon
If a country flag icon does not exist, we now display the globe icon, which
is being used for the continents as well.

This will vertically align the country name with the others that have an
icon.
2017-02-02 17:47:13 +01:00
Jan Klass
eca32a0369 Merge pull request #2801 from mkrautz/murmur-dualstacksupport-refactor
Refactor Server::supportsDualStack().
2017-02-02 17:24:15 +01:00
Davide Beatrici
2966e5f530 os_win.cpp: Fix PATH_MAX redefinition warning
The macro should be undefined and then defined again to change its value, but it's better if we use a dedicated macro instead.
This fixes the following warning when compiling with MinGW:
warning: "PATH_MAX" redefined
2017-02-02 09:01:04 +01:00
Mikkel Krautz
1be562fefb Merge PR #2790: mumble_plugin_win32_ptr_type.h: Prevent redefinition of "NOMINMAX" 2017-02-02 01:20:54 +01:00
Mikkel Krautz
4d6a813e80 Refactor Server::supportsDualStack().
The current implementation tries too hard to avoid duplication
of very few lines of code.

Instead, use two separate code paths, one for Windows, one for
Unix-like sytems.

This makes it more readable, and allows us to handle system-specific
quirks much easier. For example, SOCKET is unsigned on Windows, and
comparing it to -1 technically works (at least for two's complement
machines), but causes a compiler warning for a signed vs. unsigned
comparison.
2017-02-02 00:34:11 +01:00
Jan Klass
8f94c763ab Merge pull request #2800 from Kissaki/cert-pw
CertWizard: Password requirement notice on import
2017-02-02 00:31:58 +01:00
Davide Beatrici
49f9d61d21 VoiceRecorder.cpp: Use braces to avoid ambiguous "else"
This fixes the following warning when compiling with MinGW:
warning: suggest explicit braces to avoid ambiguous 'else' [-Wparentheses]
2017-02-01 15:05:25 +01:00
Jan Klass
c083432cbb CertWizard: Password requirement notice on import
When a (p12) certificate file is specified, it is being imported. If this
is not successful it is either because of a missing or wrong password, or
because the file is in fact otherwise not valid.

Instead of simply disabling and enabling the wizard Next button we now
display a text notice to the user to make this clear (especially for the
common use-case of having to provide a correct password).

Fixes #1025
2017-02-01 01:49:50 +01:00
Davide Beatrici
2213d5038c plugins: Prevent redefinition of "NOMINMAX"
Define "NOMINMAX" only if it isn't already.
MinGW defines it by default, which results in the following warning:
warning: "NOMINMAX" redefined
2017-01-31 11:25:54 +01:00
Mikkel Krautz
039096acf5 Merge PR #2792: Re-run mkflags.py to remove non-existant '__.svg' from our flags QRC files. 2017-01-30 20:47:38 +01:00
Mikkel Krautz
c8d088001a Re-run mkflags.py to remove non-existant '__.svg' from our flags QRC files. 2017-01-30 20:46:23 +01:00
Mikkel Krautz
867d4f6a3b Merge PR #2791: Update country flag icons 2017-01-30 18:50:21 +01:00