Skip to content

Commit

Permalink
3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
OgnitorenKs committed Nov 8, 2023
1 parent db0f716 commit a5d533a
Show file tree
Hide file tree
Showing 10 changed files with 202 additions and 40 deletions.
Binary file modified .github/EN-SS/0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .github/EN-SS/6.4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .github/EasyDism.zip
Binary file not shown.
Binary file modified .github/TR-SS/0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .github/TR-SS/6.4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
119 changes: 119 additions & 0 deletions Bin/EasyDism_OgnitorenKs.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
(
echo :: ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
echo ::
echo :: ██████ ██████ ██ ██ ████ ████████ ██████ ████████ ████████ ██ ██ ██ ██ ██████
echo :: ██ ██ ██ ██ ███ ██ ██ ██ ██ ██ ██ ██ ██ ███ ██ ██ ██ ██ █
echo :: ██ ██ ██ ████ ██ ██ ██ ██ ██ ██ ██ ██ ████ ██ ██ ██ ██
echo :: ██ ██ ██ ████ ██ ██ ██ ██ ██ ██ ██ ████████ ██████ ██ ██ ██ █████ ██████
echo :: ██ ██ ██ ██ ██ ████ ██ ██ ██ ██ ██ ██ ██ ██ ████ ██ ██ ██
echo :: ██ ██ ██ ██ ██ ███ ██ ██ ██ ██ ██ ██ ██ ██ ███ ██ ██ ██ ██
echo :: ██████ ██████ ██ ██ ████ ██ ██████ ██ ██ ████████ ██ ██ ██ ██ ██████
echo ::
echo :: ► Hazırlayan: Hüseyin UZUNYAYLA / OgnitorenKs
echo ::
echo :: ► İletişim - Contact;
echo :: --------------------------------------
echo :: • Discord: https://discord.gg/7hbzSGTYeZ
echo :: • Site: https://ognitorenks.blogspot.com/
echo ::
echo :: ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
echo echo off
echo chcp 65001
echo setlocal enabledelayedexpansion
echo title EasyDism │ OgnitorenKs
echo cls
echo.
echo FOR /F "tokens=1,2 delims=#" %%%%a in ^('"prompt #$H#$E# & echo on & for %%%%b in (1) do rem"'^) do ^(set R=%%%%b^)
echo.
echo cd /d "%%~dp0"
echo FOR /F %%%%a in ^('cd'^) do ^(set Konum=%%%%a^)
echo.
echo reg query "HKU\S-1-5-19" ^> NUL 2^>^&1
echo if %%errorlevel%% NEQ 0 ^(Call :Powershell "Start-Process '%Konum%\EasyDism_OgnitorenKs' -Verb Runas"&exit^)

:: ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
:: Powershell scipt engeli kaldırılır
Call :Powershell "Set-ExecutionPolicy Unrestricted"

cls&echo %R%[33m Masaüstü dosyaları çıkartılıyor...%R%[0m
:: Ziplenen masaüstü dosyaları masaüstüne çıkarılır.
Call :Powershell "Expand-Archive -Force '%Konum%\Desktop.zip' 'C:\Users\%username%\Desktop\EasyDism_OgnitorenKs'"
:: Çıkarma işlemi sonrası Masaustu.zip dosyası silinir
DEL /F /Q /A "%Konum%\Desktop.zip" > NUL 2>&1

:: -------------------------------------------------------------
cls&echo %R%[33m Komut dosyaları çalıştırılıyor...%R%[0m
:: Bat klasörünün içinde yer alan dosyalar çalıştırılır.
FOR %%a in (bat cmd) do (
FOR /R %Konum%\EasyDism_OgnitorenKs\Setup\ %%b in (*.%%a) do (
echo %R%[37m "%%~nb" komut dosyası bekleniyor...
"%Konum%\NSudo.exe" -U:C -P:E -Wait cmd /c "%%b"
)
)
FOR /R %Konum%\EasyDism_OgnitorenKs\Setup\ %%a in (*.vbs) do (
echo %R%[37m "%%~na" vbs dosyası bekleniyor...
"%Konum%\NSudo.exe" -U:C -P:E -Wait cmd /c "%%a"
)
FOR /R %Konum%\EasyDism_OgnitorenKs\Setup\ %%a in (*.ps1) do (
echo %R%[37m "%%~na" ps1 dosyası bekleniyor...
"%Konum%\NSudo.exe" -U:C -P:E -Wait Powershell -file "%%a"
)

:: -------------------------------------------------------------
cls&echo %R%[33m Regedit kayıtları yükleniyor...%R%[0m
:: Regedit klasörü içerisinde yer alan .reg dosyalarını sisteme entegre eder.
FOR /R %Konum%\EasyDism_OgnitorenKs\Setup\ %%a in (*.reg) do (
echo %R%[37m "%%~na" regedit kaydı uygulanıyor...
"%Konum%\NSudo.exe" -U:T -P:E -Wait -ShowWindowMode:hide cmd /c Reg import "%%a"
)
timeout /t 1 /nobreak > NUL
cls

:: -------------------------------------------------------------
echo %R%[33m Programlar yükleniyor...%R%[0m
:: Programlar klasörü içerisinde yer alan programları yükler. Yalnızca katılımsız setuplar içindir.
FOR /R %Konum%\EasyDism_OgnitorenKs\Setup\ %%a in (*.exe) do (
echo %R%[37m "%%~na" yükleniyor...
"%%a" > NUL 2>&1
)
timeout /t 1 /nobreak > NUL
cls

:: -------------------------------------------------------------
:: Powershell script engeli aktifleştirilir
Call :Powershell "Set-ExecutionPolicy restricted"
cls
echo.
echo %R%[92m İŞLEMLER TAMAMLANDI %R%[0m
echo.
echo %R%[33m DeliPetro %R%[0m
(
echo echo off
echo cls
echo reg query "HKU\S-1-5-19" ^> NUL 2^>^&1
echo if %%errorlevel%% NEQ 0 ^(Powershell -Command "Start-Process '%%temp%%\DeliPetro2.cmd' -Verb Runas"^&exit^)
echo RD /S /Q "%Konum%" ^> NUL 2^>^&1
echo reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" /v "DeliPetro" /f ^> NUL 2^>^&1
echo reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" /v "DeliPetro2" /f ^> NUL 2^>^&1
echo RD /S /Q %%temp%%\* ^> NUL 2^>^&1
echo DEL /F /Q /A %%temp%%\* ^> NUL 2^>^&1
echo exit
) > %temp%\DeliPetro2.cmd
:: Builder ile eklediğimiz regedit kaydını tekrara girmemesi için kaldırıyoruz.
reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" /v "DeliPetro" /f > NUL 2>&1
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" /v "DeliPetro2" /t REG_SZ /d "%temp%\Delipetro2.cmd" /f > NUL 2>&1
shutdown -r -f -t 5
timeout /t 4 /nobreak > NUL
exit

:: ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
:Powershell
:: Powershell komutları kullanıldığında komut istemi compact moda girmektedir. Bunu önlemek için karakter takımları arasında geçiş yapıyoruz.
chcp 437 > NUL 2>&1
Powershell -command %*
chcp 65001 > NUL 2>&1
goto :eof

:TT
title EasyDism │ OgnitorenKs
goto :eof
1 change: 1 addition & 0 deletions Bin/Language/English.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ Y0025>In eject position>file available>
Y0026>Loading regedit records>
Y0027>Configuring initial boot processes after format>
Y0028>Image is being cleaned up>
Y0029>ESD compression in progress>
::███████████████████████████████████████████████████████████████████
Error_0_>Warning>
Error_1_>ERROR! Turkish character detected in folder/file path>
Expand Down
1 change: 1 addition & 0 deletions Bin/Language/Turkish.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ Y0025>Çıkarma konumunda>dosyası mevcut>
Y0026>Regedit kayıtları yükleniyor>
Y0027>Format sonrası ilk açılış işlemleri yapılandırılıyor>
Y0028>Güncelleme artıkları temizleniyor>
Y0029>ESD sıkıştırma işlemi yapılıyor>
::███████████████████████████████████████████████████████████████████
Error_0_>UYARI>
Error_1_>HATA! Klasör/Dosya yolunda Türkçe karakter tespit edildi>
Expand Down
114 changes: 74 additions & 40 deletions EasyDism.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ Call :Error_Character "%L%"
if %Error% EQU 2 (Call :LA 2 Y0001&echo.&echo %R%[32m !LA2! %R%[0m&Call :TO 3&exit)

:: -------------------------------------------------------------
FOR %%a in (Regedit Output Driver Update Bin\Logs) do (
FOR %%a in (Regedit Output Driver Update Bin\Logs .Script-AfterSetup .Desktop-AfterSetup) do (
MD "%L%\%%a" > NUL 2>&1
)

Expand Down Expand Up @@ -543,19 +543,34 @@ goto :eof
:: Dism bazı durumlarda hata verip kapanabiliyor. Bu tarz bir durumda Powershell üzerinden toplama işlemi yapması için önlem aldım.
Call :RegeditCollect
Call :Mount_Reader
Call :LA 2 Y0018&cls&echo.&echo %R%[92m !LA2! %R%[0m
Dism /Unmount-Image /MountDir:%Mount% /commit
Call :LA 2 Y0018&cls&echo.&echo %R%[92m !LA2! %R%[0m&echo.
Call :Menu_Reader
Dism /Unmount-Image /MountDir:"%Mount%" /commit
if !errorlevel! NEQ 0 (cls&Call :LA 2 Y0019&echo %R%[31m !LA2! %R%[0m
Call :Powershell "Dismount-WindowsImage -Path '%Mount%' -Save")
echo %MainWim% | Findstr /i "boot.wim" > NUL 2>&1
if %errorlevel% EQU 0 (goto :eof)
Call :Mount_Check2
if %Hata% EQU 1 (Call :LA 2 Y0024&cls&echo.&echo %R%[32m !LA2! %R%[0m
FOR /F "tokens=3" %%a in ('Dism /Get-WimInfo /WimFile:%MainWim% ^| Find "Index"') do (
Dism /Export-Image /SourceImageFile:%MainWim% /SourceIndex:%%a /DestinationImageFile:%WimFile%\sources\newinstall.wim /Compress:max /CheckIntegrity)
DEL /F /Q /A "%MainWim%" > NUL 2>&1
Rename "%WimFile%\sources\newinstall.wim" "install.wim" > NUL 2>&1
:: install.wim optimizasyonu opsiyonel ayarı
set Settings1=0
FOR /F "delims=> tokens=2" %%g in ('Findstr /i "Wim_Optimizasyon" %L%\Settings.ini') do (set Settings1=%%g)
if !Settings1! EQU 0 (Call :Mount_Check2
if %Hata% EQU 1 (Call :LA 2 Y0024&cls&echo.&echo %R%[32m !LA2! %R%[0m
FOR /F "tokens=3" %%a in ('Dism /Get-WimInfo /WimFile:%MainWim% ^| Find "Index"') do (
Dism /Export-Image /SourceImageFile:%MainWim% /SourceIndex:%%a /DestinationImageFile:"%WimFile%\sources\newinstall.wim" /Compress:max /CheckIntegrity)
DEL /F /Q /A "%MainWim%" > NUL 2>&1
Rename "%WimFile%\sources\newinstall.wim" "install.wim" > NUL 2>&1
)
)
:: Unmount sonrası ESD sıkıştırma opsiyonel işlemi
set Settings1=1
FOR /F "delims=> tokens=2" %%g in ('Findstr /i "UnMount_ESD" %L%\Settings.ini') do (set Settings1=%%g)
if !Settings1! EQU 0 (Call :LA 2 Y0029&echo.&echo %R%[32m !LA2! %R%[0m
FOR /F "tokens=3" %%a in ('Dism /Get-WimInfo /WimFile:%MainWim% ^| Find "Index"') do (
Dism /Export-Image /SourceImageFile:%MainWim% /SourceIndex:%%a /DestinationImageFile:"%WimFile%\sources\install.esd" /Compress:Recovery /CheckIntegrity)
DEL /F /Q /A "%MainWim%" > NUL 2>&1
)
set Settings1=
set Hata=
goto :eof

:: -------------------------------------------------------------
Expand Down Expand Up @@ -624,39 +639,49 @@ goto :eof
:Mount_Reader
mode con cols=130 lines=40
set Mount_Road=GO
:: Eski bilgi dosyası silinir.
DEL /F /Q /A "%L%\Bin\Logs\wiminfo.txt" > NUL 2>&1
:: Dism ile yüklü mount bilgileri alınır
Dism /Get-Mountedwiminfo > %L%\Bin\Logs\MountInfo.txt
:: Mount yolları .txt içine kayıt edilir. Disk harfini almaz bu bölüm.
set Count=0
FOR /F "delims=':' tokens=3" %%a in ('Find "Mount Dir" %L%\Bin\Logs\MountInfo.txt 2^>NUL') do (
FOR /F "skip=2 delims=':' tokens=2" %%b in ('Find "Mount Dir" %L%\Bin\Logs\MountInfo.txt 2^>NUL') do (
echo %%b | Findstr /i "?" > NUL 2>&1
if !errorlevel! EQU 0 (FOR /F "delims='\\?\' tokens=2" %%c in ('echo %%b ^>NUL') do (set /a Count+=1
set C=%%c
set C=!C:~1!
echo =Mount_!Count!_^>!C!:%%a^> >> %L%\Bin\Logs\wiminfo.txt
))
if !errorlevel! NEQ 0 (set /a Count+=1
set B=%%b
set B=!B:~1!
echo =Mount_!Count!_^>!B!:%%a^> >> %L%\Bin\Logs\wiminfo.txt
)
)
FOR /F "delims=':' tokens=3" %%a in ('Find "Mount Dir" %L%\Bin\Logs\MountInfo.txt 2^>NUL') do (set /a Count+=1
echo =Mount_!Count!_:%%a^> >> %L%\Bin\Logs\wiminfo.txt
)
:: Mount yolunun disk harfi alınır. Parçalar halinde alınmasını nedeni Dism'in karmaşık ifadeler eklemesidir.
set Count=0
FOR /F "delims=':' tokens=3" %%a in ('Find "Image File" %L%\Bin\Logs\MountInfo.txt 2^>NUL') do (
FOR /F "skip=2 delims=':' tokens=2" %%b in ('Find "Image File" %L%\Bin\Logs\MountInfo.txt 2^>NUL') do (
echo %%b | Findstr /i "?" > NUL 2>&1
if !errorlevel! EQU 0 (FOR /F "delims='\\?\' tokens=2" %%c in ('echo %%b ^>NUL') do (set /a Count+=1
set C=%%c
set C=!C:~1!
echo =Wim_!Count!_^>!C!:%%a^> >> %L%\Bin\Logs\wiminfo.txt
))
if !errorlevel! NEQ 0 (set /a Count+=1
set B=%%b
set B=!B:~1!
echo =Wim_!Count!_^>!B!:%%a^> >> %L%\Bin\Logs\wiminfo.txt
)
)
FOR /F "skip=2 delims=':' tokens=2" %%a in ('Find "Mount Dir" %L%\Bin\Logs\MountInfo.txt 2^>NUL') do (
echo %%a | Findstr /i "?" > NUL 2>&1
if !errorlevel! EQU 0 (FOR /F "delims='\\?\' tokens=2" %%b in ('echo %%a') do (set /a Count+=1
set B=%%b
set B=!B: =!
Call :Powershell "(Get-Content '%L%\Bin\Logs\wiminfo.txt') | ForEach-Object { $_ -replace '=Mount_!Count!_:', '=Mount_!Count!_>!B!:' } | Set-Content '%L%\Bin\Logs\wiminfo.txt'")
)
if !errorlevel! NEQ 0 (set /a Count+=1
set B=%%a
set B=!B: =!
Call :Powershell "(Get-Content '%L%\Bin\Logs\wiminfo.txt') | ForEach-Object { $_ -replace '=Mount_!Count!_:', '=Mount_!Count!_>!B!:' } | Set-Content '%L%\Bin\Logs\wiminfo.txt'"
)

)
set Count=0
FOR /F "delims=':' tokens=3" %%a in ('Find "Image File" %L%\Bin\Logs\MountInfo.txt 2^>NUL') do (set /a Count+=1
echo =Wim_!Count!_:%%a^> >> %L%\Bin\Logs\wiminfo.txt
)
:: İmaj yolu alınır
set Count=0
FOR /F "skip=2 delims=':' tokens=2" %%a in ('Find "Image File" %L%\Bin\Logs\MountInfo.txt 2^>NUL') do (
echo %%a | Findstr /i "?" > NUL 2>&1
if !errorlevel! EQU 0 (FOR /F "delims='\\?\' tokens=2" %%b in ('echo %%a') do (set /a Count+=1
set B=%%b
set B=!B: =!
Call :Powershell "(Get-Content '%L%\Bin\Logs\wiminfo.txt') | ForEach-Object { $_ -replace '=Wim_!Count!_:', '=Wim_!Count!_>!B!:' } | Set-Content '%L%\Bin\Logs\wiminfo.txt'")
)
if !errorlevel! NEQ 0 (set /a Count+=1
set B=%%a
set B=!B: =!
Call :Powershell "(Get-Content '%L%\Bin\Logs\wiminfo.txt') | ForEach-Object { $_ -replace '=Wim_!Count!_:', '=Wim_!Count!_>!B!:' } | Set-Content '%L%\Bin\Logs\wiminfo.txt'"
)
)
set Count=0
FOR /F "tokens=4" %%g in ('Findstr /C:"Image Index" %L%\Bin\Logs\MountInfo.txt 2^>NUL') do (
Expand All @@ -665,10 +690,19 @@ FOR /F "tokens=4" %%g in ('Findstr /C:"Image Index" %L%\Bin\Logs\MountInfo.txt 2
)
:: Menü bölümü
cls&echo.&Call :LA 2 Y0013&echo %R%[35m !LA2! %R%[0m&echo.
set Countt=0
FOR /F %%a in ('Findstr /i "=Mount_" D:\Huseyin\0Dev\.Developer\EasyDism\Bin\Logs\wiminfo.txt') do (set /a Countt+=1)
set Count=0
FOR /F "delims=> tokens=2" %%g in ('Findstr /i "=Mount" %L%\Bin\Logs\wiminfo.txt 2^>NUL') do (
set /a Count+=1
echo %R%[32m !Count!-%R%[36m %%g %R%[0m
FOR /L %%z in (1,1,!Countt!) do (
FOR /F "delims=> tokens=2" %%g in ('Findstr /i "=Mount_%%z_" %L%\Bin\Logs\wiminfo.txt 2^>NUL') do (
FOR /F "delims=> tokens=2" %%k in ('Findstr /i "=Wim_%%z_" %L%\Bin\Logs\wiminfo.txt 2^>NUL') do (
FOR /F "delims=> tokens=2" %%j in ('Findstr /i "=Index_%%z_" %L%\Bin\Logs\wiminfo.txt 2^>NUL') do (
set /a Count+=1
echo %R%[32m !Count!-%R%[36m %%g %R%[0m
echo %R%[90m ► %%k [%%j] %R%[0m
)
)
)
)
:: Mount dizini yoksa uyarı mesajı verir
Findstr /i "=Mount_1_" %L%\Bin\Logs\wiminfo.txt > NUL 2>&1
Expand Down
7 changes: 7 additions & 0 deletions Settings.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
-------------------
0: Açık │ 1: Kapalı
-------------------
Wim_Optimizasyon>0>install.wim dosyası içindeki çöp dosyaları temizlemek için indexler çıkartılarak yeni bir install.wim dosyası oluşturulur>
-------------------
UnMount_ESD>1>Mount dizinini topladıktan sonra ESD sıkıştırma yapmasını sağlar>
-------------------

0 comments on commit a5d533a

Please sign in to comment.