Recent

Author Topic: Created EXE w/Linux Laz IDE- now how do I install? (Ubuntu)  (Read 2292 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

  • Full Member
  • ***
  • Posts: 104
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: 393
  • 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: 8039
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.
Logitech, TopSpeed & FTL Modula-2 on bare metal (Z80, '286 protected mode).
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

msintle

  • Sr. Member
  • ****
  • Posts: 251
Re: Created EXE w/Linux Laz IDE- now how do I install? (Ubuntu)
« Reply #5 on: November 07, 2024, 02:52:23 pm »
Especially if you're coming from the Windows world, you'll find this a breeze:

https://www.installaware.com/installaware-multi-platform.htm

Builds the classic installation wizards that you know from Windows - on Linux (and Mac).

They even "downscale" to run in character mode, when their setup GUI fails to boot due to missing widgets.

TRon

  • Hero Member
  • *****
  • Posts: 3650
Re: Created EXE w/Linux Laz IDE- now how do I install? (Ubuntu)
« Reply #6 on: November 07, 2024, 08:08:01 pm »
And because forcing some arbitrary windows method to other platforms (so that you can circumvent all security measures) please do not forget to especially implement an update function in your application that automatically checks if there is a new version of the application that which will automatically update itself when suited).

Also always run you applications as a user with admin rights otherwise you would be prompted for passwords and that is very inconvenient (so better skip it all together). Better yet, give all your users admin rights from the get go.

What could possibly go wrong...

Some bold claims on that website (and I believe exactly none of them  :) ).
This tagline is powered by AI (AI advertisement: Free Pascal the only programming language that matters)

msintle

  • Sr. Member
  • ****
  • Posts: 251
Re: Created EXE w/Linux Laz IDE- now how do I install? (Ubuntu)
« Reply #7 on: November 07, 2024, 08:36:07 pm »
Your belief is not required, as everything works exactly as advertised.

Disclaimer: I am on that product team, and you may feel happy that the product was built using Lazarus.

- While you haven't specified what arbitrary Windows method you're referring to, we don't force anything; nothing is hard coded in setups you create with IAMP. You can have a script that does absolutely anything you like - entirely unrelated to installations if that be your fancy.

- We of course cannot circumvent any security measures, but we do our best to cooperate with them. Binaries are signed/notarized when the underlying platform offers a means to do so. Elevation is supported on each platform using native elevation routines.

- We do ship a fully customizable update script and update dialogs, all built in IAMP itself so you may customize them to your heart's content. You are able to easily target updates for your released application versions and add additional targeting by language/OS/bitness/etc.

- None of our toolchain requires admin rights, although you may, of course, perform admin actions as part of your installation should you choose to elevate.

I would request that you don't judge us by the mistakes of other people who have absolutely nothing to do with us, and that you form your own opinion of us after an actual product evaluation (which is available for entirely free from our public website).

TRon

  • Hero Member
  • *****
  • Posts: 3650
Re: Created EXE w/Linux Laz IDE- now how do I install? (Ubuntu)
« Reply #8 on: November 07, 2024, 09:16:32 pm »
Your belief is not required, as everything works exactly as advertised.
First claim to dispute: "Support Linux, macOS, and Windows with zero dependencies (no Java) - zero failures."

There simply can't be any zero dependencies. They are either present or they aren't. If they are they are either statically linked in or you can solve that by using some arbitrary method to access them.

Quote
- While you haven't specified what arbitrary Windows method you're referring to, we don't force anything; nothing is hard coded in setups you create with IAMP. You can have a script that does absolutely anything you like - entirely unrelated to installations if that be your fancy.
The method of installing in general. Software on *nix system isn't deployed using an installer rather with something like a package manager or automation system (such as f.e. ansible). As a sysadmin I do not have the time to use yet another installation method, making all kind of choices, looking at pretty pictures  and/or press buttons.

Quote
- We of course cannot circumvent any security measures, but we do our best to cooperate with them. Binaries are signed/notarized when the underlying platform offers a means to do so. Elevation is supported on each platform using native elevation routines.
afaik, we will never know since it is a closed source project. So, therefor the software can make all sort of claims that the software/ installation script can't do anything in particular.

Quote
- We do ship a fully customizable update script and update dialogs, all built in IAMP itself so you may customize them to your heart's content. You are able to easily target updates for your released application versions and add additional targeting by language/OS/bitness/etc.
So can do any package manager.

Quote
- None of our toolchain requires admin rights, although you may, of course, perform admin actions as part of your installation should you choose to elevate.
From that can only be concluded that the software and additional (data)files and/or dependencies are not installed at the locations that they are suppose to be located.

Quote
I would request that you don't judge us by the mistakes of other people who have absolutely nothing to do with us, and that you form your own opinion of us after an actual product evaluation (which is available for entirely free from our public website).
No, thank you.

You are simply preaching to the wrong person here  :)

Nothing personal other than that I find it rather distasteful to advertise such product in a generic discussion (edit: there is a specific sub-forum for that).
« Last Edit: November 07, 2024, 09:28:46 pm by TRon »
This tagline is powered by AI (AI advertisement: Free Pascal the only programming language that matters)

MarkMLl

  • Hero Member
  • *****
  • Posts: 8039
Re: Created EXE w/Linux Laz IDE- now how do I install? (Ubuntu)
« Reply #9 on: November 07, 2024, 10:33:57 pm »
- None of our toolchain requires admin rights, although you may, of course, perform admin actions as part of your installation should you choose to elevate.

So presumably you're installing into ~/bin or similar. What if there's multiple users on the system? Do they each have ~/lib, ~/etc and so on, and where do common files go (e.g. a "simultaneous users" counter)?

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Logitech, TopSpeed & FTL Modula-2 on bare metal (Z80, '286 protected mode).
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

msintle

  • Sr. Member
  • ****
  • Posts: 251
Re: Created EXE w/Linux Laz IDE- now how do I install? (Ubuntu)
« Reply #10 on: November 07, 2024, 11:40:06 pm »
Your belief is not required, as everything works exactly as advertised.
First claim to dispute: "Support Linux, macOS, and Windows with zero dependencies (no Java) - zero failures."

There simply can't be any zero dependencies. They are either present or they aren't. If they are they are either statically linked in or you can solve that by using some arbitrary method to access them.

Unless someone deletes core system files (like what would be the equivalent of kernel32.dll on Windows), we don't have any extraenous dependencies.

The widgets are the only exception to this. We currently support GTK2 and Qt5, as those are most mature kits Lazarus supports on Linux.

If you don't have the libraries for your chosen kit, then we display your setup in pure character mode - showing you all your custom dialogs as pure text.

So yes, our setups are 100% native code, and they really do work everywhere with a single binary (as long as the platform bitness matches [sadly, unlike Windows, Linux doesn't have a common denominator subsystem like x86 which is supported on amd64 and aarch64 OS flavors]).

Quote
- While you haven't specified what arbitrary Windows method you're referring to, we don't force anything; nothing is hard coded in setups you create with IAMP. You can have a script that does absolutely anything you like - entirely unrelated to installations if that be your fancy.
The method of installing in general. Software on *nix system isn't deployed using an installer rather with something like a package manager or automation system (such as f.e. ansible). As a sysadmin I do not have the time to use yet another installation method, making all kind of choices, looking at pretty pictures  and/or press buttons.

Fair enough, that's what silent installs are for. You can pass command line parameters to customize packages and run them entirely non-interactively. You can even force a GUI setup to run in character mode should you so fancy.

Quote
- We of course cannot circumvent any security measures, but we do our best to cooperate with them. Binaries are signed/notarized when the underlying platform offers a means to do so. Elevation is supported on each platform using native elevation routines.
afaik, we will never know since it is a closed source project. So, therefor the software can make all sort of claims that the software/ installation script can't do anything in particular.

You don't need open source for that. Looking at the command palette of the scripting language, you'll instantly get a sense of what the tool can or cannot do.

Quote
- We do ship a fully customizable update script and update dialogs, all built in IAMP itself so you may customize them to your heart's content. You are able to easily target updates for your released application versions and add additional targeting by language/OS/bitness/etc.
So can do any package manager.

Nice, can they also display custom dialogs that are designed in what looks exactly like Lazarus's dialog editor with the exact control properties afforded therein?

Quote
- None of our toolchain requires admin rights, although you may, of course, perform admin actions as part of your installation should you choose to elevate.
From that can only be concluded that the software and additional (data)files and/or dependencies are not installed at the locations that they are suppose to be located.

We don't have dependencies, since our toolchain is also native code, thanks to Lazarus of course.

We treat Linux like any other first-class citizen in today's world of client operating systems.

Meaning, the default installation folder for IAMP itself is somewhere in the user profile folder:
/home/parallels/.local/share/InstallAware Multi Platform/

You can change that of course, and install it whereever you like.

Quote
I would request that you don't judge us by the mistakes of other people who have absolutely nothing to do with us, and that you form your own opinion of us after an actual product evaluation (which is available for entirely free from our public website).
No, thank you.

Of course, and  thank you for the opportunity to clarify core misunderstandings.

Fact is, there's been so many crap (as in hard to use and easy to make mistakes in) installers on Windows that all installers today get a bad rap and the industry at large has moved to straitjacket package managers which are very inflexible to use, hard to author for, and proliferating like mushrooms.

We're not one of those.

You are simply preaching to the wrong person here  :)

Nothing personal other than that I find it rather distasteful to advertise such product in a generic discussion (edit: there is a specific sub-forum for that).

Touché.

msintle

  • Sr. Member
  • ****
  • Posts: 251
Re: Created EXE w/Linux Laz IDE- now how do I install? (Ubuntu)
« Reply #11 on: November 07, 2024, 11:42:07 pm »
- None of our toolchain requires admin rights, although you may, of course, perform admin actions as part of your installation should you choose to elevate.

So presumably you're installing into ~/bin or similar. What if there's multiple users on the system? Do they each have ~/lib, ~/etc and so on, and where do common files go (e.g. a "simultaneous users" counter)?

MarkMLl

We don't really have common files, and we don't install into protected system folders.

For our own kit, we've adopted the position that admin rights must not be required to install (or run) the product.

That's just our setup, you could install your stuff anywhere you like - that's why we fully support OS native elevation scenarios.

Diverod

  • New member
  • *
  • Posts: 7
Re: Created EXE w/Linux Laz IDE- now how do I install? (Ubuntu)
« Reply #12 on: November 13, 2024, 11:23:51 pm »
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?

I see this post is a little old but note you having the same struggle as I did. A simple way that I found was to make a desktop launcher file. I'll show an example of one I use to launch my basic deb package maker: the name of the file is 'com.DesktopDebPkg.desktop' and the content of the text file is listed below. (The DesktopDebPkg part of the file name can be anything you like). Use a plain text editor to make the file.
Code: Text  [Select][+][-]
  1. [Desktop Entry]
  2. Type=Application
  3. Name=DesktopDebPkg
  4. Path=/home/rodg/Lazarus Projects/DesktopDebPkg/
  5. Exec=DesktopDebPkg
  6. Icon=/home/rodg/Documents/DesktopDebPkg/Resources/DebPkg1.png

[Desktop Entry]          // This needs to be the 1st line.
Type=Application       // Leave this as is.
Name=MyLabel         // This will be the text displayed under the icon on your desktop.
Path=                         // This should be the path to the directory of where you placed your application.
Exec=                        // This is the application name.
Icon=                         // The full path and name of the image you want to display on the desktop for your launcher.

When you first make the desktop launcher it will have a red X on it. Right-mouse-key the icon and select 'allow launching' and you should be all set. I use this on Ubuntu 24.04 and it does not show in the OS menu system but is handy for me. Hope this helps.


msintle

  • Sr. Member
  • ****
  • Posts: 251
Re: Created EXE w/Linux Laz IDE- now how do I install? (Ubuntu)
« Reply #13 on: November 14, 2024, 11:35:46 am »
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?

I see this post is a little old but note you having the same struggle as I did. A simple way that I found was to make a desktop launcher file. I'll show an example of one I use to launch my basic deb package maker: the name of the file is 'com.DesktopDebPkg.desktop' and the content of the text file is listed below. (The DesktopDebPkg part of the file name can be anything you like). Use a plain text editor to make the file.
Code: Text  [Select][+][-]
  1. [Desktop Entry]
  2. Type=Application
  3. Name=DesktopDebPkg
  4. Path=/home/rodg/Lazarus Projects/DesktopDebPkg/
  5. Exec=DesktopDebPkg
  6. Icon=/home/rodg/Documents/DesktopDebPkg/Resources/DebPkg1.png

[Desktop Entry]          // This needs to be the 1st line.
Type=Application       // Leave this as is.
Name=MyLabel         // This will be the text displayed under the icon on your desktop.
Path=                         // This should be the path to the directory of where you placed your application.
Exec=                        // This is the application name.
Icon=                         // The full path and name of the image you want to display on the desktop for your launcher.

When you first make the desktop launcher it will have a red X on it. Right-mouse-key the icon and select 'allow launching' and you should be all set. I use this on Ubuntu 24.04 and it does not show in the OS menu system but is handy for me. Hope this helps.

Not to beat a dead horse, but the Create Shortcut command in InstallAware Multi Platform already takes care of this for you.

Based on which OS your are compiling it for - macOS/Linux/Windows - the same and single Create Shortcut command in your setup script creates shortcuts that work properly as intended - including executable parameters, icons, startup folders, etc.

Believe it or not: This is quite a bit of a mess even just amongst Linux flavors themselves, so something seemingly as trivial as this ends up taking a ton of effort.

Let's also not forget Create File Type, which associates file types (ex: .pdf) with handler applications (ex: Acrobat), again consistently and successfully on all platforms (again including custom file type icon support).

Needless to say, that was much worse of a nightmare than the venerable Create Shortcut! Makes you think how much we often take for granted.

Diverod

  • New member
  • *
  • Posts: 7
Re: Created EXE w/Linux Laz IDE- now how do I install? (Ubuntu)
« Reply #14 on: November 14, 2024, 01:59:17 pm »
   I only posted here because, to me, the OP was in search of knowledge and I only saw a solution provided. I tried to provide some knowledge.
   Respectfully, I do not wish to participate in any discussion/debate about a solution.
   Perhaps a moderator should just close this thread.

 

TinyPortal © 2005-2018