Missing PROGRAMDATA Environment Variable when Chrome invokes a 64 bit binary that is wrongly packaged with Platform = x86 in the wix file

kanish garg 0 Reputation points
2023-04-26T09:52:28.9966667+00:00

Hi everyone!

I have a query around the expansion of the %PROGRAMDATA% environment variable in a 64 bit binary mistakenly packaged with Platform = x86 in the wix file.

Context: Recently, when we released the binary to our customers via Omaha, because of some reason (unknown to us as of now), ExpandEnvironmentStringsA (windows api in our binary) wasn't able to expand the path containing the %PROGRAMDATA% environment variable, which caused multiple issues.

As per my understanding if a process A starts a child process B, environment variables for process A gets passed to process B. In our case, since binary is invoked only via Chrome Native Messaging, Chrome should had passed the %PROGRAMDATA% environment variable to the binary. 

Please note that, we identified a issue with the binary that we released. It was a 64 bit binary however the value of platform in the Wix file was set to x86. Afaik, PLATFORM field in the wix file (while packaging) decides the location of the installation i.e ProgramFiles(x86) or ProgramFiles. Basically it decides whether to use the Wow64 subsystem or not. So in our case, 64 bit binary was using windows Wow64 Subsystem, which indeed was not right, however want to understand how it could impact the value of %PROGRAMDATA% environment variable?

Thanks!

Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,523 questions
{count} votes