Mercurial > utils
changeset 451:43932e6d0d46
Take more sprcific name for utils to avoid name conflicts. Added install target.
author | Oleksandr Gavenko <gavenkoa@gmail.com> |
---|---|
date | Fri, 04 Nov 2011 10:41:55 +0200 |
parents | 7962e2c07d45 |
children | 5cf2a46e4205 |
files | win/uac/Makefile win/uac/fixuac.bat win/uac/fixuac.js win/uac/uac.bat win/uac/uac.js |
diffstat | 5 files changed, 68 insertions(+), 19 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/win/uac/Makefile Fri Nov 04 10:41:55 2011 +0200 @@ -0,0 +1,49 @@ +SHELL = /bin/sh + +# Disable built in pattern rules. +MAKEFLAGS += -r +# Disable built in variables. +MAKEFLAGS += -R +# Disable built in suffix rules. +.SUFFIXES: +# Default target. +.DEFAULT_GOAL = all + +host_os = unix +ifneq '' '$(COMSPEC)' + host_os = cygwin +endif + +ifeq '' '$(prefix)' + ifneq '' '$(HOME)' + prefix = $(HOME)/usr + else + $(error HOME env var and prefix var are not set!) + endif +endif + +bindir = $(prefix)/bin + +.PHONY: all +all: + +.PHONY: install +install: +ifeq 'cygwin' '$(host_os)' + install -m 666 fixuac.bat $(bindir) + install -m 666 fixuac.js $(bindir) +endif + +.PHONY: uninstall +uninstall: +ifeq 'windows' '$(host_os)' + @echo "Uninstall currently does not supported." + exit 1 +endif + +.PHONY: distclean +distclean: clean + +.PHONY: clean +clean: +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/win/uac/fixuac.bat Fri Nov 04 10:41:55 2011 +0200 @@ -0,0 +1,6 @@ +cd "%*" + +takeown /r /f "%*" +icacls "%*" /grant:r *S-1-1-0:(f) /t /c + +pause
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/win/uac/fixuac.js Fri Nov 04 10:41:55 2011 +0200 @@ -0,0 +1,13 @@ +// To run invoke: cscript uac.js + +// http://sites.google.com/site/eneerge/home/BatchGotAdmin + +var fso = new ActiveXObject("Scripting.FileSystemObject"); +var curdir = fso.GetParentFolderName(WScript.ScriptFullName); + +var objShell = new ActiveXObject("shell.application"); +// http://msdn.microsoft.com/en-us/library/windows/desktop/gg537745.aspx +// Shell.ShellExecute method +// iRetVal = Shell.ShellExecute( sFile, [ vArguments ], [ vDirectory ], [ vOperation ], [ vShow ] ) +// If (vShow==1) open the application with a normal window. +objShell.ShellExecute("fixuac.bat", curdir, "", "runas", 1);
--- a/win/uac/uac.bat Thu Nov 03 19:35:16 2011 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,6 +0,0 @@ -cd "%*" - -takeown /r /f "%*" -icacls "%*" /grant:r *S-1-1-0:(f) /t /c - -pause
--- a/win/uac/uac.js Thu Nov 03 19:35:16 2011 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,13 +0,0 @@ -// To run invoke: cscript uac.js - -// http://sites.google.com/site/eneerge/home/BatchGotAdmin - -var fso = new ActiveXObject("Scripting.FileSystemObject"); -var curdir = fso.GetParentFolderName(WScript.ScriptFullName); - -var objShell = new ActiveXObject("shell.application"); -// http://msdn.microsoft.com/en-us/library/windows/desktop/gg537745.aspx -// Shell.ShellExecute method -// iRetVal = Shell.ShellExecute( sFile, [ vArguments ], [ vDirectory ], [ vOperation ], [ vShow ] ) -// If (vShow==1) open the application with a normal window. -objShell.ShellExecute("uac.bat", curdir, "", "runas", 1);