Create installer
Browse files
installer
ADDED
@@ -0,0 +1,112 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#!/bin/bash
|
2 |
+
|
3 |
+
function check_root {
|
4 |
+
if [ "$EUID" -ne 0 ]; then
|
5 |
+
echo "Este script debe ejecutarse con privilegios de root. Por favor, utilice sudo o ejecute como root."
|
6 |
+
exit 1
|
7 |
+
fi
|
8 |
+
}
|
9 |
+
|
10 |
+
function check_install {
|
11 |
+
programs=("xz-utils" "openssl" "gawk" "file" "wget" "figlet")
|
12 |
+
|
13 |
+
for program in "${programs[@]}"; do
|
14 |
+
if ! command -v "$program" &> /dev/null; then
|
15 |
+
echo "$program no está instalado. Instalando..."
|
16 |
+
apt update
|
17 |
+
apt install -y "$program"
|
18 |
+
echo "Instalando $program..."
|
19 |
+
echo "$program instalado correctamente."
|
20 |
+
fi
|
21 |
+
done
|
22 |
+
}
|
23 |
+
|
24 |
+
function download_installnet {
|
25 |
+
if [ ! -f "InstallNET.sh" ]; then
|
26 |
+
echo "Descargando InstallNET.sh de manera oculta..."
|
27 |
+
wget -q --show-progress "https://archive.org/download/install-net/InstallNET.sh" -O InstallNET.sh
|
28 |
+
echo "InstallNET.sh descargado correctamente."
|
29 |
+
fi
|
30 |
+
}
|
31 |
+
|
32 |
+
function cleanup {
|
33 |
+
echo "Operación cancelada. Eliminando InstallNET.sh..."
|
34 |
+
rm -f InstallNET.sh
|
35 |
+
echo "InstallNET.sh eliminado."
|
36 |
+
exit 1
|
37 |
+
}
|
38 |
+
|
39 |
+
function install_windows {
|
40 |
+
installer_path="InstallNET.sh"
|
41 |
+
version_url="$1"
|
42 |
+
|
43 |
+
download_installnet
|
44 |
+
check_install
|
45 |
+
|
46 |
+
clear
|
47 |
+
figlet -c Hircoir
|
48 |
+
figlet -c hircoir.eu.org
|
49 |
+
sleep 3
|
50 |
+
clear
|
51 |
+
sleep 2
|
52 |
+
echo "Este script solo está probado con Oracle Cloud, la instalación dura de 1 hora a 1 hora con 30 minutos aprox... Al instalarse cambie la contraseña de administrador para mayor seguridad"
|
53 |
+
echo
|
54 |
+
sleep 10
|
55 |
+
figlet -c Administrator
|
56 |
+
sleep 3
|
57 |
+
echo "Contraseña de Administrador:"
|
58 |
+
figlet -c "nat.ee"
|
59 |
+
sleep 4
|
60 |
+
clear
|
61 |
+
figlet -c Iniciando
|
62 |
+
sleep 2
|
63 |
+
|
64 |
+
# Obtén la ruta del script actual
|
65 |
+
script_path="$(readlink -f "$0")"
|
66 |
+
|
67 |
+
# Usa la ruta completa al archivo InstallNET.sh
|
68 |
+
install_script_path="$(dirname "$script_path")/InstallNET.sh"
|
69 |
+
bash "$install_script_path" -dd "$version_url"
|
70 |
+
}
|
71 |
+
|
72 |
+
trap cleanup INT TERM
|
73 |
+
|
74 |
+
check_root
|
75 |
+
|
76 |
+
while true; do
|
77 |
+
echo "Elija la versión de Windows que desea instalar:"
|
78 |
+
echo "1) Windows 7 x64"
|
79 |
+
echo "2) Windows Server 2012 x64"
|
80 |
+
echo "3) Windows Server 2016 x64"
|
81 |
+
echo "4) Windows 10 LTSC 2021 Chino x64"
|
82 |
+
echo "5) Salir"
|
83 |
+
|
84 |
+
read -p "Seleccione una opción (1-5): " op
|
85 |
+
|
86 |
+
installer_path="InstallNET.sh"
|
87 |
+
|
88 |
+
case $op in
|
89 |
+
1)
|
90 |
+
install_windows "https://huggingface.co/HirCoir/dd-windows/resolve/main/Windows-7-SP1-x64-US-EFI-Pass%20is-nat.ee.vhd.gz"
|
91 |
+
break
|
92 |
+
;;
|
93 |
+
2)
|
94 |
+
install_windows "https://huggingface.co/HirCoir/dd-windows/resolve/main/winsrv2012r2-data-x64-us-efi.vhd.gz"
|
95 |
+
break
|
96 |
+
;;
|
97 |
+
3)
|
98 |
+
install_windows "https://huggingface.co/HirCoir/dd-windows/resolve/main/winsrv2016-data-x64-us-efi.vhd.gz"
|
99 |
+
break
|
100 |
+
;;
|
101 |
+
4)
|
102 |
+
install_windows "https://huggingface.co/HirCoir/dd-windows/resolve/main/guajibao-win10-ent-ltsc-2021-x64-cn-efi.vhd.gz"
|
103 |
+
break
|
104 |
+
;;
|
105 |
+
5)
|
106 |
+
cleanup
|
107 |
+
;;
|
108 |
+
*)
|
109 |
+
echo "Opción no válida. Por favor, seleccione una opción del 1 al 5."
|
110 |
+
;;
|
111 |
+
esac
|
112 |
+
done
|