Skip to content

Commit a576cf1

Browse files
author
Jack Davis
committed
#4 qt installer defs + batch scripts for Windows installer builds
1 parent 6036e33 commit a576cf1

File tree

12 files changed

+218
-0
lines changed

12 files changed

+218
-0
lines changed

installer/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
packages/com.github.mstrthealias/data/*
2+
TFCtrlInstaller.exe

installer/config/config.xml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Installer>
3+
<Name>Teensy Fan Controller</Name>
4+
<Version>0.1.0.0</Version>
5+
<Title>Teensy Fan Controller</Title>
6+
<Publisher>mstrthealias</Publisher>
7+
<ProductUrl>https://github.com/mstrthealias/TeensyFanController</ProductUrl>
8+
<!-- Directory name is used in component.xml -->
9+
<StartMenuDir>Teensy Fan Controller</StartMenuDir>
10+
<TargetDir>@ApplicationsDirX64@/TeensyFanController</TargetDir>
11+
<Logo>installerlogo.png</Logo>
12+
<InstallerWindowIcon>installericon</InstallerWindowIcon>
13+
<InstallerApplicationIcon>installericon</InstallerApplicationIcon>
14+
<WizardStyle>Modern</WizardStyle>
15+
</Installer>

installer/config/installericon.ico

137 KB
Binary file not shown.

installer/config/installerlogo.png

13.9 KB
Loading
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
/****************************************************************************
2+
**
3+
** Copyright (C) 2017 The Qt Company Ltd.
4+
** Contact: https://www.qt.io/licensing/
5+
**
6+
** This file is part of the FOO module of the Qt Toolkit.
7+
**
8+
** $QT_BEGIN_LICENSE:GPL-EXCEPT$
9+
** Commercial License Usage
10+
** Licensees holding valid commercial Qt licenses may use this file in
11+
** accordance with the commercial license agreement provided with the
12+
** Software or, alternatively, in accordance with the terms contained in
13+
** a written agreement between you and The Qt Company. For licensing terms
14+
** and conditions see https://www.qt.io/terms-conditions. For further
15+
** information use the contact form at https://www.qt.io/contact-us.
16+
**
17+
** GNU General Public License Usage
18+
** Alternatively, this file may be used under the terms of the GNU
19+
** General Public License version 3 as published by the Free Software
20+
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
21+
** included in the packaging of this file. Please review the following
22+
** information to ensure the GNU General Public License requirements will
23+
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
24+
**
25+
** $QT_END_LICENSE$
26+
**
27+
****************************************************************************/
28+
29+
function Component()
30+
{
31+
installer.installationFinished.connect(this, Component.prototype.installationFinishedPageIsShown);
32+
installer.finishButtonClicked.connect(this, Component.prototype.installationFinished);
33+
}
34+
35+
Component.prototype.createOperations = function()
36+
{
37+
// call default implementation to actually install README.txt!
38+
component.createOperations();
39+
40+
if (systemInfo.productType === "windows") {
41+
component.addOperation("CreateShortcut", "@TargetDir@/tfctrl.exe", "@StartMenuDir@/Teensy Fan Controller.lnk",
42+
"workingDirectory=@TargetDir@", "iconId=2", "description=Launch Teensy Fan Controller configuration");
43+
44+
try {
45+
if(systemInfo.currentCpuArchitecture.search("64") < 0) {
46+
//x86
47+
console.log('UNSUPPORTED x86');
48+
} else {
49+
//x64
50+
component.addOperation("Execute", "@TargetDir@/vc_redist.x64.exe", "/install", "/passive", "/norestart");
51+
}
52+
} catch(e) {
53+
console.log(e);
54+
}
55+
}
56+
}
57+
58+
Component.prototype.installationFinishedPageIsShown = function()
59+
{
60+
try {
61+
if (installer.isInstaller() && installer.status == QInstaller.Success) {
62+
installer.addWizardPageItem( component, "LaunchCheckBoxForm", QInstaller.InstallationFinished );
63+
}
64+
} catch(e) {
65+
console.log(e);
66+
}
67+
}
68+
69+
Component.prototype.installationFinished = function()
70+
{
71+
try {
72+
if (installer.isInstaller() && installer.status == QInstaller.Success) {
73+
var isLaunchCheckBoxChecked = component.userInterface( "LaunchCheckBoxForm" ).launchCheckBox.checked;
74+
if (isLaunchCheckBoxChecked) {
75+
QDesktopServices.openUrl("file:///" + installer.value("TargetDir") + "/tfctrl.exe");
76+
}
77+
}
78+
} catch(e) {
79+
console.log(e);
80+
}
81+
}
82+
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<ui version="4.0">
3+
<class>LaunchCheckBoxForm</class>
4+
<widget class="QWidget" name="LaunchCheckBoxForm">
5+
<property name="geometry">
6+
<rect>
7+
<x>0</x>
8+
<y>0</y>
9+
<width>412</width>
10+
<height>179</height>
11+
</rect>
12+
</property>
13+
<layout class="QVBoxLayout" name="verticalLayout">
14+
<property name="margin">
15+
<number>0</number>
16+
</property>
17+
<item>
18+
<widget class="QCheckBox" name="launchCheckBox">
19+
<property name="text">
20+
<string>Launch Teensy Fan Controller</string>
21+
</property>
22+
<property name="checked">
23+
<bool>true</bool>
24+
</property>
25+
<property name="tristate">
26+
<bool>false</bool>
27+
</property>
28+
</widget>
29+
</item>
30+
</layout>
31+
</widget>
32+
<resources/>
33+
<connections/>
34+
</ui>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Package>
3+
<DisplayName>Teensy Fan Controller</DisplayName>
4+
<Description>tfctrl (Teensy Fan Controller)</Description>
5+
<Name>com.github.mstrthealias</Name>
6+
<Version>0.1.0.0</Version>
7+
<ReleaseDate>2020-03-08</ReleaseDate>
8+
<Default>true</Default>
9+
<ForcedInstallation>true</ForcedInstallation>
10+
<Script>installscript.qs</Script>
11+
<UserInterfaces>
12+
<UserInterface>launchcheckboxform.ui</UserInterface>
13+
</UserInterfaces>
14+
</Package>

installer/tfctrl-installer.pro

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
TEMPLATE = aux
2+
3+
INSTALLER = installer
4+
5+
INPUT = $$PWD/config/config.xml $$PWD/packages
6+
example.input = INPUT
7+
example.output = $$INSTALLER
8+
example.commands = ../../bin/binarycreator -c $$PWD/config/config.xml -p $$PWD/packages ${QMAKE_FILE_OUT}
9+
example.CONFIG += target_predeps no_link combine
10+
11+
QMAKE_EXTRA_COMPILERS += example
12+
13+
OTHER_FILES = README

scripts/build.bat

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
@ECHO OFF
2+
CALL scripts\env.bat
3+
4+
PATH=%PATH%;%QT_DIST_PATH%\%QT_BUILD%\bin
5+
6+
Echo Loading Visual Studio environment
7+
CALL %VC_VARS_PATH%
8+
9+
ECHO Building Teensy Fan Controller
10+
11+
nmake clean
12+
qmake -config release
13+
nmake
14+
15+
ECHO Auild at .\release\

scripts/deploy.bat

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
@ECHO OFF
2+
CALL scripts\env.bat
3+
4+
PATH=%PATH%;%QT_DIST_PATH%\%QT_BUILD%\bin
5+
6+
del /F /S /Q %INSTALL_DEST%\*
7+
del /F /S /Q %INSTALL_DEST%\*.*
8+
9+
mkdir %INSTALL_DEST%
10+
copy release\tfctrl.exe %INSTALL_DEST%\
11+
copy release\tfctrl_resource.rc %INSTALL_DEST%\
12+
13+
ECHO Creating application deployment
14+
windeployqt --compiler-runtime --qmldir . --release .\%INSTALL_DEST%\
15+
16+
17+
ECHO Application deployed to %INSTALL_DEST%

0 commit comments

Comments
 (0)