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: Anyone using Vista?
    ... problems with the fact that Vista comes with the UAC security ... Registry keys are also controlled by UAC... ... idea applies to C# assemblies for the desktop, ... Underpowered machines and antiquated hardware. ...
    (comp.lang.cobol)
  • Re: VFP Updates?
    ... I never said Vista was hacker proof, just that it's gotten much better than XP when it comes to protection against malware. ... The registry was designed for many reasons. ... Even tho, Tony, you can run most VFP portable, the regestry is important to the clean opperation of Windows. ... This is what gives any OS, including MAC OS what is called. ...
    (microsoft.public.fox.programmer.exchange)