Re: SystemRoot: XP vs VISTA



"Rob Kennedy" <me3@xxxxxxxxxxx> schreef in bericht
news:532atbF1ptm14U1@xxxxxxxxxxxxxxxxxxxxx

result := Reg.ReadString('');

Under XP this result in 'C:\WINDOWS\System32\hhctrl.ocx'
under Vista the same code results in
'%SystemRoot%\System32\hhctrl.ocx'

That registry key is stored with reference to an environment variable. Use
the ExpandEnvironmentStrings API function to replace the environment
variable with its actual value. Don't dig around in the registry any more
than you absolutely have to.

The registry has a data type for storing environment-variable-based
values. When you read from those keys, the OS is supposed to fill in the
actual value for you. Check (in regedit.exe) the type of the key you're
reading. Is it Reg_Expand_Sz, or just Reg_Sz? This is to determine whether
it's the OS that is using the wrong type, or Delphi that is ignoring that
type. You can't fix the former, but you can address the latter.


Thank you. ExpandEnvironmentStrings works.
Under XP, the data type is REG_SZ - 'C:\WINDOWS\System32\hhctrl.ocx'
Under Vista, it is REG_EXPAND_SZ - '%SystemRoot%\System32\hhctrl.ocx'

So, it should have been expanded. I do that now programmatically.
Tom


.



Relevant Pages

  • Re: Registering ActiveX control on Vista
    ... RegOverridePredefKey is actually working just fine on Vista. ... They normally extract the registry keys when creating the ... this is not related to Registry Virtualization. ...
    (microsoft.public.win32.programmer.ole)
  • Re: Forged mail addresses
    ... fully Vista compliant. ... If using XP is going to break our engineers, ... Companies should upgrade when it is in their interest to ... We're talking about the IT environment in which it is being employed. ...
    (rec.arts.anime.misc)
  • Re: Please help: MS Project 2007 Fresh Install first launch yields
    ... in regards to your registry keys... ... 3.Preparing to install ... Project 2003 into Vista Home Premium (have posted problem last June ... I tried Jim's suggestion on the mvps link, checking the memory FAQs,also ...
    (microsoft.public.project)
  • RE: Ensuring Disabling/Uninstalation of Windows XP Firewall in LA N enviro.
    ... Since the Group Policy editor is really just a fancy GUI for making registry ... Ensuring Disabling/Uninstalation of Windows XP Firewall in LAN ... Since this is not an AD environment as yet, ...
    (Focus-Microsoft)
  • Re: ActiveX create problem in Vista
    ... I don't care for all that extra BS on Vista either...but ... | 1) The Registry entries can be done "by hand". ... | this RegSvr script before using". ... | real solution is to just simply turn all that "security" off. ...
    (microsoft.public.vb.general.discussion)