Hi,

I'm running VFP 9.0 and I've built my installation program using
Instalshield Express 5.0 and it works fine. But I'm wondering, when I
install the application it prompts for User Name and Company Name, is it
possible to retrieve that information from within my program? Not during
the installation but during normal application use. I tried sys(0) but that
returns the logged in user if I'm not mistaken. Now that I think about it,
the logged in user name would probably be a better way to go but I'm still
curious about the answer to my original question.

Thanks in advance,
Linn

Re: Reading user name by Rick

Rick
Tue May 23 20:20:06 CDT 2006

Linn,
This information is in the registry. The registry.PRG and .VCX work almost
exactly the same. (Just change SET PROCEDURE TO (m.lcRegfile) ADDITIVE to
SET CLASSLIB TO (m.lcRegfile) ADDITIVE, and RELEASE PROC (m.lcRegfile) to
RELEASE CLASSLIB (m.lcRegfile).)

Here is a simple usage where I get the registered user and company name:

STORE "" TO lcRegName, lcRegCompany
= get_syslicense(@lcRegName, @lcRegCompany)
...

* Program....: GET_SYSLICENSE.PRG
* Version....: 1.0
* Author.....: ** Richard G Bean **
* Date.......: April 2, 1999
* Compiler...: Visual FoxPro 05.00.00.0415 for Windows

PARAMETERS p_cRegName, p_cRegCompany
LOCAL lcRegfile, oReg

STORE "" TO p_cRegName, p_cRegCompany

m.lcRegfile = "REGISTRY"
SET PROCEDURE TO (m.lcRegfile) ADDITIVE
oReg = CreateObject("Registry")

oReg.GetRegKey("DefName",@p_cRegName,;
"Software\Microsoft\MS Setup (ACME)\User Info",oReg.nUserKey)
oReg.GetRegKey("DefCompany",@p_cRegCompany,;
"Software\Microsoft\MS Setup (ACME)\User Info",oReg.nUserKey)
RELEASE PROC (m.lcRegfile)

IF EMPTY(p_cRegName)
p_cRegName = "(Unknown)"
ENDIF && EMPTY(p_cRegName)
IF EMPTY(p_cRegCompany)
p_cRegCompany = "(Unknown)"
ENDIF && EMPTY(p_cRegCompany)

RETURN .T.

*!* EOP: GET_SYSLICENSE.PRG

Rick

"Linn Kubler" <lkubler@chartwellwisc2.com> wrote in message
news:ey12XhqfGHA.5096@TK2MSFTNGP02.phx.gbl...
> Hi,
>
> I'm running VFP 9.0 and I've built my installation program using
> Instalshield Express 5.0 and it works fine. But I'm wondering, when I
> install the application it prompts for User Name and Company Name, is it
> possible to retrieve that information from within my program? Not during
> the installation but during normal application use. I tried sys(0) but
> that returns the logged in user if I'm not mistaken. Now that I think
> about it, the logged in user name would probably be a better way to go but
> I'm still curious about the answer to my original question.
>
> Thanks in advance,
> Linn
>
>



Re: Reading user name by Linn

Linn
Wed May 24 13:55:14 CDT 2006

Great, thanks Rick I'll give it a try.
Linn

"Rick Bean" <rgbean@unrealmelange-inc.com> wrote in message
news:uMcayAtfGHA.4496@TK2MSFTNGP03.phx.gbl...
> Linn,
> This information is in the registry. The registry.PRG and .VCX work almost
> exactly the same. (Just change SET PROCEDURE TO (m.lcRegfile) ADDITIVE to
> SET CLASSLIB TO (m.lcRegfile) ADDITIVE, and RELEASE PROC (m.lcRegfile) to
> RELEASE CLASSLIB (m.lcRegfile).)
>
> Here is a simple usage where I get the registered user and company name:
>
> STORE "" TO lcRegName, lcRegCompany
> = get_syslicense(@lcRegName, @lcRegCompany)
> ...
>
> * Program....: GET_SYSLICENSE.PRG
> * Version....: 1.0
> * Author.....: ** Richard G Bean **
> * Date.......: April 2, 1999
> * Compiler...: Visual FoxPro 05.00.00.0415 for Windows
>
> PARAMETERS p_cRegName, p_cRegCompany
> LOCAL lcRegfile, oReg
>
> STORE "" TO p_cRegName, p_cRegCompany
>
> m.lcRegfile = "REGISTRY"
> SET PROCEDURE TO (m.lcRegfile) ADDITIVE
> oReg = CreateObject("Registry")
>
> oReg.GetRegKey("DefName",@p_cRegName,;
> "Software\Microsoft\MS Setup (ACME)\User Info",oReg.nUserKey)
> oReg.GetRegKey("DefCompany",@p_cRegCompany,;
> "Software\Microsoft\MS Setup (ACME)\User Info",oReg.nUserKey)
> RELEASE PROC (m.lcRegfile)
>
> IF EMPTY(p_cRegName)
> p_cRegName = "(Unknown)"
> ENDIF && EMPTY(p_cRegName)
> IF EMPTY(p_cRegCompany)
> p_cRegCompany = "(Unknown)"
> ENDIF && EMPTY(p_cRegCompany)
>
> RETURN .T.
>
> *!* EOP: GET_SYSLICENSE.PRG
>
> Rick
>
> "Linn Kubler" <lkubler@chartwellwisc2.com> wrote in message
> news:ey12XhqfGHA.5096@TK2MSFTNGP02.phx.gbl...
>> Hi,
>>
>> I'm running VFP 9.0 and I've built my installation program using
>> Instalshield Express 5.0 and it works fine. But I'm wondering, when I
>> install the application it prompts for User Name and Company Name, is it
>> possible to retrieve that information from within my program? Not during
>> the installation but during normal application use. I tried sys(0) but
>> that returns the logged in user if I'm not mistaken. Now that I think
>> about it, the logged in user name would probably be a better way to go
>> but I'm still curious about the answer to my original question.
>>
>> Thanks in advance,
>> Linn
>>
>>
>
>