Recent

Author Topic: Created EXE w/Linux Laz IDE- now how do I install? (Ubuntu)  (Read 550 times)

Sheepdog

  • New Member
  • *
  • Posts: 41
I've created an .exe with Lazarus, on an Ubuntu box, using the amd64.deb.

Now I'd like to "install" (wrong word?) that .exe on an Ubuntu machine, so I can run it just like I run programs installed using the Ubuntu... umm... "thing". (The newbie friendly... app store?... place where I fetched, say, Firefox from to set it up on my Ubuntu system.)

Apologies for what is probably just a newbie-Linux-user question... but maybe a Lazarus-created .exe has quirks that must be provided for?

(My program runs fine... when I run it from the IDE. It does nothing particularly clever.)

If the answers for...

a) Install on an Ubuntu box with the Lazarus IDE installed
  ... and...
b) Install on an Ubuntu box which does NOT have the IDE

... would be different, the answer to "a" will suffice for present wants.

(Broad hints about the extra "features" required for the second want would be welcome.)

With thanks, Tom.  Longtime Lazarus-on-Windows programmer. New to all aspects of Linux.

Wallaby

  • Jr. Member
  • **
  • Posts: 89
Re: Created EXE w/Linux Laz IDE- now how do I install? (Ubuntu)
« Reply #1 on: June 10, 2024, 01:14:14 pm »
Assuming by .EXE you mean a Linux ELF binary without additional dependencies, it would simply run on any Linux machine.

If you want to create an installer, you would need to package that binary as a .DEB and/or .RPM file, or a SNAP, or AppImage.

Otherwise you can simply compress it with into a TGZ file and will run anywhere you copy it.

Sheepdog

  • New Member
  • *
  • Posts: 41
Re: Created EXE w/Linux Laz IDE- now how do I install? (Ubuntu)
« Reply #2 on: June 10, 2024, 01:49:04 pm »
Ah. Thank you. Apologies for flaws in my question!

---
The ".exe" file seemingly had NO extension. (If I've got "Ubuntu doesn't hide extensions except .desktop" and "Extensions aren't really "a thing" in Linux" right! Other Linux newbies like me might find the following helpful...

https://ubuntuforums.org/showthread.php?t=1460676

---
The file I was calling "the .exe" had the name I assigned to the .lpi file, i.e. the project name.

---
Thank you, Wallaby, for the several useful things in your answer.

I don't (yet!) aspire to an installer... unless it is needed for something I will come to in a moment.

Is the TGZ compression a necessary thing, or an optional extra with some obvious pros and cons?

---
I'm hoping that simply copying the file I was talking about to a folder of my choice on a different machine would make it usable there?

I can open the "Files" app, drill down, and double-click, if that's the least painful option.

I was hoping there is an uncomplicated way to create what Windows would call a shortcut that could appear on desktop (simple, crude answer), or someplace more sensible, so I can launch the program just by clicking on that?

Is it complicated, once the file is on the system's storage, to get an entry in the "Apps" list, i.e. the window full of icons-to-click which comes up if I click on the "Show Apps" grid of dots in my "Dash" ("dashboard").

Dzandaa

  • Sr. Member
  • ****
  • Posts: 317
  • From C# to Lazarus
Re: Created EXE w/Linux Laz IDE- now how do I install? (Ubuntu)
« Reply #3 on: June 10, 2024, 02:00:09 pm »
Hi,

Linux executable programs do not have an extension, as in Windows. They are Linux ELF binary.

You can see the propriety of a program by running "file MyProgram" at a command prompt.

You can run your program on another Linux computer of the same type (32 or 64 Bits).
If you want to run it from everywhere on you Linux Machine, the best directory you can copy it in is /usr/local/bin, assuming that directory is in the PATH (in root mode).

B->
Regards,
Dzandaa

MarkMLl

  • Hero Member
  • *****
  • Posts: 6940
Re: Created EXE w/Linux Laz IDE- now how do I install? (Ubuntu)
« Reply #4 on: June 10, 2024, 02:29:09 pm »
Assuming by .EXE you mean a Linux ELF binary without additional dependencies, it would simply run on any Linux machine.

If you want to create an installer, you would need to package that binary as a .DEB and/or .RPM file, or a SNAP, or AppImage.

Otherwise you can simply compress it with into a TGZ file and will run anywhere you copy it.

I'd suggest that more to the point:

* By convention, the executable doesn't have an "extension" which is a Windows (nee DOS, CP/M etc.) thing.

* From the shell, you can run the binary by specifying its full path, or using e.g. ./MyProgram if it is in the current directory.

* Remember that unix filesystems are case-preserving and case-sensitive.

* You will find it more convenient to have a program on the path. By convention, locally-compiled programs go into /usr/local/bin

* The normal user will probably not have permission to write to /usr/local/bin, so will need to use sudo (qv) providing his own password for authentication.

* Files can be copied using the cp command. It might be necessary to use the -p option to preserve the executable mode (qqv).

* Installing a file into the computer's menu system depends on the GUI (desktop environment etc.) in use.

* There's a standard program "install" which can handle executable mode etc., but it won't solve the password issue or menu.

* If copying to a different machine (e.g. using sftp (qv)), you will need to ensure that any prerequisite libraries are present. This is particularly the case if one system is 32- and the other 64-bit.

* Stating the obvious, if you've used Lazarus to build a GUI-oriented program it won't run on a system which doesn't have a GUI.

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

 

TinyPortal © 2005-2018