Recent

Author Topic: Closed source packages for Lazarus  (Read 1175 times)

Alex.Machado

  • New Member
  • *
  • Posts: 35
Closed source packages for Lazarus
« on: October 20, 2024, 12:02:38 am »
Hi all,

I'm creating a new thread here following this one that I created a coulpe of days ago, because I don't want to mix the contents:

https://forum.lazarus.freepascal.org/index.php/topic,68946.0.html

After struggling with the creation of a closed source (trial version of a commercial library) package for Lazarus, I wonder if that's possible at all to create one, at least one that can be installed and registers components into the IDE.

Unless there is some hidden feature that I'm not aware of, at this stage I'm convinced that it's not possible to create a closed source package for Lazarus which contains registered components.

Edited: Yes, it does work. See my answer here: https://forum.lazarus.freepascal.org/index.php/topic,68965.msg534383.html#msg534383

I know that some commercial packages exist but they are all installed with the sources *after* being purchased by the end user. In short: the user must try it in Delphi before purchasing the product to be used in Lazarus, which is beyond awkward.
I could not find a single package that can be installed without the sources (e.g. TMS do not have trial versions for Lazarus, only for Delphi, same with other vendors).

I've read this thread many times also https://forum.lazarus.freepascal.org/index.php?topic=47582.0
and tried every single advice there but nothing actually works.

So, my question is really simple:
 
Is it possible to create closed source packages that install/register components into the Lazarus IDE?
If so, can anyone point me a single exemple of such library?

Thanks in advance

« Last Edit: October 21, 2024, 07:49:36 am by Alex.Machado »

rvk

  • Hero Member
  • *****
  • Posts: 6643
Re: Closed source packages for Lazarus
« Reply #1 on: October 20, 2024, 12:19:32 am »

paweld

  • Hero Member
  • *****
  • Posts: 1278
Re: Closed source packages for Lazarus
« Reply #2 on: October 20, 2024, 06:29:32 am »
It is possible to create such a component for lazarus, but this has several serious drawbacks that make such a solution unprofitable:
- lack of sources results in a lack of prompts
- executing “clean and build” (with package checkboxes checked) on the project will result in an error, as there will be nothing to rebuild the component from, resulting in the need to uninstall and reinstall the component
- you will have to provide compiled packages for sure for each FPC version and for each target, and maybe even dependent on the Lazarus version (but I'm not sure about that).

Of the commercial components, it is Devart that provides a test version that you can test with Lazarus (compiled components without sources).
Best regards / Pozdrawiam
paweld

af0815

  • Hero Member
  • *****
  • Posts: 1381
Re: Closed source packages for Lazarus
« Reply #3 on: October 20, 2024, 06:39:05 am »
My experience, no it is not possible. Every ppu have some checksume from system ppu and if that change, allppu must be recompiled. If you compile the fpc from source because you need a patched version or you use fixes, mai,... you have not the same checksum as the creator of the package. And then it is not possible to recompile Lazarus.

I have this seen with a comercial product and Lazarus. I was posting this here in an old thread, if i found the thread, i will post a link.


All this is waiting for the dynamic loadable packages

edit: https://forum.lazarus.freepascal.org/index.php/topic,47582.0.html
« Last Edit: October 20, 2024, 06:42:42 am by af0815 »
regards
Andreas

440bx

  • Hero Member
  • *****
  • Posts: 4907
Re: Closed source packages for Lazarus
« Reply #4 on: October 20, 2024, 07:11:57 am »
What's follows is a possibility based on "stretching" the meaning of "closed source".

The idea is that you do provide the source but _obfuscated_ source.  That is source code where variable names, type names, constant names, function and procedure names, etc have been changed to strings that make no sense.  In addition to that, change the formatting so it is extremely hard to read (a formatter could improve that but, that would require work on the part of the user and the gain would still be minimal.)

Effectively, this makes having the source very close to totally useless, thereby making it "closed source" for practical purposes.

In economic terms, it's probably cheaper to buy the product than to spend the time figuring out what the original source was.

HTH.
(FPC v3.0.4 and Lazarus 1.8.2) or (FPC v3.2.2 and Lazarus v3.2) on Windows 7 SP1 64bit.

Thaddy

  • Hero Member
  • *****
  • Posts: 16419
  • Censorship about opinions does not belong here.
Re: Closed source packages for Lazarus
« Reply #5 on: October 20, 2024, 07:18:24 am »
I think a better solution is to provide the parts of the source you really do not want to distribute as source as shared libraries.
dll's / so's That has disadvantages for components, but anyway..you can work around that. On Windows you can also distribute components as COM objects/ActiveX. It is often enough to create just two versions of a license dll, one permanent, one with expiry date, and hide some critical code in there,like the ability to save.
« Last Edit: October 20, 2024, 07:33:00 am by Thaddy »
There is nothing wrong with being blunt. At a minimum it is also honest.

mattias

  • Administrator
  • Full Member
  • *
  • Posts: 198
    • http://www.lazarus.freepascal.org
Re: Closed source packages for Lazarus
« Reply #6 on: October 20, 2024, 11:47:20 am »
- you will have to provide compiled packages for sure for each FPC version and for each target, and maybe even dependent on the Lazarus version (but I'm not sure about that).

If the closed source package uses a lazarus package (e.g. lcl) then it will be specific for a lazarus release, not just each FPC release.

paweld

  • Hero Member
  • *****
  • Posts: 1278
Re: Closed source packages for Lazarus
« Reply #7 on: October 20, 2024, 12:10:45 pm »
@mattias: Thank you very much for that info.
Best regards / Pozdrawiam
paweld

mattias

  • Administrator
  • Full Member
  • *
  • Posts: 198
    • http://www.lazarus.freepascal.org
Re: Closed source packages for Lazarus
« Reply #8 on: October 20, 2024, 12:27:44 pm »
you have not the same checksum as the creator of the package. And then it is not possible to recompile Lazarus.[/All this is waiting for the dynamic loadable packages
edit: https://forum.lazarus.freepascal.org/index.php/topic,47582.0.html

Note that not every rebuild changes the checksums. For example compiling with range checks or some other debug flag results in the same checksum. The checksums are computed from the accessible symbols, not from all the code.

Dynamic packages are similar to ppu files compiled with -Ur.

Alex.Machado

  • New Member
  • *
  • Posts: 35
Re: Closed source packages for Lazarus
« Reply #9 on: October 20, 2024, 10:01:14 pm »
No experience but you might want to read this.

https://wiki.lazarus.freepascal.org/Lazarus_Packages#Creating_a_closed_sourced_package

Hi rvk,

that's good information. I've seen that page a couple of times and somehow I missed that "closed source" section.
It will require some work but I'll try it out and get back here to report the results.
Hopefully that will work, although I'm not sure how and why it will fix whatever problems I'm having now.

Thank you

Alex.Machado

  • New Member
  • *
  • Posts: 35
Re: Closed source packages for Lazarus
« Reply #10 on: October 20, 2024, 10:04:01 pm »
It is possible to create such a component for lazarus, but this has several serious drawbacks that make such a solution unprofitable:
- lack of sources results in a lack of prompts
- executing “clean and build” (with package checkboxes checked) on the project will result in an error, as there will be nothing to rebuild the component from, resulting in the need to uninstall and reinstall the component
- you will have to provide compiled packages for sure for each FPC version and for each target, and maybe even dependent on the Lazarus version (but I'm not sure about that).

Of the commercial components, it is Devart that provides a test version that you can test with Lazarus (compiled components without sources).

Hi paweld,

that's good information too, especially the Devart reference. I've downloaded it and will play with it a little bit to see if there is some hidden "catch".
I could quickly see that they don't use the "workaround" pointed out by rvk in his answer above (https://wiki.lazarus.freepascal.org/Lazarus_Packages#Creating_a_closed_sourced_package). So I'm kind of intrigued if it actually works.

Thank you

Alex.Machado

  • New Member
  • *
  • Posts: 35
Re: Closed source packages for Lazarus
« Reply #11 on: October 21, 2024, 07:48:26 am »
No experience but you might want to read this.

https://wiki.lazarus.freepascal.org/Lazarus_Packages#Creating_a_closed_sourced_package

EUREKA!!!!  :D :D :D :D :D

Following the exact steps above I was able to install the closed source package with component registration and it now works as expected!

So, the conclusion is that: YES, IT DOES WORK!

Due to changes in interface sections of libraries it may be a little tricky to keep it compatible with different versions/builds of the IDE, but it is doable. It's just a matter of effort, not a technical impossibility.

To @rvk, I owe you (a big) one, man!  Thank you again :)

Thanks to everybody that contributed here. The Lazarus community is great!

Cheers

 

TinyPortal © 2005-2018