English 中文(简体)
How do you distribute an HTML/Javascript web app?
原标题:

I ve built a web page using HTML and Javascript that acts like a desktop app. I d like to distribute it to users in the methods they are most familiar with. For Windows users, I think this is an installable application or a "setup.exe" file.

My app, however, works perfectly in the browser. Specifically it can be opened in a javascript popup.

What is the best way to distribute this web app so that it can simply be "installed" on a windows machine? Maybe I use the open source Inno Setup tool to create a setup that somehow opens the browser. Will I need to write a small app that actually opens the browser?

问题回答

Best thing about HTML & Javascript apps is that they are OS independent. Sharing the app in a zipped file seems best to me. Why would you want to take extra trouble to make an executable for different OS?

If you are specifically looking to do it that way, you could try out cherrypy & pyinstaller. I had done a small app with them once.

Create an Inno Setup Project and add an entries to the [icon] section for creating start menu and/or desktop shortcuts. Set the filename parameter to the start page of your app (i.e. http://MyDomain.com/index.html) That way, when the user clicks on the shortcut, Windows automatically starts the standard browser and loads your start page.

There are two possible problems with this approach:

  1. If the user has Firefox, Opera or Chrome set as his standard browser, your app will be opened in this browser, not in IE. If your app needs to be cross browser compatible for this to work.

  2. If the user somehow has messed up his filetype association for html (which I once managed to do), the browser and therefore your app will not start at all.

If it will run on the HFS.exe file server, then you could package it with that.

I m the only guy that really answered this question. Nobody else tells you how to handle the web server that hosts the Javascript app, but I covered it.

Download Visual Studio Express, then build a form with a browser frame (i believe its a standard .net form element) in it, point this browser frame towards the files which are installed along with this program. VS 2008 will build an installer file for you so just add your html and javascript files to the project and then build the distribution using Visual Studio 2008.





相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

image changed but appears the same in browser

I m writing a php script to crop an image. The script overwrites the old image with the new one, but when I reload the page (which is supposed to pickup the new image) I still see the old one. ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签