Skip to content

Commit 004b1a7

Browse files
committed
Making another change
1 parent 4baf21a commit 004b1a7

File tree

1 file changed

+34
-14
lines changed

1 file changed

+34
-14
lines changed
Lines changed: 34 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,38 @@
1-
function Controller() {}
1+
function Component()
2+
{
3+
component.forceInstallation = true;
4+
}
25

3-
Controller.prototype.TargetDirectoryPageCallback = function() {
4-
var page = gui.pageWidgetByObjectName("TargetDirectoryPage");
6+
Component.prototype.createOperations = function()
7+
{
8+
// Remove QtIFW internal installation marker
9+
var installInfoPath = installer.value("TargetDir") + "/InstallationInformation";
10+
var componentsXmlPath = installer.value("TargetDir") + "/components.xml";
511

6-
// Override the default validation function
7-
page.targetDirectoryLineEdit().textChanged.connect(function(dir) {
8-
// Always allow the user to continue
9-
page.completeChanged();
10-
});
12+
if (QFile.exists(installInfoPath)) {
13+
installer.performOperation("Delete", installInfoPath);
14+
}
15+
if (QFile.exists(componentsXmlPath)) {
16+
installer.performOperation("Delete", componentsXmlPath);
17+
}
1118

12-
page.isComplete = function() {
13-
var dir = page.targetDirectoryLineEdit().text;
19+
component.createOperations(); // must come after cleanup
1420

15-
// If the directory exists and has an existing installation, we still allow it
16-
return true;
17-
};
18-
};
21+
// Your existing logic...
22+
var exePath = installer.value("TargetDir") + "/{{ executable }}.exe";
23+
var shortcutPath = installer.value("StartMenuDir") + "/{{ executable }}.lnk";
24+
25+
if (installer.fileExists(shortcutPath)) {
26+
installer.performOperation("Delete", shortcutPath);
27+
}
28+
29+
if (systemInfo.productType === "windows") {
30+
component.addOperation("CreateShortcut",
31+
"@TargetDir@/{{ executable }}.exe",
32+
"@StartMenuDir@/{{ executable }}.lnk",
33+
"workingDirectory=@TargetDir@",
34+
"iconPath=@TargetDir@/{{ iconfilename }}",
35+
"description=Open {{ progname }}"
36+
);
37+
}
38+
}

0 commit comments

Comments
 (0)