diff --git a/Installers/Linux/OSCAR.desktop b/Installers/Linux/OSCAR.desktop new file mode 100755 index 00000000..31d08ce8 --- /dev/null +++ b/Installers/Linux/OSCAR.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Version=1.1 +Name=OSCAR +GenericName=CPAP Reporter +TryExec=OSCAR +Exec=OSCAR +Terminal=false +Icon=/opt/OSCAR/OSCAR.png +Type=Application +Categories=Education,Science,MedicalSoftware + diff --git a/Installers/Linux/OSCAR.png b/Installers/Linux/OSCAR.png new file mode 100644 index 00000000..b992e0eb Binary files /dev/null and b/Installers/Linux/OSCAR.png differ diff --git a/Installers/Linux/ln_usrlocalbin.sh b/Installers/Linux/ln_usrlocalbin.sh new file mode 100755 index 00000000..08043b01 --- /dev/null +++ b/Installers/Linux/ln_usrlocalbin.sh @@ -0,0 +1,8 @@ +#! /bin/bash +# +mv /opt/tempDir /opt/OSCAR +ln -s /opt/OSCAR/OSCAR /usr/bin/OSCAR +cp /opt/OSCAR/OSCAR.desktop /home/$SUDO_USER/Desktop +chown $SUDO_USER:$SUDO_USER /home/$SUDO_USER/Desktop/OSCAR.desktop +chmod a+x /home/$SUDO_USER/Desktop/OSCAR.desktop +# diff --git a/Installers/Linux/mkDebian9.sh b/Installers/Linux/mkDebian9.sh new file mode 100755 index 00000000..364383e9 --- /dev/null +++ b/Installers/Linux/mkDebian9.sh @@ -0,0 +1,37 @@ +#! /bin/bash +# First parameter is version number - (ex: 1.0.0) +# Second parametr is build or release status - (ex: beta or release) +# +rm -r tempDir +mkdir tempDir +cp build/oscar/OSCAR tempDir +cp -r build/oscar/Help tempDir +cp -r build/oscar/Html tempDir +cp -r build/oscar/Translations tempDir +cp OSCAR.png tempDir +cp OSCAR.desktop tempDir +#cp OSCAR-code/migration.sh tempDir +# +fpm --input-type dir --output-type deb \ + --prefix /opt \ + --after-install ln_usrlocalbin.sh \ + --before-remove rm_usrlocalbin.sh \ + --name oscar --version $1 --iteration $2 \ + --category Other \ + --maintainer oscar@nightowlsoftwre.ca \ + --license GPL-v3 \ + --vendor nightowlsoftware.ca \ + --description "Open Sourece CPAP Analysis Reporter" \ + --url https://sleepfiles.com/OSCAR \ + --depends 'libqt5core5a > 5.7.0' \ + --depends libqt5serialport5 \ + --depends libqt5xml5 \ + --depends libqt5network5 \ + --depends libqt5gui5 \ + --depends libqt5widgets5 \ + --depends libqt5opengl5 \ + --depends libqt5printsupport5 \ + --depends libglu1-mesa \ + --depends libgl1 \ + --deb-no-default-config-files \ + tempDir diff --git a/Installers/Linux/rm_usrlocalbin.sh b/Installers/Linux/rm_usrlocalbin.sh new file mode 100755 index 00000000..c2a149e5 --- /dev/null +++ b/Installers/Linux/rm_usrlocalbin.sh @@ -0,0 +1,6 @@ +#! /bin/bash +# +mv /opt/OSCAR /opt/tempDir +rm /usr/bin/OSCAR +rm /home/$SUDO_USER/Desktop/OSCAR.desktop +# diff --git a/Installers/Windows/BuildInstall.iss b/Installers/Windows/BuildInstall.iss new file mode 100644 index 00000000..525c0a7d --- /dev/null +++ b/Installers/Windows/BuildInstall.iss @@ -0,0 +1,93 @@ +; Script originally generated by the Inno Script Studio Wizard, then manually modified. +; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! +; +; See DEPLOY.BAT for documentation on how this is used to build OSCAR installer + +#include "buildinfo.iss" + +#define MyAppVersion MyMajorVersion+"."+MyMinorVersion+"."+MyRevision+"-"+MyReleaseStatus+"-"+MyBuildNumber + +#define MyAppName "OSCAR" +#define MyAppPublisher "The OSCAR Team" +#define MyAppExeName "OSCAR.exe" + +[Setup] +SetupLogging=yes +; NOTE: The value of AppId uniquely identifies this application. +; Do not use the same AppId value in installers for other applications. +; (To generate a new GUID, click Tools | Generate GUID inside the IDE.) +; Now using separate AppID for Win32 and Win64 -- GTS 4/6/2019 +#if MyPlatform == "Win64" + ArchitecturesAllowed=x64 + ArchitecturesInstallIn64BitMode=x64 + AppId={{FC6F08E6-69BF-4469-ADE3-78199288D305} +; DefaultDirName={%PROGRAMFILES|{pf}}\OSCAR +; above doesn't work. Always returns x86 directory +#else // 32-bit + AppId={{4F3EB81B-1866-4124-B388-5FB5DA34FFDD} +; DefaultDirName={%PROGRAMFILES(X86)|{pf}}\OSCAR +#endif +AppName={#MyAppName} +AppVersion={#MyAppVersion}-{#MyPlatform}-{#MyGitRevision}{#MySuffix} +AppVerName={#MyAppName} {#MyAppVersion}-{#MyPlatform}-{#MyGitRevision}{#MySuffix} +AppPublisher={#MyAppPublisher} +AppCopyright=Copyright 2019 {#MyAppPublisher} +; **** AppCopyright=Copyright {GetDateTimeString('yyyy', #0, #0)} {%MyAppPublisher} +DefaultDirName={pf}\OSCAR +DefaultGroupName={#MyAppName} +OutputDir=.\Installer +OutputBaseFilename={#MyAppName}-{#MyAppVersion}-{#MyPlatform}-{#MyGitRevision}{#MySuffix} +SetupIconFile=setup.ico +Compression=lzma +SolidCompression=yes +VersionInfoCompany={#MyAppPublisher} +VersionInfoProductName={#MyAppName} +UninstallDisplayName={#MyAppName} +UninstallDisplayIcon={app}\{#MyAppExeName} + +[Languages] +Name: "english"; MessagesFile: "compiler:Default.isl" +Name: "brazilianportuguese"; MessagesFile: "compiler:Languages\BrazilianPortuguese.isl" +Name: "catalan"; MessagesFile: "compiler:Languages\Catalan.isl" +Name: "corsican"; MessagesFile: "compiler:Languages\Corsican.isl" +Name: "czech"; MessagesFile: "compiler:Languages\Czech.isl" +Name: "danish"; MessagesFile: "compiler:Languages\Danish.isl" +Name: "dutch"; MessagesFile: "compiler:Languages\Dutch.isl" +Name: "finnish"; MessagesFile: "compiler:Languages\Finnish.isl" +Name: "french"; MessagesFile: "compiler:Languages\French.isl" +Name: "german"; MessagesFile: "compiler:Languages\German.isl" +Name: "greek"; MessagesFile: "compiler:Languages\Greek.isl" +Name: "hebrew"; MessagesFile: "compiler:Languages\Hebrew.isl" +Name: "hungarian"; MessagesFile: "compiler:Languages\Hungarian.isl" +;Name: "icelandic"; MessagesFile: "compiler:Languages\Icelandic.isl" +Name: "italian"; MessagesFile: "compiler:Languages\Italian.isl" +Name: "japanese"; MessagesFile: "compiler:Languages\Japanese.isl" +Name: "norwegian"; MessagesFile: "compiler:Languages\Norwegian.isl" +Name: "polish"; MessagesFile: "compiler:Languages\Polish.isl" +Name: "portuguese"; MessagesFile: "compiler:Languages\Portuguese.isl" +Name: "russian"; MessagesFile: "compiler:Languages\Russian.isl" +Name: "scottishgaelic"; MessagesFile: "compiler:Languages\ScottishGaelic.isl" +Name: "serbiancyrillic"; MessagesFile: "compiler:Languages\SerbianCyrillic.isl" +Name: "serbianlatin"; MessagesFile: "compiler:Languages\SerbianLatin.isl" +Name: "slovenian"; MessagesFile: "compiler:Languages\Slovenian.isl" +Name: "spanish"; MessagesFile: "compiler:Languages\Spanish.isl" +Name: "turkish"; MessagesFile: "compiler:Languages\Turkish.isl" +Name: "ukrainian"; MessagesFile: "compiler:Languages\Ukrainian.isl" + +[Tasks] +Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}" +Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked; OnlyBelowVersion: 0,6.1 + +[Files] +Source: ".\Release\OSCAR.exe"; DestDir: "{app}"; Flags: ignoreversion +Source: ".\Release\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs +; NOTE: Don't use "Flags: ignoreversion" on any shared system files + +[Icons] +Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}" +Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}" +Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon +; Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: quicklaunchicon + +[Run] +Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent diff --git a/Installers/Windows/Docs/Windows Development and Installer Creation.docx b/Installers/Windows/Docs/Windows Development and Installer Creation.docx new file mode 100644 index 00000000..748fcea9 Binary files /dev/null and b/Installers/Windows/Docs/Windows Development and Installer Creation.docx differ diff --git a/Installers/Windows/Setup.ico b/Installers/Windows/Setup.ico new file mode 100644 index 00000000..228e50b8 Binary files /dev/null and b/Installers/Windows/Setup.ico differ diff --git a/Installers/Windows/deploy.bat b/Installers/Windows/deploy.bat new file mode 100644 index 00000000..cc7f94fc --- /dev/null +++ b/Installers/Windows/deploy.bat @@ -0,0 +1,97 @@ +::: +::: Build Release and Installer subdirectories of the current shadow build directory. +::: The Release directory contains everything needed to run OSCAR. +::: The Installer directory contains a single executable -- the OSCAR installer. +::: +::: DEPLOY.BAT should be run as the last step of a QT Build Release kit. +::: QT Shadow build should be specified (this is the QT default). +::: A command line parameter is optional. Any text on the command line will be appended +::: to the file name of the installer. +::: +::: Requirements: +::: Inno Setup - http://www.jrsoftware.org/isinfo.php, installed to default Program Files (x86) location +::: gawk - somewhere in the PATH or in Git for Windows installed in its default lolcation +::: +::: Deploy.bat resides in .../OSCAR-code/Installers/Windows, along with +::: buildinstall.iss -- script for Inno Setup to create installer +::: getBuildInfo.awk -- gawk script for extracting version fields from various files +::: setup.ico -- Icon to be used for the installer. +::: +::: When building a release version in QT, QT will start this batch file which will prepare +::: additional files, run WinDeployQt, and create an installer. +::: +@echo off +setlocal + +::: toolDir is where the Windows install/deploy tools are located +set toolDir=%~dp0 +:::echo tooldir is %toolDir% + +::: Set shadowBuildDir and sourceDir for oscar_qt.pro vs oscar\oscar.pro projects +if exist ..\oscar-code\oscar\oscar.pro ( + ::: oscar_QT.pro + set sourceDir=..\oscar-code\oscar + set shadowBuildDir=%cd%\oscar +) else ( + ::: oscar\oscar.pro + set sourceDir=..\oscar + set shadowBuildDir=%cd% +) +echo sourceDir is %sourceDir% +echo shadowBuildDir is %shadowBuildDir% + +::: Now copy the base installation control file + +copy %toolDir%buildInstall.iss %shadowBuildDir% || exit 45 +copy %toolDir%setup.ico %shadowBuildDir% || exit 46 + +::: +::: If gawk.exe is in the PATH, use it. If not, add Git mingw tools (awk) to path. They cannot +::: be added to global path as they break CMD.exe (find etc.) +where /q gawk.exe || set PATH=%PATH%;%ProgramW6432%\Git\usr\bin + +::: Create and copy installer control files +::: Create file with all version numbers etc. ready for use by buildinstall.iss +::: Extract the version info from various header files using gawk and +::: #define fields for each data item in buildinfo.iss which will be +::: used by the installer script. +where /q gawk.exe || set PATH=%PATH%;%ProgramW6432%\Git\usr\bin +echo ; This script auto-generated by DEPLOY.BAT >%shadowBuildDir%\buildinfo.iss +gawk -f %toolDir%getBuildInfo.awk %sourcedir%\version.h >>%shadowBuildDir%\buildInfo.iss || exit 60 +gawk -f %toolDir%getBuildInfo.awk %sourcedir%\build_number.h >>%shadowBuildDir%\buildInfo.iss || exit 61 +gawk -f %toolDir%getBuildInfo.awk %sourcedir%\git_info.h >>%shadowBuildDir%\buildInfo.iss || exit 62 +echo %shadowBuildDir% | gawk -f %toolDir%getBuildInfo.awk >>%shadowBuildDir%\buildInfo.iss || exit 63 +echo #define MySuffix "%1" >>%shadowBuildDir%\buildinfo.iss || exit 64 +:::echo #define MySourceDir "%sourcedir%" >>%shadowBuildDir%\buildinfo.iss + +::: Create Release directory and subdirectories +if exist %shadowBuildDir%\Release\*.* rmdir /s /q %shadowBuildDir%\Release +mkdir %shadowBuildDir%\Release +cd %shadowBuildDir%\Release +copy %shadowBuildDir%\oscar.exe . || exit 71 + +::: Now in Release subdirectory +::: If QT created a help directory, copy it. But it might not have if "helpless" option was set +if exist Help\*.* rmdir /s /q Help +mkdir Help +if exist ..\help\*.qch copy ..\help Help + +if exist Html\*.* rmdir /s /q Html +mkdir Html +copy ..\html html || exit 80 + +if exist Translations\*.* rmdir /s /q Translations +mkdir Translations +copy ..\translations Translations || exit 84 + +::: Run deployment tool +windeployqt.exe --release --force --compiler-runtime OSCAR.exe || exit 87 + +::: Clean up unwanted translation files +:::For unknown reasons, Win64 build copies the .ts files into the release directory, while Win32 does not +if exist Translations\*.ts del /q Translations\*.ts + +::: Create installer +cd .. +:::"%ProgramFiles(x86)%\Inno Setup 5\compil32" /cc BuildInstall.iss +"%ProgramFiles(x86)%\Inno Setup 5\iscc" /Q BuildInstall.iss \ No newline at end of file diff --git a/Installers/Windows/getBuildInfo.awk b/Installers/Windows/getBuildInfo.awk new file mode 100644 index 00000000..7ede1ffb --- /dev/null +++ b/Installers/Windows/getBuildInfo.awk @@ -0,0 +1,21 @@ +# +# awk script to extract build identification from build_number.h, git_info.h, and version.h +# for use by Inno Setup in building installation file for OSCAR. See DEPLOY.BAT for information. +# +# Usage: gawk -f getBuildInfo.awk build_number.h >buildInfo.iss +# gawk -f getBuildInfo.awk git_info.h >>buildInfo.iss +# gawk -f getBuildInfo.awk version.h >>buildInfo.iss +# echo %cd% | gawk -f %sourcedir%getBuildInfo.awk >>buildInfo.iss + +/ build_number / { print "#define MyBuildNumber \"" substr($5,1,length($5)-1) "\""} + +/const QString GIT_BRANCH/ { print "#define MyGitBranch \"" substr($3,13,length($3)-14) "\"" } +/const QString GIT_REVISION/ { print "#define MyGitRevision \"" substr($3,15,length($3)-16) "\"" } + +/const int major_version / { print "#define MyMajorVersion \"" substr($5,1,length($5)-1) "\""} +/const int minor_version / { print "#define MyMinorVersion \"" substr($5,1,length($5)-1) "\""} +/const int revision_number / { print "#define MyRevision \"" substr($5,1,length($5)-1) "\""} +/const QString ReleaseStatus/ { print "#define MyReleaseStatus " substr($5,1,length($5)-1) } + +/32.*bit/ { print "#define MyPlatform \"Win32\"" } +/64.*bit/ { print "#define MyPlatform \"Win64\"" }