Tuesday, February 20, 2018

Inno Setup, Part 9. Compiling installer from command line.

Sometimes you may need to compile your Inno Setup installer (*.iss file) from command line, script or another application. Basically this is done with the help of ISCC.exe which is being installed together with Inno Setup:

iscc "c:\My scripts\my script.iss"

Note double quotes, they are necessary in case path contains any whitespaces. Also you may need to specify path to iscc itself. Now let's describe how you can do the same thing from C# application.

   Process process = new Process();
   ProcessStartInfo startInfo = new ProcessStartInfo();
   startInfo.WindowStyle = ProcessWindowStyle.Hidden;
   startInfo.FileName = "cmd.exe";
   string compiler = @"C:\Program Files (x86)\Inno Setup 5\ISCC.exe";
   string outputName = "output";
   string installer = @"D:\MyInstallerIsHere.iss";
   startInfo.FileName = "\"" + compiler + "\"";
   startInfo.Arguments = " /Q " + "\""+ installer+ "\"" + " /F" + "\""+outputName + "\"";
   process.StartInfo = startInfo;

ProcessWindowStyle.Hidden will for Process will help us to hide console window. What we are doing here is launching again ISCC.exe with iss script name as main argument. Other arguments are: /Q for quiet compilation, /F - for overriding output installer name (you can skip this if default name is OK for your purposes).

Thursday, October 19, 2017

We just released Wallpaper Updater 2.6!

Today we announce Wallpaper Updater 2.6, our free wallpaper manager compatible with all modern Windows versions. There are several important updates in this version, including program help and user interface.

Read more about Wallpaper Updater 2.6 release here.

You are welcome to download our program here.

Please leave any comments here or on our website, they are all very helpful to us.

Thursday, September 28, 2017

QOperatingSystemVersion - new class in Qt 5.9

Qt 5.9 is a current LTS release from Qt Company. In Qt Core we see a new class QOperationSystemVersion which aim is to replace some of the methods of QSysInfo class.

Let's see how this new class works. First create Qt console application and include necessary header:

#include <QOperatingSystemVersion>

After including the header we can use methods of QOperationSystemVersion class for getting information about our system. Available information includes system name, major version, minor version, micro version. Also it includes operation version in form of OSType enumeration which can be convenient if you need to execute some specific code, for example, for Mac OS or Windows.

auto osversion = QOperatingSystemVersion::current();

std::cout << osversion.name().toStdString() << std::endl;
std::cout << osversion.majorVersion() << "." << osversion.minorVersion()
          << "." << osversion.microVersion() << std::endl;

if (osversion.type() == QOperatingSystemVersion::Windows)
    std::cout << "Hi, we are on Windows!" << std::endl;

This code executed, for instance, on Windows 8.1 gives the following output:

Hi, we are on Windows!

Wednesday, January 18, 2017

What file formats are used with 3D printers

3D printing became really popular recently. That's why we should be able to work with various digital models representing real world. Multiple file formats are used for these digital 3D models.

STL format is very common since most CAD programs use it while generating files. It seems all 3D printers accept this format without any adjustments. Files can be ASCII or binary (large files are almost all binary), format is open and well known, see its description in wiki, for example. But this format has its own drawbacks, among them - very poor support of colors.

VRML is a little bit newer and also universal format. It is basically plain text which is good to compress. Designed initially for virtual worlds, it can contain colors, animations, sounds, etc. So it is more advanced comparing to STL.

AMF format is open (defined by ISO standard) and XML based. As it is clear from its name, it was designed for additive manufacturing processes. While STL file is basically a list of vertices only, AMF file has support for colors, materials, etc.

OBJ is a common 3D graphics open format. It is relatively simple format based on vertices (their positions, normals, etc.). OBJ files usually go together with material description files - MTL, containing additional information about materials. OBJ format allows to include information about colors for each vertex.

X3G is a binary format containing exact instructions how to print. It is used by Makerbot devices such as Makerbot Replicator. If you've got file like STL, you can convert it to X3G.

PLY is a format designed for storing data from 3D scanners. It has both ASCII and binary versions.

FBX is a proprietary Autodesk format. It is used for exchanging data between Autodesk programs mainly. Autodesk provides its SDK. Also some unofficial description of format is available. FBX files can be either binary or ASCII.

Wednesday, November 16, 2016

New print option for QtWebEngine in Qt 5.8

Beta version of Qt 5.8 version is out now and list of new features is available here .

For QWebEnginePage a new print option was added. As soon as in Qt 5.7 printing to PDF was already available, now printing through QPrinter also works:

void print(QPrinter *printer, 
       FunctorOrLambda resultCallback);

This is actually implemented by saving web content into temporary PDF file and then printing it out. When saving PDF file, settings of QPrinter are applied.

We can easily find an example of this function usage in demobrowser (Qt installation, Examples folder). resultCallback takes boolean as parameter which indicates whether printing is successful or not.

m_currentPrinter = new QPrinter();
QScopedPointer dialog(new QPrintDialog(m_currentPrinter, this));
dialog->setWindowTitle(tr("Print Document"));
if (dialog->exec() != QDialog::Accepted) {
page->print(m_currentPrinter, invoke(this, &BrowserMainWindow::slotHandlePagePrinted));
void BrowserMainWindow::slotHandlePagePrinted(bool result)

    delete m_currentPrinter;
    m_currentPrinter = nullptr;

Tuesday, May 31, 2016

New method QHostAddress::isMulticast() in Qt 5.6

Among new features of Qt 5.6 new method was added for QHostAddress:


This bool method returns true if IPv4 or IPv6 address is multicast.

From wikipedia a multicast address is a logical identifier for a group of hosts in a network available to process datagrams or frames intended to be multicast for a network service.

Here is the test program which shows the output for different IPv4 addresses:

#include <QCoreApplication> 
#include <QDebug>
#include <QHostAddress>

int main(int argc, char *argv[])
    QCoreApplication a(argc, argv);

    QHostAddress ipv4false("");
    qDebug() << ipv4false.isMulticast(); // false
    // The All Hosts multicast group addresses all 
    // hosts on the same network segment.
    QHostAddress ipv4true("");
    qDebug() << ipv4true.isMulticast(); // true

    return a.exec();

It works the same way for IPv6 addresses.

Tuesday, May 24, 2016

QtWebEngine: Printing to PDF

Among new features in Qt 5.7 for QtWebEngine there is printing to PDF. There are several samples which are available for QtWebEngine you can start from this folder in your Qt installation:


We will look at demobrowser sample. Let's start from BrowserMainWindow::slotFilePrintToPDF(). Unfortunately Qt still has problem with QPrintDialog not working on Windows described here:


So for sample purposes we will remove QPrintDialog and just hardcode filename:

void BrowserMainWindow::slotFilePrintToPDF()
    if (!currentTab())

    QPrinter printer;
    if (printer.outputFileName().isEmpty() || 
    m_printerOutputFileName = printer.outputFileName();
                                     invoke(this, &BrowserMainWindow::slotHandlePdfPrinted));
#endif // QT_NO_PRINTER

void BrowserMainWindow::slotHandlePdfPrinted(const QByteArray& result)
    if (!result.size())

    QFile file(m_printerOutputFileName);
    if (!file.open(QFile::WriteOnly))
    file.write(result.data(), result.size());

So what was actually added in Qt 5.7?

Two overloads of printToPdf() function for QWebEnginePage are here.

They allow to render page content into a PDF document.