Set registry value with environment string on x64



I am trying to set a value of a registry key on x64 which contains the
environment string. The value looks like:



%ProgramFiles%\CompanyName\ProgramName.exe



My program is a 32bit application, when the value is set, WOW64
automatically changes the value to:



%ProgramFiles(x86)%\CompanyName\ProgramName.exe



I understand why WOW64 append (x86) to the string, but is there anyway to
disable the change? I want to do that because what I really want to write is
the original one and it should point to the 64 bit program files directory.



I am using RegSetValueEx and specify REG_EXPAND_SZ as type.



I tried disable the file system redirector and it has no effect with the
string written in registry.



Regards,

Dennis S


.



Relevant Pages

  • Re: Gradient Generator BMP Tool Improved
    ... "RegQueryValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal ... Private Sub cmdSysInfo_Click ... Open Registry Key ... > ending colors of a gradient. ...
    (comp.lang.basic.visual.misc)
  • Re: ColorMask BMP Mask Builder
    ... Const READ_CONTROL = &H20000 ... "RegQueryValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal ... Private Sub cmdSysInfo_Click ... Open Registry Key ...
    (comp.lang.basic.visual.misc)
  • Re: A Simple BMP Converter
    ... "RegQueryValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal ... Private Sub cmdSysInfo_Click ... Open Registry Key ... > color bar in the color display. ...
    (comp.lang.basic.visual.misc)
  • Re: Unable to properly set the InteractiveProcess property on a windows service
    ... Changing the registry key will only affect how the service control manager ... installer code looks like this... ... string serviceName,string displayName,string description, ... the InteractiveProcess property of the service is not set ...
    (microsoft.public.dotnet.languages.csharp)
  • Access to the registry key HKEY_CLASSES_ROOTEntSrvcTest1_direct.Global is denied
    ... using enterprise services from dot-net: ... Access to the registry key HKEY_CLASSES_ROOT\EntSrvcTest1_direct.Global is ... Microsoft.Win32.RegistryKey.Win32Error(Int32 errorCode, String str) +74 ... assembly, AssemblyRegistrationFlags flags) +258 ...
    (microsoft.public.dotnet.framework.aspnet.security)