Announcement

Collapse
No announcement yet.

ProgramFilesFolder64 not returning value as expected with Wow64 plugin

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • ProgramFilesFolder64 not returning value as expected with Wow64 plugin

    Since
    g_ProgramFiles64Folder = SessionVar.Expand("%ProgramFilesFolder64%");

    returns the x86 PFF, I would expect the following would get the correct PFF value on a 64 bit machine:
    Wow64.DisableFsRedirection();
    g_ProgramFiles64Folder = SessionVar.Expand("%ProgramFilesFolder64%");
    Wow64.RevertFsRedirection();
    iManageLog("PFF is: " .. g_ProgramFiles64Folder .. "\r\n");

    but I still see:
    [08/26/2020 10:55:13] PFF is: C:\Program Files (x86)

    any help on what is being done incorrectly?

  • #2
    In TrueUpdate, %ProgramFilesFolder64% is not defined in its current version (3.8.1.0), so you cannot use it as a built-in session variable.

    Instead, try this approach to get the folder, this should work:

    Code:
    if not System.Is64BitOS() then
        Dialog.Message("64-bit Program Files", "This is a 32-bit environment!");
    else
       sFolder = os.getenv("ProgramW6432");
       if (sFolder == nil) then
          sFolder = os.getenv("ProgramFiles");
       end
       if (sFolder == nil) then
          sFolder = Registry.GetValue(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion" , "ProgramFilesDir", false)
       end
    
       if (sFolder ~= "" and sFolder ~= nil) then
          Dialog.Message("64-bit Program Files", sFolder);
       else
          Dialog.Message("64-bit Program Files", "unable to retrieve");
       end
    end
    Click image for larger version  Name:	SCRN-2020-08-26-04.png Views:	1 Size:	1.5 KB ID:	305423

    Ulrich
    Last edited by Ulrich; 4 weeks ago.

    Comment

    Working...
    X