mirror of
https://github.com/QuasarApp/QtDeployer.git
synced 2025-04-30 15:34:42 +00:00
icon creator
This commit is contained in:
parent
b0700ad6a9
commit
db4219a4fa
source
@ -293,14 +293,15 @@ void OutputManager::createRunFile()
|
|||||||
temp = "/packages/base/data";
|
temp = "/packages/base/data";
|
||||||
}
|
}
|
||||||
|
|
||||||
QString content =
|
QString content =
|
||||||
"#!/bin/sh\n"
|
"#!/bin/sh\n"
|
||||||
"export LD_LIBRARY_PATH=`pwd`/lib\n"
|
"BASEDIR=$(dirname $0)\n"
|
||||||
"export QML_IMPORT_PATH=`pwd`/qml\n"
|
"export LD_LIBRARY_PATH=\"$BASEDIR/lib\"\n"
|
||||||
"export QML2_IMPORT_PATH=`pwd`/qml\n"
|
"export QML_IMPORT_PATH=\"$BASEDIR/qml\"\n"
|
||||||
"export QT_PLUGIN_PATH=`pwd`/plugins\n"
|
"export QML2_IMPORT_PATH=\"$BASEDIR/qml\"\n"
|
||||||
"export QT_QPA_PLATFORM_PLUGIN_PATH=`pwd`/plugins/platforms\n"
|
"export QT_PLUGIN_PATH=\"$BASEDIR/plugins\"\n"
|
||||||
"./bin/%1";
|
"export QT_QPA_PLATFORM_PLUGIN_PATH=\"$BASEDIR/plugins/platforms\"\n"
|
||||||
|
"$BASEDIR/bin/%1";
|
||||||
|
|
||||||
content = content.arg(QFileInfo(m_executablepath).completeBaseName());
|
content = content.arg(QFileInfo(m_executablepath).completeBaseName());
|
||||||
|
|
||||||
@ -382,7 +383,11 @@ void OutputManager::createInstaller(){
|
|||||||
Utils::getVersion() <<
|
Utils::getVersion() <<
|
||||||
QDate::currentDate().toString("yyyy-MM-dd") <<
|
QDate::currentDate().toString("yyyy-MM-dd") <<
|
||||||
"true" <<
|
"true" <<
|
||||||
"");
|
"<Script>componentScript.js</Script>");
|
||||||
|
|
||||||
|
createModule(":/install/InstallTemplate/componentScript.js",
|
||||||
|
m_outputdir + "/packages/base/meta/componentScript.js",
|
||||||
|
QStringList() << appIcon);
|
||||||
|
|
||||||
|
|
||||||
createModule(":/install/InstallTemplate/package.xml",
|
createModule(":/install/InstallTemplate/package.xml",
|
||||||
|
54
source/InstallTemplate/componentScript.js
Normal file
54
source/InstallTemplate/componentScript.js
Normal 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");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -21,13 +21,7 @@ Controller.prototype.installationFinished = function()
|
|||||||
|
|
||||||
installer.performOperation("CreateDesktopEntry",
|
installer.performOperation("CreateDesktopEntry",
|
||||||
"@HomeDir@/.local/share/applications/@Name@.desktop",
|
"@HomeDir@/.local/share/applications/@Name@.desktop",
|
||||||
"Version=@Version@\n
|
"Version=@Version@\nType=Application\nTerminal=false\nExec=@TargetDir@/@Name@.sh\nName=@Name@\nIcon=@TargetDir@/bin/%0\nName[en_US]=YourApp_name");
|
||||||
Type=Application\n
|
|
||||||
Terminal=false\n
|
|
||||||
Exec=@TargetDir@/@Name@.sh\n
|
|
||||||
Name=@Name@\n
|
|
||||||
Icon=@TargetDir@/bin/%0\n
|
|
||||||
Name[en_US]=YourApp_name");
|
|
||||||
|
|
||||||
// installer.addElevatedOperation("Copy",
|
// installer.addElevatedOperation("Copy",
|
||||||
// "@HomeDir@/.local/share/applications/@Name@.desktop",
|
// "@HomeDir@/.local/share/applications/@Name@.desktop",
|
||||||
|
@ -29,5 +29,6 @@
|
|||||||
<file>InstallTemplate/README</file>
|
<file>InstallTemplate/README</file>
|
||||||
<file>InstallTemplate/CreateDesktopEntry.sh</file>
|
<file>InstallTemplate/CreateDesktopEntry.sh</file>
|
||||||
<file>res/iconInstaller.png</file>
|
<file>res/iconInstaller.png</file>
|
||||||
|
<file>InstallTemplate/componentScript.js</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user