Author: dreimer
Date: Tue Nov 25 03:50:02 2008
New Revision: 37627
URL:
http://svn.reactos.org/svn/reactos?rev=37627&view=rev
Log:
Fix some more small non prettinesses and bugs in update.cmd
Move the Updates and Temp folder to Appdata. Now the commands status and info X even work
with non Admin rights. The rest still needs them and ever will.
Start PS Port of update.cmd. Not yet fully working and still more a clone of the cmd and
not optimized. Will be done later.
Added:
trunk/tools/RosBE/RosBE-Windows/Powershell/update.ps1 (with props)
Modified:
trunk/tools/RosBE/RosBE-Windows/Root/ChangeLog.txt
trunk/tools/RosBE/RosBE-Windows/Root/update.cmd
Added: 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 (added)
+++ trunk/tools/RosBE/RosBE-Windows/Powershell/update.ps1 [iso-8859-1] Tue Nov 25 03:50:02
2008
@@ -1,0 +1,210 @@
+#
+# PROJECT: RosBE - ReactOS Build Environment for Windows
+# LICENSE: GNU General Public License v2. (see LICENSE.txt)
+# FILE: Root/update.ps1
+# PURPOSE: RosBE Updater.
+# COPYRIGHT: Copyright 2008 Daniel Reimer <reimer.daniel(a)freenet.de>
+#
+#
+
+#
+# Set Title
+#
+$host.ui.RawUI.WindowTitle = "Updating..."
+
+function EOC {
+ set-location "$_ROSBE_OPATH"
+ if ($_ROSBE_VERSION -ne $null) {
+ $host.ui.RawUI.WindowTitle = "ReactOS Build Environment
$_ROSBE_VERSION"
+ }
+ exit
+}
+
+function UPDCHECK {
+ if (Test-Path "$_ROSBE_VERSION-$_ROSBE_STATCOUNT.txt") {
+ break
+ }
+ if (!(Test-Path "$_ROSBE_VERSION-$_ROSBE_STATCOUNT.txt")) {
+ IEX "'$_ROSBE_BASEDIR\Tools\wget.exe' -N --ignore-length
--no-verbose $_ROSBE_URL/$_ROSBE_VERSION-$_ROSBE_STATCOUNT.txt"
+ }
+ if (Test-Path "$_ROSBE_VERSION-$_ROSBE_STATCOUNT.txt") {
+ get-Content "$_ROSBE_VERSION-$_ROSBE_STATCOUNT.txt"
+ ""
+ "Install?"
+ $YESNO = Read-Host "(yes), (no)"
+ if ($YESNO -eq "yes") {
+ if (!(Test-Path "$_ROSBE_VERSION-$_ROSBE_STATCOUNT.7z")) {
+ IEX "&'$_ROSBE_BASEDIR\Tools\wget.exe' -N
--ignore-length --no-verbose $_ROSBE_URL/$_ROSBE_VERSION-$_ROSBE_STATCOUNT.7z"
+ }
+ if (Test-Path "$_ROSBE_VERSION-$_ROSBE_STATCOUNT.7z") {
+ remove-item "$_ROSBE_VERSION-$_ROSBE_STATCOUNT\*.*" -force
+ IEX "&'$_ROSBE_BASEDIR\Tools\7z.exe' x
'$_ROSBE_VERSION-$_ROSBE_STATCOUNT.7z'"
+ set-location "$_ROSBE_VERSION-$_ROSBE_STATCOUNT"
+ "$_ROSBE_VERSION-$_ROSBE_STATCOUNT.ps1"
+ break
+ } else {
+ "ERROR: This Update does not seem to exist or the Internet
connection is not working correctly."
+ break
+ }
+ } elseif ($YESNO -eq "no") {
+ "Do you want to be asked again to install this update?"
+ $YESNO = Read-Host "(yes), (no)"
+ if ($YESNO -eq "yes") {
+ remove-item "$_ROSBE_VERSION-$_ROSBE_STATCOUNT.txt" -force
+ }
+ break
+ }
+ } else {
+ if ($_ROSBE_MULTIUPD -ne "1") {
+ "ERROR: This Update does not seem to exist or the Internet connection is
not working correctly."
+ break
+ }
+ }
+}
+
+function STATUS {
+ set-location tmp
+ if (!(Test-path "$_ROSBE_VERSION-$_ROSBE_STATCOUNT.txt")) {
+ IEX "&'$_ROSBE_BASEDIR\Tools\wget.exe' -N --ignore-length
--no-verbose $_ROSBE_URL/$_ROSBE_VERSION-$_ROSBE_STATCOUNT.txt"
+ if (Test-Path "$_ROSBE_VERSION-$_ROSBE_STATCOUNT.txt") {
+ $_ROSBE_UPDATES = "$_ROSBE_UPDATES $_ROSBE_STATCOUNT"
+ }
+ }
+ set-loaction ..
+}
+
+function UPDINFO {
+ set-location tmp
+ if (!(Test-path "$_ROSBE_VERSION-$_ROSBE_STATCOUNT.txt")) {
+ IEX "&'$_ROSBE_BASEDIR\Tools\wget.exe' -N --ignore-length
--no-verbose $_ROSBE_URL/$_ROSBE_VERSION-$_ROSBE_STATCOUNT.txt"
+ if (Test-Path "$_ROSBE_VERSION-$_ROSBE_STATCOUNT.txt") {
+ get-content "$_ROSBE_VERSION-$_ROSBE_STATCOUNT.txt"
+ } else {
+ "ERROR: This Update does not seem to exist or the Internet connection is
not working correctly."
+ }
+ }
+ set-location ..
+ remove-item "tmp\*.*" -force
+}
+
+function UPDFIN {
+ remove-item "tmp\*.*" -force
+ if ($_ROSBE_UPDATES -ne $null) {
+ "Following Updates available: $_ROSBE_UPDATES"
+ } else {
+ "RosBE is up to Date."
+ }
+ EOC
+}
+
+#
+# The Update Server.
+#
+$_ROSBE_URL = "http://mitglied.lycos.de/reimerdaniel/rosbe"
+
+#
+# Save the recent dir to cd back there at the end.
+#
+$_ROSBE_OPATH = "$pwd"
+
+if (Test-Path "$_ROSBE_BASEDIR\Tools\7z.exe") {
+ set-location "$_ROSBE_BASEDIR\Tools"
+ IEX "& wget.exe -N --ignore-length --no-verbose $_ROSBE_URL/7z.exe"
+ set-location $_ROSBE_OPATH
+}
+
+set-location $_ROSBE_BASEDIR
+
+#
+# First check for a new Updater
+#
+$_ROSBE_UPDDATE = get-content update.ps1
+IEX "$'Tools\wget.exe' -N --ignore-length --no-verbose
$_ROSBE_URL/update.ps1"
+$_ROSBE_UPDDATE = get-content update.ps1
+if ($_ROSBE_UPDDATE -ne $_ROSBE_UPDDATE2) {
+ # clear-host
+ "Updater got updated and needs to be restarted."
+ EOC
+}
+
+#
+# Get to the Updates Subfolder.
+#
+if (!(Test-Path "$ENV:APPDATA\RosBE\Updates")) {New-Item -path
"$ENV:APPDATA\RosBE" -name "Updates" -type directory}
+set-location "$ENV:APPDATA\RosBE\Updates"
+
+#
+# Parse the args.
+#
+if ("$args" -eq "") {
+ $_ROSBE_MULTIUPD = 1
+ $_ROSBE_STATCOUNT = 1
+ UPDCHECK
+ $_ROSBE_STATCOUNT += 1
+ UPDCHECK
+ $_ROSBE_STATCOUNT += 1
+ UPDCHECK
+ $_ROSBE_STATCOUNT += 1
+ UPDCHECK
+ $_ROSBE_STATCOUNT += 1
+ UPDCHECK
+ $_ROSBE_STATCOUNT += 1
+ UPDCHECK
+ $_ROSBE_STATCOUNT += 1
+ UPDCHECK
+ $_ROSBE_STATCOUNT += 1
+ UPDCHECK
+ $_ROSBE_STATCOUNT += 1
+ UPDCHECK
+ EOC
+}
+if ("$args" -eq "reset") {
+ remove-item "$ENV:APPDATA\RosBE\Updates\*.*" -force
+ remove-item "$ENV:APPDATA\RosBE\Updates\tmp\*.*" -force
+ EOC
+}
+if ("$args[0]" -eq "nr") {
+ $_ROSBE_STATCOUNT = $args[1]
+ UPDCHECK
+ EOC
+}
+if ("$args[0]" -eq "info") {
+ $_ROSBE_STATCOUNT = $args[1]
+ UPDINFO
+ EOC
+}
+if ("$args" -eq "status") {
+ if (!(test-path "tmp")) {New-Item -name "Updates" -type
directory}
+ copy-item *.txt .\tmp\.
+ $_ROSBE_STATCOUNT = 1
+ STATUS
+ $_ROSBE_STATCOUNT += 1
+ STATUS
+ $_ROSBE_STATCOUNT += 1
+ STATUS
+ $_ROSBE_STATCOUNT += 1
+ STATUS
+ $_ROSBE_STATCOUNT += 1
+ STATUS
+ $_ROSBE_STATCOUNT += 1
+ STATUS
+ $_ROSBE_STATCOUNT += 1
+ STATUS
+ $_ROSBE_STATCOUNT += 1
+ STATUS
+ $_ROSBE_STATCOUNT += 1
+ STATUS
+ UPDFIN
+}
+if ("$args" -ne "") {
+ "Unknown parameter specified. Try 'help update'."
+ EOC
+}
+
+$_ROSBE_UPDFINISH = $null
+$_ROSBE_OPATH = $null
+$_ROSBE_UPDDATE = $null
+$_ROSBE_UPDATES = $null
+$_ROSBE_UPDDATE2 = $null
+$_ROSBE_MULTIUPD = $null
+$_ROSBE_STATCOUNT = $null
Propchange: trunk/tools/RosBE/RosBE-Windows/Powershell/update.ps1
------------------------------------------------------------------------------
svn:eol-style = native
Modified: trunk/tools/RosBE/RosBE-Windows/Root/ChangeLog.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Root/Cha…
==============================================================================
--- trunk/tools/RosBE/RosBE-Windows/Root/ChangeLog.txt [iso-8859-1] (original)
+++ trunk/tools/RosBE/RosBE-Windows/Root/ChangeLog.txt [iso-8859-1] Tue Nov 25 03:50:02
2008
@@ -1,10 +1,12 @@
*** XXX xxth, 200x - RosBE 1.3.1 Released
-- Updated: The Update Utility now does not blindly sync the script files. It loads
- complete Update Packs and installs them. (Daniel Reimer)
-- Updated: The Powershell Port is now complete. (Daniel Reimer)
+- Updated: The Update Utility now does not just blindly sync the script files. It
+ loads complete Update Packs, which can contain from a single script update up to
+ a fully new GCC Version and installs them if the User confirms it. (Daniel Reimer)
+- Updated: The Powershell Port is now complete and privides the same features like
+ the Batch one, but in a way more powerful console window. (Daniel Reimer)
- Fixed: Now config adds the ELF Parameter to the config file to and lets you modify
- it. Without this param, build is broken. (Daniel Reimer)
+ it. Without this param, build was broken. (Daniel Reimer)
- Modified: Changed the default values of config to the previous setting instead of
the real default one if you don't type in anything for a setting. (Daniel Reimer)
Modified: trunk/tools/RosBE/RosBE-Windows/Root/update.cmd
URL:
http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Root/upd…
==============================================================================
--- trunk/tools/RosBE/RosBE-Windows/Root/update.cmd [iso-8859-1] (original)
+++ trunk/tools/RosBE/RosBE-Windows/Root/update.cmd [iso-8859-1] Tue Nov 25 03:50:02 2008
@@ -19,17 +19,23 @@
title Updating...
::
+:: The Update Server.
+::
+set _ROSBE_URL=http://mitglied.lycos.de/reimerdaniel/rosbe
+
+::
:: Save the recent dir to cd back there at the end.
::
set _ROSBE_OPATH=%~dp0
set _ROSBE_OPATH=%_ROSBE_OPATH:~0,-1%
+if not exist "%_ROSBE_BASEDIR%\Tools\7z.exe" (
+ cd /d "%_ROSBE_BASEDIR%\Tools"
+ wget.exe -N --ignore-length --no-verbose %_ROSBE_URL%/7z.exe 1> NUL 2> NUL
+ cd /d %_ROSBE_OPATH%
+)
+
cd /d %_ROSBE_BASEDIR%
-
-::
-:: The Update Server.
-::
-set _ROSBE_URL=http://mitglied.lycos.de/reimerdaniel/rosbe
::
:: First check for a new Updater
@@ -48,8 +54,8 @@
::
:: Get to the Updates Subfolder.
::
-if not exist "Updates" mkdir Updates 1> NUL 2> NUL
-cd Updates
+if not exist "%APPDATA%\RosBE\Updates" mkdir
"%APPDATA%\RosBE\Updates" 1> NUL 2> NUL
+cd /d "%APPDATA%\RosBE\Updates"
::
:: Parse the args.
@@ -77,7 +83,8 @@
goto :EOC
)
if /i "%1" == "reset" (
- del /F /Q "%_ROSBE_BASEDIR%\Updates\*.*" 1> NUL 2> NUL
+ del /F /Q "%APPDATA%\RosBE\Updates\*.*" 1> NUL 2> NUL
+ del /F /Q "%APPDATA%\RosBE\Updates\tmp\*.*" 1> NUL 2> NUL
goto :EOC
)
if /i "%1" == "nr" (
@@ -91,7 +98,7 @@
goto :EOC
)
if /i "%1" == "status" (
- mkdir tmp 1> NUL 2> NUL
+ if not exist "tmp" mkdir tmp 1> NUL 2> NUL
copy *.txt .\tmp\. 1> NUL 2> NUL
set _ROSBE_STATCOUNT=1
call :STATUS
@@ -112,6 +119,10 @@
set /a _ROSBE_STATCOUNT+=1
call :STATUS
goto :UPDFIN
+)
+if not "%1" == "" (
+ echo Unknown parameter specified. Try 'help update'.
+ goto :EOC
)
:STATUS
@@ -120,7 +131,7 @@
if not exist "%_ROSBE_VERSION%-%_ROSBE_STATCOUNT%.txt" (
"%_ROSBE_BASEDIR%\Tools\wget.exe" -N --ignore-length --no-verbose
%_ROSBE_URL%/%_ROSBE_VERSION%-%_ROSBE_STATCOUNT%.txt 1> NUL 2> NUL
if exist "%_ROSBE_VERSION%-%_ROSBE_STATCOUNT%.txt" (
- set _ROSBE_UPDATES=%_ROSBE_UPDATES% %_ROSBE_STATCOUNT%
+ set _ROSBE_UPDATES=%_ROSBE_UPDATES% %_ROSBE_STATCOUNT%
)
)
cd..
@@ -171,6 +182,7 @@
"%_ROSBE_BASEDIR%\Tools\wget.exe" -N --ignore-length --no-verbose
%_ROSBE_URL%/%_ROSBE_VERSION%-%_ROSBE_STATCOUNT%.7z 1> NUL 2> NUL
)
if exist "%_ROSBE_VERSION%-%_ROSBE_STATCOUNT%.7z" (
+ del /F /Q "%_ROSBE_VERSION%-%_ROSBE_STATCOUNT%\*.*" 1>NUL
2>NUL
"%_ROSBE_BASEDIR%\Tools\7z.exe" x
"%_ROSBE_VERSION%-%_ROSBE_STATCOUNT%.7z"
cd "%_ROSBE_VERSION%-%_ROSBE_STATCOUNT%"
call "%_ROSBE_VERSION%-%_ROSBE_STATCOUNT%.cmd"
@@ -198,7 +210,7 @@
:EOC
-cd /d %_ROSBE_OPATH%
+cd /d "%_ROSBE_OPATH%"
if defined _ROSBE_VERSION (
title ReactOS Build Environment %_ROSBE_VERSION%
)