summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkira Kakuto <kakuto@fuk.kindai.ac.jp>2018-04-06 21:07:13 +0000
committerAkira Kakuto <kakuto@fuk.kindai.ac.jp>2018-04-06 21:07:13 +0000
commitd7c8b684bf74098d2c8d51acfe3fd5c73816436b (patch)
tree8aafd11cdf12d7e97bc7f000b61b1b18a1dc6d19
parent60718ab3dc8b6e0bf3dc5e4a1cfd64e6c725d714 (diff)
introduce a new function to check Windows OS
git-svn-id: svn://tug.org/texlive/trunk@47327 c570f23f-e606-0410-a88d-b1316a301751
-rwxr-xr-xMaster/bin/win32/runscript.tlu31
1 files changed, 30 insertions, 1 deletions
diff --git a/Master/bin/win32/runscript.tlu b/Master/bin/win32/runscript.tlu
index 1c091ffc249..be85d060db5 100755
--- a/Master/bin/win32/runscript.tlu
+++ b/Master/bin/win32/runscript.tlu
@@ -264,6 +264,9 @@ local docstr = [[
use sys_user_progs instead, add kanji-config-updmap
2018/03/12
- introduce a new function gettexmfdist() for security.
+ 2018/04/06
+ - introduce a new function is_64bit_windows_os() to
+ check Windows OS.
]]
-- HELPER SUBROUTINES --
@@ -426,6 +429,28 @@ local function gettexmfdist()
return str
end
+--
+-- Is the Windows OS 64bit?
+--
+local function is_64bit_windows_os()
+ local return_val = false
+ -- 32 bit binaries always work, thus the default is false
+ local architecture = os.getenv('PROCESSOR_ARCHITECTURE')
+ if architecture ~= nil then
+ if architecture == 'x86' then
+ local is_wow64 = os.getenv('PROCESSOR_ARCHITEW6432')
+ if is_wow64 == nil then
+ return_val = false
+ else
+ return_val = true
+ end
+ else
+ return_val = true
+ end
+ end
+ return return_val
+end
+
-- MAIN_CHUNK -- encapsulated in a function for more robust execution with pcall
local function MAIN_CHUNK()
@@ -671,7 +696,11 @@ elseif contains(sys_user_progs, progname) then
elseif progname == 'asy' then
os.setenv('ASYMPTOTE_GS', GSEXE)
os.setenv('CYGWIN', 'nodosfilewarning')
- ARGV = {[0]=TEXDIR..'/tlpkg/asymptote/asy.exe', 'asy'}
+ if is_64bit_windows_os() then
+ ARGV = {[0]=TEXDIR..'/tlpkg/asymptote64/asy.exe', 'asy'}
+ else
+ ARGV = {[0]=TEXDIR..'/tlpkg/asymptote/asy.exe', 'asy'}
+ end
elseif progname == 'dviout' then
local fontsdir = kpse.var_value('TEXMFVAR') .. '/fonts'
if (lfs.attributes(fontsdir, 'mode') ~= 'directory') then