The RasPlex cross-platform GUI installer
C C++ PowerShell QMake
Permalink
Failed to load latest commit information.
3rd-party Add libz.a 1.2.8, update linux compile instructions to work better Feb 12, 2015
osx Final version of apple script with quoted paths Dec 2, 2013
windows Added static build instruction for windows on qt5.2.1 Mar 22, 2014
.gitignore added artifact folders to ignore Mar 19, 2014
README.md Add libz.a 1.2.8, update linux compile instructions to work better Feb 12, 2015
confighandler.cpp Add framework for portable config handling May 5, 2013
confighandler.h [Linux] Select video output from GUI May 5, 2013
confighandler_unix.cpp Various updates to OS X installer and UI improvements Dec 2, 2013
confighandler_unix.h Add framework for portable config handling May 5, 2013
confighandler_windows.cpp Various updates to OS X installer and UI improvements Dec 2, 2013
confighandler_windows.h [Windows] Select video output from GUI May 5, 2013
deviceenumerator.h Separated device enumeration to its own class Dec 1, 2013
deviceenumerator_unix.cpp Further improve error handling in DeviceEnumerator_unix::driveSize() Sep 6, 2015
deviceenumerator_unix.h Further improve error handling in DeviceEnumerator_unix::driveSize() Sep 6, 2015
deviceenumerator_windows.cpp Print size of drive as as friendly name in DeviceEnumerator_windows Aug 31, 2015
deviceenumerator_windows.h Print size of drive as as friendly name in DeviceEnumerator_windows Aug 31, 2015
diskwriter.cpp Use QByteArray instead of new char[BUFFSIZE] Aug 22, 2015
diskwriter.h Use QByteArray instead of new char[BUFFSIZE] Aug 22, 2015
diskwriter_unix.cpp Use QByteArray instead of new char[BUFFSIZE] Aug 22, 2015
diskwriter_unix.h Use QByteArray instead of new char[BUFFSIZE] Aug 22, 2015
diskwriter_windows.cpp (win) Adjust error handling. Should fix #30 Sep 16, 2015
diskwriter_windows.h Print size of drive as as friendly name in DeviceEnumerator_windows Aug 31, 2015
downloadmanager.cpp Fix segfaults on cancel Feb 15, 2015
downloadmanager.h Downloads can now be canceled Dec 1, 2013
getrasplex.icns Added icons Mar 23, 2013
getrasplex.ico Added icons Mar 23, 2013
getrasplex.png Added icons Mar 23, 2013
installer.cpp Save preferred removable device between runs Aug 28, 2015
installer.h Change default reset message Aug 28, 2015
installer.ui Update main text to credit the RasPlex team Sep 4, 2015
main.cpp Various tweaks for osx Dec 2, 2013
rasplex-installer.exe.manifest Update windows assembly manifest Aug 16, 2015
rasplex-installer.pro UNIX: compile release builds with -Os Feb 27, 2015
rasplex-installer.rc Added appicon and my changes to instructions for static build Mar 24, 2013
refresh62.png Switched to png refresh buttons since no svg support Aug 28, 2015
refresh62.svg Revamp user interface and add refresh buttons Aug 28, 2015
resources.qrc Decide on refresh icon, remove the other one Aug 31, 2015
simplejsonparser.cpp Merge Link- and DeviceParser into SimpleJsonParser Feb 15, 2015
simplejsonparser.h Merge Link- and DeviceParser into SimpleJsonParser Feb 15, 2015
static qt build notes.txt Add static Qt configure line for GNU/Linux Mar 19, 2014
xmlhandler.cpp Added special release 'experimental' Nov 28, 2013
xmlhandler.h Added special release 'experimental' Nov 28, 2013
zconf.h Made it compile on windows Mar 17, 2013
zlib.h Made it compile on windows Mar 17, 2013

README.md

Overview

This is the installer for the RasPlex project

Planned features include:

  • Allow version selection (stable, testing/bleeding, developer)
  • Allow upgrading to newer versions (not full image install)
  • Backup creation
  • Use offline files
  • RPi config

Platform Deloyment

Windows

Setup and Configuration

References:

Setup:

  • You'll need Window7 Sp1, or something that you can install powershell 3 on. Or just reverse engineer the included script.
  • Install qt5 mingw windows 32 bit precompiled to get mingw environment windows qt
  • Install msys and when it asks point it at the mingw dir from qt (should be in the Tools folder and have stuff like make and gcc in it).
  • Verify that gcc works. Always use mingw32-make and not plain make. The one that comes with Qt is much better.
  • Install activestate perl as it's required to build openssl.
  • Grab a source tarball from openssl.org
  • You're now ready to build Openssl.

Building openssl

Unpack the sources, and configure/build as such:

perl Configure mingw no-shared no-asm --prefix=/c/OpenSSL
make depend
make
make install

If asked to choose a compiler, abviously choose mingw. It'll install a fuckload of manpages for some reason. Maybe you can figure out how to make it not, but i neven tried.

There might be an undocumented step that i'm missing, if there is, please add it here.

You should end up with a lib folder containing "libcrypto.a" and "libssl.a". Woot!

Building QT

Crack open the included "windows/windows-build-qt-static.ps1", which is a... sigh... powershell script.

Notice the configure line:

    cmd /c 'configure.bat -static -debug-and-release -platform win32-g++ -prefix $QtDir -qt-zlib -qt-pcre -qt-libpng -qt-libjpeg -qt-freetype -opengl desktop -qt-sql-sqlite -no-openssl -opensource -confirm-license  -make libs -nomake tools -nomake examples -nomake tests -no-accessibility -no-openvg -no-nis -no-iconv -no-inotify -no-fontconfig -qt-zlib -no-icu -no-gif -no-libjpeg -no-freetype -no-vcproj -no-plugin-manifests -no-dbus -no-audio-backend -no-qml-debug -no-directwrite -no-native-gestures -no-mp -no-rtti -no-c++11 -no-opengl -system-zlib -openssl-linked OPENSSL_LIBS="-lssl -lcrypto" -L C:\Openssl\lib -I C:\Openssl\include

This is the most important part. The openssl-linked will tell it to use the statically linked libs, instead of relying on dynamic. The include and lib paths much match your installation. Everything else is mostly to remove dependencies to supped up build time.

Either run this powershell script or pull out the important bits using your powerful human brain, which has the distinct advantage of not involving powershell.

This will generate a new qmake in the Qt directory, which knows how to statically compile. Use this one instead of the default.

For example, mine was at "C:\Qt\Static\blahblahblah\Src\qtbase\bin\qmake.exe"

Verify you can run qmake, and you're done!

Building the installer

Command line:

From the rasplex-installer source directory, run qmake as generated above from Qt shell (Qt 5.2.1 for desktop (MinGW 4.7)), then run mingw32-make:

C:\Qt\Qt-5.0.2\5.0.2\Src\bin\qmake
C:\Qt\Static\blahblahblah\Src\qtbase\bin\qmake.exe
mingw32-make

Using Qt creator:

  • Open rasplex-installer project in Qt Creator
  • Go to Tools->Options->Build & Run->Qt Versions and click add. Select C:\Qt\qt-everywhere-opensource-src-5.0.1\qtbase\bin\qmake.exe
  • Go to Tools->Options->Build & Run->Kits and clone the existing kit. Change Qt version of that kit to the static version.
  • Apply and close Options
  • Make rasplex-installer the active project and go to the Projects tab
  • Click "Add kit" and select the new (static) clone
  • Make sure that the build configuration is set to Release
  • Build and prosper!

Packaging

The static libs make the exe quite large, so it's a good idea to compress it using upx

This should take it from about 12MB down to about 6MB

OS X

Configuration and setup

You'll need to use Qt 5.2+, at time of writing we were using the betas

Make sure to install everything (including source components).

You can't really do a static build very easily... so we just use "macdeployqt", which is located inside "Clang/bin" directory of whereever you installed Qt.

Building the installer

Just open the project in Qt creator and build.

Packaging

To bundle for osx, use "macdeployqt" on the target app. This should take a few seconds, and bloats the app up to about 20MB. This is because it copies in al the Qt frameworks.

Next, merge the included osx/GetRasplex.app, to get all the app goodies (script to run as admin, icon, etc). GetRasplex.app was created by just opening main.scpt in apple script editor, and exporting it as an app, then overwriting our own icon into the app. We save the skelaton for ease of deployment.

It should look like this:

path-to-qt/clang/bin/macdeployqt build.blahblah-Release/rasplex-installer.app
cp -r build.blahblah/rasplex-installer.app /tmp/GetRasplex.app
cp -r osx/GetRasplex.app/ /tmp/GetRasplex.app

Now, to shrink it down, go ahead and grab dmgcreator, and add GetRasplex.app to it, selecting "zlib" compression.

This should take the bundle down to about 8MB from 20. Not bad.

Linux

Configuration and setup

You'll need to use Qt 5.2+, at time of writing we were using the betas

Make sure to install everything (including source components).

Building Qt

Go to the source directory where you installed qt, and enter "qtbase". Run the following configure command (works on 5.2.1 on ubuntu):

OPENSSL_LIBS="-lssl -lcrypto" ./configure -static -release -opensource -nomake tools -nomake examples -no-accessibility -no-openvg -no-nis -no-iconv -no-directfb -no-icu -no-gif -no-libjpeg -strip -no-dbus -no-audio-backend -no-qml-debug -no-c++11 -system-zlib -no-linuxfb -no-eglfs -no-sql-mysql -no-sql-odbc  -no-cups -no-glib -no-qml-debug -no-javascript-jit -no-mtdev -qt-sql-sqlite -qt-xcb -confirm-license -fontconfig -openssl-linked
make -j `nproc`

This command is designed to minimize external dependencies, check against doconf.linux file first, as it may be more up-to-date than this readme. When the make is done, you'll have a static Qt and a qmake you can use that knows how to handle static builds.

Building the installer

From the rasplex-installer source dir, simply run the qmake you generated above (usually at qtbase/bin/qmake), then run make.

path-to-qt-sources/qtbase/bin/qmake
make -j `nproc`

Packaging

Install upx from your package manager, or from their site, whatever is easier. Then just run upx on the output from the build. This should bring the installer down from about 17MB to about 6.