Files
ngzz-mc/scripts/installer/安装.bat

34 lines
1.2 KiB
Batchfile
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
@echo off
chcp 65001 >nul
title 年糕历险记 安装程序
echo.
echo ============================================
echo 年糕历险记 安装程序 v0.1.0
echo NianGao Adventure Installer
echo ============================================
echo.
setlocal enabledelayedexpansion
rem 默认安装目录(用户目录下)
set "DEFAULT_DIR=%LOCALAPPDATA%\NianGaoAdventure"
set /p "INSTALL_DIR=请输入安装目录(直接回车使用 %DEFAULT_DIR%):"
if "!INSTALL_DIR!"=="" set "INSTALL_DIR=%DEFAULT_DIR%"
echo.
echo 正在安装到:!INSTALL_DIR!
if not exist "!INSTALL_DIR!" mkdir "!INSTALL_DIR!"
echo 复制游戏文件...
xcopy /e /i /y "%~dp0*" "!INSTALL_DIR!\" >nul 2>&1
echo 创建桌面快捷方式...
powershell -NoProfile -Command "$ws = New-Object -ComObject WScript.Shell; $s = $ws.CreateShortcut([Environment]::GetFolderPath('Desktop') + '\年糕历险记.lnk'); $s.TargetPath = '!INSTALL_DIR!\mc-client.exe'; $s.WorkingDirectory = '!INSTALL_DIR!'; $s.Save()"
echo.
echo ============================================
echo 安装完成!桌面已创建「年糕历险记」快捷方式。
echo 游戏存档保存在安装目录 worlds\ 下。
echo 按任意键退出...
echo ============================================
pause >nul