Click to See Complete Forum and Search --> : OCX registration in Windows Vista failed


sroy150
November 9th, 2009, 10:51 AM
My application is not running in Vista due MSChrt20.ocx; This control is not distributed in Vista.
I tried to register this control programmatically but the problem is I can not run regsvr32 utility from my program. [ShellExecute(NULL, "open", "Regsvr32.exe", "MSCHRT20.OCX /s", "C:\\windows\\system32\\", SW_HIDE);]

As an alternate approach, I thought of creating all the registry entries for this control manually but again I am not able to create the registry entries programmatically.

Did anyone face similar problem. I would really appreciate if someone tell me how to fix this as this one is release stopper!!!!!


I found a work around, manual solution: create a command shell; run it as admi; run regsvr32
But I dont want users to carry out the same exercise.

Arjay
November 10th, 2009, 01:11 PM
I found a work around, manual solution: create a command shell; run it as admi; run regsvr32
But I dont want users to carry out the same exercise.Why not create an installer for your program? That way the user runs your installer (setup.exe) and your program gets installed correctly (folders created, files copied, controls registered, etc.).

sroy150
November 11th, 2009, 05:42 AM
Well, we do not provide the installer for our application. It's just an exe that runs in a flash memory. That's why this OCX is a resource in the application. If the system does not have this OCX, the application will install it from it's resource. In XP, it works but in Vista, due to security issue, regsvr32 fails.

Arjay
November 11th, 2009, 08:15 AM
Well, we do not provide the installer for our application. It's just an exe that runs in a flash memory. That's why this OCX is a resource in the application. If the system does not have this OCX, the application will install it from it's resource. In XP, it works but in Vista, due to security issue, regsvr32 fails.It's not a security issue. Starting in Vista, by default, programs are not run with administrator privileges even if the current user is an admin. It's the same for Windows 7 as well. You might consider using a newer control that is available on the system or create an installer.

sroy150
November 12th, 2009, 05:24 AM
Thanks Ajay.

Actually finding the newer control is a good option but that will require me to recode the entire logic.

TT(n)
November 17th, 2009, 04:31 AM
I use the WinExec API in vb with regsvr32 in the command line.
Although this may not help with security restrictions.

You might also try different verbs in the ShellExecute, ie null or runas.
Using runas, might give you the access needed to register it.

Oh, and try it without the silent /s parameter!