1

So I'm working on a just for fun project to get practice using HTML/CSS/Javascript.

I'm using Aptana to write all my code and it is currently set up to run and work in a browser (obviously) it's a text adventure game.

It would be really cool though to be able to compile the code into an executable file that runs in its own window, not in a browser.

Is this something relatively easy to accomplish?

Thanks in advance for any help! :)

2
  • What OS are you targeting? What you need is to create your own web browser, but that doesn't mean from scratch. If you are targeting Windows, you can easily write an application that includes the part of Internet Explorer that does all of the work for you. There's also Gecko and Webkit, but those are much more work to integrate. Commented May 20, 2013 at 0:40
  • First thought: AutoIt and InternetExplorerObject. Then you just have to open the Exe and voila, it will go with you. Commented May 20, 2013 at 0:41

3 Answers 3

1

FF and Chrome provide a function to run a custom website in an app mode. That means no menubars, no addressbar and a complete window for the website. Maybe this is already what you are looking for.

http://www.rarst.net/software/dedicated-web-app-window/

https://superuser.com/questions/33548/starting-google-chrome-in-application-mode

https://superuser.com/questions/171235/does-internet-explorer-have-something-equivalent-to-chromes-app-mode

But if you are interested in compiled code for speeding up your game, this is not the way to achieve this.

Sign up to request clarification or add additional context in comments.

Comments

1

For Windows as OS see http://www.autoitscript.com/autoit3/docs/libfunctions/_IECreateEmbedded.htm

AutoIt is a scripting language for basically everything (with automation). SciTE is the editor to go.

In the example of the _IECreateEmbedded function, just change:

_IENavigate($oIE, "http://www.autoitscript.com")

to

_IENavigate($oIE, "file://.../thegame.html")

Very simple, you just have to copy-paste it and build it - you can even build it Online: AutoIt Online Compiler

Comments

1

There are many different ways you can acheive this.

If you're only targeting windows machines, then creating a HTA would be the simplest approach.

The modification to the structure of your existing code would be minimal, its essentially changing the file type and adding an extra couple of tags in. If you wanted a single file, instead of an exe and any resources (images etc) that you use you would have to base64 encode your images, and insert external scripts into the main page.

for information about embedding images and icons into a hta: http://www.john-am.com/2010/07/building-a-self-contained-hta-with-embedded-images-and-icons/

You could also use AppJS, node-webkit or similar type projects, but they would add around 30MB of stuff thats not being used.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.