Jump to content

An .EXE file to launch a html page

- - - - -

  • Please log in to reply
4 replies to this topic

#1
warner

warner

    Newbie

  • Members
  • Pip
  • 1 posts
Folks,
I'm not a programmer but I have developed a project to deliver our companies literature on cd and install. Using third party programs, I have developed an Autorun cd that permits our customers to view our product literature as a PDF. This cd utilizes a html page for the navigational interface. I then created an installation version using Qsetup. This has worked fine for years but now due to Internet Explorers security, etc. I am running into some bugs with Windows 7.

I presently use Flash to create a "splash screen" with an actionscript in Flash that targets the html page. Export the flash as an .EXE and there is my executable to launch the html "Home page". The problem is that on some systems the flash is failing to run, hence the user cannot get to the homepage. Is there a way to create an .exe that will launch the html page in a browser? And if so, how? I have asked our IT department and they dragging their feet so I am at least trying to determine if this is possible and the best way to go about it.

I had the same issue with the cd version for it had a flash screen as well. I fixed that issue by writing a new autorun.inf file that targets the html page directly so no flash is needed. The installation version is my issue due to the fact the it has to be an .exe file to open the installed program.

Any help would be appreciated, thanks!
W

#2
LuthfiHakim

LuthfiHakim

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 763 posts
Sure it can. And in fact very easy. Make sure your exe imports windows api ShellExecuteA (if your compiler does not support unicode or you simply don't want unicode version) or ShellExecuteW (if you want unicode version). With that api you can launch the html page simply with a simple line (this sample is in Delphi/Pascal language):


ShellExecute(0, 'open', YourHtmlFilename, nil, nil, SW_MAXIMIZE);


That code will tell windows explorer to open YourHtmlFilename with default program associated with its extension, which usually default webbrowser for files with extension .html or .htm.

#3
AdvMutant

AdvMutant

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 438 posts
That's weird, why would you want to open an HTML file using an exe? If we're talking about Windows, you can use a batch file for that. Fire up notepad, and use the following template -

Quote

@echo off
<HTML file goes here>
exit
"@echo off" makes the process silent, so no lines(that you don't need) will be displayed. Just an empty command prompt.

At the second line, you simply write the location of your HTML file. Let's assume we want to launch foo.html - If it's at the same directory as the exe, just write "foo.html". If there's a folder at the exe's location that's named "docs", you'd write "docs\foo.html". If there's an html directory which contains foo.html inside docs, use "docs\html\foo.html". Or, if it's not in the same directory, just write the full path - for example, "C:\docs\html\foo.html". Well, you get the idea.

"exit" is(duh) to exit the command prompt.


Now, if you really really want it to be an exe, just make a bat file and use a bat to exe converter. You can even chose to create an 'Invincible Application" if you don't want an empty command prompt to flash. If you're like me, you might want to use this more advanced converter that enables some more advanced features, such as set an icon. It's not free, however. If you'll use the free version, the exe files are locked to the computer they were compiled on. In other words, you won't be able to run the exe files you created with it on any other computer but yours.
I'm correctly trying to figure out how to assign a custom icon to an iconless exe, I'll report back soon.

Posted Image
There is no problem that cannot be solved by the use of high explosives.


#4
LuthfiHakim

LuthfiHakim

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 763 posts
^ He wants to launch the html from installation file, which is an exe file.

#5
AdvMutant

AdvMutant

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 438 posts
Ooohhh... Then I can't really help anymore :)

Posted Image
There is no problem that cannot be solved by the use of high explosives.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users