Skip to content

Commit

Permalink
Finalize details for windows installer
Browse files Browse the repository at this point in the history
Signed-off-by: falkTX <falktx@falktx.com>
  • Loading branch information
falkTX committed Oct 5, 2023
1 parent 387f295 commit 3b63e9b
Show file tree
Hide file tree
Showing 10 changed files with 1,690 additions and 35 deletions.
214 changes: 214 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion mod-host
28 changes: 21 additions & 7 deletions systray/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
#include "mod-app.hpp"
#include "qrc_mod-app.hpp"

#ifndef _WIN32
#ifdef _WIN32
#include <shlobj.h>
const WCHAR* user_files_dir = nullptr;
#else
#include <dlfcn.h>
#endif

Expand Down Expand Up @@ -32,12 +35,23 @@ int main(int argc, char* argv[])
const QString cwd(QString::fromWCharArray(wc));
SetCurrentDirectoryW(wc);

WCHAR lv2path[(MAX_PATH + 256) * 2] = {};
std::wcscat(lv2path, wc);
std::wcscat(lv2path, L"\\data\\lv2;");
std::wcscat(lv2path, wc);
std::wcscat(lv2path, L"\\plugins");
SetEnvironmentVariableW(L"LV2_PATH", lv2path);
WCHAR path[(MAX_PATH + 256) * 2] = {};
std::wcscat(path, wc);
std::wcscat(path, L"\\data\\lv2;");
std::wcscat(path, wc);
std::wcscat(path, L"\\plugins");
SetEnvironmentVariableW(L"LV2_PATH", path);

if (SHGetSpecialFolderPathW(nullptr, path, CSIDL_MYDOCUMENTS, FALSE))
{
std::wcscat(path, L"\\mod-app");
_wmkdir(path);
SetEnvironmentVariableW(L"MOD_DATA_DIR", path);

std::wcscat(path, L"\\user-files");
_wmkdir(path);
user_files_dir = path;
}
#else
// TODO
const QString cwd;
Expand Down
5 changes: 0 additions & 5 deletions utils/jackd.bat

This file was deleted.

3 changes: 1 addition & 2 deletions utils/mod-ui-wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,12 @@
from tornado import gen, iostream, web, websocket

ROOT = os.path.abspath(os.path.dirname(sys.argv[0]))
DATA_DIR = os.path.join(ROOT, 'data')
DATA_DIR = os.getenv('MOD_DATA_DIR')

sys.path = [ROOT] + sys.path

os.environ['LV2_PATH'] = os.path.join(DATA_DIR, 'lv2') + os.path.pathsep + os.path.join(ROOT, 'plugins')
os.environ['MOD_APP'] = '1'
os.environ['MOD_DATA_DIR'] = DATA_DIR
os.environ['MOD_DEFAULT_PEDALBOARD'] = os.path.join(ROOT, 'default.pedalboard')
os.environ['MOD_DEV_ENVIRONMENT'] = '0'
os.environ['MOD_DEVICE_HOST_PORT'] = '18182'
Expand Down
142 changes: 123 additions & 19 deletions utils/win64-installer.iss
Original file line number Diff line number Diff line change
@@ -1,46 +1,150 @@
#include "win64-version.iss"

[Setup]
ArchitecturesInstallIn64BitMode=x64
AppName=mod-app
AppPublisher=DISTRHO
AppPublisherURL=https://github.com/DISTRHO/Cardinal/
AppSupportURL=https://github.com/DISTRHO/Cardinal/issues/
AppUpdatesURL=https://github.com/DISTRHO/Cardinal/releases/
AppPublisher=MOD Audio
AppPublisherURL=https://github.com/moddevices/Cardinal/
AppSupportURL=https://github.com/moddevices/Cardinal/issues/
AppUpdatesURL=https://github.com/moddevices/Cardinal/releases/
AppVersion={#VERSION}
DefaultDirName={commonpf64}\mod-app
DisableDirPage=yes
DisableWelcomePage=no
LicenseFile=..\LICENSE
OutputBaseFilename=mod-app-win64-{#VERSION}-installer
OutputDir=.
OutputDir=..
UsePreviousAppDir=no

[Types]
Name: "normal"; Description: "Full installation";

[Components]
Name: plugins; Description: "LV2 plugins"; Types: normal; Flags: fixed;

[Files]
; icon
; Source: ".\mod-app.ico"; DestDir: "{app}"; Flags: ignoreversion;
; jack
Source: "..\systray\mod-logo.ico"; DestDir: "{app}"; Flags: ignoreversion;
; jack + mod-host
Source: "..\build\jackd.exe"; DestDir: "{app}"; Flags: ignoreversion;
Source: "..\build\libjack64.dll"; DestDir: "{app}"; Flags: ignoreversion;
Source: "..\build\libjackserver64.dll"; DestDir: "{app}"; Flags: ignoreversion;
Source: "..\build\jack\jack-session.conf"; DestDir: "{app}"; Flags: ignoreversion;
Source: "..\build\jack\jack_portaudio.dll"; DestDir: "{app}"; Flags: ignoreversion;
Source: "..\build\jack\jack_winmme.dll"; DestDir: "{app}"; Flags: ignoreversion;
Source: "..\build\jack\mod-host.dll"; DestDir: "{app}"; Flags: ignoreversion;
Source: "..\build\jack\mod-midi-broadcaster.dll"; DestDir: "{app}"; Flags: ignoreversion;
Source: "..\build\jack\mod-midi-merger.dll"; DestDir: "{app}"; Flags: ignoreversion;
; mod-ui
Source: "..\build\jack\jack-session.conf"; DestDir: "{app}\jack"; Flags: ignoreversion;
Source: "..\build\jack\jack_portaudio.dll"; DestDir: "{app}\jack"; Flags: ignoreversion;
Source: "..\build\jack\jack_winmme.dll"; DestDir: "{app}\jack"; Flags: ignoreversion;
Source: "..\build\jack\mod-host.dll"; DestDir: "{app}\jack"; Flags: ignoreversion;
Source: "..\build\jack\mod-midi-broadcaster.dll"; DestDir: "{app}\jack"; Flags: ignoreversion;
Source: "..\build\jack\mod-midi-merger.dll"; DestDir: "{app}\jack"; Flags: ignoreversion;
; mod-app + qt5
Source: "..\build\mod-app.exe"; DestDir: "{app}"; Flags: ignoreversion;
Source: "..\build\Qt5*.dll"; DestDir: "{app}"; Flags: ignoreversion;
Source: "..\build\bearer\q*.dll"; DestDir: "{app}\bearer"; Flags: ignoreversion;
Source: "..\build\generic\q*.dll"; DestDir: "{app}\generic"; Flags: ignoreversion;
Source: "..\build\iconengines\q*.dll"; DestDir: "{app}\iconengines"; Flags: ignoreversion;
Source: "..\build\imageformats\q*.dll"; DestDir: "{app}\imageformats"; Flags: ignoreversion;
Source: "..\build\platforms\q*.dll"; DestDir: "{app}\platforms"; Flags: ignoreversion;
Source: "..\build\styles\q*.dll"; DestDir: "{app}\styles"; Flags: ignoreversion;
; mod-ui + python
Source: "..\build\mod-screenshot.exe"; DestDir: "{app}"; Flags: ignoreversion;
Source: "..\build\mod-ui.exe"; DestDir: "{app}"; Flags: ignoreversion;
Source: "..\build\libpython3.8.dll"; DestDir: "{app}"; Flags: ignoreversion;
Source: "..\build\default.pedalboard\manifest.ttl"; DestDir: "{app}\default.pedalboard"; Flags: ignoreversion;
Source: "..\build\default.pedalboard\screenshot.png"; DestDir: "{app}\default.pedalboard"; Flags: ignoreversion;
Source: "..\build\default.pedalboard\thumbnail.png"; DestDir: "{app}\default.pedalboard"; Flags: ignoreversion;
Source: "..\build\html\*.html"; DestDir: "{app}\html"; Flags: ignoreversion;
Source: "..\build\html\favicon.ico"; DestDir: "{app}\html"; Flags: ignoreversion;
Source: "..\build\html\css\*.css"; DestDir: "{app}\html\css"; Flags: ignoreversion;
Source: "..\build\html\css\fontello\css\*.css"; DestDir: "{app}\html\css\fontello\css"; Flags: ignoreversion;
Source: "..\build\html\css\fontello\font\*.eot"; DestDir: "{app}\html\css\fontello\font"; Flags: ignoreversion;
Source: "..\build\html\css\fontello\font\*.svg"; DestDir: "{app}\html\css\fontello\font"; Flags: ignoreversion;
Source: "..\build\html\css\fontello\font\*.ttf"; DestDir: "{app}\html\css\fontello\font"; Flags: ignoreversion;
Source: "..\build\html\css\fontello\font\*.woff"; DestDir: "{app}\html\css\fontello\font"; Flags: ignoreversion;
Source: "..\build\html\css\fontello\font\*.woff2"; DestDir: "{app}\html\css\fontello\font"; Flags: ignoreversion;
Source: "..\build\html\fonts\Ek-Mukta\Ek-Mukta-200\*.eot"; DestDir: "{app}\html\fonts\Ek-Mukta\Ek-Mukta-200"; Flags: ignoreversion;
Source: "..\build\html\fonts\Ek-Mukta\Ek-Mukta-200\*.svg"; DestDir: "{app}\html\fonts\Ek-Mukta\Ek-Mukta-200"; Flags: ignoreversion;
Source: "..\build\html\fonts\Ek-Mukta\Ek-Mukta-200\*.ttf"; DestDir: "{app}\html\fonts\Ek-Mukta\Ek-Mukta-200"; Flags: ignoreversion;
Source: "..\build\html\fonts\Ek-Mukta\Ek-Mukta-200\*.woff"; DestDir: "{app}\html\fonts\Ek-Mukta\Ek-Mukta-200"; Flags: ignoreversion;
Source: "..\build\html\fonts\Ek-Mukta\Ek-Mukta-200\*.woff2"; DestDir: "{app}\html\fonts\Ek-Mukta\Ek-Mukta-200"; Flags: ignoreversion;
Source: "..\build\html\fonts\Ek-Mukta\Ek-Mukta-600\*.eot"; DestDir: "{app}\html\fonts\Ek-Mukta\Ek-Mukta-600"; Flags: ignoreversion;
Source: "..\build\html\fonts\Ek-Mukta\Ek-Mukta-600\*.svg"; DestDir: "{app}\html\fonts\Ek-Mukta\Ek-Mukta-600"; Flags: ignoreversion;
Source: "..\build\html\fonts\Ek-Mukta\Ek-Mukta-600\*.ttf"; DestDir: "{app}\html\fonts\Ek-Mukta\Ek-Mukta-600"; Flags: ignoreversion;
Source: "..\build\html\fonts\Ek-Mukta\Ek-Mukta-600\*.woff"; DestDir: "{app}\html\fonts\Ek-Mukta\Ek-Mukta-600"; Flags: ignoreversion;
Source: "..\build\html\fonts\Ek-Mukta\Ek-Mukta-600\*.woff2"; DestDir: "{app}\html\fonts\Ek-Mukta\Ek-Mukta-600"; Flags: ignoreversion;
Source: "..\build\html\fonts\Ek-Mukta\Ek-Mukta-700\*.eot"; DestDir: "{app}\html\fonts\Ek-Mukta\Ek-Mukta-700"; Flags: ignoreversion;
Source: "..\build\html\fonts\Ek-Mukta\Ek-Mukta-700\*.svg"; DestDir: "{app}\html\fonts\Ek-Mukta\Ek-Mukta-700"; Flags: ignoreversion;
Source: "..\build\html\fonts\Ek-Mukta\Ek-Mukta-700\*.ttf"; DestDir: "{app}\html\fonts\Ek-Mukta\Ek-Mukta-700"; Flags: ignoreversion;
Source: "..\build\html\fonts\Ek-Mukta\Ek-Mukta-700\*.woff"; DestDir: "{app}\html\fonts\Ek-Mukta\Ek-Mukta-700"; Flags: ignoreversion;
Source: "..\build\html\fonts\Ek-Mukta\Ek-Mukta-700\*.woff2"; DestDir: "{app}\html\fonts\Ek-Mukta\Ek-Mukta-700"; Flags: ignoreversion;
Source: "..\build\html\fonts\Ek-Mukta\Ek-Mukta-regular\*.eot"; DestDir: "{app}\html\fonts\Ek-Mukta\Ek-Mukta-regular"; Flags: ignoreversion;
Source: "..\build\html\fonts\Ek-Mukta\Ek-Mukta-regular"; DestDir: "{app}\html\fonts\Ek-Mukta\Ek-Mukta-regular\*.svg"; Flags: ignoreversion;
Source: "..\build\html\fonts\Ek-Mukta\Ek-Mukta-regular"; DestDir: "{app}\html\fonts\Ek-Mukta\Ek-Mukta-regular\*.ttf"; Flags: ignoreversion;
Source: "..\build\html\fonts\Ek-Mukta\Ek-Mukta-regular"; DestDir: "{app}\html\fonts\Ek-Mukta\Ek-Mukta-regular\*.woff"; Flags: ignoreversion;
Source: "..\build\html\fonts\Ek-Mukta\Ek-Mukta-regular"; DestDir: "{app}\html\fonts\Ek-Mukta\Ek-Mukta-regular\*.woff2"; Flags: ignoreversion;
Source: "..\build\html\fonts\comforta\*.ttf"; DestDir: "{app}\html\fonts\comforta"; Flags: ignoreversion;
Source: "..\build\html\fonts\cooper\*.eot"; DestDir: "{app}\html\fonts\cooper"; Flags: ignoreversion;
Source: "..\build\html\fonts\cooper\*.ttf"; DestDir: "{app}\html\fonts\cooper"; Flags: ignoreversion;
Source: "..\build\html\fonts\cooper\*.woff"; DestDir: "{app}\html\fonts\cooper"; Flags: ignoreversion;
Source: "..\build\html\fonts\cooper\*.woff2"; DestDir: "{app}\html\fonts\cooper"; Flags: ignoreversion;
Source: "..\build\html\fonts\css\*.css"; DestDir: "{app}\html\fonts\css"; Flags: ignoreversion;
Source: "..\build\html\fonts\england-hand\*.css"; DestDir: "{app}\html\fonts\england-hand"; Flags: ignoreversion;
Source: "..\build\html\fonts\england-hand\*.eot"; DestDir: "{app}\html\fonts\england-hand"; Flags: ignoreversion;
Source: "..\build\html\fonts\england-hand\*.svg"; DestDir: "{app}\html\fonts\england-hand"; Flags: ignoreversion;
Source: "..\build\html\fonts\england-hand\*.ttf"; DestDir: "{app}\html\fonts\england-hand"; Flags: ignoreversion;
Source: "..\build\html\fonts\england-hand\*.woff"; DestDir: "{app}\html\fonts\england-hand"; Flags: ignoreversion;
Source: "..\build\html\fonts\epf\*.css"; DestDir: "{app}\html\fonts\epf\*.css"; Flags: ignoreversion;
Source: "..\build\html\fonts\epf\*.eot"; DestDir: "{app}\html\fonts\epf\*.eot"; Flags: ignoreversion;
Source: "..\build\html\fonts\epf\*.svg"; DestDir: "{app}\html\fonts\epf\*.svg"; Flags: ignoreversion;
Source: "..\build\html\fonts\epf\*.ttf"; DestDir: "{app}\html\fonts\epf"; Flags: ignoreversion;
Source: "..\build\html\fonts\epf\*.woff"; DestDir: "{app}\html\fonts\epf"; Flags: ignoreversion;
Source: "..\build\html\fonts\nexa\*.css"; DestDir: "{app}\html\fonts\nexa"; Flags: ignoreversion;
Source: "..\build\html\fonts\nexa\*.eot"; DestDir: "{app}\html\fonts\nexa"; Flags: ignoreversion;
Source: "..\build\html\fonts\nexa\*.svg"; DestDir: "{app}\html\fonts\nexa"; Flags: ignoreversion;
Source: "..\build\html\fonts\nexa\*.ttf"; DestDir: "{app}\html\fonts\nexa"; Flags: ignoreversion;
Source: "..\build\html\fonts\nexa\*.woff"; DestDir: "{app}\html\fonts\nexa"; Flags: ignoreversion;
Source: "..\build\html\fonts\pirulen\*.css"; DestDir: "{app}\html\fonts\pirulen"; Flags: ignoreversion;
Source: "..\build\html\fonts\pirulen\*.eot"; DestDir: "{app}\html\fonts\pirulen"; Flags: ignoreversion;
Source: "..\build\html\fonts\pirulen\*.ttf"; DestDir: "{app}\html\fonts\pirulen"; Flags: ignoreversion;
Source: "..\build\html\fonts\pirulen\*.woff"; DestDir: "{app}\html\fonts\pirulen"; Flags: ignoreversion;
Source: "..\build\html\fonts\questrial\*.css"; DestDir: "{app}\html\fonts\questrial"; Flags: ignoreversion;
Source: "..\build\html\fonts\questrial\*.eot"; DestDir: "{app}\html\fonts\questrial"; Flags: ignoreversion;
Source: "..\build\html\fonts\questrial\*.svg"; DestDir: "{app}\html\fonts\questrial"; Flags: ignoreversion;
Source: "..\build\html\fonts\questrial\*.ttf"; DestDir: "{app}\html\fonts\questrial"; Flags: ignoreversion;
Source: "..\build\html\fonts\questrial\*.woff"; DestDir: "{app}\html\fonts\questrial"; Flags: ignoreversion;
Source: "..\build\html\img\*.gif"; DestDir: "{app}\html\img"; Flags: ignoreversion;
Source: "..\build\html\img\*.jpg"; DestDir: "{app}\html\img"; Flags: ignoreversion;
Source: "..\build\html\img\*.png"; DestDir: "{app}\html\img"; Flags: ignoreversion;
Source: "..\build\html\img\*.svg"; DestDir: "{app}\html\img"; Flags: ignoreversion;
Source: "..\build\html\img\cloud\*.png"; DestDir: "{app}\html\img\cloud"; Flags: ignoreversion;
Source: "..\build\html\img\favicon\*.png"; DestDir: "{app}\html\img\favicon"; Flags: ignoreversion;
Source: "..\build\html\img\icons\*.css"; DestDir: "{app}\html\img\icons"; Flags: ignoreversion;
Source: "..\build\html\img\icons\*.svg"; DestDir: "{app}\html\img\icons"; Flags: ignoreversion;
Source: "..\build\html\img\icons\*.png"; DestDir: "{app}\html\img\icons"; Flags: ignoreversion;
Source: "..\build\html\img\icons\25\*.png"; DestDir: "{app}\html\img\icons\25"; Flags: ignoreversion;
Source: "..\build\html\img\icons\36\*.png"; DestDir: "{app}\html\img\icons\36"; Flags: ignoreversion;
Source: "..\build\html\img\social\*.png"; DestDir: "{app}\html\img\social"; Flags: ignoreversion;
Source: "..\build\html\include\*.html"; DestDir: "{app}\html\include"; Flags: ignoreversion;
Source: "..\build\html\js\*.js"; DestDir: "{app}\html\js"; Flags: ignoreversion;
Source: "..\build\html\js\utils\*.js"; DestDir: "{app}\html\js\utils"; Flags: ignoreversion;
Source: "..\build\html\js\lib\*.js"; DestDir: "{app}\html\js\lib"; Flags: ignoreversion;
Source: "..\build\html\js\lib\slick\*.js"; DestDir: "{app}\html\js\lib\slick"; Flags: ignoreversion;
Source: "..\build\html\js\lib\slick\*.css"; DestDir: "{app}\html\js\lib\slick"; Flags: ignoreversion;
Source: "..\build\html\js\lib\slick\*.gif"; DestDir: "{app}\html\js\lib\slick"; Flags: ignoreversion;
Source: "..\build\html\js\lib\slick\fonts\*.eot"; DestDir: "{app}\html\js\lib\slick\fonts"; Flags: ignoreversion;
Source: "..\build\html\js\lib\slick\fonts\*.svg"; DestDir: "{app}\html\js\lib\slick\fonts"; Flags: ignoreversion;
Source: "..\build\html\js\lib\slick\fonts\*.ttf"; DestDir: "{app}\html\js\lib\slick\fonts"; Flags: ignoreversion;
Source: "..\build\html\js\lib\slick\fonts\*.woff"; DestDir: "{app}\html\js\lib\slick\fonts"; Flags: ignoreversion;
Source: "..\build\html\resources\*.html"; DestDir: "{app}\html\resources"; Flags: ignoreversion;
Source: "..\build\html\resources\pedals\*.css"; DestDir: "{app}\html\resources\pedals"; Flags: ignoreversion;
Source: "..\build\html\resources\pedals\*.png"; DestDir: "{app}\html\resources\pedals"; Flags: ignoreversion;
Source: "..\build\html\resources\templates\*.html"; DestDir: "{app}\html\resources\templates"; Flags: ignoreversion;
Source: "..\build\lib\*.dll"; DestDir: "{app}\lib"; Flags: ignoreversion;
Source: "..\build\lib\*.pyd"; DestDir: "{app}\lib"; Flags: ignoreversion;
Source: "..\build\lib\*.zip"; DestDir: "{app}\lib"; Flags: ignoreversion;
Source: "..\build\mod\*.py"; DestDir: "{app}\mod"; Flags: ignoreversion;
Source: "..\build\mod\communication\*.py"; DestDir: "{app}\mod\communication"; Flags: ignoreversion;
Source: "..\build\modtools\*.py"; DestDir: "{app}\modtools"; Flags: ignoreversion;
Source: "..\build\default.pedalboard\manifest.ttl"; DestDir: "{app}\default.pedalboard"; Flags: ignoreversion;
Source: "..\build\default.pedalboard\screenshot.png"; DestDir: "{app}\default.pedalboard"; Flags: ignoreversion;
Source: "..\build\default.pedalboard\thumbnail.png"; DestDir: "{app}\default.pedalboard"; Flags: ignoreversion;
Source: "..\build\html\*.html"
Source: "..\build\html\favicon.ico"
; plugins
#include "win64-plugins.iss"

[Icons]
Name: "{commonprograms}\MOD App"; Filename: "{app}\mod-app.exe"; IconFilename: "{app}\mod-logo.ico"; WorkingDir: "{app}"; Comment: "MOD Desktop App";
46 changes: 46 additions & 0 deletions utils/win64-installer.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/bin/bash

set -e

if [ ! -d build ]; then
echo "Please run this script from the root folder"
exit
fi

# setup innosetup
dlfile="${PWD}/utils/innosetup-6.0.5.exe"
innodir="${PWD}/build/innosetup-6.0.5"
iscc="${innodir}/drive_c/InnoSetup/ISCC.exe"

# download it
if [ ! -f "${dlfile}" ]; then
# FIXME proper dl version
curl -L https://jrsoftware.org/download.php/is.exe -o "${dlfile}"
fi

# initialize wine
if [ ! -d "${innodir}"/drive_c ]; then
env WINEPREFIX="${innodir}" wineboot -u
fi

# install innosetup in custom wineprefix
if [ ! -f "${innodir}"/drive_c/InnoSetup/ISCC.exe ]; then
env WINEPREFIX="${innodir}" wine "${dlfile}" /allusers /dir=C:\\InnoSetup /nocancel /norestart /verysilent
fi

# generate plugins
echo -n "" > utils/win64-plugins.iss
IFS='
'
for f in $(find -L build/plugins/ -type f); do
d=$(dirname $(echo ${f} | sed "s|build/plugins/||"))
echo "Source: \"..\\$(echo ${f} | tr '/' '\\')\"; DestDir: \"{app}\\plugins\\$(echo ${d} | tr '/' '\\')\"; Components: plugins; Flags: ignoreversion;" >> utils/win64-plugins.iss
done

# generate version
echo "#define VERSION \"0.0.0\"" > utils/win64-version.iss

# create the installer file
pushd "utils"
env WINEPREFIX="${innodir}" wine "${iscc}" "win64-installer.iss"
popd
Loading

0 comments on commit 3b63e9b

Please sign in to comment.