icon creator

This commit is contained in:
Andrei Yankovich 2018-06-30 16:18:16 +03:00
parent b0700ad6a9
commit db4219a4fa
4 changed files with 70 additions and 16 deletions

View File

@ -293,14 +293,15 @@ void OutputManager::createRunFile()
temp = "/packages/base/data";
}
QString content =
"#!/bin/sh\n"
"export LD_LIBRARY_PATH=`pwd`/lib\n"
"export QML_IMPORT_PATH=`pwd`/qml\n"
"export QML2_IMPORT_PATH=`pwd`/qml\n"
"export QT_PLUGIN_PATH=`pwd`/plugins\n"
"export QT_QPA_PLATFORM_PLUGIN_PATH=`pwd`/plugins/platforms\n"
"./bin/%1";
QString content =
"#!/bin/sh\n"
"BASEDIR=$(dirname $0)\n"
"export LD_LIBRARY_PATH=\"$BASEDIR/lib\"\n"
"export QML_IMPORT_PATH=\"$BASEDIR/qml\"\n"
"export QML2_IMPORT_PATH=\"$BASEDIR/qml\"\n"
"export QT_PLUGIN_PATH=\"$BASEDIR/plugins\"\n"
"export QT_QPA_PLATFORM_PLUGIN_PATH=\"$BASEDIR/plugins/platforms\"\n"
"$BASEDIR/bin/%1";
content = content.arg(QFileInfo(m_executablepath).completeBaseName());
@ -382,7 +383,11 @@ void OutputManager::createInstaller(){
Utils::getVersion() <<
QDate::currentDate().toString("yyyy-MM-dd") <<
"true" <<
"");
"<Script>componentScript.js</Script>");
createModule(":/install/InstallTemplate/componentScript.js",
m_outputdir + "/packages/base/meta/componentScript.js",
QStringList() << appIcon);
createModule(":/install/InstallTemplate/package.xml",

View File

@ -0,0 +1,54 @@
function Component()
{
// default constructor
}
Component.prototype.createOperations = function()
{
// call default implementation to actually install README.txt!
component.createOperations();
if (!component.isUninstalled()) {
console.log("remove icons!!!");
if (systemInfo.kernelType === "winnt") {
console.log("create icons!!! on Windows");
component.addOperation("Delete",
"@DesktopDir@/@Name@.lnk");
}
console.log("remove icons!!!");
if (systemInfo.kernelType === "linux") {
console.log("create icons!!! on LINUX");
component.addOperation("Delete",
"@HomeDir@/.local/share/applications/@Name@.desktop");
component.addOperation("Delete",
"@HomeDir@/Desktop/@Name@.desktop");
console.log("remove icons!!! on LINUX done");
}
} else {
console.log("create icons!!!");
if (systemInfo.kernelType === "winnt") {
console.log("create icons!!! on Windows");
component.addOperation("CreateShortcut",
"@TargetDir@/@Name@.exe",
"@DesktopDir@/@Name@.lnk");
}
console.log("create icons!!!");
if (systemInfo.kernelType === "linux") {
console.log("create icons!!! on LINUX");
component.addOperation("CreateDesktopEntry",
"@HomeDir@/.local/share/applications/@Name@.desktop",
"Version=@Version@\nType=Application\nTerminal=false\nExec=@TargetDir@/@Name@.sh\nName=@Name@\nIcon=@TargetDir@/%0\nName[en_US]=@Name@");
console.log("create icons!!! on LINUX done");
}
}
}

View File

@ -21,13 +21,7 @@ Controller.prototype.installationFinished = function()
installer.performOperation("CreateDesktopEntry",
"@HomeDir@/.local/share/applications/@Name@.desktop",
"Version=@Version@\n
Type=Application\n
Terminal=false\n
Exec=@TargetDir@/@Name@.sh\n
Name=@Name@\n
Icon=@TargetDir@/bin/%0\n
Name[en_US]=YourApp_name");
"Version=@Version@\nType=Application\nTerminal=false\nExec=@TargetDir@/@Name@.sh\nName=@Name@\nIcon=@TargetDir@/bin/%0\nName[en_US]=YourApp_name");
// installer.addElevatedOperation("Copy",
// "@HomeDir@/.local/share/applications/@Name@.desktop",

View File

@ -29,5 +29,6 @@
<file>InstallTemplate/README</file>
<file>InstallTemplate/CreateDesktopEntry.sh</file>
<file>res/iconInstaller.png</file>
<file>InstallTemplate/componentScript.js</file>
</qresource>
</RCC>