Setting "Allow active content to run files on my computer" during setup?

Add-in Express™ Support Service
That's what is more important than anything else

Setting "Allow active content to run files on my computer" during setup?
 
christianbpedersen




Posts: 34
Joined: 2009-07-19
Hi!

I have a project containing a BHO. When clicking the command, it loads a page into the current tab. The BHO also performs various other activities.

The add-on is working pretty good, but most of our customers are having trouble getting it to run initially. The breaking point is the requirement for setting "Allow active content to run files on my computer". I assume I need this, as the code for the command is stored in a javascript file in the installation folder. Is that correct?

I have created a small VBscript that I run during the setup. It modifies the registry to set the "Allow active content to run files on my computer", but it's not always with the expected result. Especially with Windows 7 Enterprise running on a Windows 2003 Domain.

The following is my VBscript code:

set objShell = CreateObject("WScript.Shell")

objShell.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\Enable Browser Extensions","yes", "REG_SZ"
objShell.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_LOCALMACHINE_LOCKDOWN\iexplore.exe","00000000", "REG_DWORD"

Is there any good workaround for avoiding having to set this setting in Internet Explorer? Or is there a best-practice way for setting this setting automatically during setup?

I'm using Add-in Express 2010 Premium edition.

Best regards,
Christian2
Posted 06 Dec, 2010 08:17:29 Top
Eugene Astafiev


Guest


Hi Christian,

I assume I need this, as the code for the command is stored in a javascript file in the installation folder. Is that correct?


Yes, you are on the right avenue. Please note that you can use regular custom actions of the MSI installer to enable the "Allow active content to run files on my computer" setting programatically. Please read more about it in the http://msdn.microsoft.com/en-us/library/aa368066%28VS.85%29.aspx article in MSDN.
Posted 06 Dec, 2010 10:56:20 Top
christianbpedersen




Posts: 34
Joined: 2009-07-19
I'm already using a Custom Action to launch my VB script. Is there a better way to apply registry changes? I looked at the documentation on the link you included, but it doesn't seem to have anything specific to registry changes.

I'm trying to use the Registry Editor in VS.net 2005, but it doesn't seem to make any changes to the registry when installing.
Posted 06 Dec, 2010 17:18:21 Top
Eugene Astafiev


Guest


Hi Christian,

Please try to use an exe application at the custom actions stage. For more information about custom actions please have a look at the http://msdn.microsoft.com/en-us/library/aa372845%28v=VS.85%29.aspx.
Posted 07 Dec, 2010 04:10:15 Top
christianbpedersen




Posts: 34
Joined: 2009-07-19
Hi Eugene,

I've made a simple exe application, included it in my solution and setup project. But it doesn't seem to work. Do you have a code sample I can see?

It seems to me, that this is a bug in the setupproject generated by the add-in-express project wizard, as it fails to set the properties needed in the target system to make add-in-express work.

- Christian
Posted 08 Dec, 2010 07:20:30 Top
Eugene Astafiev


Guest


Hi Christian,

What properties does it fail to set? Did you try to debug?
Posted 08 Dec, 2010 07:46:32 Top
christianbpedersen




Posts: 34
Joined: 2009-07-19
It should enable "Allow active content to run files on my computer". I've been debugging for two days now. I can't make Windows 7 Enterprise (on a domain) get this setting set.
Posted 08 Dec, 2010 08:00:50 Top
christianbpedersen




Posts: 34
Joined: 2009-07-19
It seems that the following piece of code, either doesn't set the correct registry entry, or sets it for the administrator (since the setup is running with elevated rights)

registry = Registry.CurrentUser.OpenSubKey("Software\\Microsoft\\Internet Explorer\\Main\\FeatureControl\\FEATURE_LOCALMACHINE_LOCKDOWN", true);

registry.SetValue("iexplore.exe", 0);

Eugene, can you please explain why this setting is needed? Isn't that something people would usually want to disable?

- Christian
Posted 08 Dec, 2010 08:04:18 Top
christianbpedersen




Posts: 34
Joined: 2009-07-19
I ended up writing a executable that would traverse HKU and set the properties, as well as set the them on HKLM. That seems to work.

Thanks.
Posted 09 Dec, 2010 14:11:12 Top
Eugene Astafiev


Guest


Hi Christian,

Good news! You broke the ice! Good luck with your add-on project!
Posted 10 Dec, 2010 04:10:04 Top