Index
2015-06-10 08:16Dave Crozier : Programatically using Regsvr32
2015-06-10 08:43Rafael Copquin : Re: Programatically using Regsvr32
2015-06-10 08:56Allen : RE: Programatically using Regsvr32
2015-06-10 09:00Mike Copeland : Re: Programatically using Regsvr32
2015-06-10 10:43Tracy Pearson : RE: Programatically using Regsvr32
2015-06-10 11:07Ted Roche : Re: Programatically using Regsvr32
2015-06-10 11:12Dave Crozier : RE: Programatically using Regsvr32
2015-06-10 11:24Mike Copeland : Re: Programatically using Regsvr32
2015-06-10 11:31Tracy Pearson : RE: Programatically using Regsvr32
2015-06-11 05:49Gianni Turri : Re: Programatically using Regsvr32
Back to top
Programatically using Regsvr32

Author: Dave Crozier

Posted: 2015-06-10 08:16:06   Link

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

--- StripMime Report -- processed MIME parts ---

multipart/alternative

text/plain (text body -- kept)

text/html

---

_______________________________________________

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/18725B8CD2D5D247873A2BAF401D4AB25975145A@EX2010-A-FPL.FPL.LOCAL

** 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 Dave Crozier
Back to top
Re: Programatically using Regsvr32

Author: Rafael Copquin

Posted: 2015-06-10 08:43:41   Link

I don't know about using it programmatically. However, I found that the

only way to use regserver32 to install an ocx in windows 7 is to open a

dos window as an administrator and run it from there.

And get rid of the uac! We are big boys and know how to do things. We

don't need Microsoft to "protect" us with the uac, at least not me !! A

good antivirus software like Kaspersky plus a password in your router is

all you need

Rafael Copquin

El 10/06/2015 a las 10:16, Dave Crozier escribió:

> 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

>

>

>

>

> --- StripMime Report -- processed MIME parts ---

> multipart/alternative

> text/plain (text body -- kept)

> text/html

> ---

>

[excessive quoting removed by server]

_______________________________________________

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/55783F0D.8090509@yahoo.com.ar

** 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 Rafael Copquin
Back to top
RE: Programatically using Regsvr32

Author: Allen

Posted: 2015-06-10 08:56:00   Link

I think turning the UAC off will not help an install. Some do and some

don't. If you are running from a exe or app maybe LogonUser in AdvApi32

might do it.

Al

-----Original Message-----

From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of Rafael

Copquin

Sent: 10 June 2015 15:44

To: profoxtech@leafe.com

Subject: Re: Programatically using Regsvr32

I don't know about using it programmatically. However, I found that the

only way to use regserver32 to install an ocx in windows 7 is to open a

dos window as an administrator and run it from there.

And get rid of the uac! We are big boys and know how to do things. We

don't need Microsoft to "protect" us with the uac, at least not me !! A

good antivirus software like Kaspersky plus a password in your router is

all you need

Rafael Copquin

_______________________________________________

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/004b01d0a385$2f853020$8e8f9060$@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 Allen
Back to top
Re: Programatically using Regsvr32

Author: Mike Copeland

Posted: 2015-06-10 09:00:08   Link

Try this...

lcFullPath = 'c:\subdir\some.ocx'

DECLARE INTEGER DllRegisterServer IN (lcfullpath) AS DllRegisterServer

IF dllregisterserver()<>0

* Failed! Probably bad path

ELSE

* Success!

ENDIF

Mike Copeland

Dave Crozier wrote:

> 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

>

>

>

>

> --- StripMime Report -- processed MIME parts ---

> multipart/alternative

> text/plain (text body -- kept)

> text/html

> ---

>

[excessive quoting removed by server]

_______________________________________________

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/557842E8.4070506@ggisoft.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 Mike Copeland
Back to top
RE: Programatically using Regsvr32

Author: Tracy Pearson

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

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
Back to top
Re: Programatically using Regsvr32

Author: Ted Roche

Posted: 2015-06-10 11:07:25   Link

On Wed, Jun 10, 2015 at 9:16 AM, Dave Crozier <DaveC@flexipol.co.uk> wrote:

> Has anyone in this wonderful throng of people had any success using regsvr32 to register an OCX programmatically in VFP.

>

Dave:

Isn't this more an installation issue? Aren't you trying to copy,

install, and register an ActiveX control on a new machine? Why not

just whip up a small InnoSetup package and have the users run it,

click "Next" and done?

--

Ted Roche

Ted Roche & Associates, LLC

http://www.tedroche.com

_______________________________________________

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/CACW6n4s8dzpRvYKGTiY9D-rjjkg8fiZqzmy+DxJ=uF7S05oq9w@mail.gmail.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 Ted Roche
Back to top
RE: Programatically using Regsvr32

Author: Dave Crozier

Posted: 2015-06-10 11:12:14   Link

Ted,

If all else fails then I may set up an Inno package and fork out to run it if the OCX throws an error.

Meanwhile I will investigate Mike's solution which looks promising.

Dave

-----Original Message-----

From: ProFox [mailto:profox-bounces@leafe.com] On Behalf Of Ted Roche

Sent: 10 June 2015 17:07

To: profox@leafe.com

Subject: Re: Programatically using Regsvr32

On Wed, Jun 10, 2015 at 9:16 AM, Dave Crozier <DaveC@flexipol.co.uk> wrote:

> Has anyone in this wonderful throng of people had any success using regsvr32 to register an OCX programmatically in VFP.

>

Dave:

Isn't this more an installation issue? Aren't you trying to copy, install, and register an ActiveX control on a new machine? Why not just whip up a small InnoSetup package and have the users run it, click "Next" and done?

--

Ted Roche

Ted Roche & Associates, LLC

http://www.tedroche.com

[excessive quoting removed by server]

_______________________________________________

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/18725B8CD2D5D247873A2BAF401D4AB2597515D6@EX2010-A-FPL.FPL.LOCAL

** 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 Dave Crozier
Back to top
Re: Programatically using Regsvr32

Author: Mike Copeland

Posted: 2015-06-10 11:24:25   Link

Dave

There's additional info about DllRegisterServer on Fox.wikis.com and

several other fox-centric websites.

One caveat...I have not used that code on Windows 7 (and therefore with

UAC.) It wouldn't surprise me if there was a need for admin level clearance.

It worked very well with WinXP. I had a routine that, during program

startup, determined if several OCXs were registered. If not, it

registered them.

Mike

Dave Crozier wrote:

> Ted,

> If all else fails then I may set up an Inno package and fork out to run it if the OCX throws an error.

>

> Meanwhile I will investigate Mike's solution which looks promising.

>

> Dave

>

> -----Original Message-----

> From: ProFox [mailto:profox-bounces@leafe.com] On Behalf Of Ted Roche

> Sent: 10 June 2015 17:07

> To: profox@leafe.com

> Subject: Re: Programatically using Regsvr32

>

> On Wed, Jun 10, 2015 at 9:16 AM, Dave Crozier <DaveC@flexipol.co.uk> wrote:

>> Has anyone in this wonderful throng of people had any success using regsvr32 to register an OCX programmatically in VFP.

>>

> Dave:

>

> Isn't this more an installation issue? Aren't you trying to copy, install, and register an ActiveX control on a new machine? Why not just whip up a small InnoSetup package and have the users run it, click "Next" and done?

>

>

> --

> Ted Roche

> Ted Roche & Associates, LLC

> http://www.tedroche.com

>

[excessive quoting removed by server]

_______________________________________________

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/557864B9.1040609@ggisoft.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 Mike Copeland
Back to top
RE: Programatically using Regsvr32

Author: Tracy Pearson

Posted: 2015-06-10 11:31:07   Link

Mike Copeland wrote on 2015-06-10:

> Dave

>

> There's additional info about DllRegisterServer on Fox.wikis.com and

> several other fox-centric websites.

>

> One caveat...I have not used that code on Windows 7 (and therefore with

> UAC.) It wouldn't surprise me if there was a need for admin level

clearance.

>

> It worked very well with WinXP. I had a routine that, during program

> startup, determined if several OCXs were registered. If not, it

> registered them.

>

> Mike

>

It is because of UAC that I went with the INNO scripts to complete my

installs.

One could, when the Manifest entry is set correctly, get administrative

access after the process started. Once you have that level in that runtime,

you keep that level. This could be seen as a security risk.

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/000301d0a39a$daedc110$90c94330$@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
Back to top
Re: Programatically using Regsvr32

Author: Gianni Turri

Posted: 2015-06-11 05:49:04   Link

Hi Dave,

I manage the ocx registration in this way.

In attach three files:

- Register_calendar_ocx.prg

a sample that show how to do

- Util.prg

Create a project with only this program and create Util.exe needed to Register.prg

- Register.prg

The registration routine

* register / unregister EXE, DLL, OCX

* uses ShellExecute with "runas" starting from Windows Vista

* m.pp_file Character: file to register / unregister

* avoid SUBSTed path that may not exist when using "runas" Administrator

* m.unreg Logical: unregister, default .f.

* m.verbose Logical: verbose, default .f.

* m.dir Character: run directory, default current directory

When needed UAC ask for authorization.

Tested also on Windows 8.1.

HTH,

Gianni

On Wed, 10 Jun 2015 13:16:06 +0000, Dave Crozier <DaveC@Flexipol.co.uk> wrote:

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

--- StripMime Report -- processed MIME parts ---

multipart/mixed

text/plain (text body -- kept)

application/octet-stream

application/octet-stream

application/octet-stream

---

_______________________________________________

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/fgoinaprga1oqeaed6vr64avol4pkee54p@4ax.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 Gianni Turri