Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Major Problem involving ActiveX controls

Status
Not open for further replies.

robotman757

Programmer
Jan 3, 2003
14
US
I know how to enable IE to allow ActiveX controls to run, but I am trying to determine if a user has these settings enabled. I have a web application for my company intranet, and I have to call a few activeX controls. However, I know that most people do not have these settings set, so I want to test if they are set, and if not run a page that displays how to turn them on. I thought I could read the registry from javascript, but I can't seem to locate any code for this. Thanks,

Dan
 
Maybe this will help get you started.

//check for RealPlayer

var plugInCounter;

for (plugInCounter = 0; plugInCounter < navigator.plugins.length; plugInCounter++)
{
if (navigator.plugins[plugInCounter].name.indexOf(&quot;Real Player&quot;) >= 0)
{
alert(&quot;RealPlayer is installed&quot;);
break;
}
}


//check for The Flash plug-in (checks for mime type and that it is enabled)

if (navigator.mimeTypes[&quot;application/x-shockwave-flash&quot;] && navigator.mimeTypes['application/x-shockwave-flash'].enabledPlugin)
{
window.location.replace(&quot;my_flash_enabled_page.htm&quot;);
}
else
{
window.location.replace(&quot;my_non_flash_page.htm&quot;);
}

//You will also want to use for browsers that have no plugins installed to handle errors:

<NOEMBED>
<H2>This page requires a browser that supports plug-ins</H2>
</NOEMBED>



There was a small discussion on active x controls at this thread. You may want to look at it.

thread216-601406

Best of luck,

Brian
 
Thanks for that information, but I am not trying to determine if they have a control, but if they can run the control based on their IE security settings. I want to know if it is possible to read the registry (not change it) via the web application, or find some other way of knowing that their settings are diabled. The settings are those like &quot;Download Unsigned ActiveX Controls&quot;, and &quot;Run ActiveX Controls Not Marked As Safe&quot;. We already allow the user to change the settings, but I want to check if they are enabled first.
 
Sorry for any misunderstanding. Did you see in the second example where it has a line to check if the control is enabled..

this line above:

...navigator.mimeTypes['application/x-shockwave-flash'].enabledPlugin)

If you know they have the control then perhaps just.

if (navigator.mimeTypes['application/x-shockwave-flash'].enabledPlugin)
{
// code to continue
}
else
{
// code to have them enable their plugin
}


As for reading the system registry, I believe that would create security issues. I sure wouldn't want anyone in my registry..

I once read where he who controls the registry controls the system, and to know or be able to read what is in there would merely be an initial phase of getting that control..

I could be wrong, and again sorry if I have mislead you..

Best of Luck,

Brian
 
Brian,

Thanks for your input. I resolved my issue a different way. On the window onload event for the default page, I used the following:

On Error Resume Next

Set test = CreateObject(&quot;WScript.Shell&quot;)

If Err.Number = 429 then
&quot;load the instruction page&quot;
End If

....This is really neat, because I can tell if they do not have the settings enabled, because error 429 is returned when the script can't execute. They will then be directed to a page with instructions on how to change the settings. This is a company intranet with no internet access, so these settings are allowed

Dan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top