Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows Installer #119

Merged
merged 10 commits into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/workflows/linux.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Build lumberjack application and plugins

name: Build

on:
push:
branches:
- master
release:
types:
- created

jobs:
linux:
runs-on: ubuntu-latest

steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
version: '6.8.1'
cache: true
- name: Build Qwt
run: |
cd qwt
qmake qwt.pro
make
sudo make install
- name: Build Lumberjack
run: |
qmake lumberjack.pro
make
- name: Build Plugins
run: |
cd plugins
qmake plugins.pro
make
50 changes: 0 additions & 50 deletions .github/workflows/linux.yaml.todo

This file was deleted.

44 changes: 9 additions & 35 deletions .github/workflows/build.yaml → .github/workflows/windows.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Build lumberjack application and plugins
# Compile windows installer

name: Build
name: Windows Installer

on:
push:
Expand All @@ -9,38 +9,8 @@ on:
release:
types:
- created

jobs:
linux:
runs-on: ubuntu-latest

steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
version: '6.8.1'
cache: true
- name: Build Qwt
run: |
cd qwt
qmake qwt.pro
make
sudo make install
- name: Build Lumberjack
run: |
qmake lumberjack.pro
make
- name: Build Plugins
run: |
cd plugins
qmake plugins.pro
make

windows:
installer:
runs-on: windows-latest

steps:
Expand All @@ -67,10 +37,14 @@ jobs:
mingw32-make install
- name: Build Lumberjack
run: |
qmake lumberjack.pro
qmake lumberjack.pro CONFIG+=release
mingw32-make
- name: Build Plugins
run: |
cd plugins
qmake plugins.pro
qmake plugins.pro CONFIG+=release
mingw32-make
- name: Build Installer
uses: Minionguyjpro/Inno-Setup-Action@v1.2.2
with:
path: lumberjack.iss
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ ui_tmp
build/
debug/
release/
unit_test/debug
unit_test/release
install/
Output/

# Custom plugins directory - ignore
custom/
Expand Down
147 changes: 147 additions & 0 deletions lumberjack.iss
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyBaseAppId "{BA395D89-E5A9-441A-8869-E9151B8EACE6}"

#define MyAppName "Lumberjack"
#define MyAppPublisher "Lumberjack"
#define MyAppURL "https://github.com/SchrodingersGat/lumberjack/"
#define MyAppExeName "Lumberjack.exe"
#define MyAppVersion ReadIni("resource/version.ini", "General", "version", "0.0.0");

#define BuildDir "build/release"

[Setup]
; 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.)
AppId={code:GetAppId}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={autopf}\{#MyAppName}
DisableProgramGroupPage=yes
LicenseFile=README.md

; Remove the following line to run in administrative install mode (install for all users.)
PrivilegesRequired=lowest
PrivilegesRequiredOverridesAllowed=dialog
UsePreviousPrivileges=no
UsePreviousLanguage=no
OutputBaseFilename=lumberjack_{#MyAppVersion}
SetupIconFile=logo\lumberjack.ico
Compression=lzma
SolidCompression=yes
WizardStyle=modern
ArchitecturesInstallIn64BitMode=x64
ArchitecturesAllowed=x64

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"

[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked

[Files]
; Application executable
Source: "{#BuildDir}\lumberjack.exe"; DestDir: "{app}"; Flags: ignoreversion

; DLL files
Source: "{#BuildDir}\*.dll"; DestDir: "{app}"; Flags: ignoreversion

; Plugins
Source: "plugins\build\release\*.dll"; DestDir: "{app}\plugins"; Flags: ignoreversion

; Qt directories
Source: "{#BuildDir}\generic\*"; DestDir: "{app}\generic"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "{#BuildDir}\iconengines\*"; DestDir: "{app}\iconengines"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "{#BuildDir}\imageformats\*"; DestDir: "{app}\imageformats"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "{#BuildDir}\networkinformation\*"; DestDir: "{app}\networkinformation"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "{#BuildDir}\platforms\*"; DestDir: "{app}\platforms"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "{#BuildDir}\styles\*"; DestDir: "{app}\styles"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "{#BuildDir}\tls\*"; DestDir: "{app}\tls"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "{#BuildDir}\translations\*"; DestDir: "{app}\translations"; Flags: ignoreversion recursesubdirs createallsubdirs

[Icons]
Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon

[Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent

[Code]
// The following code is to optionally allow multiple versions to be
// installed on the one computer. If a previous installation is
// detected, a dialogue box asks the user whether they want to overwrite the
// existing installation, or install a new one.
var
AppId: string;
DefaultDirName: string;

// Getter for AppId
function GetAppId(Param: string): string;
begin
Result := AppId;
Log('AppId = ' + Result);
end;

// Getter for DefaultDirName
function GetDefaultDirName(Param: string): string;
begin
Result := DefaultDirName;
Log('DefaultDirName = ' + Result);
end;

// Impletement the event function InitializeSetup. This is called by Inno
// Setup "during Setup's initialisation".
function InitializeSetup(): Boolean;
var
PrevVersion: string;
CurVersion: string;
Message: string;
R: Integer;

begin
CurVersion := '{#MyAppVersion}';
Log(Format('Installing "%s"', [CurVersion]));

// Returning True means that installation will proceed
Result := True;

AppId := '{#MyBaseAppId}';
DefaultDirName := ExpandConstant('{autopf}\Lumberjack\{#MyAppName}');

// Look in the registry to see if program is already installed
if RegQueryStringValue(HKLM, 'Software\Microsoft\Windows\CurrentVersion\Uninstall\{#MyBaseAppId}_is1', 'DisplayVersion', PrevVersion) or
RegQueryStringValue(HKCU, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{#MyBaseAppId}_is1', 'DisplayVersion', PrevVersion) or
RegQueryStringValue(HKLM, 'Software\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{#MyBaseAppId}_is1', 'DisplayVersion', PrevVersion) or
RegQueryStringValue(HKCU, 'SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{#MyBaseAppId}_is1', 'DisplayVersion', PrevVersion) then
begin
Message :=
Format(
'Version is %s already installed. Do you want to upgrade to %s?'#13#10#13#10+
'Press Yes, to replace %0:s with %1:s.'#13#10+
'Press No, to keep %0:s and add separate installation of %1:s.'#13#10, [
PrevVersion, CurVersion]);
R := MsgBox(Message, mbConfirmation, MB_YESNOCANCEL);
if R = IDYES then
begin
Log('User chose to replace previous installation');
end
else if R = IDNO then
begin
AppId := AppId + CurVersion;
DefaultDirName := DefaultDirName + ' ' + CurVersion;
Log('User chose to install new copy - using ID ' + AppId);
end
else
begin
Log('User chose to cancel installation');

// Returning False will cancel the installation
Result := False;
end;
end;
end;
5 changes: 3 additions & 2 deletions lumberjack.pro
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ SOURCES += \
src/data_source.cpp \
src/lumberjack_debug.cpp \
src/lumberjack_settings.cpp \
src/lumberjack_version.cpp \
src/plot_curve.cpp \
src/plot_legend.cpp \
src/plot_widget.cpp \
Expand Down Expand Up @@ -169,12 +170,12 @@ COPIES += dllFiles
CONFIG(debug, debug | release) {
win32 {
# Copy required .DLL files
QMAKE_POST_LINK += $$[QT_INSTALL_BINS]\windeployqt --debug --compiler-runtime $$shell_path($$quote($$DESTDIR))\lumberjack.exe $$escape_expand(\n\t)
QMAKE_POST_LINK += $$[QT_INSTALL_BINS]\windeployqt --debug --opengl --openglwidgets --widgets --compiler-runtime $$shell_path($$quote($$DESTDIR))\lumberjack.exe $$escape_expand(\n\t)
}
} else {
win32 {
# Copy required .DLL files
QMAKE_POST_LINK += $$[QT_INSTALL_BINS]\windeployqt --release --compiler-runtime $$shell_path($$quote($$DESTDIR))\lumberjack.exe $$escape_expand(\n\t)
QMAKE_POST_LINK += $$[QT_INSTALL_BINS]\windeployqt --release --opengl --openglwidgets --widgets --compiler-runtime $$shell_path($$quote($$DESTDIR))\lumberjack.exe $$escape_expand(\n\t)
}
}

Expand Down
2 changes: 1 addition & 1 deletion plugins/csv_exporter/csv_exporter.pro
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ CONFIG(debug, debug|release) {

} else {
CONFIG += release
DESTDIR = build/release
DESTDIR = ../build/release
}

RCC_DIR = $$DESDIR
Expand Down
2 changes: 1 addition & 1 deletion plugins/csv_importer/csv_importer.pro
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ CONFIG(debug, debug|release) {

} else {
CONFIG += release
DESTDIR = build/release
DESTDIR = ../build/release
}

RCC_DIR = $$DESDIR
Expand Down
2 changes: 1 addition & 1 deletion plugins/offset_filter/offset_filter.pro
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ CONFIG(debug, debug|release) {

} else {
CONFIG += release
DESTDIR = build/release
DESTDIR = ../build/release
}

RCC_DIR = $$DESDIR
Expand Down
2 changes: 1 addition & 1 deletion plugins/scaler_filter/scaler_filter.pro
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ CONFIG(debug, debug|release) {

} else {
CONFIG += release
DESTDIR = build/release
DESTDIR = ../build/release
}

RCC_DIR = $$DESDIR
Expand Down
2 changes: 2 additions & 0 deletions resource/version.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[General]
version="0.16.0"
1 change: 1 addition & 0 deletions resources.qrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<RCC>
<qresource prefix="/">
<file>logo/lumberjack.svg</file>
<file>resource/version.ini</file>
</qresource>
</RCC>
Loading