I'm trying to assign different versions of tools based on operating system, either 32 or 64bits. Things that normally works within windows like:
::32/64Bit Switch
ECHO %PROCESSOR_ARCHITECTURE%|FINDSTR AMD64>NUL && SET arch_var=AMD64 || SET arch_var=x86
ECHO %arch_var%>arch_var.txt
or simply
ECHO arch_var=%PROCESSOR_ARCHITECTURE% >EET\arch_var.txt
seems to return x86 instead of AMD64 when used in weidu with AT_NOW command. I could look for "Program Files (x86)" directory but it's not good enough evidence of anything as bad software can easily create this directory on a 32-bit machine.
Thanks in advance.
edit: I think this code is reliable and works within 32-bit weidu. %PROCESSOR_ARCHITEW6432% variable works correctly. Only %PROCESSOR_ARCHITECTURE% can't be used within 32-bit environment. Leaving the code here in case someone needs it too:
OUTER_SPRINT arch_var ~~
ACTION_IF ~%WEIDU_OS%~ STRING_EQUAL_CASE ~win32~ BEGIN
OUTER_SPRINT os_slash ~\~
OUTER_SPRINT exe ~.exe~
<<<<<<<< .../arch_var.bat
::32/64Bit Switch
ECHO %PROCESSOR_ARCHITEW6432%|FINDSTR AMD64>NUL && SET arch_var=AMD64 || SET arch_var=x86
ECHO %arch_var%>EET\arch_var.txt
>>>>>>>>
COPY ~.../arch_var.bat~ ~EET/arch_var.bat~
AT_NOW ~CALL EET\arch_var.bat~
COPY - ~EET/arch_var.txt~ ~EET~
REPLACE_EVALUATE CASE_INSENSITIVE ~AMD64~ BEGIN
SPRINT arch_var ~x86_64\~
PATCH_PRINT ~arch_var = %arch_var%~
END ~~
END ELSE BEGIN //osx and linux
OUTER_SPRINT os_slash ~/~
OUTER_SPRINT exe ~~
END
ACTION_FOR_EACH tool IN tile2ee tileconv BEGIN
OUTER_SPRINT EVAL ~%tool%~ ~EET%os_slash%bin%os_slash%%WEIDU_OS%%os_slash%%arch_var%%tool%%exe%~
PRINT ~%tool% path assigned to EET%os_slash%bin%os_slash%%WEIDU_OS%%os_slash%%arch_var%%tool%%exe%~
END