Recent

Author Topic: [SOLVED} Running Lazarus created Applications on a Raspberry Pi  (Read 652 times)

Barry55

  • New Member
  • *
  • Posts: 20
[SOLVED} Running Lazarus created Applications on a Raspberry Pi
« on: January 16, 2021, 10:39:21 pm »
I have created a simple application (called Alarm) on a Raspberry Pi using Lazarus/Free Pascal. It runs fine from the IDE but when I double click it in file manager, i get a message pop up which says

This file 'Alarm' is an executable. Do you wish to execute it.

Options are execute, Execute in a Terminal or Cancel.

If I choose execute it then runs fine. I originally assumed this was a Raspberry Pi issue, but having looked at the message boards there, there are a few posts that point to a Free pascal issue and the complier options, but are not specific about what/why.

I just wondered if anyone had come across this and knew the solution

Many thanks
Barry
« Last Edit: January 16, 2021, 10:54:19 pm by Barry55 »

MarkMLl

  • Hero Member
  • *****
  • Posts: 6676
Re: Running Lazarus created Applications on a Raspberry Pi
« Reply #1 on: January 16, 2021, 10:51:39 pm »
No, that's a Raspberry Pi problem. Specifically, their GUI doesn't have a facility to create a .desktop file which tells it what you want to do with the file which you've just selected, so the only thing it can do is ask (without the option of saving state permanently).

If you were using something like KDE, right-clicking on the start button would take you to a menu editor which would save program settings in a .desktop file of standard (XML) format. I've idly toyed with the idea of writing an editor myself using Lazarus, but have never got round to it since it was such a glaring omission that I was sure that either I'd overlooked something obvious or that somebody else was fixing it.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

Barry55

  • New Member
  • *
  • Posts: 20
[Solved] Re: Running Lazarus created Applications on a Raspberry Pi
« Reply #2 on: January 16, 2021, 10:53:50 pm »
Thanks, it was a Raspberry Pi problem and the solution was stunningly simple (once someone told me)

Open file manager
Go to the Edit menu
Preferences
tick 'Don't ask options on launch executable file'

Then it simply works fine

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4459
  • I like bugs.
Re: Running Lazarus created Applications on a Raspberry Pi
« Reply #3 on: January 16, 2021, 10:54:32 pm »
I have created a simple application (called Alarm) on a Raspberry Pi using Lazarus/Free Pascal. It runs fine from the IDE but when I double click it in file manager, i get a message pop up which says

This file 'Alarm' is an executable. Do you wish to execute it.

Options are execute, Execute in a Terminal or Cancel.

If I choose execute it then runs fine. I originally assumed this was a Raspberry Pi issue, but having looked at the message boards there, there are a few posts that point to a Free pascal issue and the complier options, but are not specific about what/why.
I don't think it is related to Free Pascal. I have Manjaro Linux + KDE Plasma. I get a similar question when I click any executable in Dolphin. It also offers a Checkbox "Do not ask again".
It happens with any executable under my home dir and also under /usr/bin/.

About Raspberry Pi, how well does Lazarus run there?
Lazarus trunk got some optimizations lately. You may want to test if the difference is noticeable.
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

Barry55

  • New Member
  • *
  • Posts: 20
Re: [SOLVED} Running Lazarus created Applications on a Raspberry Pi
« Reply #4 on: January 16, 2021, 11:03:52 pm »
"About Raspberry Pi, how well does Lazarus run there?"

Pretty good, I have the Raspberry Pi 400, and had mainly developed on a windows system, using syncthing to keep the Pi in step, then re-compile there and run. But lately I have just been developing native on the Pi and I have to say for an £80 computer I'm impressed.

The target of most of the applications are Pi 0W's which have have round the house running a mix of Lazarus programs and Python programs for a variety of applications.

Personally I prefer Lazarus, but then I was a Delphi programmer for years so its just what you know I guess.

Thanks
Barry

 

TinyPortal © 2005-2018