diff options
| author | Thijs Schreijer <thijs@thijsschreijer.nl> | 2013-10-07 23:00:25 +0200 |
|---|---|---|
| committer | Thijs Schreijer <thijs@thijsschreijer.nl> | 2013-10-07 23:00:25 +0200 |
| commit | 41a84a7f1fe0b62b2fbbb3fda992f586b6c43f9e (patch) | |
| tree | 2034e073700e5a0e4e61362dd09b46fcb5847ef0 | |
| parent | 83aa8df67ba691fe6ea334eba2bab82cb1a9cee4 (diff) | |
| download | luarocks-41a84a7f1fe0b62b2fbbb3fda992f586b6c43f9e.tar.gz luarocks-41a84a7f1fe0b62b2fbbb3fda992f586b6c43f9e.tar.bz2 luarocks-41a84a7f1fe0b62b2fbbb3fda992f586b6c43f9e.zip | |
modified architecture detection as per http://support.microsoft.com/kb/556009
| -rw-r--r-- | install.bat | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/install.bat b/install.bat index 7ece98bc..8d8b3e4c 100644 --- a/install.bat +++ b/install.bat | |||
| @@ -389,15 +389,22 @@ local function look_for_lua_install () | |||
| 389 | end | 389 | end |
| 390 | 390 | ||
| 391 | local function get_architecture() | 391 | local function get_architecture() |
| 392 | -- detect processor arch | 392 | -- detect processor arch |
| 393 | proc = io.popen([[.\bin\bin\uname -m]]):read("*l") | 393 | local tmpname = [[.\_architect_temp.txt]] |
| 394 | if proc:match("i[%d]86") then | 394 | local cmd = [[REG.exe Query HKLM\Hardware\Description\System\CentralProcessor\0 >"]]..tmpname.. [["]] |
| 395 | proc = "x86" | 395 | if not exec(cmd) then |
| 396 | elseif proc:match("amd64") or proc:match("x86_64") then | ||
| 397 | proc = "x86_64" | ||
| 398 | else | ||
| 399 | die("Could not detect processor architecture") | 396 | die("Could not detect processor architecture") |
| 400 | end | 397 | end |
| 398 | local f = io.open(tmpname, "r") | ||
| 399 | local proc = f:read('*a') | ||
| 400 | f:close() | ||
| 401 | os.remove(tmpname) | ||
| 402 | |||
| 403 | if proc:match("x86") then | ||
| 404 | proc = "x86" | ||
| 405 | else | ||
| 406 | proc = "x86_64" | ||
| 407 | end | ||
| 401 | return proc | 408 | return proc |
| 402 | end | 409 | end |
| 403 | 410 | ||
