You are not logged in.

#1 2016-05-08 14:32

Dai_trying
Member
From: UK
Registered: 2015-12-14
Posts: 2,992

Put application category into installer

I have created a simple installer using the instructions located here, and would like to give the created .deb file a category to place the application when installed. It currently installs to the "other" category on my test debian cinnamon installation, and I would like it to go to the correct category if possible. Any suggestion welcome. smile

Offline

#2 2016-05-08 16:34

q4osteam
Q4OS Team
Registered: 2015-12-06
Posts: 4,465
Website

Re: Put application category into installer

You need to create 'Section: the_category' line in the 'DEBIAN/control' file. There is a 'sourced.prepack' script in Q4OS devpack compiler, you can use it to do the job. Simply insert at the bottom of the installer.cfg:

cat > $CFGFILE_DIR/sourced.prepack <<EOF
echo "Section: the_category" >> wkdir/DEBIAN/control
rm \$CFGFILE_DIR/sourced.prepack
EOF

Offline

#3 2016-05-08 17:07

Dai_trying
Member
From: UK
Registered: 2015-12-14
Posts: 2,992

Re: Put application category into installer

Thank you, I am assuming I have to replace "the_category" with the category I want it to appear in. I will try and report back if any problems. smile

Offline

#4 2016-05-08 18:33

Dai_trying
Member
From: UK
Registered: 2015-12-14
Posts: 2,992

Re: Put application category into installer

I tried a few different options as I kept getting failures, but I missed the line of output that said

duplicate value for `Section' field

So it looks like I need to remove the first Section entry from the control file before adding the new one.

Offline

#5 2016-05-08 18:55

Dai_trying
Member
From: UK
Registered: 2015-12-14
Posts: 2,992

Re: Put application category into installer

I solved this by changing to :-

cat > $CFGFILE_DIR/sourced.prepack <<EOF
sed -i '/Section/c\Section: Audio' wkdir/DEBIAN/control
cat wkdir/DEBIAN/control
rm \$CFGFILE_DIR/sourced.prepack
EOF

The "cat" was just to make sure it was changed.
Although it still doesn't seem to put it into it's correct menu.

Offline

#6 2016-05-08 20:08

Dai_trying
Member
From: UK
Registered: 2015-12-14
Posts: 2,992

Re: Put application category into installer

I've been looking a bit further into this and the deb file created by the installer does not put a menu file in place in the system, would this normally be done? I have noticed q4os appears to be using these files for other applications that are installed, that is the information in these files seems to be correct so I have to assume they are used.
I cannot find any sort of menu entry file for my installed package unless it is the file in /usr/share/applications/ but that appears to just be a desktop icon file...

Offline

#7 2016-05-08 23:20

Dai_trying
Member
From: UK
Registered: 2015-12-14
Posts: 2,992

Re: Put application category into installer

I managed to get it working by changing the file /program_files/q4os-devpack/appsetup/templates/app1.desktop.template so that it contained Categories=AudioVideo;Audio;, for it to be included in the sound and video menu of cinnamon. I removed the entry posted earlier as the Section entry had no effect on menu location. and after checking the esh installer that too puts an entry into the correct menu (multimedia in this case).
So would the installer have an option to cater for menu entries so I don't have to manually change the template file each time I create an app with different menu location requirement?

Offline

#8 2016-05-09 08:59

q4osteam
Q4OS Team
Registered: 2015-12-06
Posts: 4,465
Website

Re: Put application category into installer

We have misunderstood your first question, sorry for that. The 'Section' in the .deb file means Category in Synaptic grouping.

Dai_trying wrote:

So would the installer have an option to cater for menu entries so I don't have to manually change the template file each time I create an app with different menu location requirement?

Yes, you can create own 'app1.desktop.template' template in your project subfolder, for ex. 'my_templates' and set variable 'TEMPLATES_DIR="my_templates"' in the 'installer.cfg'

Offline

#9 2016-05-09 09:59

Dai_trying
Member
From: UK
Registered: 2015-12-14
Posts: 2,992

Re: Put application category into installer

Ah, that makes sense, Thank you. I can stop scratching my head now. smile

Offline

#10 2016-05-09 10:27

q4osteam
Q4OS Team
Registered: 2015-12-06
Posts: 4,465
Website

Re: Put application category into installer

Of course, in addition, it's possible to override other custom template files in 'my_templates' subfolder as well.

Offline

#11 2016-05-09 11:45

Dai_trying
Member
From: UK
Registered: 2015-12-14
Posts: 2,992

Re: Put application category into installer

Yes thank you, I have realised that now, I'm blaming my age for not seeing that before big_smile

Offline

#12 2016-05-09 14:45

Dai_trying
Member
From: UK
Registered: 2015-12-14
Posts: 2,992

Re: Put application category into installer

I was looking for a way to get a better description into the installer, the default setting is to just use $PK_NAME for Q4OS which is not really a description. The only way I could do this was to add a variable to the installer.cfg (PK_DESC) and then modify the create_q4app_setup.sh with

if [ -z "$PK_DESC" ]; then
 echo "$PK_NAME for Q4OS" > description-pak
else
 echo "$PK_DESC" > description-pak
fi

(line 271)
I realise that modifying the installation script is probably not the best way to do this, as I would have to remember to make the same modifications if I were to have to re-install my system, but it is the only way I could see to do it.
Is there an alternative way to do this without my modifications?

EDIT: I originally got the argument the wrong way round, changed it now.

Last edited by Dai_trying (2016-05-09 15:18)

Offline

Board footer

Powered by FluxBB