How program can get it's prefix bit count
How program can get it's prefix bit count
How program that run in Wine can get if it's running in 64 or 32-bit prefix?
Re: How program can get it's prefix bit count
In the same way as the program will do in Windows.
There are several ways to do this. For example:
- check the %PROCESSOR_ARCHITECTURE% and/or %PROCESSOR_ARCHITEW6432% variabele
- check the registry key "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment"
- check kernel32.dll for IsWow64Process
There are several ways to do this. For example:
- check the %PROCESSOR_ARCHITECTURE% and/or %PROCESSOR_ARCHITEW6432% variabele
- check the registry key "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment"
- check kernel32.dll for IsWow64Process
Re: How program can get it's prefix bit count
Thank you!
Check GetEnvironmentVariable('PROCESSOR_ARCHITEW6432')='AMD64' works fine!
One more question - can program get Wine prefix name that is used to run it? I mean if program is located in prefix2 and run by prefix1 (i.e. WINEPREFIX=~\.prefix1 wine home/user/prefix2/drive_c/program) to check it and to show exception?
Check GetEnvironmentVariable('PROCESSOR_ARCHITEW6432')='AMD64' works fine!
One more question - can program get Wine prefix name that is used to run it? I mean if program is located in prefix2 and run by prefix1 (i.e. WINEPREFIX=~\.prefix1 wine home/user/prefix2/drive_c/program) to check it and to show exception?
Re: How program can get it's prefix bit count
To see if a prefix is 64 or 32 bit from another prefix, you can look in the system.reg file of the other prefix.
Code: Select all
WINEPREFIX=~/.prefix1 wine cmd /c "findstr /c:"#arch" Z:\\home\\user\\prefix2\\system.reg"
Re: How program can get it's prefix bit count
it looks like WINEPREFIX and other wine stuff are available in the windows environment, at least it's there when i checked by running 'set' in a wineconsolesfx09 wrote: ↑Fri Feb 17, 2023 3:17 am Thank you!
Check GetEnvironmentVariable('PROCESSOR_ARCHITEW6432')='AMD64' works fine!
One more question - can program get Wine prefix name that is used to run it? I mean if program is located in prefix2 and run by prefix1 (i.e. WINEPREFIX=~\.prefix1 wine home/user/prefix2/drive_c/program) to check it and to show exception?
(though it might be simpler, more appropriate, etc to use a file or unique id somewhere to do that sort of thing)