5

Is there way to run web application as standalone desktop application? Could be web application written using PHP, MySQL and Apache converted to standalone application which meets following requirements:

1. Application should be called as http://myapp.localhost.
2. Application should have desktop icon which directly opens browser with application's URL.
3. Source code of web application should be hidden from users.
4. Installation for end user must be as easy as possible.

Now I do steps 1-2 using xampp and manually creating shortcut. I was interested in some wrapper, installer which do above steps automatically. But I have no idea about 3rd step.

torayeff
  • 9,296
  • 19
  • 69
  • 103
  • FWIW, there are other options for quick development. I am aware of both autohotkey.com and WinBatch.com (the first is free, the 2nd $500 for compiler version). I am a long-time winbatch user and absolutely swear by it. Quite easy to learn, and powerful. Amazing tech support via BBS and code repository. Numerous full-on apps written in it. Fast! development. Again, just FWIW. (See [AHKexample](http://www.autohotkey.com/board/topic/37699-tutorial-how-to-compile-ahk-files-include-your-own-icons/) and [WBexample](http://files.winbatch.com/wwwftp/IntroToProgramming/IntroToProgramming.zip)) – cssyphus Jan 14 '14 at 16:22
  • For installer, [look at NSIS](http://nsis.sourceforge.net/Main_Page) (written by the WinAmp people). It's amazing. Every bit as good as InstallShield, for free. – cssyphus Jan 14 '14 at 16:22
  • I think it'll be troublesome to achieve step 3. PHP is supposed to be server side, so there shouldn't be a lot of scramblers. And they can always be de-scrambled by those who'll try hard enough. And, any way, if it runs on client - client knows the code. Only way to truly hide the logic is client-server. That way only interface is exposed. – IceGlow Jan 15 '14 at 05:25

4 Answers4

1

Regarding item 3, see Can you "compile" PHP code?. This would allow you to develop in PHP and deploy the application via an installer.

There are several installer packages which would allow you to automate these steps, depending on your development environment.

Community
  • 1
  • 1
klugerama
  • 3,312
  • 19
  • 25
1

PHP and MySQL require to have a web server running. That means you will need to copy the code over to the client's machine and then run the web server locally still on the client's machine.

If that's what you want, look into the Microsoft IIS Express (here).

In short, IIS is a web server that can host and run a server side web application, written in ASP.NET or PHP.

Here are the steps you need to take:

  1. Install IIS express on the client's machine (one-time process, and I think quite acceptable - treat this as a runtime installation).
  2. Create a designated (hidden) folder for the source files of the web application that you want to deploy (one-time process).
  3. Create a windows batch file (bat or cmd) that starts the IIS (as described here) and then opens the website's URL so that the default browser starts. This file will serve as a shortcut, so you can place it on the desktop or wherever appropriate (one-time process).
  4. Deploy your web application to the hidden folder from step 2 above (repetitive process - deploy to the same folder when you want to upgrade the clients to a new version).

Please have in mind that I am basing my suggestion on your requirement to host and run the application locally (on localhost).

However, if there's an option to run the application on a separate machine (not a localhost), then you could simply place a desktop shortcut to the network or internet address URL that would open the default browser without problems.

Tengiz
  • 8,011
  • 30
  • 39
0

i would suggest Pouchdb http://pouchdb.com/api.html and Adobe Air http://www.adobe.com/devnet/air/air-sdk-download.edu.html. This way you can code with html and javascript and package it with Adobe Air.

tshenolo
  • 463
  • 2
  • 9
0

I'm afraid it's not that simple.

  1. If you want to use this approach (and I highly discourage it), you will have to deploy a webserver of some sorts on the client. You should be able to run the Apache/IIS Express and MySQL/SQLite executable and start a simple webserver and database.

  2. If you'd also like a icon, you can create an installer that creates this icon and points to the URL you wish.

  3. I'm afraid that's not possible. PHP is and always will be a scripting language. You might be able to obfuscate it somehow, but anyone who can download your application will be able to de-obfuscate it.

  4. Again, you can create an installer. Inno Setup is pretty good from what I've heard.

Michiel De Mey
  • 198
  • 2
  • 6