aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThijs Schreijer <thijs@thijsschreijer.nl>2015-06-20 14:46:36 +0200
committerThijs Schreijer <thijs@thijsschreijer.nl>2015-06-20 14:46:36 +0200
commita0315b7bc2432ea517bb90ce39df0cc8b1cd2f65 (patch)
tree95ae6c20b8dd18e7fcacbf7d163afa465175a971
parent84f886f401a6ae362357ff65d9ac58e8b6ebc37d (diff)
parentd5fa171ad16c7c454e6e2ee63e8ae396b6d64e7e (diff)
downloadluarocks-a0315b7bc2432ea517bb90ce39df0cc8b1cd2f65.tar.gz
luarocks-a0315b7bc2432ea517bb90ce39df0cc8b1cd2f65.tar.bz2
luarocks-a0315b7bc2432ea517bb90ce39df0cc8b1cd2f65.zip
Merge pull request #392 from Alloyed/patch-1
fix typo
-rw-r--r--install.bat18
1 files changed, 9 insertions, 9 deletions
diff --git a/install.bat b/install.bat
index d81a25a7..d83dfbf1 100644
--- a/install.bat
+++ b/install.bat
@@ -90,7 +90,7 @@ local function mkdir (dir)
90 return exec([[.\win32\tools\mkdir -p "]]..dir..[[" >NUL]]) 90 return exec([[.\win32\tools\mkdir -p "]]..dir..[[" >NUL]])
91end 91end
92 92
93-- does the current user have admin priviledges ( = elevated) 93-- does the current user have admin privileges ( = elevated)
94local function permission() 94local function permission()
95 return exec("net session >NUL 2>&1") -- fails if not admin 95 return exec("net session >NUL 2>&1") -- fails if not admin
96end 96end
@@ -175,7 +175,7 @@ Other options:
175/F Remove installation directory if it already exists. 175/F Remove installation directory if it already exists.
176/NOREG Do not load registry info to register '.rockspec' 176/NOREG Do not load registry info to register '.rockspec'
177 extension with LuaRocks commands (right-click). 177 extension with LuaRocks commands (right-click).
178/NOADMIN The installer requires admin priviledges. If not 178/NOADMIN The installer requires admin privileges. If not
179 available it will elevate a new process. Use this 179 available it will elevate a new process. Use this
180 switch to prevent elevation, but make sure the 180 switch to prevent elevation, but make sure the
181 destination paths are all accessible for the current 181 destination paths are all accessible for the current
@@ -550,12 +550,12 @@ check_flags()
550 550
551if not permission() then 551if not permission() then
552 if not NOADMIN then 552 if not NOADMIN then
553 -- must elevate the process with admin priviledges 553 -- must elevate the process with admin privileges
554 if not exec("PowerShell /? >NUL 2>&1") then 554 if not exec("PowerShell /? >NUL 2>&1") then
555 -- powershell is not available, so error out 555 -- powershell is not available, so error out
556 die("No administrative priviledges detected and cannot auto-elevate. Please run with admin priviledges or use the /NOADMIN switch") 556 die("No administrative privileges detected and cannot auto-elevate. Please run with admin privileges or use the /NOADMIN switch")
557 end 557 end
558 print("Need admin priviledges, now elevating a new process to continue installing...") 558 print("Need admin privileges, now elevating a new process to continue installing...")
559 local runner = os.getenv("TEMP").."\\".."LuaRocks_Installer.bat" 559 local runner = os.getenv("TEMP").."\\".."LuaRocks_Installer.bat"
560 local f = io.open(runner, "w") 560 local f = io.open(runner, "w")
561 f:write("@echo off\n") 561 f:write("@echo off\n")
@@ -567,13 +567,13 @@ if not permission() then
567 f:close() 567 f:close()
568 -- run the created temp batch file in elevated mode 568 -- run the created temp batch file in elevated mode
569 exec("PowerShell -Command (New-Object -com 'Shell.Application').ShellExecute('"..runner.."', '', '', 'runas')\n") 569 exec("PowerShell -Command (New-Object -com 'Shell.Application').ShellExecute('"..runner.."', '', '', 'runas')\n")
570 print("Now exiting unpriviledged installer") 570 print("Now exiting unprivileged installer")
571 os.exit() -- exit here, the newly created elevated process will do the installing 571 os.exit() -- exit here, the newly created elevated process will do the installing
572 else 572 else
573 print("Attempting to install without admin priviledges...") 573 print("Attempting to install without admin privileges...")
574 end 574 end
575else 575else
576 print("Admin priviledges available for installing") 576 print("Admin privileges available for installing")
577end 577end
578 578
579vars.PREFIX = vars.PREFIX or os.getenv("PROGRAMFILES")..[[\LuaRocks]] 579vars.PREFIX = vars.PREFIX or os.getenv("PROGRAMFILES")..[[\LuaRocks]]
@@ -755,7 +755,7 @@ ECHO ECHO Press any key to close this window... >> "%TMPFILE%"
755ECHO PAUSE ^> NUL >> "%TMPFILE%" 755ECHO PAUSE ^> NUL >> "%TMPFILE%"
756ECHO DEL "%TMPFILE%" >> "%TMPFILE%" 756ECHO DEL "%TMPFILE%" >> "%TMPFILE%"
757 757
758ECHO Now retrying as a priviledged user... 758ECHO Now retrying as a privileged user...
759PowerShell -Command (New-Object -com 'Shell.Application').ShellExecute('%TMPFILE%', '', '', 'runas') 759PowerShell -Command (New-Object -com 'Shell.Application').ShellExecute('%TMPFILE%', '', '', 'runas')
760 760
761:EXITLR 761:EXITLR