summaryrefslogtreecommitdiff
path: root/xmake/actions/update/main.lua
diff options
context:
space:
mode:
authorOpportunityLiu <[email protected]>2019-06-20 12:22:41 +0800
committerOpportunityLiu <[email protected]>2019-06-20 12:22:41 +0800
commita3229f788ef9b0b1695e5996fc682ac4d0ab016a (patch)
treebe21a7459b01780bbbb228f1f9816cba3d183331 /xmake/actions/update/main.lua
parentf36cd220cbf087247254b1f6700dd89c6b62428a (diff)
noamin
Diffstat (limited to 'xmake/actions/update/main.lua')
-rw-r--r--xmake/actions/update/main.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/xmake/actions/update/main.lua b/xmake/actions/update/main.lua
index ab17ef135..2ad5ac647 100644
--- a/xmake/actions/update/main.lua
+++ b/xmake/actions/update/main.lua
@@ -154,10 +154,14 @@ function _install(sourcedir)
if os.isfile(win_installer_name) then
-- /D sets the default installation directory ($INSTDIR), overriding InstallDir and InstallDirRegKey. It must be the last parameter used in the command line and must not contain any quotes, even if the path contains spaces. Only absolute paths are supported.
local params = ("/D=" .. os.programdir()):split("%s", { strict = true })
+ local testfile = path.join(os.programdir(), "temp-install")
+ local no_admin = os.trymv(path.join(os.programdir(), "scripts", "run.vbs"), testfile)
+ os.tryrm(testfile)
+ if no_admin then table.insert(params, 1, "/NOADMIN") end
if not option.get("verbose") then table.insert(params, 1, "/S") end
-- need UAC?
if winos:version():gt("winxp") then
- _run_win_v(win_installer_name, params, true)
+ _run_win_v(win_installer_name, params, not no_admin)
else
_run_win_v(win_installer_name, params, false)
end