Installers!

This commit is contained in:
DepressedTWM 2026-05-24 12:40:29 +04:00
parent 514a21d5d8
commit fae4fc9bf2
3 changed files with 84 additions and 35 deletions

31
installer/installer.bat Normal file
View file

@ -0,0 +1,31 @@
@echo off
setlocal
echo Sunshine installer
set /p oneshot_path=Enter the Oneshot 2016 installation path:
set /p install_path=Enter the path to install Sunshine:
set "TARGET=%install_path%\oneshot.exe"
set "ICON=%install_path%\icon.ico"
if not exist "%install_path%\" mkdir "%install_path%"
echo Copying the files of the original Oneshot
xcopy "%oneshot_path%\*" "%install_path%\" /E /I /Y
if errorlevel 1 echo Warning: xcopy from oneshot_path returned non-zero code.
echo Patching the original game
xcopy "Sunshine\*" "%install_path%\" /E /I /Y
if errorlevel 1 echo Warning: xcopy from Sunshine returned non-zero code.
echo (create .int files) :: <-- реализуйте здесь если нужно
powershell -NoProfile -Command ^
"$s=New-Object -ComObject WScript.Shell; $l=$s.CreateShortcut('%USERPROFILE%\Desktop\Sunshine.lnk'); $l.TargetPath='%TARGET%'; $l.IconLocation='%ICON%'; $l.WorkingDirectory=(Split-Path '%TARGET%'); $l.Save()"
powershell -NoProfile -Command ^
"$s=New-Object -ComObject WScript.Shell; $l=$s.CreateShortcut('%APPDATA%\Microsoft\Windows\Start Menu\Programs\Sunshine.lnk'); $l.TargetPath='%TARGET%'; $l.IconLocation='%ICON%'; $l.WorkingDirectory=(Split-Path '%TARGET%'); $l.Save()"
echo Done!
endlocal
pause

18
installer/installer.sh Executable file
View file

@ -0,0 +1,18 @@
#!/bin/bash
set -euo pipefail
read -rp "Enter your Oneshot 2016 installation path: " oneshot_path
read -rp "Enter path for installation: " install_path
mkdir -p $install_path
cp -r "$oneshot_path/*" "$install_path/"
cp -r "Sunshine/*" "$install_path/"
echo """[Desktop Entry]
Type=Application
Name=Oneshot: Sunshine
Comment=Oneshot mod
Exec=$install_path/oneshot
Icon=$install_path/icon.png
Categories=Game;
""" > $HOME/.local/share/applications/sunshine.desktop

View file

@ -7,7 +7,6 @@ cd `dirname $0`
linux_version="0.1.0"
make_threads=8
oneshot_id=420530
ONESHOT_PATH=$HOME/.local/share/Steam/steamapps/common/OneShot
STEAMWORKS_PATH=$(realpath ..)/steamworks
# Colors.
@ -19,59 +18,60 @@ color_reset="\033[0m" # Reset Colors
echo -e "${white}Compiling ${bold}SyngleChance v${linux_version} ${white}engine for Linux...${color_reset}\n"
# Generate makefile.
echo -e "-> ${cyan}Generate makefile...${color_reset}"
export MRIVERSION=$(echo "puts RUBY_VERSION.split('.').slice(0, 2).join('.')" | ruby)
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
qmake mkxp.pro > oneshot.qmake.out
cmake . -B build/
cd build
make -j${nproc}
cd ..
# Compile OneShot.
echo -e "-> ${cyan}Compile engine...${color_reset}"
make -j${make_threads} > oneshot.make.out
mkdir build/bandle
mkdir build/bandle/Sunshine
mkdir build/bandle/Sunshine/Data
# Compile steamshim.
echo -e "-> ${cyan}Compile steamshim...${color_reset}"
cd steamshim_parent
mkdir build
cd build
cmake -DSTEAMWORKS_PATH=${STEAMWORKS_PATH} .. > steamshim.cmake.out
cp "$STEAMWORKS_PATH/redistributable_bin/linux64/libsteam_api.so" .
make -j${make_threads} > steamshim.make.out
cd ../..
#echo -e "-> ${cyan}Compile steamshim...${color_reset}"
#cd steamshim_parent
#mkdir build
#cd build
#cmake -DSTEAMWORKS_PATH=${STEAMWORKS_PATH} .. > steamshim.cmake.out
#cp "$STEAMWORKS_PATH/redistributable_bin/linux64/libsteam_api.so" .
#make -j${make_threads} > steamshim.make.out
#cd ../..
# Compile Journal.
echo -e "-> ${cyan}Compile journal...${color_reset}"
pyinstaller journal/unix/journal.spec --windowed
pyinstaller journal/unix/journal.spec #--windowed
# Compile scripts.
echo -e "-> ${cyan}Compile xScripts.rxdata...${color_reset}"
ruby rpgscript.rb ./scripts "$ONESHOT_PATH" > rpgscript.out
ruby rpgscript.rb scripts/ build/bandle/Sunshine/
# Copy results.
echo -e "-> ${cyan}Install OneShot apps to Steam directory...${color_reset}"
yes | cp -r dist/_______/* "$ONESHOT_PATH"
yes | cp oneshot "$ONESHOT_PATH"
yes | cp steamshim_parent/build/steamshim "$ONESHOT_PATH"
echo "$oneshot_id" > "$ONESHOT_PATH/steam_appid.txt"
yes | cp -r dist/_______/* build/bandle/Sunshine/
yes | cp build/oneshot build/bandle/Sunshine
#yes | cp steamshim_parent/build/steamshim "$ONESHOT_PATH"
#echo "$oneshot_id" > "$ONESHOT_PATH/steam_appid.txt"
# Copy libraries.
echo -e "-> ${cyan}Install OneShot libraries to Steam directory...${color_reset}"
mkdir libs
ldd oneshot | ruby libraries.rb
ldd steamshim_parent/build/steamshim | ruby libraries.rb
yes | cp libs/* "$ONESHOT_PATH"
ldd build/oneshot | ruby libraries.rb
#ldd steamshim_parent/build/steamshim | ruby libraries.rb
yes | cp libs/* build/bandle/Sunshine
yes | cp build/oneshot build/bandle/Sunshine
cp installer/installer.sh build/bandle/
cp -r ../SunshineAssets/* build/bandle/Sunshine
cd build
zip -r OneshotSunshine.zip bandle/*
cd ..
# Cleanup.
echo -e "-> ${cyan}Cleanup files...${color_reset}"
rm -rf journal/unix/__pycache__
rm -rf build
#rm -rf build/*
rm -rf dist
rm -rf steamshim_parent/build
#rm -rf steamshim_parent/build
rm -rf libs
make clean > clean.out
rm -f *.out
rm Makefile
rm oneshot
rm .qmake.stash
echo -e "\n${green}Complete! ${white}Please report any issues to https://github.com/GooborgStudios/synglechance/issues${color_reset}"