FileInsight is a Qt-based file type identifier using libmagic (i.e. the Unix file command), Qt 5, and TrID as its backends. It is written in C++ and has been tested to work on both Windows and Linux.
Linux installation is fairly straightforward. For icon display, FileInsight will simply use the icon theme configured on your desktop.
Install Qt 5's development suite, Qt Creator, and libmagic's development files. On a Debian / Ubuntu system, this corresponds to
apt-get install qt5-default libmagic-dev qtcreator.Build the project with Qt Creator.
Optionally, you can download and install TrID from http://mark0.net/soft-trid-e.html (the backend works by calling it as a subprocess). TrID is free for personal and non-commercial use, but is NOT free as in FOSS.
Windows builds are a pain (no, really!). Instead, you may want to simply grab a Windows build from the releases page.
Download and install MinGW and MSYS using this guide: http://www.mingw.org/wiki/Getting_Started
Install Qt with MinGW from https://www.qt.io/download/..
Fetch the sources for libmagic/file and its dependency libgnurx
Create an empty folder (prefix) to use as the prefix for building libgnurx and libmagic/file.
Compile libgnurx into the empty prefix you created: in a MinGW shell, navigate to the source folder and run
./configure --prefix=THE FOLDER YOU CHOSE && make && make installCompile libmagic/file into the empty prefix you created: in a MinGW shell, navigate to the source folder and run:
export TARGET=THE FOLDER YOU CHOSEautoreconf -f -iLDFLAGS="-L$TARGET/lib -static-libgcc" CFLAGS="-I$TARGET/include" ./configure --prefix=$TARGETmake && make install
- Now that libmagic and libgnurx have been built, copy the contents of the libmagic build folder into the
thirdparty/directory of FileInsight's source. On Windows, this is where the toolchain will try to load its dependency libraries from.
- You should be able to build FileInsight now using Qt Creator + MinGW. However, in order for the resulting binary to run, you must copy the following into the directory of your resultant build:
bin/libgnurx-0.dllfrom the libmagic buildbin/libmagic-1.dllfrom the libmagic buildshare/misc/magic.mgc(libmagic's data file) from the libmagic buildlibgcc_s_dw2-1.dllfrom your MinGW root (e.g.C:\MinGW\bin)
Copy the
windows-build-skeleton/folder in FileInsight's source to somewhere else (this will be your "Windows build folder"). This folder includes the relevant copyright information that makes the build legally distributable (hopefully).Use windeployqt to copy the required Qt libraries to the Windows build folder: in a command line, run
windeploy PATH-TO-FILEINSIGHT.EXE.Copy
libgnurx-0.dll,libmagic-1.dll,libgcc_s_dw2-1.dll, andmagic.mgcinto the Windows build folder.Optional: for TrID backend support, extract TrID from http://mark0.net/soft-trid-e.html it into the
thirdpartydirectory in the Windows build folder.Optional: for icon display, extract a prebuilt copy of the Oxygen icon theme (from a source like Debian) into the
icons/folder. Since simple tarball extraction may create (broken) Unix symlinks, they must be expanded so that FileInsight can actually load them.
- You can use the bundled
expand-symlinks.pyin thescripts/folder for this purpose:scripts/expand-symlinks.py PATH_TO_OXYGEN_ICONS