Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
- - - - -

An .EXE file to launch a html page

HTML

  • Please log in to reply
4 replies to this topic

#1 warner

warner

    CC Lurker

  • Just Joined
  • Pip
  • 1 posts

Posted 18 November 2010 - 07:09 AM

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
  • 0

#2 Luthfi

Luthfi

    CC Leader

  • Expert Member
  • PipPipPipPipPipPipPip
  • 1320 posts
  • Programming Language:PHP, Delphi/Object Pascal, Pascal, Transact-SQL
  • Learning:C, Java, PHP

Posted 19 November 2010 - 10:00 AM

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.
  • 0

#3 Bujbuj

Bujbuj

    CC Devotee

  • Just Joined
  • PipPipPipPipPipPip
  • 435 posts
  • Programming Language:C
  • Learning:Java, C#, (Visual) Basic, JavaScript, Assembly

Posted 20 November 2010 - 01:24 AM

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 -

@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.
  • 0

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


#4 Luthfi

Luthfi

    CC Leader

  • Expert Member
  • PipPipPipPipPipPipPip
  • 1320 posts
  • Programming Language:PHP, Delphi/Object Pascal, Pascal, Transact-SQL
  • Learning:C, Java, PHP

Posted 20 November 2010 - 02:00 PM

^ He wants to launch the html from installation file, which is an exe file.
  • 0

#5 Bujbuj

Bujbuj

    CC Devotee

  • Just Joined
  • PipPipPipPipPipPip
  • 435 posts
  • Programming Language:C
  • Learning:Java, C#, (Visual) Basic, JavaScript, Assembly

Posted 20 November 2010 - 09:32 PM

Ooohhh... Then I can't really help anymore :)
  • 0

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






Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download