diff --git a/Install.cmd b/Install.cmd index 9d52f47..21f638c 100644 --- a/Install.cmd +++ b/Install.cmd @@ -1,10 +1,10 @@ @echo off REM Check if user place it in right place(inside Steam\skins). -if not exist "..\..\Steam.exe" ( -if not exist "..\skins" ( - echo Threshold Miku Skin is in the wrong folder. - echo You need to place it into Steam\skins. -)) +if not exist "..\..\Steam.exe" (goto WrongDirErr) +REM command for have some issue while inside the else branch +REM so make it standalone +for %%d in ("%~dp0..") do set ParentDirectory=%%~nxd +if not "%ParentDirectory%"=="skins" (goto WrongDirErr) REM Copy SteamUI's file to the original place. xcopy /e /y ".\steamui" "..\..\steamui" 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 ("..\..\") DO set WorkDir=%%~fi set LnkName=Steam -if not defined WorkDir call:GetWorkDir "%Program%" (echo Set WshShell=CreateObject("WScript.Shell"^) echo strDesKtop=WshShell.SpecialFolders("DesKtop"^) echo Set oShellLink=WshShell.CreateShortcut(strDesKtop^&"\%LnkName%.lnk"^) @@ -28,5 +27,18 @@ cls echo All works done. 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 Check https://github.com/Jack-Myth/Threshold-Miku to get the lastest version -pause \ No newline at end of file +echo Check https://github.com/Jack-Myth/Threshold-Miku for update. +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 \ No newline at end of file