echo off setlocal EnableDelayedExpansion setlocal enableextensions SET FX_CUR_PATH=%~dp0 echo Umisteni Scriptu: %FX_CUR_PATH% for /f "tokens=1*" %%a in ('powershell -command "Get-ItemPropertyValue -Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Steam App 892970' -Name 'InstallLocation' "') do set FX_VAL_DIR=%%a %%b if exist "%FX_VAL_DIR%\valheim.exe" ( echo Slozka se hrou1: "!FX_VAL_DIR!" set FX_VAL_DIR_FOUND=True ) else ( for /f "tokens=1*" %%a in ('powershell -command "Get-ItemPropertyValue -Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Steam App 892970' -Name 'InstallLocation' "') do set FX_VAL_DIR=%%a if exist "!FX_VAL_DIR!\valheim.exe" ( echo Slozka se hrou2: "!FX_VAL_DIR!" set FX_VAL_DIR_FOUND=True ) else ( echo Slozka se hrou nenalezena! echo Cesta v registrech 1: "!FX_VAL_DIR!" set FX_VAL_DIR_FOUND=False ) ) echo. :: Local Folders if not exist "FxS_ValheimFerus" ( mkdir FxS_ValheimFerus ) if not exist "FxS_ValheimFerus\FxS_dload" ( mkdir FxS_ValheimFerus\FxS_dload ) if not exist "FxS_ValheimFerus\FxS_ext" ( mkdir FxS_ValheimFerus\FxS_ext ) if not exist "FxS_ValheimFerus\FxS_dll" ( mkdir FxS_ValheimFerus\FxS_dll ) if exist ".\FxS_ValheimFerus\FxS_cfg" ( rmdir /Q/S .\FxS_ValheimFerus\FxS_cfg ) if not exist "FxS_ValheimFerus\FxS_cfg" ( mkdir FxS_ValheimFerus\FxS_cfg ) cd %FX_CUR_PATH%\FxS_ValheimFerus :: BepInEx For Valheim Source: https://thunderstore.io/package/download/denikson/BepInExPack_Valheim/5.4.2202/ if exist "BepInExPack_Valheim.zip" ( echo BepInExPack_Valheim.zip jiz existuje. set /p FX_VAL_REDOWNLOAD="Stahnout Znovu? (Ano/Ne)" if "%FX_VAL_REDOWNLOAD%" == "Ano" ( powershell Invoke-WebRequest https://thunderstore.io/package/download/denikson/BepInExPack_Valheim/5.4.2202/ -O BepInExPack_Valheim.zip ) ) else ( echo Stahuji BepInExPack_Valheim.zip powershell Invoke-WebRequest https://thunderstore.io/package/download/denikson/BepInExPack_Valheim/5.4.2202/ -O BepInExPack_Valheim.zip ) echo. echo Rozbaluji: BepInExPack_Valheim.zip tar -xf BepInExPack_Valheim.zip echo. :: Stazeni Modulu echo Stahovani Modulu ze serveru: powershell Invoke-WebRequest http://fxs.ddns.net/FxFiles/ValheimFerusPlugins/FxS_Plugins_URLs_client.txt -O FxS_Plugins_URLs_client.txt powershell -command "foreach($line in Get-Content .\FxS_Plugins_URLs_client.txt) { $filename=$line -replace ('/[0-9.]+/$', '') -replace ('^.*/', ''); $filever=$line -replace ('^.*/[^0-9.]+', '') -replace ('/', ''); if( Test-path ('.\FxS_dload\' + $filename + '_' + $filever + '.zip') -PathType leaf ) {echo ('Jiz Stazen: ' + $filename + '_' + $filever + '.zip')} else { Get-ChildItem -path '.\FxS_dload\' -include ($filename + '_' + '*.zip') -recurse | Remove-Item; echo ('=> Stahuji: ' + $filename + '_' + $filever + '.zip'); iwr -Uri $line -Method GET -Outfile ('.\FxS_dload\' + $filename + '_' + $filever + '.zip')}}" :: Rozbaleni Mudulu echo Rozbaluji Moduly cd FxS_ext for /f %%f in ('dir /b ..\FxS_dload\') do tar -xf ..\FxS_dload\%%f cd %FX_CUR_PATH%\FxS_ValheimFerus :: Usporadani do FxS_dll powershell -command "powershell -command '$fxfiles= @(dir -Path .\FxS_ext\ -Filter *.dll -Recurse | %%{$_.FullName}); foreach($file in $fxfiles){xcopy $file .\FxS_dll\ /H/Q/Y}'" :: Stazeni Configu echo Stahovani Configu ze serveru: powershell -command "$FxSrvCfgs='http://fxs.ddns.net/FxFiles/ValheimFerusConfig/'; $response=iwr $FxSrvCfgs -UseBasicParsing; $fxfiles = @( $response.Links -split '\s+' | Select-String -Pattern 'href=[a-zA-Z0-9\.]+cfg' -AllMatches | %% { $_.Matches } | %% { $_.Value } | Select-String -Pattern '[a-zA-Z0-9\.]+cfg' -AllMatches | %% { $_.Matches } | %% { $_.Value } ); foreach( $file in $fxfiles){ if( Test-path ('.\FxS_cfg\' + $file) -PathType leaf ) {echo ('Jiz Stazen: ' + $file)} else {echo ('Stahuji: ' + $file); iwr -Uri ($FxSrvCfgs + $file) -Method GET -Outfile ( '.\FxS_cfg\' + $file )}}; " echo. :: Cisteni predchozich modulu if exist "%FX_VAL_DIR%\BepInEx" ( echo Cistim Starsi Pluginy. del /Q /F /S "%FX_VAL_DIR%\BepInEx\*.dll" ) if exist "%FX_VAL_DIR%\unstripped_corlib" ( echo Cistim Starsi Knihovny. del /Q /F "%FX_VAL_DIR%\unstripped_corlib" ) if exist "%FX_VAL_DIR%\doorstop_libs" ( echo Cistim Starsi Moduly. del /Q /F "%FX_VAL_DIR%\doorstop_libs" ) :: Installace if "%FX_VAL_DIR_FOUND%" == "True" ( echo Probiha installace BepInEx. xcopy .\BepInExPack_Valheim "%FX_VAL_DIR%\" /E/H/Q/Y echo Probiha installace Modulu. xcopy .\FxS_dll "%FX_VAL_DIR%\BepInEx\plugins\" /E/H/Q/Y echo Probiha installace Configu. xcopy .\FxS_cfg "%FX_VAL_DIR%\BepInEx\config\" /E/H/Q/Y ) else ( echo Je treba provest manualni installaci, nebot nebyla nalezena steam slozka s Valheim. ) echo. echo Hotovo. Po spusteni hry by v levem hornim rohu mela byt informace o BepInEx. pause