Fix many bugs of Install.cmd

This commit is contained in:
Jack-Myth 2020-03-10 00:37:47 +08:00
parent 06695a4c28
commit 0c0b8d1202
1 changed files with 20 additions and 8 deletions

View File

@ -1,10 +1,10 @@
@echo off @echo off
REM Check if user place it in right place(inside Steam\skins). REM Check if user place it in right place(inside Steam\skins).
if not exist "..\..\Steam.exe" ( if not exist "..\..\Steam.exe" (goto WrongDirErr)
if not exist "..\skins" ( REM command for have some issue while inside the else branch
echo Threshold Miku Skin is in the wrong folder. REM so make it standalone
echo You need to place it into Steam\skins. for %%d in ("%~dp0..") do set ParentDirectory=%%~nxd
)) if not "%ParentDirectory%"=="skins" (goto WrongDirErr)
REM Copy SteamUI's file to the original place. REM Copy SteamUI's file to the original place.
xcopy /e /y ".\steamui" "..\..\steamui" xcopy /e /y ".\steamui" "..\..\steamui"
for %%i in ("%cd%") do set SkinName=%%~nxi for %%i in ("%cd%") do set SkinName=%%~nxi
@ -14,7 +14,6 @@ reg add HKCU\Software\Valve\Steam /v SkinV5 /t REG_SZ /d "%SkinName%" /f
FOR /F %%i IN ("..\..\Steam.exe") DO set Program=%%~fi FOR /F %%i IN ("..\..\Steam.exe") DO set Program=%%~fi
FOR /F %%i IN ("..\..\") DO set WorkDir=%%~fi FOR /F %%i IN ("..\..\") DO set WorkDir=%%~fi
set LnkName=Steam set LnkName=Steam
if not defined WorkDir call:GetWorkDir "%Program%"
(echo Set WshShell=CreateObject("WScript.Shell"^) (echo Set WshShell=CreateObject("WScript.Shell"^)
echo strDesKtop=WshShell.SpecialFolders("DesKtop"^) echo strDesKtop=WshShell.SpecialFolders("DesKtop"^)
echo Set oShellLink=WshShell.CreateShortcut(strDesKtop^&"\%LnkName%.lnk"^) echo Set oShellLink=WshShell.CreateShortcut(strDesKtop^&"\%LnkName%.lnk"^)
@ -28,5 +27,18 @@ cls
echo All works done. echo All works done.
echo You need to restart Steam before the skin takes effect. echo You need to restart Steam before the skin takes effect.
echo Next open Steam,Pleace use the shortcut on the DesKtop, or the skin will be restored. echo Next open Steam,Pleace use the shortcut on the DesKtop, or the skin will be restored.
echo Check https://github.com/Jack-Myth/Threshold-Miku to get the lastest version echo Check https://github.com/Jack-Myth/Threshold-Miku for update.
pause pause
explorer https://github.com/Jack-Myth/Threshold-Miku
exit
:WrongDirErr
REM Try find Steam Path
FOR /F "tokens=2* skip=2" %%a in ('reg query "HKCU\Software\Valve\Steam" /v "SteamPath"') do set SteamPath=%%b
REM If return value is not an exist path(Err Msg)
if not exist "%SteamPath%" (set SteamPath=Steam)
set SteamPath=%SteamPath:/=\%
echo Threshold Miku Skin is in the wrong folder.
echo You need to place it into %SteamPath%\skins.
pause
exit