October 1, 2013

Path issue when having installed a lot of software

Windows is having some trouble with very long path environment variable, even in Windows 7. There are several limits which prevent the path to be as long as one would like.

This present an issue when you have installed a bunch of software, each one adding is own items to the path variable. A some point, the path becomes too long and strange things happens such as control panel applet not working anymore.

This happened to me when installing Delphi XE5 on a system which already had a lot of software, including 6 other Delphi versions.

Actually, the solution is simple. Three steps:
  1. Remove the items installed by the application from the path
  2. Create a batch file adding the items back to the path and launch the application
  3. Change the shortcut (Desktop and Start Menu) to run your batch instead of the application.
I have done that for all the Delphi version I have currently installed on my system. Here is the batch for XE5:

@ECHO OFF
ECHO Starting Delphi XE5
SET RSBIN=D:\Program Files (x86)\Embarcadero\RAD Studio\12.0
SET RSBPL=C:\Users\Public\Documents\RAD Studio\12.0\Bpl
PATH | FIND /I "%RSBIN%"
IF ERRORLEVEL 1 PATH=%RSBIN%\bin;%RSBPL%;%RSBIN%\bin64;%RSBPL%\Win64;%PATH%
START /D "%RSBIN%\bin" bds.exe %1

Please note that the paths in this batch reflect my own installation: Delphi is on D: driver and common files on C: drive. You must adapt this to your own setup!

The batch is almost the same for X2, XE3, XE4 and XE5. Just change the version number form 12.0 for XE5 down to 9.0 for XE2.

Before XE2, the batch is a little bit different because there was no win64 compiler. The arts with win64 and bin64 must be removed. At some point in the past, Embarcadero directory was CodeGear and even before it was Borland. The executable file is bds.exe for most versions, but it was Delphi32.exe for Delphi 7 and earlier. All in all, just have a look at your path variable and reproduce what you see.


Follow me on Twitter
Follow me on LinkedIn
Follow me on Google+
Visit my website: http://www.overbyte.be

September 29, 2013

Delphi language for mobile development

Marco Cantù wrote a white paper about using the Delphi language for mobile development. Altough this has been written back in april 2013, it is really hot now that Delphi XE5 is out.

Android development is growing fast with Delphi XE5 and reading this white paper will help you write better code for the mobile platform. Delphi compiler for Android (and iOS by the way) is different than Delphi compiler for Windows and MAC. The new compiler is an ARM compiler based on LLVM. This has implications on the speed of some operations. The white paper will tell you what.

You can read the white paper here: http://embt.co/DelphiWP


Follow me on Twitter
Follow me on LinkedIn
Follow me on Google+
Visit my website: http://www.overbyte.be

August 20, 2013

Delphi XE5 to develop Android applications

Delphi XE5 is about to be announced. I have the chance to use a preview version for several weeks now. I’m very impressed!

Using Delphi XE5 I was able to write my first Android application and deploy it to my Nexus 7 in a couple of minutes. OK, for now it is a very basic application: I just took one of the predefined application templates, added a few buttons and labels, hit F9. After a few seconds, the application was compiled and deployed on my Nexus 7 connected to my PC with an USB cable. The application was up and running and I was able to debug it. Waouw!

As you know, I the author of the Internet Component Suite (aka ICS). ICS is about internet programming according to the asynchronous non-blocking programming model. I already started porting my code to Android.

Delphi XE5 is a native compiler for Android. It means Delphi XE5 compile into ARM machine language. It is neither Java nor running under a Java Virtual Machine (Renamed Dalvik on Android). No, Delphi XE5 produces native code which runs fast.

This will help me porting ICS to Android because Delphi XE5 gives me access to the underlying operating system which is… Linux! ICS is all about low level programming and I’m very happy about how it is done in XE5.

Of course XE5 comes with the famous FireMonkey framework (FMX) which covers a lot of thing. The most noticeable is the user interface. For ICS I don’t care about the user interface but of course most application using ICS do. They will simply use FMX. And guess what? FMX is cross platform: the same components (You know edits, labels and hundreds of UI components) can be used for Windows, Android, iOS and MAC OSx.

In the upcoming blog articles, I will enter in more details about Delphi XE5. Stay tuned!

Note: This article is based on a preview version (beta). Retail product may be different. I have been given special permission from Embarcadero to speak about XE5 despite the NDA covering the beta version.

Visit the official RAD Studio/Delphi Android page: http://embt.co/RADAndroid
Follow me on Twitter
Follow me on LinkedIn
Follow me on Google+
Visit my website: http://www.overbyte.be