M-L-P / Yours-UEFI

Y-o-u-r-s, Your own usual rEFInd's sign for UEFI firmware. It can even load Clover or OpenCore to boot Hackintosh with SecureBoot enabled. It needs 64bit UEFI firmware.
17 stars 2 forks source link

Add Simple Installer #2

Open weskerty opened 1 month ago

weskerty commented 1 month ago

A Simple Installer for Yours

https://github.com/user-attachments/assets/20003fbc-a06c-4324-8d2a-e8efefe9d969

Install Script;

@echo off
setlocal

echo Buscando tu Particion EFI

rem Estas palabras pueden Variar por Idioma, en caso de que no encuentre Agrega la variante de Sistema en tu Idioma. Esto ejecuta diskpart list volume y busca el efi encontrando la palabra Sistema.
set "keywords=Sistema System"

set "EFI_VOLUME="

for %%k in (%keywords%) do (
    for /f "tokens=2 delims= " %%i in ('echo list volume ^| diskpart ^| findstr /i "%%k"') do (
        set "EFI_VOLUME=%%i"
        goto :found
    )
)

:found
if "%EFI_VOLUME%"=="" (
    echo Lamentablemente no encontre la Particion.
    pause
    exit /b 1
)

echo Volumen encontrado: %EFI_VOLUME%

(
    echo select volume %EFI_VOLUME%
    echo assign letter=S
) | diskpart > nul 2>&1

if %errorlevel% neq 0 (
    echo Error. Al parecer la letra S ya esta en uso en alguna unidad. Desactiva la unidad S y vuelve a ejecutar este script.
    pause
    exit /b %errorlevel%
)

if exist "S:\EFI\Yours" (
    rd /s /q "S:\EFI\Yours"
)

if exist "S:\EFI\BOOT" (
    rd /s /q "S:\EFI\BOOT"
)

echo Instalando Yours...
xcopy /E /I /Y /C /H /R "C:\MiLinux\Yours\Yours\" "S:\" > nul 2>&1

if %errorlevel% neq 0 (
    echo Error en la copia. Es probable que la carpeta "C:\MiLinux\Yours" no exista.
    goto :hide_partition
)

echo Ajustando para iniciar Yours al encender la PC...

rem Usa la ruta completa para bcdedit.exe
C:\Windows\System32\bcdedit.exe /set {bootmgr} path \EFI\BOOT\BOOTX64.EFI

if %errorlevel% neq 0 (
    echo Error al ejecutar bcdedit. Intentando con PowerShell...

    powershell -Command "C:\Windows\System32\bcdedit.exe /set '{bootmgr}' path '\EFI\BOOT\BOOTX64.EFI'"     

    if %errorlevel% neq 0 (
        echo Error al ejecutar bcdedit a través de PowerShell. 
        goto :hide_partition
    )
)

:hide_partition
(
    echo select volume %EFI_VOLUME%
    echo remove letter=S
) | diskpart > nul 2>&1

if %errorlevel% neq 0 (
    echo Error ocultando particion EFI. 
    pause
    exit /b %errorlevel%
)
echo.
echo ##############################################################
echo #                Instalacion Completa \:D/                   #
echo #              Reiniciar la PC para Probarlo.                #
echo #            Debes tener SecureBoot Desactivado              #
echo #                 Pulsa ENTER para Salir                     #
echo ##############################################################
echo.
timeout /t 3 /nobreak >nul
endlocal
exit /b 0

Nisis Exe;

!include "x64.nsh"

OutFile "Yours.exe"
Icon "F:\Documentos\LinuxMint\ICO\Yours.ico"
RequestExecutionLevel admin
InstallDir "C:\Yours"

Function .onInit
    Call Is64Bit
    Pop $0
    StrCmp $0 0 Not64Bit
    Return

    Not64Bit:
    MessageBox MB_OK "Solo-Only PC 64bits."
    Quit
FunctionEnd

Function Is64Bit
    ${If} ${RunningX64}
        StrCpy $0 1
    ${Else}
        StrCpy $0 0
    ${EndIf}
FunctionEnd

Section "MainSection" SEC01
    CreateDirectory "$INSTDIR"
    SetOutPath "$INSTDIR"
    File /r "F:\Documentos\LinuxMint\SecureBoot\YoursOrig\*.*"
    ExecWait '"$WINDIR\SysNative\cmd.exe" /c "$INSTDIR\Install.bat"'
    ExecShell "open" "$INSTDIR"

    Quit
SectionEnd

Download https://github.com/weskerty/rEFIndWindowsInstaller/releases/download/SecureBoot/Yours.exe

1457384613gh commented 1 month ago

Thank you for your sincerity and enthusiasm, I'm definitely going to see.

1457384613gh commented 1 month ago

I would love it, which is convenient and advanced.

weskerty commented 1 month ago

I would love it, which is convenient and advanced.

The installation is comfortable. The executable unzips the Yours C:/ folder and then runs the install.bat script that finds the EFI partition and copies the files without needing DiskGenius. The search for the EFI partition tries to find the System label (if your PC is in another language other than English or Spanish diskpart will show system with its language and will not detect it, you must modify the script to add how the label appears, there is a comment at the beginning of the intalar.bat script)

Work on Windows10

weskerty commented 1 month ago

Script; Updated search; Type "Sistema System" diskpart list volume to Detect EFI Nisis; It only runs in 64Bits.

1457384613gh commented 1 month ago

2024-08-05.23-47-55.mp4

Great! But where is the banner? It could have shown like these.

Screenshot_2024-08-06-16-51-17-797_com.github.android-edit.jpg

weskerty commented 1 month ago

2024-08-05.23-47-55.mp4

Great! But where is the banner? It could have shown like these.

I suppose the poster cannot be seen because I commented #display setting among other configuration things since when starting in virtual box it started with an immense resolution that did not adapt to my screen.

You can make more adjustments and compile it with nisis to test, you just have to change the directory where it looks for the files to compress

1457384613gh commented 1 month ago

Would you like to be part of MLP?

weskerty commented 1 month ago

Would you like to be part of MLP?

Thanks for the invitation ❤️ but no. I'm usually not active. Just some ideas to do and then abandon it hahaha.