modmii.github.io/temp/updater.bat

190 lines
7.2 KiB
Batchfile
Raw Normal View History

2022-04-03 02:23:31 +03:00
::get info and return to caller UNLESS temp\currentversion.txt is detected, not currentversionInfo.txt
2021-01-25 21:35:42 +02:00
@echo off
ModMii v7.0.3 Update - 2024-11-04 - This is likely the last ModMii update that will fully support 32-bit windows or Windows 8 and older. This is a small bug-fix only update so that users unable to use the next BIG update will have something more stable to fall back on. - Reverted the server used by NusFileGrabber back to NUS from RC24's redirect to resolve downloads impacting building themes or sneek. - Updated sourceforge download links to resolve "Some files required for neek installation are missing" issue. - Fixed bug in mym and csm drag and drop theme building operations if the path contained an even number of folders. - Fixed bug where Photo-Channel-1.0-NUS-v2 was not being listed in the Install WADs step of guides for Korean region Wiis. - Fixed harmless "Get-Disk.vbs not found" bug which only impacted ModMii Skin users. This message was safe to ignore as it only indicated that it was unable to detect the format details of connected drives to include in guides saving users the trouble of having to manually check. - Updated broken download links for Bootmii SD files, WiiMC-SS and Customize Mii. Even before this release these issues were being automatically repaired when ModMii checked for updates. - Updated download link for USB Loader GX as the oscwii.org package has problems (for now) with its bundled meta.xml. Even before this release this issue was being automatically repaired when ModMii checked for updates. - Updated Wiimmfi DNS IP. Even before this release this issue was being automatically repaired when ModMii checked for updates. - Stay tuned; I promise the next update will be more exciting!
2024-11-04 12:19:15 +02:00
set newversion=7.0.3
2021-02-20 00:42:39 +02:00
set changelogURL=https://modmii.github.io/changelog.html
2022-04-03 02:23:31 +03:00
::Enable new hidden "set debug=on" setting when testing offline updater.bat changes, careful that this file does not accidentally get deleted during development\testing, save a copy of updater.bat the same folder as ModMii.exe and rename it Updatetemp.bat to test
::note when ModMii downloads updater.bat it is renamed to Updatetemp.bat for legacy purposes
if /i "%debug%" EQU "on" copy "Updatetemp.bat" "Updatetemp_backup.bat">nul
::do not change the below from 6.6.3 for the foreseable future, effective 6.6.4 variable will get updated
if "%currentversion%"=="" set currentversion=6.6.3
if exist temp\currentversionInfo.txt set /p currentversion= <temp\currentversionInfo.txt
if exist temp\skin.txt (set updatermode=skin) else (set updatermode=classic)
2024-12-04 10:19:49 +02:00
if %currentversion% NEQ 7.0.3 goto:skip
if /i "%DBversion%" EQU "24.12.04" goto:skip
echo.
echo Updating File Download Database (DB.bat) with minor changes to fix broken links...
echo.
start /min /wait support\wget --no-check-certificate -t 3 "https://raw.githubusercontent.com/modmii/modmii.github.io/master/Support/subscripts/DB.bat" -O Support/subscripts/DB.bat
2024-02-23 18:12:28 +02:00
call Support/subscripts/DB.bat
:skip
if %currentversion% GEQ 7.0.3 goto:skip
::update old str2hax DNS's, latest change in mid-2024 during 7.0.2 reign
support\sfk filter "Support\Guide\str2hax.001" -rep _"18.188.135.9"_"3.143.163.250"_ -rep _"173.201.71.14"_"3.143.163.250"_ -rep _"97.74.103.14"_"3.143.163.250"_ -write -yes>nul
:skip
2024-12-24 13:44:34 +02:00
if %currentversion% GEQ 6.6.4 goto:skiparcme
2022-04-03 02:23:31 +03:00
2022-05-15 23:20:47 +03:00
::force redownload of old cached ARCME.zip
if not exist "temp\ARCME.zip" goto:skiparcme
::hash is for old zip, if hashes match, then rename it
support\sfk md5 -quiet -verify 4eff09f8a16ab6157edcb339bd909ed3 "temp\ARCME.zip"
if not errorlevel 1 move /y "temp\ARCME.zip" "temp\ARCME_1.0.5.zip"> nul
:skiparcme
2022-04-03 02:23:31 +03:00
if not exist temp\currentversion.txt goto:ReturnToCaller
set /p currentversion= <temp\currentversion.txt
2024-12-24 13:44:34 +02:00
if exist Support\settings.bat call Support\settings.bat
IF "%AudioOption%"=="" set AudioOption=on
IF "%skin%"=="" set skin=Default
if exist "Support\Skins\Default\Fail.mp3" (set "Fail.mp3=Support\Skins\Default\Fail.mp3") else (set "Fail.mp3=Support\Fail.mp3")
if exist "Support\Skins\%skin%\Fail.mp3" set "Fail.mp3=Support\Skins\%skin%\Fail.mp3"
if exist "Support\Skins\Default\Success.mp3" (set "Success.mp3=Support\Skins\Default\Success.mp3") else (set "Success.mp3=Support\Success.mp3")
if exist "Support\Skins\%skin%\Success.mp3" set "Success.mp3=Support\Skins\%skin%\Success.mp3"
set waico=support\icon.ico
set wasig=Brought to you by XFlak
2022-04-03 02:23:31 +03:00
2021-01-28 02:06:39 +02:00
title ModMiiUpdater
set UPDATENAME=ModMii
if exist temp\skin.txt (set updatermode=skin) else (set updatermode=classic)
copy /y support\7za.exe support\7za2.exe>nul
if /i "%updatermode%" EQU "skin" goto:skin
setlocal
chcp 437>nul
2023-03-10 03:37:08 +02:00
::mode con cols=85
2021-01-28 02:06:39 +02:00
color 1f
cls
echo ModMii v%currentversion%
echo by XFlak
echo.
echo.
echo Updating from v%currentversion% to v%newversion%
echo.
echo.
echo Please Wait...
echo.
2023-03-10 03:51:14 +02:00
if exist "%UPDATENAME%.zip" del "%UPDATENAME%.zip">nul
2023-03-10 03:46:09 +02:00
start /min /wait support\wget --no-check-certificate -t 3 https://github.com/modmii/modmii.github.io/releases/download/%newversion%/%UPDATENAME%.zip
2023-03-10 03:51:14 +02:00
if not exist "%UPDATENAME%.zip" goto:updatefail
2021-01-28 02:06:39 +02:00
2024-12-24 13:44:34 +02:00
::if exist "support\ModMii.bat" ren "support\ModMii.bat" "ModMii-v%currentversion%.bat"
::if exist "support\ModMiiSkin.bat" ren "support\ModMiiSkin.bat" "ModMiiSkin-v%currentversion%.bat"
2023-03-10 03:51:14 +02:00
support\7za2 x %UPDATENAME%.zip -aoa
2022-04-04 03:10:17 +03:00
2024-12-24 13:44:34 +02:00
IF %ERRORLEVEL% EQU 0 goto:continue
::if exist "support\ModMii-v%currentversion%.bat" ren "support\ModMii-v%currentversion%.bat" "ModMii.bat"
::if exist "support\ModMiiSkin-v%currentversion%.bat" ren "support\ModMiiSkin-v%currentversion%.bat" "ModMiiSkin.bat"
del support\7za2.exe>nul
if exist %UPDATENAME%.zip del %UPDATENAME%.zip>nul
goto:updatefail
2022-04-04 03:10:17 +03:00
2024-12-24 13:44:34 +02:00
:continue
if exist %UPDATENAME%.zip del %UPDATENAME%.zip>nul
del support\7za2.exe>nul
2022-04-04 03:10:17 +03:00
2024-12-24 13:44:34 +02:00
if /i "%AudioOption%" EQU "on" start support\nircmd.exe mediaplay 3000 "%Success.mp3%"
2021-01-28 02:06:39 +02:00
Start ModMii.exe
exit
2022-04-04 03:10:17 +03:00
2021-01-28 02:06:39 +02:00
:updatefail
2022-04-03 02:23:31 +03:00
2024-12-24 13:44:34 +02:00
if /i "%AudioOption%" EQU "on" start support\nircmd.exe mediaplay 3000 "%Fail.mp3%"
echo Update failed, check your internet connection and antivirus\firewall settings.
2021-01-28 02:06:39 +02:00
echo.
echo Press any key to return to ModMii v%currentversion%
pause>nul
Start ModMii.exe
exit
:skin
::make cmd window transparent and hidden
2024-12-24 13:44:34 +02:00
if /i "%ModMiiverbose%" NEQ "on" support\nircmd.exe win trans ititle "ModMiiUpdater" 0
if /i "%ModMiiverbose%" NEQ "on" support\nircmd.exe win hide ititle "ModMiiUpdater"
2021-01-28 02:06:39 +02:00
2021-02-28 21:29:31 +02:00
copy /y support\wizapp.exe support\wizapp2.exe>nul
2021-01-28 02:06:39 +02:00
setlocal
chcp 437>nul
2024-12-24 13:44:34 +02:00
if exist "Support\Skins\Default\UPDATING.bmp" (set "wabmp=Support\Skins\Default\UPDATING.bmp") else (set wabmp=support\bmp\UPDATING.bmp)
if exist "Support\Skins\%skin%\UPDATING.bmp" set "wabmp=Support\Skins\%skin%\UPDATING.bmp"
2021-01-28 02:06:39 +02:00
set watext=~Updating from v%currentversion% to v%newversion%~~Please Wait...
2024-12-24 13:44:34 +02:00
start support\wizapp2.exe PB OPEN
start support\wizapp2.exe PB UPDATE 25
2021-01-28 02:06:39 +02:00
::Kill ModMiiSkin.exe process so it can be updated
taskkill /im ModMiiSkin.exe /f >nul
2023-03-10 03:51:14 +02:00
if exist "%UPDATENAME%.zip" del "%UPDATENAME%.zip">nul
2023-03-10 03:46:09 +02:00
start /min /wait support\wget --no-check-certificate -t 3 https://github.com/modmii/modmii.github.io/releases/download/%newversion%/%UPDATENAME%.zip
2023-03-10 03:51:14 +02:00
if not exist "%UPDATENAME%.zip" goto:updatefailskin
2021-01-28 02:06:39 +02:00
2022-04-04 03:10:17 +03:00
start support\wizapp2.exe PB UPDATE 50
2021-01-28 02:06:39 +02:00
2024-12-24 13:44:34 +02:00
::if exist "support\ModMii.bat" ren "support\ModMii.bat" "ModMii-v%currentversion%.bat"
::if exist "support\ModMiiSkin.bat" ren "support\ModMiiSkin.bat" "ModMiiSkin-v%currentversion%.bat"
2023-03-10 03:51:14 +02:00
support\7za2 x %UPDATENAME%.zip -aoa
2022-04-04 03:10:17 +03:00
2024-12-24 13:44:34 +02:00
IF %ERRORLEVEL% EQU 0 goto:continue
::if exist "support\ModMii-v%currentversion%.bat" ren "support\ModMii-v%currentversion%.bat" "ModMii.bat"
::if exist "support\ModMiiSkin-v%currentversion%.bat" ren "support\ModMiiSkin-v%currentversion%.bat" "ModMiiSkin.bat"
2021-02-28 21:46:38 +02:00
del support\7za2.exe>nul
del support\wizapp2.exe>nul
2024-12-24 13:44:34 +02:00
if exist %UPDATENAME%.zip del %UPDATENAME%.zip>nul
goto:updatefailskin
2022-04-04 03:10:17 +03:00
2024-12-24 13:44:34 +02:00
:continue
start support\wizapp2.exe PB UPDATE 80
start support\wizapp2.exe PB UPDATE 100
start support\wizapp2.exe PB CLOSE
2022-04-04 03:10:17 +03:00
2024-12-24 13:44:34 +02:00
del support\7za2.exe>nul
del support\wizapp2.exe>nul
if exist %UPDATENAME%.zip del %UPDATENAME%.zip>nul
if /i "%AudioOption%" EQU "on" start support\nircmd.exe mediaplay 3000 "%Success.mp3%"
2022-04-04 03:10:17 +03:00
Start ModMiiSkin.exe
exit
2021-01-28 02:06:39 +02:00
:updatefailskin
start support\wizapp PB UPDATE 100
start support\wizapp PB CLOSE
2024-12-24 13:44:34 +02:00
set watext=~~Update check has failed, check your internet connection and antivirus\firewall settings.~~Click any button to return to ModMiiSkin v%currentversion%
if /i "%AudioOption%" EQU "on" start support\nircmd.exe mediaplay 3000 "%Fail.mp3%"
2021-01-28 02:06:39 +02:00
start /w support\wizapp NOBACK TB
::set wabmp=%wabmplast%
Start ModMiiSkin.exe
exit
::ReturnToCaller should be the last line
:ReturnToCaller