Ever imagine making a desktop application using PHP? or maybe Ruby on Rails? Try ASP, Coldfusion or whatever technology the web are made of today. Well I did, and I made a few myself this year and it works great! Why would I want to do that? Why not make one using current desktop technology like Visual Studio, Delphi, etc?
To answer that questions, let’s review the weakness of a desktop application: First of all, it’s Operating System specific. You can’t run a Windows application on Linux or Mac and vice versa. Second, It’s harder to maintain if it’s installed on numerous computer. Third, It’s rather hard to make and eye candy out of a desktop application (maybe this is just me, but there are tons of ugly Windows application out there..).
Ok, if you’re still reading this then I believe you are interested. Read on
Now now, what would we use to make this work? Let’s list the tool of the trade that I have used on my previous project
- PHP
- XAMPP (available for windows, mac and linux)
- Opera or SSB (Single Site Browser) like Mozilla Prism (Windows) or Fluid (Mac)
- A little understanding about batch file (windows), Applescript (Mac), or shell script (Linux)
And to make it short, I’ll just list the steps:
- Write your code like you are making a web app
- When you are done, install XAMPP on the computer you wish to install the program to
- Migrate the application to the installed XAMPP
- Make sure that it is accessible with the computer’s browser
- Put the XAMPP on the Startup Menu (or Login Items if you’re on Mac) so that it would run everytime the computer starts
- Install your preferred SSB or use Opera (Why opera?)
- Direct the homepage of the SSB or Opera to the web application’s address
- There you go, your very own desktop application
With general SSB application like Mozilla Prism or Fluid, you can change the Application Icon into something more appropriate. This way the user would never realize that it’s not a desktop app.
Ok, I know that it’s kind of like a cheat. But it works and it beats the hell out of learning another language! So what’s the catch? Here’s some:
- You can’t use an Desktop OS specific Action like drag and drop (but then again most Windows app doesn’t have a drag-and-drop feature)
- It would be rather big (the size in KB) since you are using xampp or maybe other instant web server
But look at the bright side:
- Copy and paste works
- Migrating would be a piece of cake, just copy the whole XAMPP folder!
- Making it look like a desktop app is easy with Ajax framework like ExtJS or others alike
So there you have it, I know you can make a more desktop-y looking app with Adobe Flash, AIR and Flex and there are great applications using it like Snitter (Twitter client) but I can’t code in AIR and not really interested in it at the moment, maybe later
Why Opera
Opera provide 2 features that I need for my project, it provides full screen and Kiosk Mode (user can’t go to another page or close opera without a password). This was needed because I made an touch screen interface application that users can interact independently. Moreover, opera provides an excellent command line options so that you can make your own setup with a batch file, change the icon so it would look like a program and can also put it to the Windows Start up menu so that it would run automatically when the computer starts.








August 20th, 2008 at 5:00 am
just use AIR
August 20th, 2008 at 8:42 am
haven’t got time to play with AIR yet
August 20th, 2008 at 4:50 pm
actually, I think the application it self is not that big is it? install xampp is a one time activity which can be use for other applications.. just think of it as shared libraries
August 20th, 2008 at 6:11 pm
Yup, assuming there are more than one application. But it would be considered big if the xampp is being used by 1 application only.
December 4th, 2008 at 4:52 pm
Well, this is absolutely fulfill
project requirementclient request.Thanks for sharing.