echo off

for /f "tokens=2*" %%A in ('reg query "HKLM\SOFTWARE\Wow6432Node\Eagle Dynamics\BlackShark" /v "Path"') do set InstallPath=%%B
reg query "HKLM\SOFTWARE\Wow6432Node\Eagle Dynamics\BlackShark" /v "Path"

if errorlevel 1 goto A1
goto Process

:A1
for /f "tokens=2*" %%A in ('reg query "HKLM\SOFTWARE\Eagle Dynamics\BlackShark" /v "Path"') do set InstallPath=%%B
reg query "HKLM\SOFTWARE\Eagle Dynamics\BlackShark" /v "Path"

if errorlevel 1 goto A2
goto Process

:A2
set InstallPath=%cd%
goto Process


:Process
md font
copy %windir%\Fonts\meiryo.ttc font
copy %windir%\Fonts\meiryob.ttc font

ttc2ttf.exe font\meiryo.ttc
ren font\meiryo-00.ttf meiryo.ttf
ren font\meiryo-01.ttf meiryo_italic.ttf

ttc2ttf.exe font\meiryob.ttc
ren font\meiryob-00.ttf meiryo_bold.ttf
ren font\meiryob-01.ttf meiryo_bold_italic.ttf

md "%InstallPath%"\BlackShark\themes\fonts\backup\
move "%InstallPath%"\BlackShark\themes\fonts\DejaVuLGCSans.ttf "%InstallPath%"\BlackShark\themes\fonts\backup
move "%InstallPath%"\BlackShark\themes\fonts\DejaVuLGCSans-Bold.ttf "%InstallPath%"\BlackShark\themes\fonts\backup
move "%InstallPath%"\BlackShark\themes\fonts\DejaVuLGCSans-BoldOblique.ttf "%InstallPath%"\BlackShark\themes\fonts\backup
move "%InstallPath%"\BlackShark\themes\fonts\DejaVuLGCSansCondensed.ttf "%InstallPath%"\BlackShark\themes\fonts\backup
move "%InstallPath%"\BlackShark\themes\fonts\DejaVuLGCSansCondensed-Bold.ttf "%InstallPath%"\BlackShark\themes\fonts\backup
move "%InstallPath%"\BlackShark\themes\fonts\DejaVuLGCSansCondensed-BoldOblique.ttf "%InstallPath%"\BlackShark\themes\fonts\backup
move "%InstallPath%"\BlackShark\themes\fonts\DejaVuLGCSansCondensed-Oblique.ttf "%InstallPath%"\BlackShark\themes\fonts\backup
move "%InstallPath%"\BlackShark\themes\fonts\DejaVuLGCSans-ExtraLight.ttf "%InstallPath%"\BlackShark\themes\fonts\backup
move "%InstallPath%"\BlackShark\themes\fonts\DejaVuLGCSansMono.ttf "%InstallPath%"\BlackShark\themes\fonts\backup
move "%InstallPath%"\BlackShark\themes\fonts\DejaVuLGCSansMono-Bold.ttf "%InstallPath%"\BlackShark\themes\fonts\backup
move "%InstallPath%"\BlackShark\themes\fonts\DejaVuLGCSansMono-BoldOblique.ttf "%InstallPath%"\BlackShark\themes\fonts\backup
move "%InstallPath%"\BlackShark\themes\fonts\DejaVuLGCSansMono-Oblique.ttf "%InstallPath%"\BlackShark\themes\fonts\backup
move "%InstallPath%"\BlackShark\themes\fonts\DejaVuLGCSans-Oblique.ttf "%InstallPath%"\BlackShark\themes\fonts\backup
move "%InstallPath%"\BlackShark\themes\fonts\DejaVuLGCSerif.ttf "%InstallPath%"\BlackShark\themes\fonts\backup
move "%InstallPath%"\BlackShark\themes\fonts\DejaVuLGCSerif-Bold.ttf "%InstallPath%"\BlackShark\themes\fonts\backup
move "%InstallPath%"\BlackShark\themes\fonts\DejaVuLGCSerif-BoldItalic.ttf "%InstallPath%"\BlackShark\themes\fonts\backup
move "%InstallPath%"\BlackShark\themes\fonts\DejaVuLGCSerifCondensed.ttf "%InstallPath%"\BlackShark\themes\fonts\backup
move "%InstallPath%"\BlackShark\themes\fonts\DejaVuLGCSerifCondensed-Bold.ttf "%InstallPath%"\BlackShark\themes\fonts\backup
move "%InstallPath%"\BlackShark\themes\fonts\DejaVuLGCSerifCondensed-BoldItalic.ttf "%InstallPath%"\BlackShark\themes\fonts\backup
move "%InstallPath%"\BlackShark\themes\fonts\DejaVuLGCSerifCondensed-Italic.ttf "%InstallPath%"\BlackShark\themes\fonts\backup
move "%InstallPath%"\BlackShark\themes\fonts\DejaVuLGCSerif-Italic.ttf "%InstallPath%"\BlackShark\themes\fonts\backup

copy font\meiryo.ttf "%InstallPath%"\BlackShark\themes\fonts\DejaVuLGCSans.ttf
copy font\meiryo_bold.ttf "%InstallPath%"\BlackShark\themes\fonts\DejaVuLGCSans-Bold.ttf
copy font\meiryo_bold_italic.ttf "%InstallPath%"\BlackShark\themes\fonts\DejaVuLGCSans-BoldOblique.ttf
copy font\meiryo.ttf "%InstallPath%"\BlackShark\themes\fonts\DejaVuLGCSansCondensed.ttf
copy font\meiryo_bold.ttf "%InstallPath%"\BlackShark\themes\fonts\DejaVuLGCSansCondensed-Bold.ttf
copy font\meiryo_bold_italic.ttf "%InstallPath%"\BlackShark\themes\fonts\DejaVuLGCSansCondensed-BoldOblique.ttf
copy font\meiryo_italic.ttf "%InstallPath%"\BlackShark\themes\fonts\DejaVuLGCSansCondensed-Oblique.ttf
copy font\meiryo.ttf "%InstallPath%"\BlackShark\themes\fonts\DejaVuLGCSans-ExtraLight.ttf
copy font\meiryo.ttf "%InstallPath%"\BlackShark\themes\fonts\DejaVuLGCSansMono.ttf
copy font\meiryo_bold.ttf "%InstallPath%"\BlackShark\themes\fonts\DejaVuLGCSansMono-Bold.ttf
copy font\meiryo_bold_italic.ttf "%InstallPath%"\BlackShark\themes\fonts\DejaVuLGCSansMono-BoldOblique.ttf
copy font\meiryo_italic.ttf "%InstallPath%"\BlackShark\themes\fonts\DejaVuLGCSansMono-Oblique.ttf
copy font\meiryo_italic.ttf "%InstallPath%"\BlackShark\themes\fonts\DejaVuLGCSans-Oblique.ttf
copy font\meiryo.ttf "%InstallPath%"\BlackShark\themes\fonts\DejaVuLGCSerif.ttf
copy font\meiryo_bold.ttf "%InstallPath%"\BlackShark\themes\fonts\DejaVuLGCSerif-Bold.ttf
copy font\meiryo_bold_italic.ttf "%InstallPath%"\BlackShark\themes\fonts\DejaVuLGCSerif-BoldItalic.ttf
copy font\meiryo.ttf "%InstallPath%"\BlackShark\themes\fonts\DejaVuLGCSerifCondensed.ttf
copy font\meiryo_bold.ttf "%InstallPath%"\BlackShark\themes\fonts\DejaVuLGCSerifCondensed-Bold.ttf
copy font\meiryo_bold_italic.ttf "%InstallPath%"\BlackShark\themes\fonts\DejaVuLGCSerifCondensed-BoldItalic.ttf
copy font\meiryo_italic.ttf "%InstallPath%"\BlackShark\themes\fonts\DejaVuLGCSerifCondensed-Italic.ttf
copy font\meiryo_italic.ttf "%InstallPath%"\BlackShark\themes\fonts\DejaVuLGCSerif-Italic.ttf

rmdir /s /q font

:End
