It may save other time.
Call below function from installer.qs for creating *.desktop file
you can call prototype by this. desktopFileCreateOnLinux() from any function in side component script.
Below script will create the two place *.desktop file.
inside the @TargetDir@/ inside ~/.local/share/applications/ (it will help while searching from Show application).prototype definition:
Component.prototype.desktopFileCreateOnLinux = function() { if ((systemInfo.kernelType === "linux") ||(systemInfo.kernelType === "Linux")) { var dir = installer.value("TargetDir"); component.addOperation("CreateDesktopEntry", "Squidstat.desktop", "Type=Application\nName=Squidstat\nExec=\'"+dir+"/SquidStat.sh\'\nGenericName=The IDE of choice for Squidstat handle.\nIcon="+dir+"/Squidstat.png\nTerminal=false\nCategories=IDE;Qt;"); component.addOperation("CreateDesktopEntry", "@TargetDir@/Squidstat.desktop", "Type=Application\nName=Squidstat\nExec=\'"+dir+"/SquidStat.sh\'\nGenericName=The IDE of choice for Squidstat handle.\nIcon="+dir+"/Squidstat.png\nTerminal=false\nCategories=IDE;Qt;"); } }