Skip to content

Commit 0ce48c5

Browse files
committed
Further tuning installer
1 parent 793ef1e commit 0ce48c5

File tree

4 files changed

+23
-12
lines changed

4 files changed

+23
-12
lines changed

gui/packaging/config/config.xml.template

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,9 @@
99
<!-- Fixed install location (no version folder) -->
1010
<TargetDir>@ApplicationsDir@/{{ publisher }}/{{ progfolder }}</TargetDir>
1111

12-
<!-- Launch main executable after install -->
13-
<RunProgram>{{ executable }}.exe</RunProgram>
14-
<RunProgramDescription>{{ progdescription }}</RunProgramDescription>
15-
1612
<!-- Installer window icon -->
1713
<InstallerApplicationIcon>{{ iconfilename }}</InstallerApplicationIcon>
14+
15+
<!-- Optional: Add control script for custom UI like launch checkbox -->
16+
<ControlScript>installscript.qs</ControlScript>
1817
</Installer>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
var checkbox;
2+
3+
function Controller() {}
4+
5+
Controller.prototype.FinishedPageCallback = function() {
6+
var page = gui.pageWidgetByObjectName("FinishedPage");
7+
8+
checkbox = new QCheckBox();
9+
checkbox.text = "Launch {{ progname }}";
10+
checkbox.checked = true;
11+
page.layout().addWidget(checkbox);
12+
};
13+
14+
Controller.prototype.FinishedClickedCallback = function() {
15+
if (checkbox && checkbox.checked) {
16+
var exePath = installer.value("TargetDir") + "/{{ executable }}.exe";
17+
QProcess.startDetached(exePath);
18+
}
19+
};

gui/packaging/package.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ def render(templates, filenames, variables):
3434

3535
def read_templates():
3636
templates = [
37+
os.path.join(ROOT, 'installscript.qs'),
3738
os.path.join(ROOT, 'config', 'config.xml'),
3839
os.path.join(ROOT, 'packages', 'com.vendor.product', 'meta', 'installscript.qs'),
3940
os.path.join(ROOT, 'packages', 'com.vendor.product', 'meta', 'package.xml'),

gui/packaging/packages/com.vendor.product/meta/installscript.qs.template

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,4 @@ Component.prototype.createOperations = function()
2525
"description=Open {{ progname }}"
2626
);
2727
}
28-
29-
// Optional: launch the application after install
30-
component.addOperation("Execute",
31-
"@TargetDir@/{{ executable }}.exe",
32-
"",
33-
"UNDOEXECUTE",
34-
"@TargetDir@/{{ executable }}.exe"
35-
);
3628
}

0 commit comments

Comments
 (0)