Recent

Poll

How should my program get the OpenSSL package

Program should download it to project directory every time it starts
0 (0%)
Program's installer/user should be the only thing to download/install OpenSSL
4 (100%)

Total Members Voted: 4

Author Topic: Can't use fphttpclient to GET HTML  (Read 1408 times)

rvk

  • Hero Member
  • *****
  • Posts: 3505
Re: Can't use fphttpclient to GET HTML
« Reply #15 on: November 26, 2018, 11:05:46 pm »
http://wiki.lazarus.freepascal.org/Deploying_Your_Application

http://wiki.lazarus.freepascal.org/Inno_Setup_Usage

The Lazarus Windows installer itself is also created with Inno Setup.
http://wiki.freepascal.org/Lazarus_Installer

But I wouldn't worry about distribution until your application is actually ready to be deployed.

Edit: I see there is a poll now. But there are lots of other options available. And it all depends on your application and your clients.

1) install openssl during installation to system directory.
2) install openssl during installation to exe directory.
3) download openssl when not available systemwide
4) download openssl when not available in exe directory
5) download openssl each time when started (don't do this)

I usually choose option 4. But if you're distributing to big companies with security settings etc. option 1 or 2 might be advisable.

But if you have just one .exe with no other files, distributing just that .exe and downloading openssl is easiest.
« Last Edit: November 26, 2018, 11:11:18 pm by rvk »

lucamar

  • Sr. Member
  • ****
  • Posts: 494
Re: Can't use fphttpclient to GET HTML
« Reply #16 on: November 26, 2018, 11:21:51 pm »
You have usually much more control on your development environment so that's not really an issue: if you need them you can download external DLLs and put them wherever appropiate.

On deployment, though, things are not so easy: unless you can control the deployment environment (like p.e. in so called "portable" installations) you must attend to possible installation problems. The usual way to do that is to let others worry about it and use one of the many install-builders out there: Inno Setup, NSIS, Microsoft's own (which I never remember how it's called), etc. Once you start going down that way it's almost always easier to let the installer deal with your dependencies.

Look into any typical application (LibreOffice, Firefox, etc.) install and see how many third-party libraries they contain. Heck, OpenOffice used to install even a minimal Python environment! ;D
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus 1.8.4/FPC 3.0.4 on:
(K)Ubuntu 11..16, Windows XP SP3 (Home/Prof.) and various DOS incarnations.

anon101

  • New member
  • *
  • Posts: 12
Re: Can't use fphttpclient to GET HTML
« Reply #17 on: December 05, 2018, 02:39:49 am »
http://wiki.lazarus.freepascal.org/Deploying_Your_Application

http://wiki.lazarus.freepascal.org/Inno_Setup_Usage

The Lazarus Windows installer itself is also created with Inno Setup.
http://wiki.freepascal.org/Lazarus_Installer

But I wouldn't worry about distribution until your application is actually ready to be deployed.

Edit: I see there is a poll now. But there are lots of other options available. And it all depends on your application and your clients.

1) install openssl during installation to system directory.
2) install openssl during installation to exe directory.
3) download openssl when not available systemwide
4) download openssl when not available in exe directory
5) download openssl each time when started (don't do this)

I usually choose option 4. But if you're distributing to big companies with security settings etc. option 1 or 2 might be advisable.

But if you have just one .exe with no other files, distributing just that .exe and downloading openssl is easiest.
Hey, thanks for the info and sorry for the delay. I've been very busy lately.
I'll probably go with option 4 then with Inno setup wizard. It seems the best for me. This would easily work on most OS's though right?
I just need Windows, Mac OS X, Linux and if possible Android as well.
Thanks for all your help!

CCRDude

  • Sr. Member
  • ****
  • Posts: 443
Re: Can't use fphttpclient to GET HTML
« Reply #18 on: December 05, 2018, 12:03:22 pm »
On Windows, InnoSetup along with option 2 - installing to program folder - would in my opinion be the best solution. Especially with different OpenSSL versions out there, using one from the system directory might not be a good idea. And if your code is statically dynamically linking OpenSSL, it won't run without them. Microsofts own MSI is required if you want to distribute through the Microsoft Store.

On MacOS, you can create .pkg installers using XCodes productbuild command line tool, and would place the libraries within the app bundle. But I would prefer using NSURLDelegate there to be independent of OpenSSL/LibreSSL versions of the OS.

On Linux, this depends a lot on your packaging. For .deb and .rpm, you could specify dependencies. If you want to ship them, take a look at AppImage.

Downloading libraries in my opinion has the advantage of staying up to date, but the disadvantage of having to implement a lot of validity checking, and having permissions to write to the app folder, which is not very user friendly.

So, to sum it up - distribution is quite different on each platform.

anon101

  • New member
  • *
  • Posts: 12
Re: Can't use fphttpclient to GET HTML
« Reply #19 on: December 08, 2018, 11:24:05 am »
So what about Android and maybe IOS?
Also, if I was to opt to let the user install it themselves, would this reduce the difficulty of deploying for different platforms.
Since this is a small and simple utility project though, what should I do, I just want to make sure that maybe when I get a new phone or a friend on maybe OS X wants to use my program, I can pretty easily get it working for them without too much problems.
What's the simplist thing I can do for max platforms? I mean hasn't an SSL client or whatever been designed in pure Free Pascal so I don't have to have this trouble? I only want something which can get and post https requests. Nothing complex.
Again, thanks so much!!!
« Last Edit: December 08, 2018, 11:26:36 am by anon101 »

lucamar

  • Sr. Member
  • ****
  • Posts: 494
Re: Can't use fphttpclient to GET HTML
« Reply #20 on: December 08, 2018, 12:55:39 pm »
What's the simplist thing I can do for max platforms? I mean hasn't an SSL client or whatever been designed in pure Free Pascal so I don't have to have this trouble? I only want something which can get and post https requests. Nothing complex.

SSL/TLS is complex (each day more, it seems) and AFAIK there's no pure-pascal "client". But take heart: most current platforms use OpenSSL or a simil thereof (LibreSSL in MacOS/iOS) with the glaring exception of Windows so your problem will most likely arise there (in Windows) and the best solution, as indicated various times, is to let the installer deal with OpenSSL along with your program.
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus 1.8.4/FPC 3.0.4 on:
(K)Ubuntu 11..16, Windows XP SP3 (Home/Prof.) and various DOS incarnations.