QtDeployer/source/InstallTemplate/controlScript.js

43 lines
1.3 KiB
JavaScript
Raw Normal View History

2018-06-26 10:07:46 +03:00
function Controller()
{
installer.uninstallationFinished.connect(this, Controller.prototype.uninstallationFinished);
installer.installationFinished.connect(this, Controller.prototype.installationFinished);
2018-06-11 15:23:52 +03:00
}
2018-06-26 10:07:46 +03:00
Controller.prototype.installationFinished = function()
{
2018-06-24 19:30:56 +03:00
2018-06-26 10:07:46 +03:00
if (systemInfo.kernelType === "winnt") {
component.addOperation("CreateShortcut",
"@TargetDir@/@Name@.exe",
"@DesktopDir@/@Name@.lnk");
2018-06-24 19:30:56 +03:00
}
2018-06-30 14:38:16 +03:00
console.log("create icons!!!");
2018-06-26 10:07:46 +03:00
if (systemInfo.kernelType === "linux") {
2018-06-30 14:38:16 +03:00
console.log("create icons!!! on LINUX");
installer.performOperation("CreateDesktopEntry",
2018-06-26 10:07:46 +03:00
"@HomeDir@/.local/share/applications/@Name@.desktop",
2018-06-30 16:18:16 +03:00
"Version=@Version@\nType=Application\nTerminal=false\nExec=@TargetDir@/@Name@.sh\nName=@Name@\nIcon=@TargetDir@/bin/%0\nName[en_US]=YourApp_name");
2018-06-26 10:07:46 +03:00
2018-06-30 14:38:16 +03:00
// installer.addElevatedOperation("Copy",
// "@HomeDir@/.local/share/applications/@Name@.desktop",
// "@HomeDir@/Desktop/@Name@.desktop");
console.log("create icons!!! on LINUX done");
2018-06-24 19:30:56 +03:00
}
2018-06-26 10:07:46 +03:00
}
2018-06-24 19:30:56 +03:00
2018-06-26 10:07:46 +03:00
Controller.prototype.uninstallationFinished = function()
{
}
2018-06-24 19:30:56 +03:00