Export - HTML not working without server

Get help using Construct 2

Post » Wed Jan 30, 2013 6:45 am

Hi all,

I probably have a unique problem. I would like to use Construct to make programs that run on desktop computers as part of our existing win32 software. The export to exe presents problems including the size, 33-40MB for a simple program is excessive. Also the exe is not going to work as I need to read some data out of the registry, including the students Name, ID etc.

Then I thought I hit on a marvellous solution.

Create a an embedded chromium webpage within a win32 Delphi program and just open the html on the local machine. (The local machine does not have internet). This way I only need to include the embedded Chrome once and the HTML files are not so large.

The snag is that for some reason if you export a project to HTML files it need to be put onto a server. If I double click the index.html I get a message and black screen.

Can someone explain that requirement? Is it by design to limit use or is there a real reason for it?

Is there a work around that I could use?
B
31
S
8
G
5
Posts: 436
Reputation: 5,836

Post » Wed Jan 30, 2013 1:31 pm

Web pages don't work when run from disk due to security limitations in browsers. So you have to run them from a server. This is why Construct 2 also previews via a localhost server rather than just opening files on disk.

Maybe Construct 2 is not the right tool for the job - it's a game engine.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,580

Post » Wed Jan 30, 2013 6:19 pm

@Ashley

It certainly is the right tool for the job, construct 2 is brilliant and we are already using it for a online project. It is so right for the job that I want to use it in more ways, I may have to look at setting up a server within each centre that hosts the software.

thanks
B
31
S
8
G
5
Posts: 436
Reputation: 5,836

Post » Wed Jan 30, 2013 6:22 pm

I meant we currently have no support for things like reading out the registry or file I/O, so if you need other application-oriented features you might struggle with Construct 2.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,580

Post » Wed Jan 30, 2013 6:39 pm

Granted but there are ways I can send info from win32 app to webpage so I may look into it again at a later date when I am experienced with Construct.
B
31
S
8
G
5
Posts: 436
Reputation: 5,836

Post » Thu Jan 31, 2013 10:28 am

@czar : your win32 Delphi program doesn't need to use an embedded webkit, but an embedded webserver. That way, your user can access your page from their browser, and the win32 code can access I/O, registry, etc.
If you don't want the user to use its own browser, you can then integrate an embedded webkit next to the embedded browser.
Your browser will serve the page on http://localhost:The_port_you_want_to_use, and the embedded webkit will read http://localhost:The_port_you_want_to_use
B
33
S
9
G
6
Posts: 709
Reputation: 6,704

Post » Thu Jan 31, 2013 7:04 pm

@Pode

Good idea. I will investigate. You have got me thinking.

Loving this forum. Lots of people, lots of great ideas.
B
31
S
8
G
5
Posts: 436
Reputation: 5,836

Post » Sun Feb 17, 2013 7:36 pm

Just an update if anyone has a similar question/problem in the future.

I have used the Delphi source code from TinyWeb (http://www.ritlabs.com/en/products/tinyweb/) to set up my server and then I am using embedded Chrome to view my files. It looks like this will be a viable solution for me.
B
31
S
8
G
5
Posts: 436
Reputation: 5,836


Return to How do I....?

Who is online

Users browsing this forum: makkancs and 26 guests