Author: dreimer
Date: Wed Oct 21 23:19:05 2009
New Revision: 43675
URL:
http://svn.reactos.org/svn/reactos?rev=43675&view=rev
Log:
Add Elevation Tool into the PS Port, too. With some luck it works.
Modified:
trunk/tools/RosBE/RosBE-Windows/Powershell/RosBE.ps1
trunk/tools/RosBE/RosBE-Windows/Powershell/update.ps1
Modified: trunk/tools/RosBE/RosBE-Windows/Powershell/RosBE.ps1
URL:
http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Powershe…
==============================================================================
--- trunk/tools/RosBE/RosBE-Windows/Powershell/RosBE.ps1 [iso-8859-1] (original)
+++ trunk/tools/RosBE/RosBE-Windows/Powershell/RosBE.ps1 [iso-8859-1] Wed Oct 21 23:19:05
2009
@@ -78,19 +78,6 @@
New-PInvoke user32.dll "public static extern void FlashWindow(IntPtr hwnd, bool
bInvert);"
-# Web Downloader in a function.
-
-function global:Get-WebFile {
- param(
- $url = $null,
- $file = $null
- )
- $local:ErrorActionPreference = "SilentlyContinue"
- $clnt = new-object System.Net.WebClient
- $clnt.DownloadFile($url,$file)
- $local:ErrorActionPreference = "Continue"
-}
-
# Load the doskey macros and delete any macros for components
# that are not actually present.
function LoadAliases {
@@ -131,10 +118,7 @@
set-alias SSVN "$_ROSBE_BASEDIR\sSVN.ps1" -scope Global
set-alias SVN "$_ROSBE_BASEDIR\Tools\svn.exe" -scope Global
}
-
- if (Test-Path "$_ROSBE_BASEDIR\update.ps1") {
- set-alias UPDATE "$_ROSBE_BASEDIR\update.ps1" -scope Global
- }
+ function global:UPDATE($xargs) {IEX
"&'$_ROSBE_BASEDIR\Tools\Elevate.exe' '$pshome\powershell.exe'
-noexit {&'$_ROSBE_BASEDIR\update.ps1' '$_ROSBE_VERSION'
'$_ROSBE_BASEDIR' $($xargs)}"}
set-alias VERSION "$_ROSBE_BASEDIR\version.ps1" -scope Global
Modified: trunk/tools/RosBE/RosBE-Windows/Powershell/update.ps1
URL:
http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Powershe…
==============================================================================
--- trunk/tools/RosBE/RosBE-Windows/Powershell/update.ps1 [iso-8859-1] (original)
+++ trunk/tools/RosBE/RosBE-Windows/Powershell/update.ps1 [iso-8859-1] Wed Oct 21 23:19:05
2009
@@ -8,6 +8,22 @@
#
$host.ui.RawUI.WindowTitle = "Updating..."
+
+$_ROSBE_VERSION = "$($args[0])"
+$_ROSBE_BASEDIR = "$($args[1])"
+
+# Web Downloader in a function.
+
+function global:Get-WebFile {
+ param(
+ $url = $null,
+ $file = $null
+ )
+ $local:ErrorActionPreference = "SilentlyContinue"
+ $clnt = new-object System.Net.WebClient
+ $clnt.DownloadFile($url,$file)
+ $local:ErrorActionPreference = "Continue"
+}
function EOC {
set-location "$_ROSBE_OPATH"
@@ -89,25 +105,25 @@
if (!(Test-Path "$ENV:APPDATA\RosBE\Updates")) {New-Item -path
"$ENV:APPDATA\RosBE" -name "Updates" -type directory}
set-location "$ENV:APPDATA\RosBE\Updates"
-if ("$args" -eq "") {
+if ("$($args[2])" -eq "") {
$_ROSBE_MULTIUPD = 1
$_ROSBE_STATCOUNT = 1
while ($_ROSBE_STATCOUNT -lt 10) {
UPDCHECK
$_ROSBE_STATCOUNT += 1
}
-} elseif ("$args" -eq "reset") {
+} elseif ("$($args[2])" -eq "reset") {
remove-item "$ENV:APPDATA\RosBE\Updates\*.*" -force -recurse -EA
SilentlyContinue
remove-item "$ENV:APPDATA\RosBE\Updates\tmp\*.*" -force -recurse -EA
SilentlyContinue
-} elseif ("$($args[0])" -eq "nr") {
- $_ROSBE_STATCOUNT = $($args[1])
+} elseif ("$($args[2])" -eq "nr") {
+ $_ROSBE_STATCOUNT = $($args[3])
UPDCHECK
-} elseif ("$($args[0])" -eq "delete") {
- $_ROSBE_STATCOUNT = $($args[1])
+} elseif ("$($args[2])" -eq "delete") {
+ $_ROSBE_STATCOUNT = $($args[3])
remove-item
"$ENV:APPDATA\RosBE\Updates\$_ROSBE_VERSION-$_ROSBE_STATCOUNT.*" -force -recurse
-EA SilentlyContinue
remove-item
"$ENV:APPDATA\RosBE\Updates\tmp\$_ROSBE_VERSION-$_ROSBE_STATCOUNT.*" -force
-recurse -EA SilentlyContinue
-} elseif ("$($args[0])" -eq "info") {
- $_ROSBE_STATCOUNT = $($args[1])
+} elseif ("$($args[2])" -eq "info") {
+ $_ROSBE_STATCOUNT = $($args[3])
set-location tmp
if (!(Test-Path "$_ROSBE_VERSION-$_ROSBE_STATCOUNT.txt")) {
get-webfile $_ROSBE_URL/$_ROSBE_VERSION-$_ROSBE_STATCOUNT.txt
$PWD\$_ROSBE_VERSION-$_ROSBE_STATCOUNT.txt
@@ -119,7 +135,7 @@
}
set-location ..
remove-item "tmp\*.*" -force -EA SilentlyContinue
-} elseif ("$args" -eq "status") {
+} elseif ("$($args[2])" -eq "status") {
$_ROSBE_STATCOUNT = 1
if (!(test-path "tmp")) {New-Item -name "tmp" -type directory}
copy-item *.txt .\tmp\.