build.cmd: fix cmd script syntax

build.cmd: fix cmd script syntax

--- build.cmd
+++ build.cmd
@@ -3,8 +3,8 @@

 : Check which branch we are on, or just assume master if we are not in a git repository
 for /f %%z in ('git rev-parse --abbrev-ref HEAD') do set GIT_BRANCH=%%z
-if %GIT_BRANCH% =="" (
-    GIT_BRANCH = "master"
+if not defined GIT_BRANCH (
+    set GIT_BRANCH=master
 )

 if "%1"=="/?" (


Add "all" command to build.cmd

Add "all" command to build.cmd

With "all", all build architectures and type are built. If a set of architectures or types
is also given, then the set of builds is restricted to those architecturs or flavors.

For example:
    build all
       -- builds all architectures, and all build types per architecture
    build all x86
       -- builds all build types for x86
    build all x64 x86 Checked Release
       -- builds x64 and x86 architectures, Checked and Release build types for each

--- build.cmd
+++ build.cmd
@@ -1,5 +1,25 @@
 @if not defined __echo @echo off
-setlocal EnableDelayedExpansion
+setlocal EnableDelayedExpansion EnableExtensions
+
+set __ThisScriptShort=%0
+set __ThisScriptFull="%~f0"
+
+:: Note that the msbuild project files (specifically, dir.proj) will use the following variables, if set:
+::      __BuildArch         -- default: x64
+::      __BuildType         -- default: Debug
+::      __BuildOS           -- default: Windows_NT
+::      __ProjectDir        -- default: directory of the dir.props file
+::      __SourceDir         -- default: %__ProjectDir%\src\
+::      __PackagesDir       -- default: %__ProjectDir%\packages\
+::      __RootBinDir        -- default: %__ProjectDir%\bin\
+::      __BinDir            -- default: %__RootBinDir%\%__BuildOS%.%__BuildArch.%__BuildType%\
+::      __IntermediatesDir
+::      __PackagesBinDir    -- default: %__BinDir%\.nuget
+::      __TestWorkingDir    -- default: %__RootBinDir%\tests\%__BuildOS%.%__BuildArch.%__BuildType%\
+::
+:: Thus, these variables are not simply internal to this script!
+::
+:: The UseRoslynCompiler variable is used by src\mscorlib\GenerateCompilerResponseFile.targets.

 :: Set the default arguments for build
 set __BuildArch=x64
@@ -36,6 +56,21 @@
 set __msbuildCleanBuildArgs=
 set __msbuildExtraArgs=

+set __BuildAll=
+
+set __BuildArchX64=0
+set __BuildArchX86=0
+set __BuildArchArm=0
+set __BuildArchArm64=0
+
+set __BuildTypeDebug=0
+set __BuildTypeChecked=0
+set __BuildTypeRelease=0
+
+REM __PassThroughArgs is a set of things that will be passed through to nested calls to build.cmd
+REM when using "all".
+set __PassThroughArgs=
+
 :Arg_Loop
 if "%1" == "" goto ArgsDone

@@ -46,14 +81,20 @@
 if /i "%1" == "/help" goto Usage
 if /i "%1" == "-help" goto Usage

-if /i "%1" == "x64"                 (set __BuildArch=x64&shift&goto Arg_Loop)
-if /i "%1" == "x86"                 (set __BuildArch=x86&shift&goto Arg_Loop)
-if /i "%1" == "arm"                 (set __BuildArch=arm&shift&goto Arg_Loop)
-if /i "%1" == "arm64"               (set __BuildArch=arm64&shift&goto Arg_Loop)
-
-if /i "%1" == "debug"               (set __BuildType=Debug&shift&goto Arg_Loop)
-if /i "%1" == "release"             (set __BuildType=Release&shift&goto Arg_Loop)
-if /i "%1" == "checked"             (set __BuildType=Checked&shift&goto Arg_Loop)
+if /i "%1" == "all"                 (set __BuildAll=1&shift&goto Arg_Loop)
+
+if /i "%1" == "x64"                 (set __BuildArchX64=1&shift&goto Arg_Loop)
+if /i "%1" == "x86"                 (set __BuildArchX86=1&shift&goto Arg_Loop)
+if /i "%1" == "arm"                 (set __BuildArchArm=1&shift&goto Arg_Loop)
+if /i "%1" == "arm64"               (set __BuildArchArm64=1&shift&goto Arg_Loop)
+
+if /i "%1" == "debug"               (set __BuildTypeDebug=1&shift&goto Arg_Loop)
+if /i "%1" == "checked"             (set __BuildTypeChecked=1&shift&goto Arg_Loop)
+if /i "%1" == "release"             (set __BuildTypeRelease=1&shift&goto Arg_Loop)
+
+REM All arguments after this point will be passed through directly to build.cmd on nested invocations
+REM using the "all" argument, and must be added to the __PassThroughArgs variable.
+set __PassThroughArgs=%__PassThroughArgs% %1

 if /i "%1" == "clean"               (set __CleanBuild=1&shift&goto Arg_Loop)

@@ -69,14 +110,14 @@
 if /i "%1" == "skiptests"           (set __SkipTestBuild=1&shift&goto Arg_Loop)
 if /i "%1" == "docrossgen"          (set __DoCrossgen=1&shift&goto Arg_Loop)
 if /i "%1" == "sequential"          (set __BuildSequential=1&shift&goto Arg_Loop)
-if /i "%1" == "priority"            (set __TestPriority=%2&shift&shift&goto Arg_Loop)
+if /i "%1" == "priority"            (set __TestPriority=%2&set __PassThroughArgs=%__PassThroughArgs% %2&shift&shift&goto Arg_Loop)

 @REM For backwards compatibility, continue accepting "skiptestbuild", which was the original name of the option.
 if /i "%1" == "skiptestbuild"       (set __SkipTestBuild=1&shift&goto Arg_Loop)

 @REM It was initially /toolset_dir. Not sure why, since it doesn't match the other usage.
-if /i "%1" == "/toolset_dir"        (set __ToolsetDir=%2&shift&shift&goto Arg_Loop)
-if /i "%1" == "toolset_dir"         (set __ToolsetDir=%2&shift&shift&goto Arg_Loop)
+if /i "%1" == "/toolset_dir"        (set __ToolsetDir=%2&set __PassThroughArgs=%__PassThroughArgs% %2&shift&shift&goto Arg_Loop)
+if /i "%1" == "toolset_dir"         (set __ToolsetDir=%2&set __PassThroughArgs=%__PassThroughArgs% %2&shift&shift&goto Arg_Loop)

 if /i not "%1" == "msbuildargs" goto SkipMsbuildArgs
 :: All the rest of the args will be collected and passed directly to msbuild.
@@ -84,6 +125,7 @@
 shift
 if "%1"=="" goto ArgsDone
 set __msbuildExtraArgs=%__msbuildExtraArgs% %1
+set __PassThroughArgs=%__PassThroughArgs% %1
 goto CollectMsbuildArgs
 :SkipMsbuildArgs

@@ -96,6 +138,29 @@
     echo Error: option 'skipmscorlib' is incompatible with 'freebsdmscorlib', 'linuxmscorlib', 'osxmscorlib', and 'windowsmscorlib'.
     goto Usage
 )
+
+if defined __BuildAll goto BuildAll
+
+set /A __TotalSpecifiedBuildArch=__BuildArchX64 + __BuildArchX86 + __BuildArchArm + __BuildArchArm64
+if %__TotalSpecifiedBuildArch% GTR 1 (
+    echo Error: more than one build architecture specified, but "all" not specified.
+    goto Usage
+)
+
+if %__BuildArchX64%==1      set __BuildArch=x64
+if %__BuildArchX86%==1      set __BuildArch=x86
+if %__BuildArchArm%==1      set __BuildArch=arm
+if %__BuildArchArm64%==1    set __BuildArch=arm64
+
+set /A __TotalSpecifiedBuildType=__BuildTypeDebug + __BuildTypeChecked + __BuildTypeRelease
+if %__TotalSpecifiedBuildType% GTR 1 (
+    echo Error: more than one build type specified, but "all" not specified.
+    goto Usage
+)
+
+if %__BuildTypeDebug%==1    set __BuildType=Debug
+if %__BuildTypeChecked%==1  set __BuildType=Checked
+if %__BuildTypeRelease%==1  set __BuildType=Release

 echo %__MsgPrefix%Commencing CoreCLR Repo build

@@ -196,7 +261,7 @@
 echo %__MsgPrefix%Commencing build of native components for %__BuildOS%.%__BuildArch%.%__BuildType%

 REM Use setlocal to restrict environment changes form vcvarsall.bat and more to just this native components build section.
-setlocal EnableDelayedExpansion
+setlocal EnableDelayedExpansion EnableExtensions

 if /i not "%__BuildArch%" == "arm64" goto NotArm64Build

@@ -343,7 +408,7 @@
 echo %__MsgPrefix%Commencing build of mscorlib for %__BuildOS%.%__BuildArch%.%__BuildType%

 REM setlocal to prepare for vsdevcmd.bat
-setlocal EnableDelayedExpansion
+setlocal EnableDelayedExpansion EnableExtensions

 rem Explicitly set Platform causes conflicts in mscorlib project files. Clear it to allow building from VS x64 Native Tools Command Prompt
 set Platform=
@@ -469,14 +534,92 @@

 REM =========================================================================================
 REM ===
+REM === Handle the "all" case.
+REM ===
+REM =========================================================================================
+
+:BuildAll
+
+set __BuildArchList=
+
+set /A __TotalSpecifiedBuildArch=__BuildArchX64 + __BuildArchX86 + __BuildArchArm + __BuildArchArm64
+if %__TotalSpecifiedBuildArch% EQU 0 (
+    REM Nothing specified means we want to build all architectures.
+    set __BuildArchList=x64 x86 arm arm64
+)
+
+REM Otherwise, add all the specified architectures to the list.
+
+if %__BuildArchX64%==1      set __BuildArchList=%__BuildArchList% x64
+if %__BuildArchX86%==1      set __BuildArchList=%__BuildArchList% x86
+if %__BuildArchArm%==1      set __BuildArchList=%__BuildArchList% arm
+if %__BuildArchArm64%==1    set __BuildArchList=%__BuildArchList% arm64
+
+set __BuildTypeList=
+
+set /A __TotalSpecifiedBuildType=__BuildTypeDebug + __BuildTypeChecked + __BuildTypeRelease
+if %__TotalSpecifiedBuildType% EQU 0 (
+    REM Nothing specified means we want to build all build types.
+    set __BuildTypeList=Debug Checked Release
+)
+
+if %__BuildTypeDebug%==1    set __BuildTypeList=%__BuildTypeList% Debug
+if %__BuildTypeChecked%==1  set __BuildTypeList=%__BuildTypeList% Checked
+if %__BuildTypeRelease%==1  set __BuildTypeList=%__BuildTypeList% Release
+
+REM Create a temporary file to collect build results. We always build all flavors specified, and
+REM report a summary of the results at the end.
+
+set __AllBuildSuccess=true
+set __BuildResultFile=%TEMP%\build-all-summary-%RANDOM%.txt
+if exist %__BuildResultFile% del /f /q %__BuildResultFile%
+
+for %%i in (%__BuildArchList%) do (
+    for %%j in (%__BuildTypeList%) do (
+        call :BuildOne %%i %%j
+    )
+)
+
+if %__AllBuildSuccess%==true (
+    echo %__MsgPrefix%All builds succeeded!
+    exit /b 0
+) else (
+    echo %__MsgPrefix%Builds failed:
+    type %__BuildResultFile%
+    del /f /q %__BuildResultFile%
+    exit /b 1
+)
+
+REM This code is unreachable, but leaving it nonetheless, just in case things change.
+exit /b 99
+
+:BuildOne
+set __BuildArch=%1
+set __BuildType=%2
+set __NextCmd=call %__ThisScriptFull% %__BuildArch% %__BuildType% %__PassThroughArgs%
+echo %__MsgPrefix%Invoking: %__NextCmd%
+%__NextCmd%
+if errorlevel 1 (
+    echo %__MsgPrefix%    %__BuildArch% %__BuildType% %__PassThroughArgs% >> %__BuildResultFile%
+    set __AllBuildSuccess=false
+)
+exit /b 0
+
+REM =========================================================================================
+REM ===
 REM === Helper routines
 REM ===
 REM =========================================================================================

 :Usage
 echo.
+echo Build the CoreCLR repo.
+echo.
 echo Usage:
-echo     %0 [option1] [option2] ...
+echo     %__ThisScriptShort% [option1] [option2] ...
+echo or:
+echo     %__ThisScriptShort% all [option1] [option2] ...
+echo.
 echo All arguments are optional. The options are:
 echo.
 echo./? -? /h -h /help -help: view this message.
@@ -498,6 +641,18 @@
 echo skipnative: skip building native components ^(default: native components are built^).
 echo skiptests: skip building tests ^(default: tests are built^).
 echo toolset_dir ^<dir^> : set the toolset directory -- Arm64 use only. Required for Arm64 builds.
+echo.
+echo If "all" is specified, then all build architectures and types are built. If, in addition,
+echo one or more build architectures or types is specified, then only those build architectures
+echo and types are built.
+echo.
+echo For example:
+echo     build all
+echo        -- builds all architectures, and all build types per architecture
+echo     build all x86
+echo        -- builds all build types for x86
+echo     build all x64 x86 Checked Release
+echo        -- builds x64 and x86 architectures, Checked and Release build types for each
 exit /b 1

 :NoVS


build: patch Windows container, fixing Node 10 (#695)

--- .kokoro/test.bat
+++ .kokoro/test.bat
@@ -17,7 +17,15 @@
 cd /d %~dp0
 cd ..

-call npm install -g npm@latest || goto :error
+@rem The image we're currently running has a broken version of Node.js enabled
+@rem by nvm (v10.15.3), which has no npm bin. This hack uses the functional
+@rem Node v8.9.1 to install npm@latest, it then uses this version of npm to
+@rem install npm for v10.15.3.
+call nvm use v8.9.1 || goto :error
+call node C:\Users\kbuilder\AppData\Roaming\nvm-ps\versions\v8.9.1\node_modules\npm-bootstrap\bin\npm-cli.js i npm -g || goto :error
+call nvm use v10.15.3 || goto :error
+call node C:\Users\kbuilder\AppData\Roaming\nvm-ps\versions\v8.9.1\node_modules\npm\bin\npm-cli.js i npm -g || goto :error
+
 call npm install || goto :error
 call npm run test || goto :error


chore: use latest npm on Windows (#111)

chore: use latest npm on Windows (#111)

--- .kokoro/test.bat
+++ .kokoro/test.bat
@@ -1,4 +1,4 @@
-@rem Copyright 2018 gRPC authors.
+@rem Copyright 2018 Google LLC. All rights reserved.
 @rem
 @rem Licensed under the Apache License, Version 2.0 (the "License");
 @rem you may not use this file except in compliance with the License.
@@ -17,8 +17,7 @@
 cd /d %~dp0
 cd ..

-call npm install -g npm@5 || goto :error
-
+call npm install -g npm@latest || goto :error
 call npm install || goto :error
 call npm run test || goto :error


add explicit .vimrc.bundles parameter to .cmd

--- spf13-vim-windows-install.cmd
+++ spf13-vim-windows-install.cmd
@@ -10,4 +10,4 @@
 call mklink %HOME%\.vimrc.bundles %BASE_DIR%\.vimrc.bundles

 call git clone http://github.com/gmarik/vundle.git %HOME%/.vim/bundle/vundle
-call vim - +BundleInstall! +BundleClean +qall
+call vim -u "$BASE_DIR/.vimrc.bundles" - +BundleInstall! +BundleClean +qall


Copy test sources into the release as well.

--- build-vs2013.bat
+++ build-vs2013.bat
@@ -10,12 +10,14 @@
 mkdir librealsense-dll\bindings
 mkdir librealsense-dll\examples
 mkdir librealsense-dll\librealsense.vc12
+mkdir librealsense-dll\tests

 xcopy bin\* librealsense-dll\bin /S
 xcopy include\* librealsense-dll\include /S
 xcopy bindings\* librealsense-dll\bindings /S
 xcopy examples\* librealsense-dll\examples /S
 xcopy librealsense.vc12\* librealsense-dll\librealsense.vc12 /S
+xcopy tests\* librealsense-dll\tests /S
 xcopy COPYING librealsense-dll\
 xcopy readme.md librealsense-dll\


Update recipes/tip/bld.bat

Update recipes/tip/bld.bat

Co-authored-by: Daniel Ching <4876789ef84f5ace0ae2b99f3357543ddc734747@users.noreply.github.com>

--- recipes/tip/bld.bat
+++ recipes/tip/bld.bat
@@ -3,9 +3,6 @@
 mkdir build
 cd build

-:: Hardcoded USER_VERSION is bad. Can't get previously un-defined
-:: env var that is defined in build.script_env to pass through.
-:: How to do this?
 :: USER_VERSION is used to hardcode version in built executables.
 :: It is typically unnecessary because CMake configure-time uses
 :: git ops to discover tag or commit SHA, both of which are not
@@ -14,7 +11,7 @@
     -DCMAKE_INSTALL_PREFIX:PATH="%LIBRARY_PREFIX%" ^
     -DCMAKE_PREFIX_PATH:PATH="%LIBRARY_PREFIX%" ^
     -DCONDA_PREFIX:PATH="%CONDA_PREFIX%" ^
-    -DUSER_VERSION:STRING=v1.0.2
+    -DUSER_VERSION:STRING="v%PKG_VERSION%"

 if errorlevel 1 exit /b 1


Better build script

Better build script

--- BuildAll.bat
+++ BuildAll.bat
@@ -16,7 +16,7 @@

 rem Start the Visuall Studio build process
-msbuild.exe build\FreeCAD_trunk.sln /m /p:Configuration="Debug"
+msbuild.exe build\FreeCAD_trunk.sln /t:ZERO_CHECK
 msbuild.exe build\FreeCAD_trunk.sln /m /p:Configuration="Debug"
 msbuild.exe build\FreeCAD_trunk.sln /m /p:Configuration="Release"


set env vars

set env vars


Change path where error messages are saved on Homer

--- bravo_logger.bat
+++ bravo_logger.bat
@@ -1,6 +1,6 @@
 @ECHO OFF
 SETLOCAL
-SET LOG_PATH="H:\bravo_logs\"
+SET LOG_PATH="Y:\Bravo\bravo_logs\"
 SET LOG_FILE="marvin_errors.log"
 IF NOT EXIST %LOG_PATH% (SET LOG_PATH="%USERPROFILE%\Desktop\")
 SET SCRIPT="%USERPROFILE%\Repos\standalone_scripts\upload_robot_logs.py"


Script to download MinGW

Script to download MinGW

There are multiple flavours of MinGW. mingw-builds provides multiple
variants of MinGW that the script can download. The version, threading
model and exception model can all be different. This can be used on
build servers to automatically provide builds and artefacts for multiple
variants of MinGW


[Rust] Fix _start-example.bat using wrong symbol for multi-line

--- Games/Unity/Oxide.Game.Rust/Files/_start-example.bat
+++ Games/Unity/Oxide.Game.Rust/Files/_start-example.bat
@@ -3,21 +3,21 @@
 :start
 echo Starting server...

-RustDedicated.exe -batchmode -nographics /
-+rcon.ip 0.0.0.0 /
-+rcon.port 28016 /
-+rcon.password "changeme" /
-+server.ip 0.0.0.0 /
-+server.port 28015 /
-+server.maxplayers 10 /
-+server.hostname "My Oxide Server" /
-+server.identity "my_server_identity" /
-+server.level "Procedural Map" /
-+server.seed 12345 +server.worldsize 4000 /
-+server.saveinterval 300 /
-+server.globalchat true /
-+server.description "Powered by Oxide" /
-+server.headerimage "http://i.imgur.com/xNyLhMt.jpg" /
+RustDedicated.exe -batchmode -nographics ^
++rcon.ip 0.0.0.0 ^
++rcon.port 28016 ^
++rcon.password "changeme" ^
++server.ip 0.0.0.0 ^
++server.port 28015 ^
++server.maxplayers 10 ^
++server.hostname "My Oxide Server" ^
++server.identity "my_server_identity" ^
++server.level "Procedural Map" ^
++server.seed 12345 +server.worldsize 4000 ^
++server.saveinterval 300 ^
++server.globalchat true ^
++server.description "Powered by Oxide" ^
++server.headerimage "http://i.imgur.com/xNyLhMt.jpg" ^
 +server.url "http://oxidemod.org"

 echo.


edit push script

edit push script

--- BuildTools/push.bat
+++ BuildTools/push.bat
@@ -1 +1 @@
-nuget push ReactiveProperty-PCL.0.4.0.0.nupkg
+nuget push ReactiveProperty*.nupkg


Add startup script for portable postgresql in windows


Add ailment to setup.bat

Add ailment to setup.bat


update script

update script

--- build_script.bat
+++ build_script.bat
@@ -4,7 +4,7 @@
 goto custom_python:

 :default_value_python:
-set pythonexe="c:\Python35_x64\python"
+set pythonexe="c:\Python36_x64\python"
 :custom_python:
 %pythonexe% -u setup.py build_script
 if %errorlevel% neq 0 exit /b %errorlevel%


Added test script for windows

Added test script for windows

error: pathspec 'scripts/testrun.bat' did not match any file(s) known to git

--- scripts/testrun.bat
+++ scripts/testrun.bat
@@ -0,0 +1,37 @@
+echo off
+REM use echoproxy and Java wsdl compiler (wsimport) to find list of url's that wsdl uses
+pushd ..
+call mvn clean package
+cls
+
+echo Starting echo proxy
+
+start cmd /c "title=echoproxy-1337 & java -jar target/echoproxy-1.0.jar -httpProxy webproxy:8080 -port 1337 -echoFile target\echo.log -shutdownKey 7331"
+timeout 3 1> nul
+echo Starting analysis
+
+mkdir target\out1
+set name1=OIOAbonnentVirksomhedStamOplysningHent
+echo Analyzing %name1%.wsdl
+call wsimport -d target\out1 -quiet -Xnocompile -httpproxy:localhost:1337 http://85.81.229.78/services/prod/ES/wsdl/OIOAbonnentVirksomhedStamOplysningHent.wsdl
+move target\echo.log target\%name1%.log 1> nul
+
+mkdir target\out2
+set name2=OIOAbonnentCVRSENummerRelationHent
+echo Analyzing %name2%.wsdl
+call wsimport -d target\out2 -quiet -Xnocompile -httpproxy:localhost:1337 http://85.81.229.78/services/prod/ES/wsdl/OIOAbonnentCVRSENummerRelationHent.wsdl
+move target\echo.log target\%name2%.log 1> nul
+echo.
+<nul set /p notused="Resources used by %name1%: "
+type target\%name1%.log | find /c /v ""
+echo See details in target\%name1%.log
+<nul set /p notused="Resources used by %name2%: "
+type target\%name2%.log | find /c /v ""
+echo See details in target\%name2%.log
+
+REM tasklist /FI "WINDOWTITLE eq echoproxy-1337*" /FI "IMAGENAME eq cmd.exe"
+echo.
+echo Stopping echo proxy
+taskkill /FI "WINDOWTITLE eq echoproxy-1337*" /FI "IMAGENAME eq cmd.exe" 1> nul
+popd
+echo on


Issue number:  20
Obtained from: mpoisot
Submitted by:  mpoisot
Reviewed by:

Modified Windows batch script to no longer show a console window when run via the Windows GUI interface.

CVS: ----------------------------------------------------------------------
CVS: Issue number:
CVS:   If this change addresses one or more issues,
CVS:   then enter the issue number(s) here.
CVS: Obtained from:
CVS:   If this change has been taken from another system,
CVS:   then name the system in this line, otherwise delete it.
CVS: Submitted by:
CVS:   If this code has been contributed to the project by someone else; i.e.,
CVS:   they sent us a patch or a set of diffs, then include their name/email
CVS:   address here. If this is your work then delete this line.
CVS: Reviewed by:
CVS:   If we are doing pre-commit code reviews and someone else has
CVS:   reviewed your changes, include their name(s) here.
CVS:   If you have not had it reviewed then delete this line.

--- scripts/cockpit.bat
+++ scripts/cockpit.bat
@@ -8,4 +8,4 @@
 set CP=%CP%;libs/commons-httpclient/commons-httpclient-3.0.1.jar
 set CP=%CP%;libs/misc/BareBonesBrowserLaunch.jar

-java -classpath %CP% org.jets3t.apps.cockpit.Cockpit
+start javaw -classpath %CP% org.jets3t.apps.cockpit.Cockpit


fixing start.bat so server begins..

fixing start.bat so server begins..

--- start.bat
+++ start.bat
@@ -1,2 +1 @@
-cd node
-..\bin\node server.js
+bin\node.exe node_modules\ep_etherpad-lite\node\server.js


修改init做测试

修改init做测试

error: pathspec 'init-bak.cmd' did not match any file(s) known to git

--- init-bak.cmd
+++ init-bak.cmd
@@ -0,0 +1,37 @@
+@echo off
+color 03
+REM =====================================
+REM   ʼwebĿ 0.1 Author Theowang
+REM
+REM =====================================
+SETLOCAL ENABLEEXTENSIONS
+
+echo.
+echo ʼwebĿ 0.1 Author Theowang
+
+
+
+:copyFile
+echo.
+echo ݡ
+echo.
+xcopy /e "%~dp0\\init" "%~dpf1"
+goto getInNewFolder
+
+:getInNewFolder
+echo.
+echo ݳɹO(_)O~
+echo.
+cd "%~dpf1"
+goto createCompass
+
+:createCompass
+compass init
+echo.
+echo **** ~O(_)O~ ʼɹ ****
+echo.
+goto End
+
+:End
+ENDLOCAL
+pause


Fix source files being copied to the wrong directory.

--- build/copy-files-for-packaging.cmd
+++ build/copy-files-for-packaging.cmd
@@ -20,7 +20,7 @@

 @echo ==========================
 @echo Copying source files for NuGet symbols package
-xcopy /ys src\* NuGet\src\src\
+xcopy /ys src\* %TO_PACK_TARGET%\src\src\

 @echo ==========================
 @echo Copying signed files to the NuGet lib path


changed server

changed server

--- Windows/patcher.bat
+++ Windows/patcher.bat
@@ -1,817 +1,797 @@
-@echo off
-mode 120,30
-chcp 65001
-if exist C:\Users\%username%\Desktop\DebugPatcher.txt goto debug_failsafe_begin
-goto begin
-:begin
-if not exist %appdata%\WiimmfiPatcher\temp\ md %appdata%\WiimmfiPatcher\temp\
-set patchingok=1
-set mode=126,35
-mode %mode%
-set /a cor=0
-set /a patchingnumber=1
-set /a repeatvbs=0
-set /a temperrorlev=0
-set last_build=2017/09/14
-set at=22:47
-set version=2.1.3
-set /a
-
-if not exist %appdata%\WiimmfiPatcher\temp\vbs.vbs echo x=msgbox("When the operation will be done, click any button." ,64, "Wiimmfi WAD Patcher") >>%appdata%\WiimmfiPatcher\temp\vbs.vbs
-@echo off
-title Wiimmfi Patcher for WAD's v.%version%  Created by @KcrPL, @Larsenv, @PokeAcer
-cls
-
-set /a patherror=0
-if "%cd%"=="%windir%\system32" set /a patherror=1
-if %patherror%==0 if not exist patcher.bat set /a patherror=2
-
-:: ### Auto Update ###
-set /a WiiWarePatcher_Update_Activate=1
-set /a whatsnew=1
-set /a offlinestorage=0
-set FilesHostedOn=https://rc24.xyz/Patchers_Auto_Update/WiiWare-Patcher
-set MainFolder=%appdata%\WiiWare-Patcher
-set TempStorage=%appdata%\WiiWare-Patcher\internet\temp
-
-
-if exist temp.bat del temp.bat /q
-goto begin_main
-:begin_main
-mode 126,40
-cls
-echo Wiimmfi WiiWarePatcher - (C) Larsenv, (C) KcrPL, (C) PokeAcer. v%version%. (Compiled on %last_build% at %at%)
-if %WiiWarePatcher_Update_Activate%==1 if %patherror%==0 echo              `..````
-if %WiiWarePatcher_Update_Activate%==1 if %patherror%==0 echo              yNNNNNNNNMNNmmmmdddhhhyyyysssooo+++/:--.`
-if %WiiWarePatcher_Update_Activate%==1 if %patherror%==0 echo              ddmNNd:dNMMMMNMMMMMMMMMMMMMMMMMMMMMMMMMMs
-if %WiiWarePatcher_Update_Activate%==1 if %patherror%==0 echo              hNNNNNNNNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMd
-
-if %patherror%==1 echo :----------------------------------------------------------------:
-if %patherror%==1 echo : Warning: Please run this application without admin privilages. :
-if %patherror%==1 echo :----------------------------------------------------------------:
-
-if %patherror%==2 echo :------------------------------------------------------------------------------------------------------:
-if %patherror%==2 echo : Warning: patcher.bat not found. You may be running this application from unknown and untrusted source:
-if %patherror%==2 echo :------------------------------------------------------------------------------------------------------:
-
-if %WiiWarePatcher_Update_Activate%==0 echo :------------------------------------------------------------------------------------------------------:
-if %WiiWarePatcher_Update_Activate%==0 echo : Warning: Auto updates are disabled.                                                                  :
-if %WiiWarePatcher_Update_Activate%==0 echo :------------------------------------------------------------------------------------------------------:
-
-echo             `mdmNNy dNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM+    Wiimmfi WADs Patcher.
-echo             .mmmmNs mNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM:
-echo             :mdmmN+`mNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM.
-echo             /mmmmN:-mNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMN   Play Wii games online after Nintendo WFC shutdown!
-echo             ommmmN.:mMMMMMMMMMMMMmNMMMMMMMMMMMMMMMMMd    Press any button to continue
-echo             smmmmm`+mMMMMMMMMMNhMNNMNNMMMMMMMMMMMMMMy
-echo             hmmmmh omMMMMMMMMMmhNMMMmNNNNMMMMMMMMMMM+
-echo             mmmmms smMMMMMMMMMmddMMmmNmNMMMMMMMMMMMM:
-echo            `mmmmmo hNMMMMMMMMMmddNMMMNNMMMMMMMMMMMMM.
-echo            -mmmmm/ dNMMMMMMMMMNmddMMMNdhdMMMMMMMMMMN
-echo            :mmmmm-`mNMMMMMMMMNNmmmNMMNmmmMMMMMMMMMMd
-echo            +mmmmN.-mNMMMMMMMMMNmmmmMMMMMMMMMMMMMMMMy
-echo            smmmmm`/mMMMMMMMMMNNmmmmNMMMMNMMNMMMMMNmy.
-echo            hmmmmd`omMMMMMMMMMNNmmmNmMNNMmNNNNMNdhyhh.
-echo            mmmmmh ymMMMMMMMMMNNmmmNmNNNMNNMMMMNyyhhh`
-echo           `mmmmmy hmMMNMNNMMMNNmmmmmdNMMNmmMMMMhyhhy
-echo           -mddmmo`mNMNNNNMMMNNNmdyoo+mMMMNmNMMMNyyys
-echo           :mdmmmo-mNNNNNNNNNNdyo++sssyNMMMMMMMMMhs+-
-echo          .+mmdhhmmmNNNNNNmdysooooosssomMMMNNNMMMm
-echo          o/ossyhdmmNNmdyo+++oooooosssoyNMMNNNMMMM+
-echo          o/::::::://++//+++ooooooo+oo++mNMMmNNMMMm
-echo         `o//::::::::+////+++++++///:/+shNMMNmNNmMM+
-echo         .o////////::+++++++oo++///+syyyymMmNmmmNMMm
-echo         -+//////////o+ooooooosydmdddhhsosNMMmNNNmho            `:/
-echo         .+++++++++++ssss+//oyyysso/:/shmshhs+:.          `-/oydNNNy
-echo           `..-:/+ooss+-`          +mmhdy`           -/shmNNNNNdy+:`
-echo                   `.              yddyo++:    `-/oymNNNNNdy+:`
-echo                                   -odhhhhyddmmmmmNNmhs/:`
-echo                                     :syhdyyyyso+/-`
-pause>NUL
-if %patherror%==1 goto begin_main
-goto startup_script
-:error_update_not_available
-cls
-echo.
-echo              `..````
-echo              yNNNNNNNNMNNmmmmdddhhhyyyysssooo+++/:--.`
-echo              hNNNNNNNNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMd
-echo              ddmNNd:dNMMMMNMMMMMMMMMMMMMMMMMMMMMMMMMMs
-echo             `mdmNNy dNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM+
-echo             .mmmmNs mNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM:
-echo             :mdmmN+`mNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM.
-echo             /mmmmN:-mNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMN
-echo             ommmmN.:mMMMMMMMMMMMMmNMMMMMMMMMMMMMMMMMd
-echo             smmmmm`+mMMMMMMMMMNhMNNMNNMMMMMMMMMMMMMMy
-echo             hmmmmh omMMMMMMMMMmhNMMMmNNNNMMMMMMMMMMM+
-echo ------------------------------------------------------------------------------------------------------------------------------
-echo    /---\   Error.
-echo   /     \  An Update server is not available.
-echo  /   !   \
-echo  ---------
-echo.
-echo            Press any button to continue.
-echo ------------------------------------------------------------------------------------------------------------------------------
-echo           -mddmmo`mNMNNNNMMMNNNmdyoo+mMMMNmNMMMNyyys
-echo           :mdmmmo-mNNNNNNNNNNdyo++sssyNMMMMMMMMMhs+-
-echo          .+mmdhhmmmNNNNNNmdysooooosssomMMMNNNMMMm
-echo          o/ossyhdmmNNmdyo+++oooooosssoyNMMNNNMMMM+
-echo          o/::::::://++//+++ooooooo+oo++mNMMmNNMMMm
-echo         `o//::::::::+////+++++++///:/+shNMMNmNNmMM+
-echo         .o////////::+++++++oo++///+syyyymMmNmmmNMMm
-echo         -+//////////o+ooooooosydmdddhhsosNMMmNNNmho            `:/
-echo         .+++++++++++ssss+//oyyysso/:/shmshhs+:.          `-/oydNNNy
-echo           `..-:/+ooss+-`          +mmhdy`           -/shmNNNNNdy+:`
-echo                   `.              yddyo++:    `-/oymNNNNNdy+:`
-echo                                   -odhhhhyddmmmmmNNmhs/:`
-echo                                     :syhdyyyyso+/-`
-pause>NUL
-goto begin_main
-:startup_script
-mode %mode%
-cls
-echo.
-echo              `..````
-echo              yNNNNNNNNMNNmmmmdddhhhyyyysssooo+++/:--.`
-echo              hNNNNNNNNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMd
-echo              ddmNNd:dNMMMMNMMMMMMMMMMMMMMMMMMMMMMMMMMs
-echo             `mdmNNy dNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM+
-echo             .mmmmNs mNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM:
-echo             :mdmmN+`mNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM.
-echo             /mmmmN:-mNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMN
-echo             ommmmN.:mMMMMMMMMMMMMmNMMMMMMMMMMMMMMMMMd
-echo             smmmmm`+mMMMMMMMMMNhMNNMNNMMMMMMMMMMMMMMy
-echo             hmmmmh omMMMMMMMMMmhNMMMmNNNNMMMMMMMMMMM+
-echo             mmmmms smMMMMMMMMMmddMMmmNmNMMMMMMMMMMMM:
-echo            `mmmmmo hNMMMMMMMMMmddNMMMNNMMMMMMMMMMMMM.
-echo            -mmmmm/ dNMMMMMMMMMNmddMMMNdhdMMMMMMMMMMN
-echo            :mmmmm-`mNMMMMMMMMNNmmmNMMNmmmMMMMMMMMMMd
-echo            +mmmmN.-mNMMMMMMMMMNmmmmMMMMMMMMMMMMMMMMy
-echo            smmmmm`/mMMMMMMMMMNNmmmmNMMMMNMMNMMMMMNmy.
-echo            hmmmmd`omMMMMMMMMMNNmmmNmMNNMmNNNNMNdhyhh.
-echo            mmmmmh ymMMMMMMMMMNNmmmNmNNNMNNMMMMNyyhhh`
-echo           `mmmmmy hmMMNMNNMMMNNmmmmmdNMMNmmMMMMhyhhy
-echo           -mddmmo`mNMNNNNMMMNNNmdyoo+mMMMNmNMMMNyyys
-echo           :mdmmmo-mNNNNNNNNNNdyo++sssyNMMMMMMMMMhs+-
-echo          .+mmdhhmmmNNNNNNmdysooooosssomMMMNNNMMMm
-echo          o/ossyhdmmNNmdyo+++oooooosssoyNMMNNNMMMM+
-echo          o/::::::://++//+++ooooooo+oo++mNMMmNNMMMm
-echo         `o//::::::::+////+++++++///:/+shNMMNmNNmMM+
-echo         .o////////::+++++++oo++///+syyyymMmNmmmNMMm
-echo         -+//////////o+ooooooosydmdddhhsosNMMmNNNmho            `:/
-echo         .+++++++++++ssss+//oyyysso/:/shmshhs+:.          `-/oydNNNy
-echo           `..-:/+ooss+-`          +mmhdy`           -/shmNNNNNdy+:`
-echo                   `.              yddyo++:    `-/oymNNNNNdy+:`
-echo                                   -odhhhhyddmmmmmNNmhs/:`
-echo                                     :syhdyyyyso+/-`
-echo                                                                        Please wait...
-set updateversion=0.0.0
-
-if %offlinestorage%==0 if exist %TempStorage%\version.txt del %TempStorage%\version.txt /q
-if %offlinestorage%==0 if exist %TempStorage%\version.txt` del %TempStorage%\version.txt` /q
-if %offlinestorage%==0 if exist %TempStorage%\whatsnew.txt del %TempStorage%\whatsnew.txt /q
-if %offlinestorage%==0 if exist %TempStorage%\whatsnew.txt` del %TempStorage%\whatsnew.txt` /q
-
-if not exist %TempStorage% md %TempStorage%
-if %WiiWarePatcher_Update_Activate%==1 if %offlinestorage%==0 powershell -command "(new-object System.Net.WebClient).DownloadFile('%FilesHostedOn%/whatsnew.txt', '%TempStorage%/whatsnew.txt')"
-if %WiiWarePatcher_Update_Activate%==1 if %offlinestorage%==0 powershell -command "(new-object System.Net.WebClient).DownloadFile('%FilesHostedOn%/version.txt', '%TempStorage%/version.txt')"
-
-	if %offlinestorage%==0 set /a temperrorlev=%errorlevel%
-
-	::Bind error codes to errors here
-	if %offlinestorage%==0 if not %errorlevel%==0 goto error_update_not_available
-
-
-if exist "%TempStorage%\version.txt`" ren "%TempStorage%\version.txt`" "version.txt"
-if exist "%TempStorage%\whatsnew.txt`" ren "%TempStorage%\whatsnew.txt`" "whatsnew.txt"
-
-if exist %TempStorage%\version.txt set /p updateversion=<%TempStorage%\version.txt
-if not exist %TempStorage%\version.txt set /a updateavailable=0
-if %WiiWarePatcher_Update_Activate%==1 if exist %TempStorage%\version.txt set /a updateavailable=1
-if %updateversion%==%version% set /a updateavailable=0
-
-if %WiiWarePatcher_Update_Activate%==1 if %updateavailable%==1 goto update_notice
-
-if not exist Sharpii.exe goto files_req_err
-if not exist libWiiSharp.dll goto files_req_err
-if not exist lzx.exe goto files_req_err
-if not exist WadInstaller.dll goto files_req_err
-if not exist WiiwarePatcher.exe goto files_req_err
-
-set /a errorwinxp=0
-timeout -0 /nobreak >NUL || set /a errorwinxp=1
-if %errorwinxp%==1 goto winxp_notice
-
-goto main_fade_out
-:main_fade_out
-cls
-echo.
-echo              `..````
-echo              yNNNNNNNNMNNmmmmdddhhhyyyysssooo+++/:--.`
-echo              hNNNNNNNNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMd
-echo              ddmNNd:dNMMMMNMMMMMMMMMMMMMMMMMMMMMMMMMMs
-echo             `mdmNNy dNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM+
-echo             .mmmmNs mNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM:
-echo             :mdmmN+`mNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM.
-echo             /mmmmN:-mNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMN
-echo             ommmmN.:mMMMMMMMMMMMMmNMMMMMMMMMMMMMMMMMd
-echo             smmmmm`+mMMMMMMMMMNhMNNMNNMMMMMMMMMMMMMMy
-echo             hmmmmh omMMMMMMMMMmhNMMMmNNNNMMMMMMMMMMM+
-echo             mmmmms smMMMMMMMMMmddMMmmNmNMMMMMMMMMMMM:
-echo            `mmmmmo hNMMMMMMMMMmddNMMMNNMMMMMMMMMMMMM.
-echo            -mmmmm/ dNMMMMMMMMMNmddMMMNdhdMMMMMMMMMMN
-echo            :mmmmm-`mNMMMMMMMMNNmmmNMMNmmmMMMMMMMMMMd
-echo            +mmmmN.-mNMMMMMMMMMNmmmmMMMMMMMMMMMMMMMMy
-echo            smmmmm`/mMMMMMMMMMNNmmmmNMMMMNMMNMMMMMNmy.
-echo            hmmmmd`omMMMMMMMMMNNmmmNmMNNMmNNNNMNdhyhh.
-echo            mmmmmh ymMMMMMMMMMNNmmmNmNNNMNNMMMMNyyhhh`
-echo           `mmmmmy hmMMNMNNMMMNNmmmmmdNMMNmmMMMMhyhhy
-echo           -mddmmo`mNMNNNNMMMNNNmdyoo+mMMMNmNMMMNyyys
-echo           :mdmmmo-mNNNNNNNNNNdyo++sssyNMMMMMMMMMhs+-
-echo          .+mmdhhmmmNNNNNNmdysooooosssomMMMNNNMMMm
-echo          o/ossyhdmmNNmdyo+++oooooosssoyNMMNNNMMMM+
-echo          o/::::::://++//+++ooooooo+oo++mNMMmNNMMMm
-echo         `o//::::::::+////+++++++///:/+shNMMNmNNmMM+
-echo         .o////////::+++++++oo++///+syyyymMmNmmmNMMm
-echo         -+//////////o+ooooooosydmdddhhsosNMMmNNNmho            `:/
-echo         .+++++++++++ssss+//oyyysso/:/shmshhs+:.          `-/oydNNNy
-echo           `..-:/+ooss+-`          +mmhdy`           -/shmNNNNNdy+:`
-echo                   `.              yddyo++:    `-/oymNNNNNdy+:`
-echo                                   -odhhhhyddmmmmmNNmhs/:`
-echo                                     :syhdyyyyso+/-`
-echo.
-ping localhost -n 3 >NUL
-goto choose_patch_type
-:update_notice
-set /a update=1
-cls
-echo.
-echo              `..````
-echo              yNNNNNNNNMNNmmmmdddhhhyyyysssooo+++/:--.`
-echo              hNNNNNNNNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMd
-echo              ddmNNd:dNMMMMNMMMMMMMMMMMMMMMMMMMMMMMMMMs
-echo             `mdmNNy dNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM+
-echo             .mmmmNs mNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM:
-echo             :mdmmN+`mNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM.
-echo             /mmmmN:-mNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMN
-echo             ommmmN.:mMMMMMMMMMMMMmNMMMMMMMMMMMMMMMMMd
-echo             smmmmm`+mMMMMMMMMMNhMNNMNNMMMMMMMMMMMMMMy
-echo             hmmmmh omMMMMMMMMMmhNMMMmNNNNMMMMMMMMMMM+
-echo ------------------------------------------------------------------------------------------------------------------------------
-echo    /---\   An Update is available.
-echo   /     \  An Update for this program is available. We suggest updating the WiiWare Patcher to the latest version.
-echo  /   !   \
-echo  ---------  Current version: %version%
-echo             New version: %updateversion%
-echo                       1. Update                      2. Dismiss               3. What's new in this update?
-echo ------------------------------------------------------------------------------------------------------------------------------
-echo           -mddmmo`mNMNNNNMMMNNNmdyoo+mMMMNmNMMMNyyys
-echo           :mdmmmo-mNNNNNNNNNNdyo++sssyNMMMMMMMMMhs+-
-echo          .+mmdhhmmmNNNNNNmdysooooosssomMMMNNNMMMm
-echo          o/ossyhdmmNNmdyo+++oooooosssoyNMMNNNMMMM+
-echo          o/::::::://++//+++ooooooo+oo++mNMMmNNMMMm
-echo         `o//::::::::+////+++++++///:/+shNMMNmNNmMM+
-echo         .o////////::+++++++oo++///+syyyymMmNmmmNMMm
-echo         -+//////////o+ooooooosydmdddhhsosNMMmNNNmho            `:/
-echo         .+++++++++++ssss+//oyyysso/:/shmshhs+:.          `-/oydNNNy
-echo           `..-:/+ooss+-`          +mmhdy`           -/shmNNNNNdy+:`
-echo                   `.              yddyo++:    `-/oymNNNNNdy+:`
-echo                                   -odhhhhyddmmmmmNNmhs/:`
-echo                                     :syhdyyyyso+/-`
-set /p s=
-if %s%==1 goto update_files
-if %s%==2 goto begin_main
-if %s%==3 goto whatsnew
-goto update_notice
-:update_files
-cls
-cls
-echo.
-echo              `..````
-echo              yNNNNNNNNMNNmmmmdddhhhyyyysssooo+++/:--.`
-echo              hNNNNNNNNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMd
-echo              ddmNNd:dNMMMMNMMMMMMMMMMMMMMMMMMMMMMMMMMs
-echo             `mdmNNy dNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM+
-echo             .mmmmNs mNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM:
-echo             :mdmmN+`mNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM.
-echo             /mmmmN:-mNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMN
-echo             ommmmN.:mMMMMMMMMMMMMmNMMMMMMMMMMMMMMMMMd
-echo             smmmmm`+mMMMMMMMMMNhMNNMNNMMMMMMMMMMMMMMy
-echo             hmmmmh omMMMMMMMMMmhNMMMmNNNNMMMMMMMMMMM+
-echo ------------------------------------------------------------------------------------------------------------------------------
-echo    /---\   Updating.
-echo   /     \  Please wait...
-echo  /   !   \
-echo  --------- WiiWare Patcher will restart shortly...
-echo.
-echo.
-echo ------------------------------------------------------------------------------------------------------------------------------
-echo           -mddmmo`mNMNNNNMMMNNNmdyoo+mMMMNmNMMMNyyys
-echo           :mdmmmo-mNNNNNNNNNNdyo++sssyNMMMMMMMMMhs+-
-echo          .+mmdhhmmmNNNNNNmdysooooosssomMMMNNNMMMm
-echo          o/ossyhdmmNNmdyo+++oooooosssoyNMMNNNMMMM+
-echo          o/::::::://++//+++ooooooo+oo++mNMMmNNMMMm
-echo         `o//::::::::+////+++++++///:/+shNMMNmNNmMM+
-echo         .o////////::+++++++oo++///+syyyymMmNmmmNMMm
-echo         -+//////////o+ooooooosydmdddhhsosNMMmNNNmho            `:/
-echo         .+++++++++++ssss+//oyyysso/:/shmshhs+:.          `-/oydNNNy
-echo           `..-:/+ooss+-`          +mmhdy`           -/shmNNNNNdy+:`
-echo                   `.              yddyo++:    `-/oymNNNNNdy+:`
-echo                                   -odhhhhyddmmmmmNNmhs/:`
-echo                                     :syhdyyyyso+/-`
-if exist WadInstaller.dll` del WadInstaller.dll` /q 2> nul
-if exist WiiwarePatcher.exe` del wget.exe` /q 2> nul
-if exist lzx.exe` del xdelta3.exe` 2> nul
-if exist patcher.bat` del patch.bat` /q 2> nul
-if exist libWiiSharp.dll` del  libWiiSharp.dll` /q 2> nul
-if exist Sharpii.exe` del Sharpii.exe` /q 2> nul
-
-powershell -command "(new-object System.Net.WebClient).DownloadFile('%FilesHostedOn%/WadInstaller.dll', 'WadInstaller.dll`')"
-powershell -command "(new-object System.Net.WebClient).DownloadFile('%FilesHostedOn%/WiiwarePatcher.exe', 'WiiwarePatcher.exe`')"
-powershell -command "(new-object System.Net.WebClient).DownloadFile('%FilesHostedOn%/lzx.exe', 'lzx.exe`')"
-powershell -command "(new-object System.Net.WebClient).DownloadFile('%FilesHostedOn%/patcher.bat', 'patcher.bat`')"
-powershell -command "(new-object System.Net.WebClient).DownloadFile('%FilesHostedOn%/libWiiSharp.dll', 'libWiiSharp.dll`')"
-powershell -command "(new-object System.Net.WebClient).DownloadFile('%FilesHostedOn%/Sharpii.exe', 'Sharpii.exe`')"
-
-if %update%==1 if not exist WadInstaller.dll` goto error_update_not_available
-if %update%==1 if not exist WiiwarePatcher.exe` goto error_update_not_available
-if %update%==1 if not exist lzx.exe` goto error_update_not_available
-if %update%==1 if not exist patcher.bat` goto error_update_not_available
-if %update%==1 if not exist libWiiSharp.dll` goto error_update_not_available
-if %update%==1 if not exist Sharpii.exe` goto error_update_not_available
-
-if exist WadInstaller.dll del WadInstaller.dll /q
-if exist WiiwarePatcher.exe del WiiwarePatcher.exe /q
-if exist lzx.exe del lzx.exe /q
-if exist libWiiSharp.dll del libWiiSharp.dll /q
-if exist Sharpii.exe del Sharpii.exe /q
-
-ren WadInstaller.dll` WadInstaller.dll
-ren WiiwarePatcher.exe` WiiwarePatcher.exe
-ren lzx.exe` lzx.exe
-ren libWiiSharp.dll` libWiiSharp.dll
-ren Sharpii.exe` Sharpii.exe
-
-echo ping localhost -n 2 >>temp.bat
-echo del patcher.bat /q >>temp.bat
-echo ren patcher.bat` patcher.bat >>temp.bat
-echo start patcher.bat >>temp.bat
-echo exit >>temp.bat
-start temp.bat
-exit
-exit
-exit
-:whatsnew
-cls
-if not exist %TempStorage%\whatsnew.txt goto whatsnew_notexist
-echo Wiimmfi WiiWarePatcher - (C) Larsenv, (C) KcrPL, (C) PokeAcer. v%version%. (Compiled on %last_build% at %at%)
-echo ------------------------------------------------------------------------------------------------------------------------------
-echo.
-echo What's new in update %updateversion%?
-echo.
-type %TempStorage%\whatsnew.txt
-pause>NUL
-goto update_notice
-:whatsnew_notexist
-cls
-echo Wiimmfi WiiWarePatcher - (C) Larsenv, (C) KcrPL, (C) PokeAcer. v%version%. (Compiled on %last_build% at %at%)
-echo -----------------------------------------------------------------------------------------------------------------------------
-echo.
-echo What's new is not available right now.
-echo.
-echo Press any button to go back.
-pause>NUL
-goto update_notice
-
-:debug_failsafe_begin
-echo initiating debug
-set output=No output
-set debug=1
-@echo off
-cls
-goto debug_1
-:debug_1
-cls
-echo Wiimmfi WAD Patcher debug menu
-echo @Larsenv, @PokeAcer, @KcrPL
-echo.
-echo --- Output ---
-echo %output%
-echo --------------
-echo.
-echo 1. Reset program
-echo 2. Reset database
-echo 3. Delete patched files
-echo 4. exit
-echo 5. open command prompt
-echo 6. Files check
-echo 7. Check for program compatibility on this computer
-echo.
-set /p s=Choose:
-if %s%==1 goto begin
-if %s%==2 goto debug_reset_database
-if %s%==3 goto debug_patched_Del
-if %s%==4 exit
-if %s%==5 goto debug_cmd
-if %s%==6 goto debug_file_check
-if %s%==7 goto debug_check_comp
-set output=command_Not_recognized
-goto debug_1
-:debug_reset_database
-cls
-echo Executing command...
-rmdir %appdata%\WiimmfiPatcher /s /q
-if not exist %appdata%\WiimmfiPatcher set output=OK! It seems that database is deleted, try restarting this program.
-if exist %appdata%\WiimmfiPatcher set output=FAIL! The Database has not been deleted.
-goto debug_1
-:debug_patched_Del
-cls
-echo Executing command...
-rmdir backup-wads /s /q
-rmdir wiimmfi-wads /s /q
-set output=OK! It seems that 2 folders has been deleted
-goto debug_1
-:debug_cmd
-cls
-echo Type "exit" to return to debug menu
-echo :---------------------------------------:
-cmd
-goto debug_1
-:debug_file_check
-cls
-echo Executing command...
-set exist=1
-if not exist Sharpii.exe set exist=0
-if not exist libWiiSharp.dll set exist=0
-if not exist lzx.exe set exist=0
-if not exist WadInstaller.dll set exist=0
-if not exist WiiwarePatcher.exe set exist=0
-if %exist%==0 set output=FAIL! Files are corrupted. Redownload the package.
-if %exist%==1 set output=OK! It seems that every file is in it's place.
-goto debug_1
-:debug_check_comp
-cls
-echo Executing command...
-set check=1
-timeout 3 /nobreak >NUL || set check=0
-if %check%==1 set output=OK! Program will work correctly
-if %check%==0 set output=FAIL! Legacy PC found, some commands may not work correct but the program will work and do it's job.
-goto debug_1
-:files_req_err
-set /a update=0
-cls
-echo.
-echo              `..````
-echo              yNNNNNNNNMNNmmmmdddhhhyyyysssooo+++/:--.`
-echo              hNNNNNNNNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMd
-echo              ddmNNd:dNMMMMNMMMMMMMMMMMMMMMMMMMMMMMMMMs
-echo             `mdmNNy dNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM+
-echo             .mmmmNs mNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM:
-echo             :mdmmN+`mNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM.
-echo             /mmmmN:-mNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMN
-echo             ommmmN.:mMMMMMMMMMMMMmNMMMMMMMMMMMMMMMMMd
-echo             smmmmm`+mMMMMMMMMMNhMNNMNNMMMMMMMMMMMMMMy
-echo             hmmmmh omMMMMMMMMMmhNMMMmNNNNMMMMMMMMMMM+
-echo ------------------------------------------------------------------------------------------------------------------------------
-echo    /---\   ERROR.
-echo   /     \  Some files needed to run this program wasn't found.
-echo  /   !   \ Press any button to download these files.
-echo  ---------
-echo ------------------------------------------------------------------------------------------------------------------------------
-echo            mmmmmh ymMMMMMMMMMNNmmmNmNNNMNNMMMMNyyhhh`
-echo           `mmmmmy hmMMNMNNMMMNNmmmmmdNMMNmmMMMMhyhhy
-echo           -mddmmo`mNMNNNNMMMNNNmdyoo+mMMMNmNMMMNyyys
-echo           :mdmmmo-mNNNNNNNNNNdyo++sssyNMMMMMMMMMhs+-
-echo          .+mmdhhmmmNNNNNNmdysooooosssomMMMNNNMMMm
-echo          o/ossyhdmmNNmdyo+++oooooosssoyNMMNNNMMMM+
-echo          o/::::::://++//+++ooooooo+oo++mNMMmNNMMMm
-echo         `o//::::::::+////+++++++///:/+shNMMNmNNmMM+
-echo         .o////////::+++++++oo++///+syyyymMmNmmmNMMm
-echo         -+//////////o+ooooooosydmdddhhsosNMMmNNNmho            `:/
-echo         .+++++++++++ssss+//oyyysso/:/shmshhs+:.          `-/oydNNNy
-echo           `..-:/+ooss+-`          +mmhdy`           -/shmNNNNNdy+:`
-echo                   `.              yddyo++:    `-/oymNNNNNdy+:`
-echo                                   -odhhhhyddmmmmmNNmhs/:`
-echo                                     :syhdyyyyso+/-`
-pause>NUL
-goto update_files
-:ndstart
-cls
-echo Hi.
-ping localhost -n 3 >NUL
-goto intro2_frs2
-:firststart
-cls
-goto firststart
-:choose_patch_type
-cls
-echo.
-echo              `..````
-echo              yNNNNNNNNMNNmmmmdddhhhyyyysssooo+++/:--.`
-echo              hNNNNNNNNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMd
-echo              ddmNNd:dNMMMMNMMMMMMMMMMMMMMMMMMMMMMMMMMs
-echo             `mdmNNy dNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM+
-echo             .mmmmNs mNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM:
-echo             :mdmmN+`mNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM.
-echo             /mmmmN:-mNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMN
-echo             ommmmN.:mMMMMMMMMMMMMmNMMMMMMMMMMMMMMMMMd
-echo             smmmmm`+mMMMMMMMMMNhMNNMNNMMMMMMMMMMMMMMy
-echo             hmmmmh omMMMMMMMMMmhNMMMmNNNNMMMMMMMMMMM+
-echo ------------------------------------------------------------------------------------------------------------------------------
-echo     Please choose what you want to patch.
-echo.
-echo.
-echo  1. I want to patch normal games.  2. I want to patch Wii Speak.
-echo ------------------------------------------------------------------------------------------------------------------------------
-echo            mmmmmh ymMMMMMMMMMNNmmmNmNNNMNNMMMMNyyhhh`
-echo           `mmmmmy hmMMNMNNMMMNNmmmmmdNMMNmmMMMMhyhhy
-echo           -mddmmo`mNMNNNNMMMNNNmdyoo+mMMMNmNMMMNyyys
-echo           :mdmmmo-mNNNNNNNNNNdyo++sssyNMMMMMMMMMhs+-
-echo          .+mmdhhmmmNNNNNNmdysooooosssomMMMNNNMMMm
-echo          o/ossyhdmmNNmdyo+++oooooosssoyNMMNNNMMMM+
-echo          o/::::::://++//+++ooooooo+oo++mNMMmNNMMMm
-echo         `o//::::::::+////+++++++///:/+shNMMNmNNmMM+
-echo         .o////////::+++++++oo++///+syyyymMmNmmmNMMm
-echo         -+//////////o+ooooooosydmdddhhsosNMMmNNNmho            `:/
-echo         .+++++++++++ssss+//oyyysso/:/shmshhs+:.          `-/oydNNNy
-echo           `..-:/+ooss+-`          +mmhdy`           -/shmNNNNNdy+:`
-echo                   `.              yddyo++:    `-/oymNNNNNdy+:`
-echo                                   -odhhhhyddmmmmmNNmhs/:`
-echo                                     :syhdyyyyso+/-`
-set /p s=
-if %s%==1 goto letsbegin
-if %s%==2 goto wii_speak_patch
-goto choose_patch_type
-:wii_speak_patch
-set /a wii_speak_region=NUL
-cls
-echo.
-echo              `..````
-echo              yNNNNNNNNMNNmmmmdddhhhyyyysssooo+++/:--.`
-echo              hNNNNNNNNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMd
-echo              ddmNNd:dNMMMMNMMMMMMMMMMMMMMMMMMMMMMMMMMs
-echo             `mdmNNy dNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM+
-echo             .mmmmNs mNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM:
-echo             :mdmmN+`mNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM.
-echo             /mmmmN:-mNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMN
-echo             ommmmN.:mMMMMMMMMMMMMmNMMMMMMMMMMMMMMMMMd
-echo             smmmmm`+mMMMMMMMMMNhMNNMNNMMMMMMMMMMMMMMy
-echo             hmmmmh omMMMMMMMMMmhNMMMmNNNNMMMMMMMMMMM+
-echo ------------------------------------------------------------------------------------------------------------------------------
-echo     Please choose your Wii Speak WAD region to download and patch.
-echo.
-echo.
-echo  1. USA  2. PAL  3. JPN  4. KOR  5. Go back.
-echo ------------------------------------------------------------------------------------------------------------------------------
-echo            mmmmmh ymMMMMMMMMMNNmmmNmNNNMNNMMMMNyyhhh`
-echo           `mmmmmy hmMMNMNNMMMNNmmmmmdNMMNmmMMMMhyhhy
-echo           -mddmmo`mNMNNNNMMMNNNmdyoo+mMMMNmNMMMNyyys
-echo           :mdmmmo-mNNNNNNNNNNdyo++sssyNMMMMMMMMMhs+-
-echo          .+mmdhhmmmNNNNNNmdysooooosssomMMMNNNMMMm
-echo          o/ossyhdmmNNmdyo+++oooooosssoyNMMNNNMMMM+
-echo          o/::::::://++//+++ooooooo+oo++mNMMmNNMMMm
-echo         `o//::::::::+////+++++++///:/+shNMMNmNNmMM+
-echo         .o////////::+++++++oo++///+syyyymMmNmmmNMMm
-echo         -+//////////o+ooooooosydmdddhhsosNMMmNNNmho            `:/
-echo         .+++++++++++ssss+//oyyysso/:/shmshhs+:.          `-/oydNNNy
-echo           `..-:/+ooss+-`          +mmhdy`           -/shmNNNNNdy+:`
-echo                   `.              yddyo++:    `-/oymNNNNNdy+:`
-echo                                   -odhhhhyddmmmmmNNmhs/:`
-echo                                     :syhdyyyyso+/-`
-set /p s=
-if %s%==5 goto choose_patch_type
-
-if %s%==1 set regiontype_speak=0001000148434645
-if %s%==1 set region=USA
-
-if %s%==2 set regiontype_speak=0001000148434650
-if %s%==2 set region=PAL
-
-if %s%==3 set regiontype_speak=0001000148434645
-if %s%==3 set region=JPN
-
-if %s%==4 set regiontype_speak=000100014843464B
-if %s%==4 set region=KOR
-
-if not %regiontype_speak%==NUL goto wii_speak_patch_1
-
-goto wii_speak_patch
-:wii_speak_patch_1
-cls
-echo.
-echo              `..````
-echo              yNNNNNNNNMNNmmmmdddhhhyyyysssooo+++/:--.`
-echo              hNNNNNNNNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMd
-echo              ddmNNd:dNMMMMNMMMMMMMMMMMMMMMMMMMMMMMMMMs
-echo             `mdmNNy dNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM+
-echo             .mmmmNs mNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM:
-echo             :mdmmN+`mNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM.
-echo             /mmmmN:-mNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMN
-echo             ommmmN.:mMMMMMMMMMMMMmNMMMMMMMMMMMMMMMMMd
-echo             smmmmm`+mMMMMMMMMMNhMNNMNNMMMMMMMMMMMMMMy
-echo             hmmmmh omMMMMMMMMMmhNMMMmNNNNMMMMMMMMMMM+
-echo ------------------------------------------------------------------------------------------------------------------------------
-echo     Please wait. We are now downloading and patching the Wii Speak Channel ;)...
-echo.
-echo.
-echo.
-echo ------------------------------------------------------------------------------------------------------------------------------
-echo            mmmmmh ymMMMMMMMMMNNmmmNmNNNMNNMMMMNyyhhh`
-echo           `mmmmmy hmMMNMNNMMMNNmmmmmdNMMNmmMMMMhyhhy
-echo           -mddmmo`mNMNNNNMMMNNNmdyoo+mMMMNmNMMMNyyys
-echo           :mdmmmo-mNNNNNNNNNNdyo++sssyNMMMMMMMMMhs+-
-echo          .+mmdhhmmmNNNNNNmdysooooosssomMMMNNNMMMm
-echo          o/ossyhdmmNNmdyo+++oooooosssoyNMMNNNMMMM+
-echo          o/::::::://++//+++ooooooo+oo++mNMMmNNMMMm
-echo         `o//::::::::+////+++++++///:/+shNMMNmNNmMM+
-echo         .o////////::+++++++oo++///+syyyymMmNmmmNMMm
-echo         -+//////////o+ooooooosydmdddhhsosNMMmNNNmho            `:/
-echo         .+++++++++++ssss+//oyyysso/:/shmshhs+:.          `-/oydNNNy
-echo           `..-:/+ooss+-`          +mmhdy`           -/shmNNNNNdy+:`
-echo                   `.              yddyo++:    `-/oymNNNNNdy+:`
-echo                                   -odhhhhyddmmmmmNNmhs/:`
-echo                                     :syhdyyyyso+/-`
-
-sharpii NUSD -id %regiontype_speak% -v 512 -all >NUL
-
-move "%regiontype_speak%v512\%regiontype_speak%v512.wad" "Wii_Speak_Channel_%region%.wad" >NUL
-
-rmdir /s /q %regiontype_speak%v512 >NUL
-
-if %regiontype_speak%==NUL set /a temperrorlev=1
-if %regiontype_speak%==NUL set /a modul=Variables mismatch
-if %regiontype_speak%==NUL goto error_patching
-
-goto letsbegin
-:letsbegin_error
-cls
-echo.
-echo Wiimmfi WiiWarePatcher - (C) Larsenv, (C) KcrPL, (C) PokeAcer. v%version%. Compiled on %last_build% at %at%
-echo ------------------------------------------------------------------------------------------------------------------------
-echo.
-echo Let's begin.
-echo.
-echo In order to patch wad file, I need an wad file.
-echo So, if you can please copy any wad file to this directory where I am.
-echo.
-if %rep%==1 if exist "*.wad" set /a cor=1
-if %rep%==1 if exist "*.wad" goto letsbegin
-if %rep%==1 echo Waiting for .wad files.
-if %rep%==2 echo Waiting for .wad files..
-if %rep%==3 echo Waiting for .wad files...
-if %rep%==4 echo Waiting for .wad files....
-if %rep%==4 set /a rep=0
-set /a rep=%rep%+1
-ping localhost -n 3 >NUL
-goto letsbegin_error
-:letsbegin
-for %%f in ("*.wad") do set /a file_counter+=1
-set /a repeat=1
-set /a errorrep=0
-set /a rep=0
-cls
-
-cls
-echo.
-echo Wiimmfi WiiWarePatcher - (C) Larsenv, (C) KcrPL, (C) PokeAcer. v%version%. Compiled on %last_build% at %at%
-echo ------------------------------------------------------------------------------------------------------------------------
-echo.
-if %cor%==0 echo Let's begin.
-if %cor%==1 echo Let's begin.
-ping localhost -n 3 >NUL
-if not exist "*.wad" goto letsbegin_error
-echo.
-set modul=NUL
-rmdir temp /s /q
-
-if not exist temp md temp
-if not exist wiimmfi-wads md wiimmfi-wads
-if not exist backup-wads md backup-wads
-
-for %%f in ("*.wad") do (
-cls
-echo Wiimmfi WiiWarePatcher - Larsenv, KcrPL, PokeAcer. v%version%. Compiled on %last_build% at %at%
-echo ------------------------------------------------------------------------------------------------------------------------
-echo.
-echo Patching file: %%~nf
-echo Total ammount of files to patch: %file_counter%
-echo.
-copy /b "%%f" backup-wads >NUL
-set /a temperrorlev=%errorlevel%
-set modul=copy.exe
-if not %temperrorlev%==0 goto error_patching
-
-Sharpii.exe WAD -u "%%f" temp >NUL
-set /a temperrorlev=%errorlevel%
-set modul=Sharpii.exe
-if not %temperrorlev%==0 goto error_patching
-
-move temp\00000001.app 00000001.app >NUL
-set /a temperrorlev=%errorlevel%
-set modul=move.exe
-if not %temperrorlev%==0 goto error_patching
-
-if %repeatvbs%==0 start %appdata%\WiimmfiPatcher\temp\vbs.vbs
-set patchdebug=%%~nf
-WiiWarePatcher.exe
-set /a temperrorlev=%errorlevel%
-set modul=WiiWarePatcher.exe
-if not %temperrorlev%==0 goto error_patching
-
-move 00000001.app temp\00000001.app >NUL
-set /a temperrorlev=%errorlevel%
-set modul=move.exe
-if not %temperrorlev%==0 goto error_patching
-
-del "%%f"
-set /a temperrorlev=%errorlevel%
-set modul=del.exe
-if not %temperrorlev%==0 goto error_patching
-
-Sharpii.exe WAD -p temp "wiimmfi-wads/%%f"
-set /a temperrorlev=%errorlevel%
-set modul=Sharpii.exe
-if not %temperrorlev%==0 goto error_patching
-
-rmdir temp /s /q
-set /a repeatvbs=1
-)
-cd wiimmfi-wads
-for %%a in (*.wad) do ren "%%~a" "%%~na_Wiimmfi%%~xa"
-cd wiimmfi-wads
-cd..
-pause
-goto end
-:error_patching
-cls
-cls
-echo.
-echo              `..````
-echo              yNNNNNNNNMNNmmmmdddhhhyyyysssooo+++/:--.`
-echo              hNNNNNNNNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMd
-echo              ddmNNd:dNMMMMNMMMMMMMMMMMMMMMMMMMMMMMMMMs
-echo             `mdmNNy dNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM+
-echo             .mmmmNs mNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM:
-echo             :mdmmN+`mNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM.
-echo             /mmmmN:-mNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMN
-echo             ommmmN.:mMMMMMMMMMMMMmNMMMMMMMMMMMMMMMMMd
-echo             smmmmm`+mMMMMMMMMMNhMNNMNNMMMMMMMMMMMMMMy
-echo             hmmmmh omMMMMMMMMMmhNMMMmNNNNMMMMMMMMMMM+
-echo ---------------------------------------------------------------------------------------------------------------------------
-echo    /---\   ERROR.
-echo   /     \  There was an error while patching.
-echo  /   !   \ Error Code: %temperrorlev%
-echo  --------- Failing module: %modul%
-echo.
-if not %temperrorlev%==-532459699 echo.
-if %temperrorlev%==-532459699 echo  Please check your internet connection.
-echo       Press any key to start patching again.
-echo ---------------------------------------------------------------------------------------------------------------------------
-echo           :mdmmmo-mNNNNNNNNNNdyo++sssyNMMMMMMMMMhs+-
-echo          .+mmdhhmmmNNNNNNmdysooooosssomMMMNNNMMMm
-echo          o/ossyhdmmNNmdyo+++oooooosssoyNMMNNNMMMM+
-echo          o/::::::://++//+++ooooooo+oo++mNMMmNNMMMm
-echo         `o//::::::::+////+++++++///:/+shNMMNmNNmMM+
-echo         .o////////::+++++++oo++///+syyyymMmNmmmNMMm
-echo         -+//////////o+ooooooosydmdddhhsosNMMmNNNmho            `:/
-echo         .+++++++++++ssss+//oyyysso/:/shmshhs+:.          `-/oydNNNy
-echo           `..-:/+ooss+-`          +mmhdy`           -/shmNNNNNdy+:`
-echo                   `.              yddyo++:    `-/oymNNNNNdy+:`
-echo                                   -odhhhhyddmmmmmNNmhs/:`
-echo                                     :syhdyyyyso+/-`
-pause>NUL
-goto begin_main
-:end
-if not exist %appdata%\WiimmfiPatcher\ndlaunch.id echo e >>%appdata%\WiimmfiPatcher\ndlaunch.id
-set /a exiting=10
-set /a timeouterror=1
-timeout 1 /nobreak >NUL && set /a timeouterror=0
-goto end1
-:end1
-cls
-cls
-echo.
-echo Wiimmfi WiiWarePatcher - (C) Larsenv, (C) KcrPL, (C) PokeAcer. v%version%. Compiled on %last_build% at %at%
-echo ------------------------------------------------------------------------------------------------------------------------
-echo.
-if %patchingok%==1 echo Patched files are in wiimmfi-wads folder
-if %patchingok%==1 echo Backed up wads are in backup-wads folder
-if %patchingok%==1 echo.
-echo Exiting the patcher in...
-if %exiting%==10 echo :----------: 10
-if %exiting%==9 echo :--------- : 9
-if %exiting%==8 echo :--------  : 8
-if %exiting%==7 echo :-------   : 7
-if %exiting%==6 echo :------    : 6
-if %exiting%==5 echo :-----     : 5
-if %exiting%==4 echo :----      : 4
-if %exiting%==3 echo :---       : 3
-if %exiting%==2 echo :--        : 2
-if %exiting%==1 echo :-         : 1
-if %exiting%==0 echo :          :
-if %exiting%==0 if %patchingok%==2 start "C:\Users\%username%\Desktop\WiiWarePatcher\"
-if %exiting%==0 exit
-if %timeouterror%==0 timeout 1 /nobreak >NUL
-if %timeouterror%==1 ping localhost -n 2 >NUL
-set /a exiting=%exiting%-1
-goto end1
+@echo off
+mode 120,30
+chcp 65001
+if exist C:\Users\%username%\Desktop\DebugPatcher.txt goto debug_failsafe_begin
+goto begin
+:begin
+if not exist %appdata%\WiimmfiPatcher\temp\ md %appdata%\WiimmfiPatcher\temp\
+set patchingok=1
+set mode=126,35
+mode %mode%
+set /a cor=0
+set /a patchingnumber=1
+set /a repeatvbs=0
+set /a temperrorlev=0
+set last_build=2017/09/14
+set at=22:47
+set version=2.1.4
+set /a
+
+if not exist %appdata%\WiimmfiPatcher\temp\vbs.vbs echo x=msgbox("When the operation will be done, click any button." ,64, "Wiimmfi WAD Patcher") >>%appdata%\WiimmfiPatcher\temp\vbs.vbs
+@echo off
+title Wiimmfi Patcher for WAD's v.%version%  Created by @KcrPL, @Larsenv, @PokeAcer
+cls
+
+set /a patherror=0
+if "%cd%"=="%windir%\system32" set /a patherror=1
+if %patherror%==0 if not exist patcher.bat set /a patherror=2
+
+:: ### Auto Update ###
+set /a WiiWarePatcher_Update_Activate=1
+set /a whatsnew=1
+set /a offlinestorage=0
+set FilesHostedOn=https://kcrpl.github.io/Patchers_Auto_Update/WiiWare-Patcher
+set MainFolder=%appdata%\WiiWare-Patcher
+set TempStorage=%appdata%\WiiWare-Patcher\internet\temp
+
+
+if exist temp.bat del temp.bat /q
+goto begin_main
+:begin_main
+mode 126,40
+cls
+echo Wiimmfi WiiWarePatcher - (C) Larsenv, (C) KcrPL, (C) PokeAcer. v%version%. (Compiled on %last_build% at %at%)
+if %WiiWarePatcher_Update_Activate%==1 if %patherror%==0 echo              `..````
+if %WiiWarePatcher_Update_Activate%==1 if %patherror%==0 echo              yNNNNNNNNMNNmmmmdddhhhyyyysssooo+++/:--.`
+if %WiiWarePatcher_Update_Activate%==1 if %patherror%==0 echo              ddmNNd:dNMMMMNMMMMMMMMMMMMMMMMMMMMMMMMMMs
+if %WiiWarePatcher_Update_Activate%==1 if %patherror%==0 echo              hNNNNNNNNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMd
+
+if %patherror%==1 echo :----------------------------------------------------------------:
+if %patherror%==1 echo : Warning: Please run this application without admin privilages. :
+if %patherror%==1 echo :----------------------------------------------------------------:
+
+if %patherror%==2 echo :------------------------------------------------------------------------------------------------------:
+if %patherror%==2 echo : Warning: patcher.bat not found. You may be running this application from unknown and untrusted source:
+if %patherror%==2 echo :------------------------------------------------------------------------------------------------------:
+
+if %WiiWarePatcher_Update_Activate%==0 echo :------------------------------------------------------------------------------------------------------:
+if %WiiWarePatcher_Update_Activate%==0 echo : Warning: Auto updates are disabled.                                                                  :
+if %WiiWarePatcher_Update_Activate%==0 echo :------------------------------------------------------------------------------------------------------:
+
+echo             `mdmNNy dNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM+    Wiimmfi WADs Patcher.
+echo             .mmmmNs mNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM:
+echo             :mdmmN+`mNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM.
+echo             /mmmmN:-mNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMN   Play Wii games online after Nintendo WFC shutdown!
+echo             ommmmN.:mMMMMMMMMMMMMmNMMMMMMMMMMMMMMMMMd    Press any button to continue
+echo             smmmmm`+mMMMMMMMMMNhMNNMNNMMMMMMMMMMMMMMy
+echo             hmmmmh omMMMMMMMMMmhNMMMmNNNNMMMMMMMMMMM+
+echo             mmmmms smMMMMMMMMMmddMMmmNmNMMMMMMMMMMMM:
+echo            `mmmmmo hNMMMMMMMMMmddNMMMNNMMMMMMMMMMMMM.
+echo            -mmmmm/ dNMMMMMMMMMNmddMMMNdhdMMMMMMMMMMN
+echo            :mmmmm-`mNMMMMMMMMNNmmmNMMNmmmMMMMMMMMMMd
+echo            +mmmmN.-mNMMMMMMMMMNmmmmMMMMMMMMMMMMMMMMy
+echo            smmmmm`/mMMMMMMMMMNNmmmmNMMMMNMMNMMMMMNmy.
+echo            hmmmmd`omMMMMMMMMMNNmmmNmMNNMmNNNNMNdhyhh.
+echo            mmmmmh ymMMMMMMMMMNNmmmNmNNNMNNMMMMNyyhhh`
+echo           `mmmmmy hmMMNMNNMMMNNmmmmmdNMMNmmMMMMhyhhy
+echo           -mddmmo`mNMNNNNMMMNNNmdyoo+mMMMNmNMMMNyyys
+echo           :mdmmmo-mNNNNNNNNNNdyo++sssyNMMMMMMMMMhs+-
+echo          .+mmdhhmmmNNNNNNmdysooooosssomMMMNNNMMMm
+echo          o/ossyhdmmNNmdyo+++oooooosssoyNMMNNNMMMM+
+echo          o/::::::://++//+++ooooooo+oo++mNMMmNNMMMm
+echo         `o//::::::::+////+++++++///:/+shNMMNmNNmMM+
+echo         .o////////::+++++++oo++///+syyyymMmNmmmNMMm
+echo         -+//////////o+ooooooosydmdddhhsosNMMmNNNmho            `:/
+echo         .+++++++++++ssss+//oyyysso/:/shmshhs+:.          `-/oydNNNy
+echo           `..-:/+ooss+-`          +mmhdy`           -/shmNNNNNdy+:`
+echo                   `.              yddyo++:    `-/oymNNNNNdy+:`
+echo                                   -odhhhhyddmmmmmNNmhs/:`
+echo                                     :syhdyyyyso+/-`
+pause>NUL
+if %patherror%==1 goto begin_main
+goto startup_script
+:startup_script
+mode %mode%
+cls
+echo.
+echo              `..````
+echo              yNNNNNNNNMNNmmmmdddhhhyyyysssooo+++/:--.`
+echo              hNNNNNNNNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMd
+echo              ddmNNd:dNMMMMNMMMMMMMMMMMMMMMMMMMMMMMMMMs
+echo             `mdmNNy dNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM+
+echo             .mmmmNs mNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM:
+echo             :mdmmN+`mNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM.
+echo             /mmmmN:-mNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMN
+echo             ommmmN.:mMMMMMMMMMMMMmNMMMMMMMMMMMMMMMMMd
+echo             smmmmm`+mMMMMMMMMMNhMNNMNNMMMMMMMMMMMMMMy
+echo             hmmmmh omMMMMMMMMMmhNMMMmNNNNMMMMMMMMMMM+
+echo             mmmmms smMMMMMMMMMmddMMmmNmNMMMMMMMMMMMM:
+echo            `mmmmmo hNMMMMMMMMMmddNMMMNNMMMMMMMMMMMMM.
+echo            -mmmmm/ dNMMMMMMMMMNmddMMMNdhdMMMMMMMMMMN
+echo            :mmmmm-`mNMMMMMMMMNNmmmNMMNmmmMMMMMMMMMMd
+echo            +mmmmN.-mNMMMMMMMMMNmmmmMMMMMMMMMMMMMMMMy
+echo            smmmmm`/mMMMMMMMMMNNmmmmNMMMMNMMNMMMMMNmy.
+echo            hmmmmd`omMMMMMMMMMNNmmmNmMNNMmNNNNMNdhyhh.
+echo            mmmmmh ymMMMMMMMMMNNmmmNmNNNMNNMMMMNyyhhh`
+echo           `mmmmmy hmMMNMNNMMMNNmmmmmdNMMNmmMMMMhyhhy
+echo           -mddmmo`mNMNNNNMMMNNNmdyoo+mMMMNmNMMMNyyys
+echo           :mdmmmo-mNNNNNNNNNNdyo++sssyNMMMMMMMMMhs+-
+echo          .+mmdhhmmmNNNNNNmdysooooosssomMMMNNNMMMm
+echo          o/ossyhdmmNNmdyo+++oooooosssoyNMMNNNMMMM+
+echo          o/::::::://++//+++ooooooo+oo++mNMMmNNMMMm
+echo         `o//::::::::+////+++++++///:/+shNMMNmNNmMM+
+echo         .o////////::+++++++oo++///+syyyymMmNmmmNMMm
+echo         -+//////////o+ooooooosydmdddhhsosNMMmNNNmho            `:/
+echo         .+++++++++++ssss+//oyyysso/:/shmshhs+:.          `-/oydNNNy
+echo           `..-:/+ooss+-`          +mmhdy`           -/shmNNNNNdy+:`
+echo                   `.              yddyo++:    `-/oymNNNNNdy+:`
+echo                                   -odhhhhyddmmmmmNNmhs/:`
+echo                                     :syhdyyyyso+/-`
+echo                                                                        Please wait...
+set updateversion=0.0.0
+
+if %offlinestorage%==0 if exist %TempStorage%\version.txt del %TempStorage%\version.txt /q
+if %offlinestorage%==0 if exist %TempStorage%\version.txt` del %TempStorage%\version.txt` /q
+if %offlinestorage%==0 if exist %TempStorage%\whatsnew.txt del %TempStorage%\whatsnew.txt /q
+if %offlinestorage%==0 if exist %TempStorage%\whatsnew.txt` del %TempStorage%\whatsnew.txt` /q
+
+if not exist %TempStorage% md %TempStorage%
+if %WiiWarePatcher_Update_Activate%==1 if %offlinestorage%==0 powershell -command "(new-object System.Net.WebClient).DownloadFile('%FilesHostedOn%/whatsnew.txt', '%TempStorage%/whatsnew.txt')"
+if %WiiWarePatcher_Update_Activate%==1 if %offlinestorage%==0 powershell -command "(new-object System.Net.WebClient).DownloadFile('%FilesHostedOn%/version.txt', '%TempStorage%/version.txt')"
+
+	if %offlinestorage%==0 set /a temperrorlev=%errorlevel%
+
+set /a updateserver=1
+	::Bind error codes to errors here
+	if %offlinestorage%==0 if not %errorlevel%==0 set /a updateserver=0
+
+
+if exist "%TempStorage%\version.txt`" ren "%TempStorage%\version.txt`" "version.txt"
+if exist "%TempStorage%\whatsnew.txt`" ren "%TempStorage%\whatsnew.txt`" "whatsnew.txt"
+
+if exist %TempStorage%\version.txt set /p updateversion=<%TempStorage%\version.txt
+if not exist %TempStorage%\version.txt set /a updateavailable=0
+if %WiiWarePatcher_Update_Activate%==1 if exist %TempStorage%\version.txt set /a updateavailable=1
+if %updateversion%==%version% set /a updateavailable=0
+
+if %WiiWarePatcher_Update_Activate%==1 if %updateavailable%==1 set /a updateserver=2
+if %WiiWarePatcher_Update_Activate%==1 if %updateavailable%==1 goto update_notice
+
+if not exist Sharpii.exe goto files_req_err
+if not exist libWiiSharp.dll goto files_req_err
+if not exist lzx.exe goto files_req_err
+if not exist WadInstaller.dll goto files_req_err
+if not exist WiiwarePatcher.exe goto files_req_err
+
+set /a errorwinxp=0
+timeout -0 /nobreak >NUL || set /a errorwinxp=1
+if %errorwinxp%==1 goto winxp_notice
+
+goto main_fade_out
+:main_fade_out
+cls
+echo.
+echo              `..````
+echo              yNNNNNNNNMNNmmmmdddhhhyyyysssooo+++/:--.`
+echo              hNNNNNNNNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMd
+echo              ddmNNd:dNMMMMNMMMMMMMMMMMMMMMMMMMMMMMMMMs
+echo             `mdmNNy dNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM+
+echo             .mmmmNs mNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM:
+echo             :mdmmN+`mNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM.
+echo             /mmmmN:-mNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMN
+echo             ommmmN.:mMMMMMMMMMMMMmNMMMMMMMMMMMMMMMMMd
+echo             smmmmm`+mMMMMMMMMMNhMNNMNNMMMMMMMMMMMMMMy
+echo             hmmmmh omMMMMMMMMMmhNMMMmNNNNMMMMMMMMMMM+
+echo             mmmmms smMMMMMMMMMmddMMmmNmNMMMMMMMMMMMM:
+echo            `mmmmmo hNMMMMMMMMMmddNMMMNNMMMMMMMMMMMMM.
+echo            -mmmmm/ dNMMMMMMMMMNmddMMMNdhdMMMMMMMMMMN
+echo            :mmmmm-`mNMMMMMMMMNNmmmNMMNmmmMMMMMMMMMMd
+echo            +mmmmN.-mNMMMMMMMMMNmmmmMMMMMMMMMMMMMMMMy
+echo            smmmmm`/mMMMMMMMMMNNmmmmNMMMMNMMNMMMMMNmy.
+echo            hmmmmd`omMMMMMMMMMNNmmmNmMNNMmNNNNMNdhyhh.
+echo            mmmmmh ymMMMMMMMMMNNmmmNmNNNMNNMMMMNyyhhh`
+echo           `mmmmmy hmMMNMNNMMMNNmmmmmdNMMNmmMMMMhyhhy
+echo           -mddmmo`mNMNNNNMMMNNNmdyoo+mMMMNmNMMMNyyys
+echo           :mdmmmo-mNNNNNNNNNNdyo++sssyNMMMMMMMMMhs+-
+echo          .+mmdhhmmmNNNNNNmdysooooosssomMMMNNNMMMm
+echo          o/ossyhdmmNNmdyo+++oooooosssoyNMMNNNMMMM+
+echo          o/::::::://++//+++ooooooo+oo++mNMMmNNMMMm
+echo         `o//::::::::+////+++++++///:/+shNMMNmNNmMM+
+echo         .o////////::+++++++oo++///+syyyymMmNmmmNMMm
+echo         -+//////////o+ooooooosydmdddhhsosNMMmNNNmho            `:/
+echo         .+++++++++++ssss+//oyyysso/:/shmshhs+:.          `-/oydNNNy
+echo           `..-:/+ooss+-`          +mmhdy`           -/shmNNNNNdy+:`
+echo                   `.              yddyo++:    `-/oymNNNNNdy+:`
+echo                                   -odhhhhyddmmmmmNNmhs/:`
+echo                                     :syhdyyyyso+/-`
+echo.
+ping localhost -n 3 >NUL
+goto choose_patch_type
+:update_notice
+set /a update=1
+cls
+echo.
+echo              `..````
+echo              yNNNNNNNNMNNmmmmdddhhhyyyysssooo+++/:--.`
+echo              hNNNNNNNNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMd
+echo              ddmNNd:dNMMMMNMMMMMMMMMMMMMMMMMMMMMMMMMMs
+echo             `mdmNNy dNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM+
+echo             .mmmmNs mNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM:
+echo             :mdmmN+`mNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM.
+echo             /mmmmN:-mNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMN
+echo             ommmmN.:mMMMMMMMMMMMMmNMMMMMMMMMMMMMMMMMd
+echo             smmmmm`+mMMMMMMMMMNhMNNMNNMMMMMMMMMMMMMMy
+echo             hmmmmh omMMMMMMMMMmhNMMMmNNNNMMMMMMMMMMM+
+echo ------------------------------------------------------------------------------------------------------------------------------
+echo    /---\   An Update is available.
+echo   /     \  An Update for this program is available. We suggest updating the WiiWare Patcher to the latest version.
+echo  /   !   \
+echo  ---------  Current version: %version%
+echo             New version: %updateversion%
+echo                       1. Update                      2. Dismiss               3. What's new in this update?
+echo ------------------------------------------------------------------------------------------------------------------------------
+echo           -mddmmo`mNMNNNNMMMNNNmdyoo+mMMMNmNMMMNyyys
+echo           :mdmmmo-mNNNNNNNNNNdyo++sssyNMMMMMMMMMhs+-
+echo          .+mmdhhmmmNNNNNNmdysooooosssomMMMNNNMMMm
+echo          o/ossyhdmmNNmdyo+++oooooosssoyNMMNNNMMMM+
+echo          o/::::::://++//+++ooooooo+oo++mNMMmNNMMMm
+echo         `o//::::::::+////+++++++///:/+shNMMNmNNmMM+
+echo         .o////////::+++++++oo++///+syyyymMmNmmmNMMm
+echo         -+//////////o+ooooooosydmdddhhsosNMMmNNNmho            `:/
+echo         .+++++++++++ssss+//oyyysso/:/shmshhs+:.          `-/oydNNNy
+echo           `..-:/+ooss+-`          +mmhdy`           -/shmNNNNNdy+:`
+echo                   `.              yddyo++:    `-/oymNNNNNdy+:`
+echo                                   -odhhhhyddmmmmmNNmhs/:`
+echo                                     :syhdyyyyso+/-`
+set /p s=
+if %s%==1 goto update_files
+if %s%==2 goto choose_patch_type
+if %s%==3 goto whatsnew
+goto update_notice
+:update_files
+cls
+cls
+echo.
+echo              `..````
+echo              yNNNNNNNNMNNmmmmdddhhhyyyysssooo+++/:--.`
+echo              hNNNNNNNNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMd
+echo              ddmNNd:dNMMMMNMMMMMMMMMMMMMMMMMMMMMMMMMMs
+echo             `mdmNNy dNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM+
+echo             .mmmmNs mNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM:
+echo             :mdmmN+`mNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM.
+echo             /mmmmN:-mNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMN
+echo             ommmmN.:mMMMMMMMMMMMMmNMMMMMMMMMMMMMMMMMd
+echo             smmmmm`+mMMMMMMMMMNhMNNMNNMMMMMMMMMMMMMMy
+echo             hmmmmh omMMMMMMMMMmhNMMMmNNNNMMMMMMMMMMM+
+echo ------------------------------------------------------------------------------------------------------------------------------
+echo    /---\   Updating.
+echo   /     \  Please wait...
+echo  /   !   \
+echo  --------- WiiWare Patcher will restart shortly...
+echo.
+echo.
+echo ------------------------------------------------------------------------------------------------------------------------------
+echo           -mddmmo`mNMNNNNMMMNNNmdyoo+mMMMNmNMMMNyyys
+echo           :mdmmmo-mNNNNNNNNNNdyo++sssyNMMMMMMMMMhs+-
+echo          .+mmdhhmmmNNNNNNmdysooooosssomMMMNNNMMMm
+echo          o/ossyhdmmNNmdyo+++oooooosssoyNMMNNNMMMM+
+echo          o/::::::://++//+++ooooooo+oo++mNMMmNNMMMm
+echo         `o//::::::::+////+++++++///:/+shNMMNmNNmMM+
+echo         .o////////::+++++++oo++///+syyyymMmNmmmNMMm
+echo         -+//////////o+ooooooosydmdddhhsosNMMmNNNmho            `:/
+echo         .+++++++++++ssss+//oyyysso/:/shmshhs+:.          `-/oydNNNy
+echo           `..-:/+ooss+-`          +mmhdy`           -/shmNNNNNdy+:`
+echo                   `.              yddyo++:    `-/oymNNNNNdy+:`
+echo                                   -odhhhhyddmmmmmNNmhs/:`
+echo                                     :syhdyyyyso+/-`
+if exist WadInstaller.dll` del WadInstaller.dll` /q 2> nul
+if exist WiiwarePatcher.exe` del wget.exe` /q 2> nul
+if exist lzx.exe` del xdelta3.exe` 2> nul
+if exist patcher.bat` del patch.bat` /q 2> nul
+if exist libWiiSharp.dll` del  libWiiSharp.dll` /q 2> nul
+if exist Sharpii.exe` del Sharpii.exe` /q 2> nul
+
+powershell -command "(new-object System.Net.WebClient).DownloadFile('%FilesHostedOn%/WadInstaller.dll', 'WadInstaller.dll`')"
+powershell -command "(new-object System.Net.WebClient).DownloadFile('%FilesHostedOn%/WiiwarePatcher.exe', 'WiiwarePatcher.exe`')"
+powershell -command "(new-object System.Net.WebClient).DownloadFile('%FilesHostedOn%/lzx.exe', 'lzx.exe`')"
+powershell -command "(new-object System.Net.WebClient).DownloadFile('%FilesHostedOn%/patcher.bat', 'patcher.bat`')"
+powershell -command "(new-object System.Net.WebClient).DownloadFile('%FilesHostedOn%/libWiiSharp.dll', 'libWiiSharp.dll`')"
+powershell -command "(new-object System.Net.WebClient).DownloadFile('%FilesHostedOn%/Sharpii.exe', 'Sharpii.exe`')"
+
+if %update%==1 if not exist WadInstaller.dll` goto error_update_not_available
+if %update%==1 if not exist WiiwarePatcher.exe` goto error_update_not_available
+if %update%==1 if not exist lzx.exe` goto error_update_not_available
+if %update%==1 if not exist patcher.bat` goto error_update_not_available
+if %update%==1 if not exist libWiiSharp.dll` goto error_update_not_available
+if %update%==1 if not exist Sharpii.exe` goto error_update_not_available
+
+if exist WadInstaller.dll del WadInstaller.dll /q
+if exist WiiwarePatcher.exe del WiiwarePatcher.exe /q
+if exist lzx.exe del lzx.exe /q
+if exist libWiiSharp.dll del libWiiSharp.dll /q
+if exist Sharpii.exe del Sharpii.exe /q
+
+ren WadInstaller.dll` WadInstaller.dll
+ren WiiwarePatcher.exe` WiiwarePatcher.exe
+ren lzx.exe` lzx.exe
+ren libWiiSharp.dll` libWiiSharp.dll
+ren Sharpii.exe` Sharpii.exe
+
+echo ping localhost -n 2 >>temp.bat
+echo del patcher.bat /q >>temp.bat
+echo ren patcher.bat` patcher.bat >>temp.bat
+echo start patcher.bat >>temp.bat
+echo exit >>temp.bat
+start temp.bat
+exit
+exit
+exit
+:whatsnew
+cls
+if not exist %TempStorage%\whatsnew.txt goto whatsnew_notexist
+echo Wiimmfi WiiWarePatcher - (C) Larsenv, (C) KcrPL, (C) PokeAcer. v%version%. (Compiled on %last_build% at %at%)
+echo ------------------------------------------------------------------------------------------------------------------------------
+echo.
+echo What's new in update %updateversion%?
+echo.
+type %TempStorage%\whatsnew.txt
+pause>NUL
+goto update_notice
+:whatsnew_notexist
+cls
+echo Wiimmfi WiiWarePatcher - (C) Larsenv, (C) KcrPL, (C) PokeAcer. v%version%. (Compiled on %last_build% at %at%)
+echo -----------------------------------------------------------------------------------------------------------------------------
+echo.
+echo What's new is not available right now.
+echo.
+echo Press any button to go back.
+pause>NUL
+goto update_notice
+
+:debug_failsafe_begin
+echo initiating debug
+set output=No output
+set debug=1
+@echo off
+cls
+goto debug_1
+:debug_1
+cls
+echo Wiimmfi WAD Patcher debug menu
+echo @Larsenv, @PokeAcer, @KcrPL
+echo.
+echo --- Output ---
+echo %output%
+echo --------------
+echo.
+echo 1. Reset program
+echo 2. Reset database
+echo 3. Delete patched files
+echo 4. exit
+echo 5. open command prompt
+echo 6. Files check
+echo 7. Check for program compatibility on this computer
+echo.
+set /p s=Choose:
+if %s%==1 goto begin
+if %s%==2 goto debug_reset_database
+if %s%==3 goto debug_patched_Del
+if %s%==4 exit
+if %s%==5 goto debug_cmd
+if %s%==6 goto debug_file_check
+if %s%==7 goto debug_check_comp
+set output=command_Not_recognized
+goto debug_1
+:debug_reset_database
+cls
+echo Executing command...
+rmdir %appdata%\WiimmfiPatcher /s /q
+if not exist %appdata%\WiimmfiPatcher set output=OK! It seems that database is deleted, try restarting this program.
+if exist %appdata%\WiimmfiPatcher set output=FAIL! The Database has not been deleted.
+goto debug_1
+:debug_patched_Del
+cls
+echo Executing command...
+rmdir backup-wads /s /q
+rmdir wiimmfi-wads /s /q
+set output=OK! It seems that 2 folders has been deleted
+goto debug_1
+:debug_cmd
+cls
+echo Type "exit" to return to debug menu
+echo :---------------------------------------:
+cmd
+goto debug_1
+:debug_file_check
+cls
+echo Executing command...
+set exist=1
+if not exist Sharpii.exe set exist=0
+if not exist libWiiSharp.dll set exist=0
+if not exist lzx.exe set exist=0
+if not exist WadInstaller.dll set exist=0
+if not exist WiiwarePatcher.exe set exist=0
+if %exist%==0 set output=FAIL! Files are corrupted. Redownload the package.
+if %exist%==1 set output=OK! It seems that every file is in it's place.
+goto debug_1
+:debug_check_comp
+cls
+echo Executing command...
+set check=1
+timeout 3 /nobreak >NUL || set check=0
+if %check%==1 set output=OK! Program will work correctly
+if %check%==0 set output=FAIL! Legacy PC found, some commands may not work correct but the program will work and do it's job.
+goto debug_1
+:files_req_err
+set /a update=0
+cls
+echo.
+echo              `..````
+echo              yNNNNNNNNMNNmmmmdddhhhyyyysssooo+++/:--.`
+echo              hNNNNNNNNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMd
+echo              ddmNNd:dNMMMMNMMMMMMMMMMMMMMMMMMMMMMMMMMs
+echo             `mdmNNy dNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM+
+echo             .mmmmNs mNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM:
+echo             :mdmmN+`mNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM.
+echo             /mmmmN:-mNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMN
+echo             ommmmN.:mMMMMMMMMMMMMmNMMMMMMMMMMMMMMMMMd
+echo             smmmmm`+mMMMMMMMMMNhMNNMNNMMMMMMMMMMMMMMy
+echo             hmmmmh omMMMMMMMMMmhNMMMmNNNNMMMMMMMMMMM+
+echo ------------------------------------------------------------------------------------------------------------------------------
+echo    /---\   ERROR.
+echo   /     \  Some files needed to run this program wasn't found.
+echo  /   !   \ Press any button to download these files.
+echo  ---------
+echo ------------------------------------------------------------------------------------------------------------------------------
+echo            mmmmmh ymMMMMMMMMMNNmmmNmNNNMNNMMMMNyyhhh`
+echo           `mmmmmy hmMMNMNNMMMNNmmmmmdNMMNmmMMMMhyhhy
+echo           -mddmmo`mNMNNNNMMMNNNmdyoo+mMMMNmNMMMNyyys
+echo           :mdmmmo-mNNNNNNNNNNdyo++sssyNMMMMMMMMMhs+-
+echo          .+mmdhhmmmNNNNNNmdysooooosssomMMMNNNMMMm
+echo          o/ossyhdmmNNmdyo+++oooooosssoyNMMNNNMMMM+
+echo          o/::::::://++//+++ooooooo+oo++mNMMmNNMMMm
+echo         `o//::::::::+////+++++++///:/+shNMMNmNNmMM+
+echo         .o////////::+++++++oo++///+syyyymMmNmmmNMMm
+echo         -+//////////o+ooooooosydmdddhhsosNMMmNNNmho            `:/
+echo         .+++++++++++ssss+//oyyysso/:/shmshhs+:.          `-/oydNNNy
+echo           `..-:/+ooss+-`          +mmhdy`           -/shmNNNNNdy+:`
+echo                   `.              yddyo++:    `-/oymNNNNNdy+:`
+echo                                   -odhhhhyddmmmmmNNmhs/:`
+echo                                     :syhdyyyyso+/-`
+pause>NUL
+goto update_files
+:ndstart
+cls
+echo Hi.
+ping localhost -n 3 >NUL
+goto intro2_frs2
+:firststart
+cls
+goto firststart
+:choose_patch_type
+cls
+echo.
+echo :========================================================:
+echo : WiiWare Patcher Update System.                         :
+if %updateserver%==1 echo : The latest version is installed. Press C to read more. :
+if %updateserver%==2 echo : An Update is available. Press C to read more.          :
+if %updateserver%==0 echo : A Update Server is not available. Press C to read more :
+echo :========================================================:
+echo             :mdmmN+`mNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM.
+	echo             /mmmmN:-mNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMN
+echo             ommmmN.:mMMMMMMMMMMMMmNMMMMMMMMMMMMMMMMMd
+echo             smmmmm`+mMMMMMMMMMNhMNNMNNMMMMMMMMMMMMMMy
+echo             hmmmmh omMMMMMMMMMmhNMMMmNNNNMMMMMMMMMMM+
+echo ------------------------------------------------------------------------------------------------------------------------------
+echo     Please choose what you want to patch.
+echo.
+echo.
+echo  1. I want to patch normal games.  2. I want to patch Wii Speak.
+echo ------------------------------------------------------------------------------------------------------------------------------
+echo            mmmmmh ymMMMMMMMMMNNmmmNmNNNMNNMMMMNyyhhh`
+echo           `mmmmmy hmMMNMNNMMMNNmmmmmdNMMNmmMMMMhyhhy
+echo           -mddmmo`mNMNNNNMMMNNNmdyoo+mMMMNmNMMMNyyys
+echo           :mdmmmo-mNNNNNNNNNNdyo++sssyNMMMMMMMMMhs+-
+echo          .+mmdhhmmmNNNNNNmdysooooosssomMMMNNNMMMm
+echo          o/ossyhdmmNNmdyo+++oooooosssoyNMMNNNMMMM+
+echo          o/::::::://++//+++ooooooo+oo++mNMMmNNMMMm
+echo         `o//::::::::+////+++++++///:/+shNMMNmNNmMM+
+echo         .o////////::+++++++oo++///+syyyymMmNmmmNMMm
+echo         -+//////////o+ooooooosydmdddhhsosNMMmNNNmho            `:/
+echo         .+++++++++++ssss+//oyyysso/:/shmshhs+:.          `-/oydNNNy
+echo           `..-:/+ooss+-`          +mmhdy`           -/shmNNNNNdy+:`
+echo                   `.              yddyo++:    `-/oymNNNNNdy+:`
+echo                                   -odhhhhyddmmmmmNNmhs/:`
+echo                                     :syhdyyyyso+/-`
+set /p s=
+if %s%==1 goto letsbegin
+if %s%==2 goto wii_speak_patch
+if %s%==c goto more_info_update
+if %s%==C goto more_info_update
+goto choose_patch_type
+:more_info_update
+cls
+echo Wiimmfi WiiWarePatcher - (C) Larsenv, (C) KcrPL, (C) PokeAcer. v%version%. (Compiled on %last_build% at %at%)
+echo.
+if %updateserver%==1 echo The latest version of WiiWare Patcher is now installed. (v%version%)
+if %updateserver%==2 goto update_notice
+
+if %updateserver%==0 echo Update server is not available.
+if %updateserver%==0 echo We could not connect to the update server. Please check your internet connection.
+if %updateserver%==0 echo It can also mean that the server is under maintance now.
+pause>NUL
+goto choose_patch_type
+:wii_speak_patch
+set /a wii_speak_region=NUL
+cls
+echo.
+echo              `..````
+echo              yNNNNNNNNMNNmmmmdddhhhyyyysssooo+++/:--.`
+echo              hNNNNNNNNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMd
+echo              ddmNNd:dNMMMMNMMMMMMMMMMMMMMMMMMMMMMMMMMs
+echo             `mdmNNy dNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM+
+echo             .mmmmNs mNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM:
+echo             :mdmmN+`mNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM.
+echo             /mmmmN:-mNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMN
+echo             ommmmN.:mMMMMMMMMMMMMmNMMMMMMMMMMMMMMMMMd
+echo             smmmmm`+mMMMMMMMMMNhMNNMNNMMMMMMMMMMMMMMy
+echo             hmmmmh omMMMMMMMMMmhNMMMmNNNNMMMMMMMMMMM+
+echo ------------------------------------------------------------------------------------------------------------------------------
+echo     Please choose your Wii Speak WAD region to download and patch.
+echo.
+echo.
+echo  1. USA  2. PAL  3. JPN  4. KOR  5. Go back.
+echo ------------------------------------------------------------------------------------------------------------------------------
+echo            mmmmmh ymMMMMMMMMMNNmmmNmNNNMNNMMMMNyyhhh`
+echo           `mmmmmy hmMMNMNNMMMNNmmmmmdNMMNmmMMMMhyhhy
+echo           -mddmmo`mNMNNNNMMMNNNmdyoo+mMMMNmNMMMNyyys
+echo           :mdmmmo-mNNNNNNNNNNdyo++sssyNMMMMMMMMMhs+-
+echo          .+mmdhhmmmNNNNNNmdysooooosssomMMMNNNMMMm
+echo          o/ossyhdmmNNmdyo+++oooooosssoyNMMNNNMMMM+
+echo          o/::::::://++//+++ooooooo+oo++mNMMmNNMMMm
+echo         `o//::::::::+////+++++++///:/+shNMMNmNNmMM+
+echo         .o////////::+++++++oo++///+syyyymMmNmmmNMMm
+echo         -+//////////o+ooooooosydmdddhhsosNMMmNNNmho            `:/
+echo         .+++++++++++ssss+//oyyysso/:/shmshhs+:.          `-/oydNNNy
+echo           `..-:/+ooss+-`          +mmhdy`           -/shmNNNNNdy+:`
+echo                   `.              yddyo++:    `-/oymNNNNNdy+:`
+echo                                   -odhhhhyddmmmmmNNmhs/:`
+echo                                     :syhdyyyyso+/-`
+set /p s=
+if %s%==5 goto choose_patch_type
+
+if %s%==1 set regiontype_speak=0001000148434645
+if %s%==1 set region=USA
+
+if %s%==2 set regiontype_speak=0001000148434650
+if %s%==2 set region=PAL
+
+if %s%==3 set regiontype_speak=0001000148434645
+if %s%==3 set region=JPN
+
+if %s%==4 set regiontype_speak=000100014843464B
+if %s%==4 set region=KOR
+
+if not %regiontype_speak%==NUL goto wii_speak_patch_1
+
+goto wii_speak_patch
+:wii_speak_patch_1
+cls
+echo.
+echo              `..````
+echo              yNNNNNNNNMNNmmmmdddhhhyyyysssooo+++/:--.`
+echo              hNNNNNNNNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMd
+echo              ddmNNd:dNMMMMNMMMMMMMMMMMMMMMMMMMMMMMMMMs
+echo             `mdmNNy dNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM+
+echo             .mmmmNs mNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM:
+echo             :mdmmN+`mNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM.
+echo             /mmmmN:-mNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMN
+echo             ommmmN.:mMMMMMMMMMMMMmNMMMMMMMMMMMMMMMMMd
+echo             smmmmm`+mMMMMMMMMMNhMNNMNNMMMMMMMMMMMMMMy
+echo             hmmmmh omMMMMMMMMMmhNMMMmNNNNMMMMMMMMMMM+
+echo ------------------------------------------------------------------------------------------------------------------------------
+echo     Please wait. We are now downloading and patching the Wii Speak Channel ;)...
+echo.
+echo.
+echo.
+echo ------------------------------------------------------------------------------------------------------------------------------
+echo            mmmmmh ymMMMMMMMMMNNmmmNmNNNMNNMMMMNyyhhh`
+echo           `mmmmmy hmMMNMNNMMMNNmmmmmdNMMNmmMMMMhyhhy
+echo           -mddmmo`mNMNNNNMMMNNNmdyoo+mMMMNmNMMMNyyys
+echo           :mdmmmo-mNNNNNNNNNNdyo++sssyNMMMMMMMMMhs+-
+echo          .+mmdhhmmmNNNNNNmdysooooosssomMMMNNNMMMm
+echo          o/ossyhdmmNNmdyo+++oooooosssoyNMMNNNMMMM+
+echo          o/::::::://++//+++ooooooo+oo++mNMMmNNMMMm
+echo         `o//::::::::+////+++++++///:/+shNMMNmNNmMM+
+echo         .o////////::+++++++oo++///+syyyymMmNmmmNMMm
+echo         -+//////////o+ooooooosydmdddhhsosNMMmNNNmho            `:/
+echo         .+++++++++++ssss+//oyyysso/:/shmshhs+:.          `-/oydNNNy
+echo           `..-:/+ooss+-`          +mmhdy`           -/shmNNNNNdy+:`
+echo                   `.              yddyo++:    `-/oymNNNNNdy+:`
+echo                                   -odhhhhyddmmmmmNNmhs/:`
+echo                                     :syhdyyyyso+/-`
+
+sharpii NUSD -id %regiontype_speak% -v 512 -all >NUL
+
+move "%regiontype_speak%v512\%regiontype_speak%v512.wad" "Wii_Speak_Channel_%region%.wad" >NUL
+
+rmdir /s /q %regiontype_speak%v512 >NUL
+
+if %regiontype_speak%==NUL set /a temperrorlev=1
+if %regiontype_speak%==NUL set /a modul=Variables mismatch
+if %regiontype_speak%==NUL goto error_patching
+
+goto letsbegin
+:letsbegin_error
+cls
+echo.
+echo Wiimmfi WiiWarePatcher - (C) Larsenv, (C) KcrPL, (C) PokeAcer. v%version%. Compiled on %last_build% at %at%
+echo ------------------------------------------------------------------------------------------------------------------------
+echo.
+echo Let's begin.
+echo.
+echo In order to patch wad file, I need an wad file.
+echo So, if you can please copy any wad file to this directory where I am.
+echo.
+if %rep%==1 if exist "*.wad" set /a cor=1
+if %rep%==1 if exist "*.wad" goto letsbegin
+if %rep%==1 echo Waiting for .wad files.
+if %rep%==2 echo Waiting for .wad files..
+if %rep%==3 echo Waiting for .wad files...
+if %rep%==4 echo Waiting for .wad files....
+if %rep%==4 set /a rep=0
+set /a rep=%rep%+1
+ping localhost -n 3 >NUL
+goto letsbegin_error
+:letsbegin
+for %%f in ("*.wad") do set /a file_counter+=1
+set /a repeat=1
+set /a errorrep=0
+set /a rep=0
+cls
+
+cls
+echo.
+echo Wiimmfi WiiWarePatcher - (C) Larsenv, (C) KcrPL, (C) PokeAcer. v%version%. Compiled on %last_build% at %at%
+echo ------------------------------------------------------------------------------------------------------------------------
+echo.
+if %cor%==0 echo Let's begin.
+if %cor%==1 echo Let's begin.
+ping localhost -n 3 >NUL
+if not exist "*.wad" goto letsbegin_error
+echo.
+set modul=NUL
+rmdir temp /s /q
+
+if not exist temp md temp
+if not exist wiimmfi-wads md wiimmfi-wads
+if not exist backup-wads md backup-wads
+
+for %%f in ("*.wad") do (
+cls
+echo Wiimmfi WiiWarePatcher - Larsenv, KcrPL, PokeAcer. v%version%. Compiled on %last_build% at %at%
+echo ------------------------------------------------------------------------------------------------------------------------
+
+echo.
+echo Patching file: %%~nf
+echo Total ammount of files to patch: %file_counter%
+echo.
+copy /b "%%f" backup-wads >NUL
+set /a temperrorlev=%errorlevel%
+set modul=copy.exe
+if not %temperrorlev%==0 goto error_patching
+
+Sharpii.exe WAD -u "%%f" temp >NUL
+set /a temperrorlev=%errorlevel%
+set modul=Sharpii.exe
+if not %temperrorlev%==0 goto error_patching
+
+move temp\00000001.app 00000001.app >NUL
+set /a temperrorlev=%errorlevel%
+set modul=move.exe
+if not %temperrorlev%==0 goto error_patching
+
+if %repeatvbs%==0 start %appdata%\WiimmfiPatcher\temp\vbs.vbs
+set patchdebug=%%~nf
+WiiWarePatcher.exe
+set /a temperrorlev=%errorlevel%
+set modul=WiiWarePatcher.exe
+if not %temperrorlev%==0 goto error_patching
+
+move 00000001.app temp\00000001.app >NUL
+set /a temperrorlev=%errorlevel%
+set modul=move.exe
+if not %temperrorlev%==0 goto error_patching
+
+del "%%f"
+set /a temperrorlev=%errorlevel%
+set modul=del.exe
+if not %temperrorlev%==0 goto error_patching
+
+Sharpii.exe WAD -p temp "wiimmfi-wads/%%f"
+set /a temperrorlev=%errorlevel%
+set modul=Sharpii.exe
+if not %temperrorlev%==0 goto error_patching
+
+rmdir temp /s /q
+set /a repeatvbs=1
+)
+cd wiimmfi-wads
+for %%a in (*.wad) do ren "%%~a" "%%~na_Wiimmfi%%~xa"
+cd wiimmfi-wads
+cd..
+pause
+goto end
+:error_patching
+cls
+cls
+echo.
+echo              `..````
+echo              yNNNNNNNNMNNmmmmdddhhhyyyysssooo+++/:--.`
+echo              hNNNNNNNNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMd
+echo              ddmNNd:dNMMMMNMMMMMMMMMMMMMMMMMMMMMMMMMMs
+echo             `mdmNNy dNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM+
+echo             .mmmmNs mNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM:
+echo             :mdmmN+`mNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM.
+echo             /mmmmN:-mNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMN
+echo             ommmmN.:mMMMMMMMMMMMMmNMMMMMMMMMMMMMMMMMd
+echo             smmmmm`+mMMMMMMMMMNhMNNMNNMMMMMMMMMMMMMMy
+echo             hmmmmh omMMMMMMMMMmhNMMMmNNNNMMMMMMMMMMM+
+echo ---------------------------------------------------------------------------------------------------------------------------
+echo    /---\   ERROR.
+echo   /     \  There was an error while patching.
+echo  /   !   \ Error Code: %temperrorlev%
+echo  --------- Failing module: %modul%
+echo.
+if not %temperrorlev%==-532459699 echo.
+if %temperrorlev%==-532459699 echo  Please check your internet connection.
+echo       Press any key to start patching again.
+echo ---------------------------------------------------------------------------------------------------------------------------
+echo           :mdmmmo-mNNNNNNNNNNdyo++sssyNMMMMMMMMMhs+-
+echo          .+mmdhhmmmNNNNNNmdysooooosssomMMMNNNMMMm
+echo          o/ossyhdmmNNmdyo+++oooooosssoyNMMNNNMMMM+
+echo          o/::::::://++//+++ooooooo+oo++mNMMmNNMMMm
+echo         `o//::::::::+////+++++++///:/+shNMMNmNNmMM+
+echo         .o////////::+++++++oo++///+syyyymMmNmmmNMMm
+echo         -+//////////o+ooooooosydmdddhhsosNMMmNNNmho            `:/
+echo         .+++++++++++ssss+//oyyysso/:/shmshhs+:.          `-/oydNNNy
+echo           `..-:/+ooss+-`          +mmhdy`           -/shmNNNNNdy+:`
+echo                   `.              yddyo++:    `-/oymNNNNNdy+:`
+echo                                   -odhhhhyddmmmmmNNmhs/:`
+echo                                     :syhdyyyyso+/-`
+pause>NUL
+goto begin_main
+:end
+if not exist %appdata%\WiimmfiPatcher\ndlaunch.id echo e >>%appdata%\WiimmfiPatcher\ndlaunch.id
+set /a exiting=10
+set /a timeouterror=1
+timeout 1 /nobreak >NUL && set /a timeouterror=0
+goto end1
+:end1
+cls
+cls
+echo.
+echo Wiimmfi WiiWarePatcher - (C) Larsenv, (C) KcrPL, (C) PokeAcer. v%version%. Compiled on %last_build% at %at%
+echo ------------------------------------------------------------------------------------------------------------------------
+echo.
+if %patchingok%==1 echo Patched files are in wiimmfi-wads folder
+if %patchingok%==1 echo Backed up wads are in backup-wads folder
+if %patchingok%==1 echo.
+echo Exiting the patcher in...
+if %exiting%==10 echo :----------: 10
+if %exiting%==9 echo :--------- : 9
+if %exiting%==8 echo :--------  : 8
+if %exiting%==7 echo :-------   : 7
+if %exiting%==6 echo :------    : 6
+if %exiting%==5 echo :-----     : 5
+if %exiting%==4 echo :----      : 4
+if %exiting%==3 echo :---       : 3
+if %exiting%==2 echo :--        : 2
+if %exiting%==1 echo :-         : 1
+if %exiting%==0 echo :          :
+if %exiting%==0 if %patchingok%==2 start "C:\Users\%username%\Desktop\WiiWarePatcher\"
+if %exiting%==0 exit
+if %timeouterror%==0 timeout 1 /nobreak >NUL
+if %timeouterror%==1 ping localhost -n 2 >NUL
+set /a exiting=%exiting%-1
+goto end1


Update windows.bat

Update windows.bat

--- Windows/windows.bat
+++ Windows/windows.bat
@@ -1,2 +1,4 @@
 REM Add other things if could be automated, RUN THIS AS ADMIN
 @echo off
+REM Windows Defender scan
+cd C:\Program Files\Windows Defender\MpCmdRun.exe -Scan 2


add var to script

add var to script

--- src/application.bat
+++ src/application.bat
@@ -1,4 +1,6 @@
 ### application.bat - 2015 - Louis ABID ###
-echo "Copyright company - 201x"
-echo "Build : 10:00"
-echo "version 1.1"+version = "2"
+build_hour = "11H00"
+
+echo "Build ${build_hour}"
+echo "version ${version}"


Add file header

Add file header

--- src/application.bat
+++ src/application.bat
@@ -1,2 +1,3 @@
+### application.bat - 201x - Carr Adrien ###
 echo "Build : 10:00"
 echo "version 1"


Update build-windows-toolchain.bat

Update build-windows-toolchain.bat

Checkout tags even though it carries ~20% build overhead as swift-experimental-string-processing requires that.

--- utils/build-windows-toolchain.bat
+++ utils/build-windows-toolchain.bat
@@ -201,6 +201,7 @@
   -D PYTHON_HOME=%PYTHON_HOME% ^
   -D PYTHON_EXECUTABLE=%PYTHON_HOME%\python.exe ^
   -D SWIFT_PATH_TO_LIBDISPATCH_SOURCE="%SourceRoot%\swift-corelibs-libdispatch" ^
+  -D EXPERIMENTAL_STRING_PROCESSING_SOURCE_DIR=%SourceRoot%\swift-experimental-string-processing ^
   -D SWIFT_WINDOWS_x86_64_ICU_UC_INCLUDE="%BuildRoot%\Library\icu-67.1\include\unicode" ^
   -D SWIFT_WINDOWS_x86_64_ICU_UC="%BuildRoot%\Library\icu-67.1\lib64\icuuc.lib" ^
   -D SWIFT_WINDOWS_x86_64_ICU_I18N_INCLUDE="%BuildRoot%\Library\icu-67.1\include" ^
@@ -231,6 +232,7 @@
   -D LLVM_DIR=%BuildRoot%\1\lib\cmake\llvm ^
   -D SWIFT_NATIVE_SWIFT_TOOLS_PATH=%BuildRoot%\1\bin ^
   -D SWIFT_PATH_TO_LIBDISPATCH_SOURCE=%SourceRoot%\swift-corelibs-libdispatch ^
+  -D EXPERIMENTAL_STRING_PROCESSING_SOURCE_DIR=%SourceRoot%\swift-experimental-string-processing ^
   -D SWIFT_WINDOWS_x86_64_ICU_UC_INCLUDE="%BuildRoot%\Library\icu-67.1\include\unicode" ^
   -D SWIFT_WINDOWS_x86_64_ICU_UC="%BuildRoot%\Library\icu-67.1\lib64\icuuc.lib" ^
   -D SWIFT_WINDOWS_x86_64_ICU_I18N_INCLUDE="%BuildRoot%\Library\icu-67.1\include" ^
@@ -815,7 +817,7 @@
 set "args=%args% --skip-repository swift-stress-tester"
 set "args=%args% --skip-repository swift-xcode-playground-support"

-call "%SourceRoot%\swift\utils\update-checkout.cmd" %args% --clone --skip-tags --skip-history --github-comment "%ghprbCommentBody%"
+call "%SourceRoot%\swift\utils\update-checkout.cmd" %args% --clone --skip-history --github-comment "%ghprbCommentBody%"

 goto :eof
 endlocal


appveyor: did the debug flag break this...?

--- testing/appveyor-scripts/build-test.bat
+++ testing/appveyor-scripts/build-test.bat
@@ -8,7 +8,7 @@
 cmake -G "%CMAKE_DASH_G%" -DCMAKE_BUILD_TYPE=Debug ..\..
 if not %ERRORLEVEL%==0 goto fail

-msbuild /v:n /p:configuration=Debug ALL_BUILD.vcxproj
+msbuild ALL_BUILD.vcxproj
 if not %ERRORLEVEL%==0 goto fail

 :: Don't run anything when cross-compiling
@@ -21,9 +21,16 @@
     set PATH=c:\projects\pksav\test-env\build\apps\Debug;%PATH%

     pksav-gen1-save-dump --all --input=%SAVEDIR%\red_blue\pokemon_red.sav
+    if not %ERRORLEVEL%==0 goto fail
+
     pksav-gen1-save-dump --all --input=%SAVEDIR%\yellow\pokemon_yellow.sav
+    if not %ERRORLEVEL%==0 goto fail
+
     pksav-gen2-save-dump %SAVEDIR%\gold_silver\pokemon_gold.sav
+    if not %ERRORLEVEL%==0 goto fail
+
     pksav-gen2-save-dump %SAVEDIR%\crystal\pokemon_crystal.sav
+    if not %ERRORLEVEL%==0 goto fail
 )

 goto pass