Solved

How can I register/unregister ActiveX controls without administrator privileges programatically?

Posted on 2007-12-03
3
1,415 Views
Last Modified: 2008-02-01
Our old C++/VFP application is setup to allow updating of the individual modules programmatically upon startup.  Some of these modules are ActiveX controls and the process works by calling DllUnregisterServer, replacing the ActiveX control and then calling DllRegisterServer entry points within each DLL.    The initial install works fine upon initial install and  registers the new files.  (even under Vista)

On subsequent updates to these modules however, Vista now brings up the annoying dialog requesting "elevation" for permission and will not update these files.   If I have the user run as Administrator, then none of these problems exist but the application now does not recognize some of the other ActiveX controls and returns a "Class not Registered" error when accessing them.  

So it appears as if I have no good alternative.... so any suggestions you have would be helpful.

Gregg Peele
0
Comment
Question by:GreggPeele
3 Comments
 

Author Comment

by:GreggPeele
ID: 20404984
I think I've solve this issue after much research..  Hopefully it will help others that are attempting to accomplish this...

 

1. The programs that actually registers/unregisters the files can be elevated by using ShellExecuteEx instead of CreateProcess.  Using "runas" as the verb causes the use to be able to allow or reject execution at the elevated status.  This avoids the elevation error.  The following link supplied the way to do this with ShellExecute. I just modified it to use ShellExecuteEx.

 

http://weblogs.asp.net/kennykerr/archive/2006/09/29/Windows-Vista-for-Developers-_1320_-Part-4-_1320_-User-Account-Control.aspx

 

2. It was important that the execution of the program finish before continuing to the next line of code.   Using ShellExecuteEx provides a processID that can be used by WaitforSingleObject to wait for the process to complete before continuing.

 

Note that the user must still approve the escalation but at least it is possible to continue successfully.  

 

Gregg
0
 
LVL 1

Accepted Solution

by:
Computer101 earned 0 total points
ID: 20560253
PAQed with points refunded (500)

Computer101
EE Admin
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many people tend to confuse the function of a virus with the one of adware, this misunderstanding of the basic of what each software is and how it operates causes users and organizations to take the wrong security measures that would protect them ag…
Windows 7 does not have the best desktop search built in. This is something Windows 7 users have struggled with. You type something in, and your search results don’t always match what you are looking for, or it doesn’t actually work at all. There ar…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question