Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Launching HTML file at runtime


6 replies to this topic

Dyerald

Dyerald
  • Members
  • 43 posts

Posted 12 November 2001 - 10:08

Hi,

Im using ISDev7.0 and I have a custom dialog on my project that should lauch an HTML file when the user click a button on it. How can I do this??? Any idea???

Hope you could help me. Thanks in advance for any help =)

Dyerald


grahamm

grahamm
  • Members
  • 15 posts

Posted 12 November 2001 - 11:29

I have something similar where I want to launch a PDF file in acrobat reader (if the system has the reader installed). This is slightly different as I know the client program, whereas for an HTML file there could be different clients.

What I did was:

1. Have an AppSearch event looking for the acrobat reader (sets a property called ACROBATREADER)
2. Depending on certain conditions I set a RELEASENOTES property to the file I want to start
3. If the checkbox on the SetupCompleteSuccess dialog is checked then I run a Type 498 (Launch EXE, stored in the property table, don't wait, ignore return code, exec only once) with the Source attribute ACROBATREADER and the Target "[RELEASENOTES]"

You should be able to use this technique, searching for iexplore.exe, or you could replace the first section with something that reads the association for .html files if you want to launch Netscape.

Hope this helps
Graham


Dyerald

Dyerald
  • Members
  • 43 posts

Posted 13 November 2001 - 02:41

Thanks for your help Sir but I have one question... It this applicable to standard project??? My project is a starndard project. It looks like it applies to Basic MSI. I jst want to confirm =) Thanks again.

Dyerald


grahamm

grahamm
  • Members
  • 15 posts

Posted 13 November 2001 - 13:53

Yes this is a Basic MSI project but I thought the approach still held in a Standard project too. I can't say I've tried this though.

If not, the first point about the AppSearch event should still be useful to you to find the location of iexplore.exe, and then you should be able to use the InstallScript LaunchApp function using the resulting property.

In this situation it might be best to write some InstallScript code that checks the association of html files in the registry and launches the associated browser. Or you could go directly to the ShellExecute API call and let this do the work for you if you're familiar with API programming from InstallScript...

Graham


Perotin

Perotin
  • Full Members
  • 407 posts

Posted 14 November 2001 - 09:28

If you want to do it based on InstallScript, you can use the sample ShellOpen.
You just have to edit to event handling for the dialog and run the script when the button is pressed.

ObjectCentric

ObjectCentric
  • Members
  • 34 posts

Posted 15 November 2001 - 20:28

Greetings,
Did you want to launch the browser(If so in a separate process ?), or did you want to inject the html into your dialog?
For the browser issue I solved this problem by breaking it up into a few routines. I needed first to determine which browser they were using, so I locate this information by enumerating the browsers, (Opera, Netscape, IE) (and their version numbers)I am especially interested in they default browser, and we know how to do that. So once I find this I pass the value to its executable location, where as I mimic the control parameters and then just add a space and the UNC of the html file I wish to present. It should take you about 15 minutes to plot it out and 10 to write it out by hand using only InstallShield Scripting. I had mine writing to the RunOnce in the registry.... and it works great for whatever browser on whichever platform.
TIP: some OS' require that you have quotes around both sets of paths... else you may get a file not found return message from the browser.
Hope that helped...
-=OC

Dyerald

Dyerald
  • Members
  • 43 posts

Posted 20 November 2001 - 07:03

Hi ObjectCentric,

Thanks you so much for the idea, but I still dont know how to do it? What function will I use on the InstallScript? Did you use InstallScript or MSI functions? If its not too much for you.. can you give me an example???
Pls i really need help. Thanks so much in advance. =)

Dyerald