CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Nov 2009
    Posts
    3

    OCX registration in Windows Vista failed

    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.

  2. #2
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: OCX registration in Windows Vista failed

    Quote Originally Posted by sroy150 View Post
    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.).

  3. #3
    Join Date
    Nov 2009
    Posts
    3

    Re: OCX registration in Windows Vista failed

    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.

  4. #4
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: OCX registration in Windows Vista failed

    Quote Originally Posted by sroy150 View Post
    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.

  5. #5
    Join Date
    Nov 2009
    Posts
    3

    Re: OCX registration in Windows Vista failed

    Thanks Ajay.

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

  6. #6
    Join Date
    Jun 2004
    Location
    NH
    Posts
    678

    Re: OCX registration in Windows Vista failed

    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!
    Last edited by TT(n); November 17th, 2009 at 05:33 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured