luvit / lit

Toolkit for developing, sharing, and running luvit/lua programs and libraries.
http://lit.luvit.io/
Apache License 2.0
245 stars 58 forks source link

get-lit.ps1 on Windows 32bit fails. #105

Closed rphillips closed 9 years ago

rphillips commented 9 years ago

This [1] needs some smarter detection: https://github.com/luvit/lit/blob/master/get-lit.ps1#L5

64bits:

C:> $ENV:PROCESSOR_ARCHITECTURE
IA64

32bits:

C:> $ENV:PROCESSOR_ARCHITECTURE
x86
kaustavha commented 9 years ago

Note: changing line 9 to "windows-ia32' solved this

creationix commented 9 years ago

So we can compare it with IA64 and use the 64-bit version in that case? I'm not quite sure how to do this in powershell.

rphillips commented 9 years ago

something like

if ($ENV:PROCESSOR_ARCHITECTURE -eq "IA64") {
  $LUVI_ARCH = "Windows-amd64"
}
elseif ($ENV:PROCESSOR_ARCHITECTURE -eq "x86") {
  $LUVI_ARCH = "Windows-ia32"
}
kaustavha commented 9 years ago

Or

if ([System.Environment]::Is64BitProcess) {
//Do 64-bit stuff
} else {
//Do 32-bit stuff
}

One should note both of these have pitfalls, if run in a 32 bit powershell. Ref for rphillips` code http://stackoverflow.com/questions/1738985/why-processor-architecture-always-returns-x86-instead-of-amd64