mirror of
https://github.com/dockur/windows.git
synced 2025-10-27 03:15:49 +00:00
Compare commits
5 commits
28580ba276
...
b6b1dd3ed4
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b6b1dd3ed4 | ||
|
|
e3e3a45697 | ||
|
|
adc4eda4f2 | ||
|
|
49090dcbc4 | ||
|
|
ceaacaeb2c |
2 changed files with 40 additions and 24 deletions
|
|
@ -135,8 +135,12 @@ parseVersion() {
|
||||||
"2003" | "2003r2" | "win2003" | "win2003r2" | "windows2003" | "windows 2003" )
|
"2003" | "2003r2" | "win2003" | "win2003r2" | "windows2003" | "windows 2003" )
|
||||||
VERSION="win2003r2"
|
VERSION="win2003r2"
|
||||||
;;
|
;;
|
||||||
"core11" | "core 11" )
|
"nano11" | "nano 11" )
|
||||||
VERSION="core11"
|
VERSION="nano11"
|
||||||
|
[ -z "$DETECTED" ] && DETECTED="win11x64"
|
||||||
|
;;
|
||||||
|
"" | "core 11" )
|
||||||
|
VERSION=""
|
||||||
[ -z "$DETECTED" ] && DETECTED="win11x64"
|
[ -z "$DETECTED" ] && DETECTED="win11x64"
|
||||||
;;
|
;;
|
||||||
"tiny11" | "tiny 11" )
|
"tiny11" | "tiny 11" )
|
||||||
|
|
@ -432,6 +436,7 @@ printVersion() {
|
||||||
"tiny11"* ) desc="Tiny 11" ;;
|
"tiny11"* ) desc="Tiny 11" ;;
|
||||||
"tiny10"* ) desc="Tiny 10" ;;
|
"tiny10"* ) desc="Tiny 10" ;;
|
||||||
"core11"* ) desc="Core 11" ;;
|
"core11"* ) desc="Core 11" ;;
|
||||||
|
"nano11"* ) desc="Nano 11" ;;
|
||||||
"win7"* ) desc="Windows 7" ;;
|
"win7"* ) desc="Windows 7" ;;
|
||||||
"win8"* ) desc="Windows 8" ;;
|
"win8"* ) desc="Windows 8" ;;
|
||||||
"win10"* ) desc="Windows 10" ;;
|
"win10"* ) desc="Windows 10" ;;
|
||||||
|
|
@ -570,6 +575,9 @@ fromFile() {
|
||||||
*"winvista"* | *"win_vista"* | *"windowsvista"* | *"windows_vista"* )
|
*"winvista"* | *"win_vista"* | *"windowsvista"* | *"windows_vista"* )
|
||||||
id="winvista${arch}"
|
id="winvista${arch}"
|
||||||
;;
|
;;
|
||||||
|
"nano11"* | "nano_11"* )
|
||||||
|
id="nano11"
|
||||||
|
;;
|
||||||
"tiny11core"* | "tiny11_core"* | "tiny_11_core"* )
|
"tiny11core"* | "tiny11_core"* | "tiny_11_core"* )
|
||||||
id="core11"
|
id="core11"
|
||||||
;;
|
;;
|
||||||
|
|
@ -1093,6 +1101,11 @@ getLink4() {
|
||||||
[[ "${lang,,}" != "en" ]] && [[ "${lang,,}" != "en-us" ]] && return 0
|
[[ "${lang,,}" != "en" ]] && [[ "${lang,,}" != "en-us" ]] && return 0
|
||||||
|
|
||||||
case "${id,,}" in
|
case "${id,,}" in
|
||||||
|
"nano11" )
|
||||||
|
size=2463565824
|
||||||
|
sum="a1e0614372768cbe2d24de74b78a4a97bc1017ea5080dfed1d2125e4a527eb1a"
|
||||||
|
url="nano11_25h2/nano11%2025h2.iso"
|
||||||
|
;;
|
||||||
"core11" )
|
"core11" )
|
||||||
size=2159738880
|
size=2159738880
|
||||||
sum="78f0f44444ff95b97125b43e560a72e0d6ce0a665cf9f5573bf268191e5510c1"
|
sum="78f0f44444ff95b97125b43e560a72e0d6ce0a665cf9f5573bf268191e5510c1"
|
||||||
|
|
|
||||||
|
|
@ -9,30 +9,40 @@ backup () {
|
||||||
|
|
||||||
local count=1
|
local count=1
|
||||||
local iso="$1"
|
local iso="$1"
|
||||||
local name="$2"
|
local name="unknown"
|
||||||
|
local root="$STORAGE/backups"
|
||||||
|
local previous="$STORAGE/windows.base"
|
||||||
|
|
||||||
|
if [ -f "$previous" ]; then
|
||||||
|
|
||||||
|
previous=$(<"$previous")
|
||||||
|
previous="${previous//[![:print:]]/}"
|
||||||
|
|
||||||
|
[ -n "$previous" ] && name="${previous%.*}"
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
|
mkdir -p "$root"
|
||||||
local folder="$name"
|
local folder="$name"
|
||||||
local dir="$STORAGE/backups"
|
local dir="$root/$folder"
|
||||||
|
|
||||||
mkdir -p "$dir"
|
while [ -d "$dir" ]
|
||||||
|
|
||||||
while [ -d "$STORAGE/$folder" ]
|
|
||||||
do
|
do
|
||||||
count=$[$count +1]
|
count=$[$count +1]
|
||||||
folder="${name}.${count}"
|
folder="${name}.${count}"
|
||||||
|
dir="$root/$folder"
|
||||||
done
|
done
|
||||||
|
|
||||||
dir+="/$folder"
|
|
||||||
|
|
||||||
rm -rf "$dir"
|
rm -rf "$dir"
|
||||||
mkdir -p "$dir"
|
mkdir -p "$dir"
|
||||||
|
|
||||||
[ -f "$iso" ] && mv -f "$iso" "$dir/"
|
[ -f "$iso" ] && mv -f "$iso" "$dir/"
|
||||||
|
find "$STORAGE" -maxdepth 1 -type f -iname 'data.*' -not -iname '*.iso' -exec mv -n {} "$dir/" \;
|
||||||
|
find "$STORAGE" -maxdepth 1 -type f -iname 'windows.*' -not -iname '*.iso' -exec mv -n {} "$dir/" \;
|
||||||
find "$STORAGE" -maxdepth 1 -type f \( -iname '*.rom' -or -iname '*.vars' \) -exec mv -n {} "$dir/" \;
|
find "$STORAGE" -maxdepth 1 -type f \( -iname '*.rom' -or -iname '*.vars' \) -exec mv -n {} "$dir/" \;
|
||||||
find "$STORAGE" -maxdepth 1 -type f \( -iname 'data.*' -or -iname 'windows.*' \) -exec mv -n {} "$dir/" \;
|
|
||||||
|
|
||||||
if [ -z "$(ls -A "$dir")" ]; then
|
[ -z "$(ls -A "$dir")" ] && rm -rf "$dir"
|
||||||
rm -rf "$dir"
|
[ -z "$(ls -A "$root")" ] && rm -rf "$root"
|
||||||
fi
|
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
@ -51,7 +61,6 @@ skipInstall() {
|
||||||
previous="${previous//[![:print:]]/}"
|
previous="${previous//[![:print:]]/}"
|
||||||
|
|
||||||
if [ -n "$previous" ]; then
|
if [ -n "$previous" ]; then
|
||||||
|
|
||||||
if [[ "${STORAGE,,}/${previous,,}" != "${iso,,}" ]]; then
|
if [[ "${STORAGE,,}/${previous,,}" != "${iso,,}" ]]; then
|
||||||
|
|
||||||
if ! hasDisk; then
|
if ! hasDisk; then
|
||||||
|
|
@ -78,10 +87,7 @@ skipInstall() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
info "Detected that $method, a backup of your previous installation will be saved..."
|
info "Detected that $method, a backup of your previous installation will be saved..."
|
||||||
|
! backup "$STORAGE/$previous" && error "Backup failed!"
|
||||||
if ! backup "$STORAGE/$previous" "${previous%.*}"; then
|
|
||||||
error "Backup failed!"
|
|
||||||
fi
|
|
||||||
|
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
|
|
@ -146,11 +152,7 @@ startInstall() {
|
||||||
skipInstall "$BOOT" && return 1
|
skipInstall "$BOOT" && return 1
|
||||||
|
|
||||||
if hasDisk; then
|
if hasDisk; then
|
||||||
|
! backup "" && error "Backup failed!"
|
||||||
if ! backup "" "backup"; then
|
|
||||||
error "Backup failed!"
|
|
||||||
fi
|
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
mkdir -p "$TMP"
|
mkdir -p "$TMP"
|
||||||
|
|
@ -168,8 +170,9 @@ startInstall() {
|
||||||
|
|
||||||
rm -f "$BOOT"
|
rm -f "$BOOT"
|
||||||
|
|
||||||
|
find "$STORAGE" -maxdepth 1 -type f -iname 'data.*' -not -iname '*.iso' -delete
|
||||||
|
find "$STORAGE" -maxdepth 1 -type f -iname 'windows.*' -not -iname '*.iso' -delete
|
||||||
find "$STORAGE" -maxdepth 1 -type f \( -iname '*.rom' -or -iname '*.vars' \) -delete
|
find "$STORAGE" -maxdepth 1 -type f \( -iname '*.rom' -or -iname '*.vars' \) -delete
|
||||||
find "$STORAGE" -maxdepth 1 -type f \( -iname 'data.*' -or -iname 'windows.*' \) -delete
|
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue