First of all, Lazarus is the class libraries for Free Pascal that emulate Delphi. Free Pascal is a GPL’ed compiler that runs on Linux, Win32, OS/2, 68K and more.
I knew it before and frankly speaking always thought that Lazarus is some kind of not a serious thing. However several days ago I found the first issue of Blaise Pascal Magazine in Russian with article of Zeljan about it. “You never know till you try”, I thought, and decided to give Lazarus a chance.
Since I’m a developer of PostgresDAC component suite my first thought was to use it under Lazarus. Well, I spent two days working and suddenly… Now I’m able to create “Hello world!” bagatelle. Anyway “that’s one small step for man, one giant leap for mankind”. :) I think soon we will add official support for Lazarus in PostgresDAC.
Imagine the following situation. Our product can detect if it is running under WineHQ already. And, indeed, our product has many places from which we must open URL’s:
information about the product,
checking for updates,
technical support page
and so on.
Trying to call ShellExecute head-on, passing the URL as parameter, and … Nothing happens!
The thing is that Wine, honestly emulating everything, wants to start a web browser not installed in the system, but installed under the Wine. There are no any browsers installed yet. Therefore, nothing happens.
Of course, you can install the browser, but why not open the required documents in their native system applications? This raises the question of interaction of the Wine and the operating system.
We are interested in winebrowser command, which opens the URL in the native operating system application. And taking into account that URL can refer to the file, we have really serious mechanism in our hands.
In the life of every Windows developer there comes a point when you want to know if your application is running under WineHQ or not. Why? Because the world is not perfect. And you for sure will help Wine to crunch your application correctly. Of course if you’re interested in support of millions of guys with red eyes (Mac, Linux etc.). ;)
There is an elegant way to find this out. Below is the Pascal\Delphi code, however any sane developer would be able to translate it into preferred language:
function GetWineAvail: boolean;
var H: cardinal;
Result := False;
H := LoadLibrary('ntdll.dll');
if H > HINSTANCE_ERROR then
Result := Assigned(GetProcAddress(H, 'wine_get_version'));
if GetWineAvail() then
ShowMessage('Launched under Wine')
There was some guy, Sherlok, who couldn’t start DB Designer in Wine properly. And I have no idea what he did wrong as my HOWTO is very simple. Yet it’s short… but not anymore! ;)kishkin rewrote that tutorial with the screenshots, and there are LOTS OF THEM!
Here is photo, kishkin receving free license for Database Designer for PostgreSQL. Lot’s of friends came for the party. :)