IE Addin not loading due to UAC

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

IE Addin not loading due to UAC
 
michaelyim




Posts: 5
Joined: 2010-05-26
I am running the following:
-Windows Vista with SP2
-Visual Studio 2005
-Addin Express for IE 2010
-Internet Explorer 8

To recreate the problem,

1. Create new ADX IE add-on project with all default settings
2. Add one context menu item
3. Build program
4. Create setup project
5. Install setup

Note: If Setup is run with UAC On, IE addon does not load. After turning UAC off, it loads fine. But if setup is run with UAC off, even after turning UAC back on, the IE addon loads properly. So this is most likely due to the deployment project.
Posted 26 May, 2010 23:28:35 Top
Sergey Grischenko


Add-in Express team


Posts: 7202
Joined: 2004-07-05
Hello.

Please run the setup.exe file to install the add-on if UAC is turned on. Also you should have administrative privileges on the PC.
Posted 27 May, 2010 04:42:17 Top
michaelyim




Posts: 5
Joined: 2010-05-26
Thanks, that worked! For some reason, UAC elevation did prompt me when installing with just the .msi file but it still runs into problems. However, forcing the deployment project to produce a Setup.exe and running that works fine.
Posted 27 May, 2010 10:35:00 Top
Sergey Grischenko


Add-in Express team


Posts: 7202
Joined: 2004-07-05
Ok, please let me know if you face any other difficulties.
Posted 27 May, 2010 11:21:28 Top
michaelyim




Posts: 5
Joined: 2010-05-26
On second look, it is still having UAC issues. The addin loads properly, but does not run in admin mode and does not prompt for UAC elevation either. My application uses NamedPipes and it seems like admin status is required.

I tried to include a manifest file to induce the UAC elevation prompt but when I compile it, i get the following warning:

Warning 1 C:\Users\user\Desktop\Xnippet\Xnippet\bin\Release\Xnippet.dll is a strong-name signed assembly and embedding a manifest invalidates the signature. You will need to re-sign this file to make it a valid assembly. C:\Users\user\Desktop\Xnippet\Xnippet\mt.exe Xnippet

And then compiling the setup project fails due to this problem. How do I re-sign the assembly? Assuming I can do that, would the addin properly prompt for UAC elevation at run time?

Thanks
Posted 27 May, 2010 18:26:58 Top
michaelyim




Posts: 5
Joined: 2010-05-26
Some updates. I re-assigned the dll by running:

sn.exe -R Xnippet.dll Xnippet.snk

It then told me that it has successfully re-signed it. I compiled the setup project successfully. I then installed the addin but it did not prompt for UAC elevation and just failed when the addin attempt to write a file to C:\Program Files

Here is my manifest file:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:s chemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity version="1.0.0.0"
processorArchitecture="X86"
name="IsUserAdmin"
type="win32"/>
<description>Description of your application</description>
<!-- Identify the application security requirements. -->
<trustInfo xmlns="urn:s chemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges>
<requestedExecutionLevel
level="requireAdministrator"
uiAccess="false"/>
</requestedPrivileges>
</security>
</trustInfo>
</assembly>


This manifest file has worked before for other projects of mine which are not IE addins.
Posted 27 May, 2010 18:46:27 Top
Sergey Grischenko


Add-in Express team


Posts: 7202
Joined: 2004-07-05
Hello.

To change any files in the C:\Program Files folder you need to disable the Protected mode in IE.
Please read the following article: http://www.codeproject.com/KB/vista-security/PMSurvivalGuide.aspx
Posted 28 May, 2010 09:06:15 Top