Showing posts with label portable applications. Show all posts
Showing posts with label portable applications. Show all posts

Saturday, 4 April 2009

Portable Development - XAMPP Control Panel Issue

If anyone has used the PortableApps' tools and particularly the portable web development suite XAMPP from ApacheFriends, may have encountered the following issue.

On the PortableApps site there is a handy tool called "XAMPP Control Panel". It is really good except for one thing. Lets say you just installed the suite on your flash drive. You start the control panel from the PA menu and it initializes just fine. You do your work and go elsewhere. Then on another PC you start again the XAMPP Control Panel from your removable drive and you get this warning:
Current Directory: X:\xampp
Install Directory:
*** WARNING: Directory mismatch ***

or may be as reported here.

There are two things to be said:
  • First - as John T. Haller stated the problem should be solved in the 1.2 version of the XAMPP Launcher. Well I use the 1.3 version and I still experience this issue. While googling the web I stumbled upon this (see the post of Draven from 22. September 2007) funny but extremely easy solution. I say it's funny because it leads to the
  • Second thing to be noted - the XAMPP Control Panel is not a portable tool at all since it relies on hte Windows registry for storing its configuration data. This conclusion is made also in the PortableApps forum (the upper link).
For PCs you're in control this might be the right decision but in the rest of the cases you just might have to work without the XAMPP Control Panel.

Thursday, 3 April 2008

Portable Development - the JAVA trail

In the previous post most of the questions were only glanced at their surface. Some of the topics deserve more in depth exploration, which cannot be achieved in a single article. Despite that here we'll take one more fast look at the intersection between the PortableApps suite and two of the most powerful and widely used open source tools (IDEs) for JAVA development - NetBeans and eclipse.
I chose them not only because of their popularity but also because they are Platforms and represent two different approaches in creating a platform on which any other desktop application, rich with features can be built.
The glance here focuses on the possible ability of the IDEs to be made portable. As NetBeans is my favorite development tool of all. More articles concerning this one will be posted on its specialized blog.

The Environment
The first thing about development in any platform is preparing the environment - installing the tools involved in the development chain and eventually configuring them. In the JAVA case these are the Virtual Machine (JVM) - the interpreter of the byte code, the Compiler - the major development tool that translates the source code into the interpreted byte code, the documenting tool (javadoc.exe), the packaging tool (packager.exe) and lots of others complementary executables bound together into a JAVA Development Kit (JDK). The details on the ways of installing the Development Kit on portable device are available in this blog.
Once you have these tools detached from the host system, you have enough to simply start coding. In the PA Menu you may install Notepad++ Portable (it is an excellent editor for writing the code, which can be configured to act as a simple IDE for managing very small projects) and Command Prompt Portable (a console which can be configured according to your mobile environment). But even without them any system should provide such minimum tools. Whether you have enough privileges to change the environment variables is a different topic.

The Integrated Development Environments
Generally the eclipse IDE is easier because it has no installer, but the NetBeans' one is flexible enough to let you put it on the USB drive. So let's do it step by step.

*** eclipse ***
Download the ZIP archive of your preferred version from http://www.eclipse.org/downloads/.
Unzip it into the folder 'X:\PortableApps\'. Switch the drive letter to what's relevant for you.
The directory 'eclipse' is created there. Open the PA Menu and refresh it. Two new icons appear. Both of them start the IDE. The second one starts it in a console, so if you don't need this feature, just move the executable to some subfolder and refresh again.
If on the system where you set up your portable environment there is JRE or JDK installed already, if you run your newly imported eclipse, it finds the runtime environment and configures itself according to it.
That is nice of eclipse but is not very portable in our sense. In this case the first time you start the IDE on a system without JAVA, it will cry out for help, asking you to point to it where the JAVA is. So now we're gonna have to fix that.
What I normally would do in the past is to open the 'X:\PortableApps\eclipse\configuration\config.ini' file and change the value of the appropriate variable to point. These days situation is different. In the last version (europa or 3.3) overall configuration is made more sophisticated. Just open Window > Preferences... from the program menu and navigate to Java > Installed JREs and change the default location to point where you installed the JAVA SDK on your USB disk.
Now you're independent of the system specifics.

I'd like to mention here the Aptana Studio IDE. It is not meant for JAVA but is an ultimate Web development tool designed around coding in AJAX, Ruby (the 'On Rails' platform), PHP, etc. Part of its robustness is due to the fact that it is built on the eclipse platform. That's why it can be installed in the PA Menu exactly the same way as the eclipse IDE. And that is the reason I mention it.

*** NetBeans ***
Installing it is quite similar, but let's go through it anyway.
Run the installer you downloaded from http://download.netbeans.org/netbeans/6.0/final/ (the latest stable release) or http://download.netbeans.org/netbeans/6.1/beta/ (the beta of the interesting new version).
I recommend the full version of the installer. After all you may not install everything but it is good to have the rest at hand (just in case).
Customizing what to install is possible on the first 'page' of the wizard. For default just press 'Next'. Then accept the 'License Agreement' and continue to the next page which is the most important step. Here you define the point of install and the source of the runtime. In both cases point to the appropriate folders on your portable device. Here is an example:
Install at: 'X:\PortableApps\NetBeans 6.1 Beta'
Get runtime from: 'X:\tools\jdk1.6.0_03'
Press 'Next' and then 'Install'. Now wait a while for the process to finish. The full installation takes up to 500 MegaBytes on the drive, but that doesn't count the two servers: Apache Tomcat 6.0.14 (about 12 MB more) and the GlassFish v2 (with its additional 142 MB). They both by default are installed in 'C:\Program Files'. If you find it sensible may move them to a portable location and reconfigure them accordingly (me, I wouldn't do it).
After pressing 'Finish' and refresh the PA Menu only the 'uninstall.exe' of the application appears - exactly the one you don't need at the moment.
What you can do is simply to switch places of the two executables. Go to the 'X:\PortableApps\NetBeans 6.1 Beta\bin' directory and move upfolder the 'netbeans.exe' file while placing here the uninstaller. Refresh again the PA Menu and that's it.

Monday, 24 March 2008

Praise the Mobile Portability

Where in the technologies world the ability to store data and applications meets the possibility to use them just anywhere? The mobile disk devices of course. And when it comes to have one on an affordable price the first thing one can think of is the USB memory device.
They are produced in many shapes from many vendors and fast become bigger and bigger in storage space.
What's more important and interesting than what USB disks are is how can they be used.
Well just take a look at some sites: Pegtop, PortablePython or PortableApps.
Especially the last one!
It is a big one - an enormous impact on the world of mobile applications and the idea of carrying your digital personality with you everywhere. Even right now I'm writing this post using the portable version of Firefox (provided by PortableApps) while browsing the net. It is not just a set of solutions, it is a Platform.

The Applications Set
So if you decide to try it don't hesitate but download one of the three versions of the PortableApps suite. The menu is wonderful. It looks a bit familiar, because resembles the Windows' start menu (only placed on the right side of the screen). It also minimizes to the system tray where from it is accessible with a single click. One of the most useful features is its monitor of the free space available on the portable drive.
The applications available on the site are divided into categories and range from games and accessibility aids to "on the fly" development tools.

Development
Mentioning the latter group, the PHP web developers are given access to the robust solution XAMPP, which incorporates a database server (MySQL made portable - nice!), the programming language PHP (there is also an option to code in Perl) and the most popular free web server - Apache.
I'll leave the interesting tale of how to make some other development tools portable for another post, but I can not miss to mention the fine PortablePython platform, which includes the quite serious django web framework.
It is also possible for you to manage your projects if you are a C/C++|Java|Ruby developer - the powerful IDEs like NetBeans and eclipse are very easily made portable, and even accessible from the PA menu.

Extending beyond the PortableApps
Not only additional development tools can be added to the PA Suite, but any EXEcutable can be ported to the PA menu. You'll just have to place it properly on the USB drive - in the 'PortableApps' directory make another one for the application you will be accessing from the PA menu. Place your executable (and its supporting files - configurations, libraries, etc.) into that folder and you're almost done. Open the menu from the tray. From options choose 'Refresh App Icons' and an icon of your application should appear in the list on the left.
There are some drawbacks:
  • the *.exe file should be placed exactly into the newly created directory and nowhere else (shortcuts won't work);
  • and what's worse if there are other executables in the folder that you don't want to use (like uninstall.exe) they will show up in the menu. It looks ugly. So if you don't want them, you'll have to move them in a subfolder.
In my opinion such flaws are not so relevant. After all the PortableApps Suite is pretty self standardized and full of tools (just take a look at the bunch of apps available on their site - few things are missing and in time the list grows bigger). That's why it is so easy to make a regular (and not strictly tied to Windows internal libraries) application a portable one, available in the menu. It is enough to mimic the directory structure of the other portables. And if you're eager to investigate and experiment, you may also try some additional configurations (anything beyond that makes you a PortableApps.com Developer, right?).
In the near past I collected these little apps that work anywhere you place them and rarely are more than just an executable. These were small (mostly less than a MegaByte) and useful and sometimes very easy to lose them in the file system. Now finally they all found a home. And that home is everywhere where Windows lives.

Some portability beyond Windows
Well all this beauty cannot be accessed in Linux. Right?
Think again! I've used the PA Menu in Ubuntu Linux (with WINE installed of course). It is not as pretty as in the original case but it is useful after all. I haven't tried all the applications but at least the OpenOffice works :D Using the OpenOffice application from the PortableApps in Ubuntu or other Linux (if the distro comes with it) is generally stupid idea when you can use it natively - at least the performance will be better. But as long as portability is concerned, this is pretty much an achievement.
That's one of the aspects - even on Linux with WINE most of your portable Windows executables are useful.
The other aspect - did we all forget about JAVA? Yes, the predecessor of all this hype. The binaries that were expected to run even on toasters.
The thing is that the JAVA applications can not be ported in the PA Menu (at least not when there is no executable responsible for starting the JAR files). So what? They can be used after all. All the requirement is to have an appropriate JAVA Runtime Environment (or JRE) somewhere on the system. But wait! Although JAVA is very wide spread these days that doesn't make it omnipresent. And even if you find it on every system you poke your drive, how can you be sure that the version available will suffice? The answer to these questions is very simple - make your JAVA portable ;) Actually I made my USB drive a development environment for JAVA - I can execute, but also I can develop JAVA programs directly from the drive. That is very easy and is explained in some more details here.
And when we talk about JAVA the word everywhere is closest to the truth. On Linux and Windows I've used my "jarred" tools the same manner and they behave the same way.

So in this world of flexibility and unlimited possibilities for using applications and data all I can say is: Praise the portability and observe the horizon for the next generation.