Cross Platform Browser Detection - c++

Can anyone help me out, I need a cross platform way to detect if browsers are installed e.g. Is Firefox installed, Is Safari installed etc.
I am using wxWidgets for my GUI libary if this helps.
I can check the registry on windows but am unsure on how find out browsers for Linux and Mac. Would prefer one clean cross platform way rather than several
If(windows)
then search registry
If (Mac)
then do something else
etc.
Thanks

What's wrong with http://docs.wxwidgets.org/2.6.3/wx_miscellany.html#wxlaunchdefaultbrowser?
And why not using several ways of detection? This functionality could then be implemented in wxWidgets itself. After all, wxWidgets does exactly this and just abstracts it away using function with platform specifics hidden behind.

Related

How can I use WebRTC in a desktop application for voice chat?

I am trying to add voice chat between peers using my software - desktop application to desktop application over a network. My software is compatible with Windows and OSX. The difficulty is that there seems to be very little documentation on using the native API, and all the tutorials I've come across are out of date.
I started off by building the libraries and linking them in a new project, but as I mentioned, the tutorials I have found on the Internet are several years out of date, so I didn't get far with that.
So instead I built the native code, following these instructions https://webrtc.org/native-code/development/, and have successfully used peerconnection_client and -_server, which work great.
My problem now is that the peerconnection_client is more complicated than what I need, and I'm finding it difficult extracting the relevant parts (I want to remove the GUI, connect to a peer programmatically, and only transmit audio). And even if I do manage to strip down the peerconnection_client code, to just make voice calls through a terminal, it would still be lot of code to then embed into my program because it isn't linked to libraries, but raw code.
Has anyone else tried using WebRTC for native desktop applications in this way before? Is there any up to date documentation for this I can use? Any help would be greatly appreciated.
Best solution is to use this project :
CEF project
You will get mac os, windows and linux implementation from one project.
You can always update your cef library's to stay on road.
You can also use Firefox variant :
Firefox implementation
There is a lot of other ways like :
QT framework.
https://www.qt.io/
I've worked on a couple Voice/Video/Screen over IP projects using native C++ API, and my advice is: don't do it unless you have tons of time on your hands. Native API/samples is very much abandonware - Google devs keep it in sync with Chrome, but you're on your own, you'll have to dig through WebRTC & Chrome issues and PRs when your code stops working after updating to a newer release branch.
The only documentation is the source code itself, there's plenty of comments, but it's still very hard to figure things out. And those things tend to change from one release to another

Using Windows Visual Themes with Code::Blocks?

this is my first post on this website,
Anyway, I recently started trying to make a win32 app, and its been going well so far. Then I wanted to add aero to my app (as in not just the borders). So I looked it up online and one tutorial said I have to include dwmapi.h. This is in the Windows SDK. I don't know how to add this to Code::Blocks. By the way, I am using MinGW as my compiler. Also I tried using the MSVC 10 (VS2010) compiler in Code::Blocks, but I got a bunch of errors when I tried to use it, relating to the compilers/linkers not being found.
Any help would be great.
Unless you want to do custom drawing of controls and theme interfaces, all you need to do to support the visual themes is to add the appropriate manifest.
If you want to extend Aero Glass into your client area, look at DwmExtendFrameIntoClientArea () and family.
There are various articles and tutorials online about how to use it. I don't know specifics of using it with Code::Blocks though.
Never Mind, I figured it out. I updated to the nightly build of Code::Blocks and it had an easy preset to help me set up the SDK.

Alternate of win32 framework for windowing system on windows

I want to develop a custom window system in c++ that should not depend on win32 library. As an example, Google Chrome has an interface that is not similar to windows own interface. Similarly MPCstar and adobe products have their own interfaces. Please help me where to start for such a project?
You can use cross platform
Qt
or
wxWidgets
but in my opinion Qt is better.
Qt is awesome even if you don't need cross platform support. I assure you after using it you won't understand how anyone could ever develop native GUI on frameworks like Win32 and MFC. Its only shortcoming is the size of the DLLs you'll have to distribute with your app.
BTW is C++ a prerequisite? if not, and you only need windows, use .Net.
I believe Qt should do the trick. I've never used it myself but it is platform independent. I know a few applications that use it, and it seems fine.
Qt and WxWidgets are the better options. And since its GUI I think Qt performs better and has greater support and lots of libraries.
Find Qt here!

Launching URL - Cross Platform (C++)

I am not sure if this is possible, but I am trying to open a URL in the users default browser in C++. I would just use 'ShellExecute', but I am trying to make it cross platform. Anyone know any ways that this is possible, if it is?
By cross platform I mean the 3:
Linux
Windows
Mac
I've literally Google search for sooo long, and found nothing. Thanks for any help :)
Your best bet is to use a cross platform library like Qt or something like that. Qt has a nice class called QDesktopServices which you can use to do it:
QDesktopServices::openUrl(QUrl("http://google.com", QUrl::TolerantMode));
According to the documentation:
Opens the given url in the appropriate Web browser for the user's
desktop environment, and returns true if successful; otherwise returns
false.
Do note that this will add an dependency on Qt for all your platforms for what might be a very trivial task. It is best that you use custom code for each platform and set compiler directives to see which operating system you are on and run the browser launching code according to that.
Like, if it is being compiled on windows, you could just compile ShellExecute function, if it is being run on Linux, then depending on the desktop environment you could run the appropriate command.
But, if you are really making a cross platform application, a dependency like Qt would not be bad as it will help with a lot of cross-platform stuff (like keeping an icon in the system tray, multimedia playback etc.).
Without a library, there is no standard-C++ way to do it that will run on all platforms.

Which install system to pick when deploying to Windows and Linux?

My company is thinking of dumping InstallShield and move to something else, mainly because of the poor experience it had with it, mostly on Linux.
Our product is a C++ application (binaries, shared libraries) targeted at Windows and Linux (Red Hat).
The installer itself isn't required to do anything special, just dump some binaries and shared libraries and sometime execute an external process. Things like version upgrading through the installer isn't necessary, this is handled after the installer finishes.
I thought of suggesting using NSIS on Windows and RPM on Linux.
What are the recommended installer systems to use when deploying to Windows/Linux? Something that is cross platform to prevent maintaining two installers is a definite plus.
For Windows I would definitively use NSIS. It's very lightweight, easy to code and very simple to understand. Using msis would just be a killer - it generates guid for every file so you can get upgrades for free and stuff but truth being said, you never end up using any of these.
Regarding Linux I would go for RPM and Deb. They're probably the two biggest packaging system so you'll be targeting most of the Linux users. I've never tried RPM but creating a Deb package is fairly straightforward.
See also:
What to use for creating a quick and light setup file?
Packaging to use to deploy cross-platform?
And even:
Creating installers for complex cross-platform programs
There's a tool called BitRock Installer which can create installers for Windows, Linux and OS X.
However, I think that if you target RedHat it would be better to provide native packages for that platform (that is .rpm).
For C++ projects, I'd go with cmake/cpack, if you are also willing to change your build system. Great support, strongly cross-platform. cpack has various generators, NSIS is one..
Take a look at InstallJammer. It will handle both platforms from the same build project, and you can have the installer register the package with the RPM database as well if that's your requirement.
You may want to consider our tool BitRock InstallBuilder , it can generate installers for Windows and Linux from a single project file and also RPMs. Is your application based on Qt? Our clients include the makers of Qt, Nokia (previously Trolltech) and they use it to package their Qt Creator product. We encourage to give InstallBuilder a try and contact our support with any questions or suggestions you may have.