forked from StarCoreSE/Orrery-Combat-Framework
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request StarCoreSE#211 from InvalidArgument3/ai-init-fix
better rm symlink bat
- Loading branch information
Showing
15 changed files
with
79 additions
and
47 deletions.
There are no files selected for viewing
6 changes: 3 additions & 3 deletions
6
...Demo/Communication/DefinitionCollector.cs → ...work/Communication/DefinitionCollector.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...eworkDemo/Communication/TargetingEnums.cs → ...Framework/Communication/TargetingEnums.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ation/WeaponBases/WeaponDefinitionBase.cs → ...ation/WeaponBases/WeaponDefinitionBase.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...ameworkDemo/Example2BarrelTurretWeapon.cs → ...atFramework/Example2BarrelTurretWeapon.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...ryFrameworkDemo/ExampleFixedBeamWeapon.cs → ...CombatFramework/ExampleFixedBeamWeapon.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...rameworkDemo/ExampleFixedMissileWeapon.cs → ...batFramework/ExampleFixedMissileWeapon.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...ryFrameworkDemo/ExampleFixedProjWeapon.cs → ...CombatFramework/ExampleFixedProjWeapon.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...rreryFrameworkDemo/ExampleTurretWeapon.cs → ...eryCombatFramework/ExampleTurretWeapon.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...s/OrreryFrameworkDemo/HeartDefinitions.cs → ...OrreryCombatFramework/HeartDefinitions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,71 @@ | ||
@echo off | ||
setlocal enabledelayedexpansion | ||
|
||
:: Check if the script is running with administrative privileges | ||
NET SESSION >NUL 2>&1 | ||
if %ERRORLEVEL% NEQ 0 ( | ||
echo Please run this script as administrator! | ||
REM Check if the script is running as administrator | ||
>nul 2>&1 "%SystemRoot%\system32\cacls.exe" "%SystemRoot%\system32\config\system" | ||
if '%errorlevel%' NEQ '0' ( | ||
echo. | ||
echo ==================================================== | ||
echo This script must be run as an administrator to remove symlinks! | ||
echo Right-click the script and select "Run as administrator". | ||
echo ==================================================== | ||
echo. | ||
pause | ||
exit /b 1 | ||
exit /b | ||
) | ||
|
||
set "targetDir=%APPDATA%\SpaceEngineers\Mods" | ||
set "desktopDir=%USERPROFILE%\Desktop\SpaceEngineersModsBackup" | ||
REM Define the root Space Engineers mod directory | ||
set modRootDir="%APPDATA%\SpaceEngineers\Mods" | ||
|
||
:: Creating desktop directory if it doesn't exist | ||
if not exist "%desktopDir%" ( | ||
mkdir "%desktopDir%" | ||
REM Check if the mod directory exists | ||
if not exist !modRootDir! ( | ||
echo Mod directory does not exist: !modRootDir! | ||
echo Please ensure that the Space Engineers game has created mod directories. | ||
pause | ||
exit /b | ||
) | ||
|
||
:: Copying non-symbolic link folders to the desktop | ||
for /d %%i in ("%targetDir%\*") do ( | ||
set "folderName=%%~nxi" | ||
fsutil reparsepoint query "%%i" > nul 2>&1 | ||
if errorlevel 1 ( | ||
robocopy "%%i" "%desktopDir%\!folderName!" /E /NFL /NDL /NJH /NJS /nc /ns /np | ||
) | ||
REM Change to the mod directory | ||
cd /d "!modRootDir!" | ||
|
||
REM List only symbolic links in the mod directory | ||
echo. | ||
echo Searching for symbolic links in: !modRootDir! | ||
set foundSymlink=false | ||
for /f "tokens=*" %%l in ('dir /AL /B') do ( | ||
set foundSymlink=true | ||
echo Found symlink: %%l | ||
) | ||
|
||
REM Check if any symbolic links were found | ||
if "!foundSymlink!"=="false" ( | ||
echo No symbolic links found in: !modRootDir! | ||
pause | ||
exit /b | ||
) | ||
|
||
REM Prompt the user for confirmation once to delete all symbolic links | ||
set /p confirmDelete="Do you want to delete all symlinks in this directory? [Y/N]: " | ||
if /i "!confirmDelete!" NEQ "Y" ( | ||
echo Operation canceled. No symlinks were removed. | ||
pause | ||
exit /b | ||
) | ||
|
||
:: Removing symbolic links from the mod folder | ||
for /d %%i in ("%targetDir%\*") do ( | ||
set "folderName=%%~nxi" | ||
fsutil reparsepoint query "%%i" > nul 2>&1 | ||
if not errorlevel 1 ( | ||
rmdir /s /q "%%i" | ||
echo Removed symlink in "%%i" | ||
REM Remove all symlinks in the mod directory | ||
echo. | ||
echo Deleting all symbolic links in: !modRootDir! | ||
for /f "tokens=*" %%l in ('dir /AL /B') do ( | ||
echo Removing symlink: %%l | ||
rmdir "%%l" | ||
if !errorlevel! == 0 ( | ||
echo Successfully removed symlink: %%l | ||
) else ( | ||
echo Failed to remove symlink: %%l. Check permissions or path issues. | ||
) | ||
) | ||
|
||
REM Completion message | ||
echo. | ||
echo All symbolic links have been removed from: !modRootDir! | ||
pause |