Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Referencing details from Windows.


6 replies to this topic

Edmundo

Edmundo
  • Members
  • 26 posts

Posted 06 March 2001 - 16:23

Hi All,

Would anyone have an aswer for the following question, please?

Issue: I have an AskText box which asks the User to enter their company's name. The default for this AskText box is "Enter your company name here."

Question: Can I pick up the Company Name from windows?, (as I'm sure the User would have entered their company name here, when installing windows), so the default picks up this windows value instead of my default, "Enter your company name here.".

Thanks in advance,


Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 06 March 2001 - 17:39

Take a look at the SdRegisterUser dialog. It uses the following undocumented function, that you could call in your setup:

SdGetUserCompanyInfo(svName, svCompany)

Or you can read this information from registry (somewhere)


Torgui

Torgui
  • Members
  • 27 posts

Posted 07 March 2001 - 12:36

At least on Windows NT 4 you can find the company name from the registry value:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\\RegisteredOrganization



Edmundo

Edmundo
  • Members
  • 26 posts

Posted 07 March 2001 - 13:52

Hi All,

Thanks to Stefan and Torgui for their replies.

For those that are interested I went with Stefans suggestion of using the undocumented fuction, SdGetUserCompanyInfo( svName , svCompany );, this retrieved the Company Name form the registery. I then passed svCompany as the deafult parameter in my AskText box, which did the trick.

Thanks for the help lads, it's greatly appreciated.

P.S: Is there a list of these undocumented functions anywhere, that I can get my hands on?


Torgui

Torgui
  • Members
  • 27 posts

Posted 08 March 2001 - 09:20

Check SdInt.h in INCLUDE directory.

Btw. I checked the code for SdGetUserCompanyInfo function and it actually does this:
If(OS == WIN95)
// Get reg. value: HKLM\Software\Microsoft\Windows\CurrentVersion\\RegisteredOrganization
elseif (OS == WINNT)
//Get reg. value:
HKLM\Software\Microsoft\Windows NT\CurrentVersion\\RegisteredOrganization
else
  hUser = GetModuleHandle("USER");
  LoadString(hUser, 514, svName, 255);
  LoadString(hUser, 515, svCompany, 255);
  return TRUE;
endif;



Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 08 March 2001 - 09:24

These functions are documented in book "Bulletproof Installs" (see More Help -> Books for details)