如何分发 HTML/Javascript Web 应用程序?
我使用 HTML 和 Javascript 构建了一个网页,其行为类似于桌面应用程序。我想以用户最熟悉的方式分发给他们。对于 Windows 用户,我认为这是一个可安装的应用程序或“setup.exe”文件。
然而,我的应用程序在浏览器中运行得很好。具体来说,它可以在 JavaScript 弹出窗口中打开。
分发此 Web 应用程序以便可以简单地“安装”在 Windows 计算机上的最佳方法是什么?也许我使用开源 Inno Setup 工具来创建一个以某种方式打开浏览器的设置。我需要编写一个实际打开浏览器的小应用程序吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
关于 HTML 和 HTML 的最好的事情Javascript 应用程序的特点是它们独立于操作系统。在压缩文件中共享应用程序对我来说似乎是最好的。
为什么您要花费额外的精力来为不同的操作系统制作可执行文件?
如果您特别希望这样做,您可以尝试 cherrypy & pyinstaller。我曾经和他们一起做过一个小应用程序。
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.
创建一个 Inno Setup 项目并将条目添加到 [icon] 部分以创建开始菜单和/或桌面快捷方式。将文件名参数设置为应用程序的起始页(即
http://MyDomain.com/index.html
)这样,当用户单击快捷方式时,Windows 会自动启动标准浏览器并加载您的起始页。
这种方法可能存在两个问题:
如果用户将 Firefox、Opera 或 Chrome 设置为标准浏览器,您的应用程序将在此浏览器中打开,而不是在 IE 中打开。如果您的应用需要跨浏览器兼容才能正常工作。
如果用户以某种方式搞乱了他的 html 文件类型关联(我曾经设法做到过),则浏览器和您的应用程序将根本无法启动。
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:
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.
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.
如果它将在 HFS.exe 文件服务器上运行,那么您可以将其打包。
我是唯一真正回答这个问题的人。没有其他人告诉您如何处理托管 Javascript 应用程序的 Web 服务器,但我介绍了它。
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.
下载 Visual Studio Express,然后构建一个带有浏览器框架(我相信它是标准 .net 表单元素)的表单,将该浏览器框架指向与该程序一起安装的文件。 VS 2008 将为您构建一个安装程序文件,因此只需将 html 和 javascript 文件添加到项目中,然后使用 Visual Studio 2008 构建发行版即可。
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.
了解 Adobe Inc. 的 AIR 技术。
http://en.wikipedia.org/wiki/Adobe_Integrated_Runtime
这是你搜索的东西。
Read about AIR technology by Adobe Inc.
http://en.wikipedia.org/wiki/Adobe_Integrated_Runtime
It's a thing you search.