RE: Programatically using Regsvr32

Author: Tracy Pearson

Posted: 2015-06-10 at 10:43:02

Dave Crozier wrote on 2015-06-10:

> Has anyone in this wonderful throng of people had any success using

regsvr32 to register an OCX programmatically in VFP.

>

> I have a routine that used to run brilliantly on XP but it just fails on

Win 7 despite giving the indication that all is OK. I am sure it is to do

with elevated permissions and UAC.

>

> The additional problem is also to decide whether to copy the OCX into the

Windows\System, or Windows\System32 or Windows\SYSWOW64 folder before

registering it as the OCX's required are held on a network share, but that

is just a nicety just to package the OXC installation up into a one off "if

it isn't there then install it" routine.

>

> I would ideally like to use only inbuilt VFP commends (DLL Calls etc) and

not have to shell out to the command window on both 32 and 64 bit operating

system versions.

>

> Thanks in anticipation.

> Dave

>

Dave,

I use small INNO install scripts to install these things. I launch them and

require administrative mode when it is required.

To test that I have the correct version of DLL/OCX, I look up Registry entry

HKEY_CLASSES_ROOT, which gives me the CLSID. I then search for the CLSID in

HKEY_CLASSES_ROOT\{guid}. Which gives me the path of the registered DLL/OCX

in the InProcServer32 key.

When the registry entry isn't found in HKEY_CLASSES_ROOT, I need to install.

When the version is less than the current version I have coded for, I need

to install.

I let the customer know with a messagebox that a process is about to install

updated runtimes to use the module they requested. They have the option to

cancel. After the installer returns, I check to see the DLL/OCX is the right

version. If it isn't, I don't let them into that module.

Tracy Pearson

PowerChurch Software

_______________________________________________

Post Messages to: ProFox@leafe.com

Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox

OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech

Searchable Archive: http://leafe.com/archives/search/profox

This message: http://leafe.com/archives/byMID/profox/000001d0a394$2357ac60$6a070520$@powerchurch.com

** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

©2015 Tracy Pearson