mirror of
https://github.com/ChuckPa/PlexDBRepair.git
synced 2025-11-06 03:08:55 -05:00
Windows: Make path discovery better
DBRepair (Win) now understands mixed mode (32 bit on 64 bit OS)
This commit is contained in:
parent
852fdfc0d5
commit
1a3228e648
@ -7,7 +7,9 @@ REM
|
|||||||
REM -- WARNNING -- WARNING -- WARNING
|
REM -- WARNNING -- WARNING -- WARNING
|
||||||
REM
|
REM
|
||||||
REM This is stable working software but not "Released" software. Development will continue.
|
REM This is stable working software but not "Released" software. Development will continue.
|
||||||
REM
|
|
||||||
|
setlocal enabledelayedexpansion
|
||||||
|
|
||||||
REM ### Create Timestamp
|
REM ### Create Timestamp
|
||||||
set Hour=%time:~0,2%
|
set Hour=%time:~0,2%
|
||||||
set Min=%time:~3,2%
|
set Min=%time:~3,2%
|
||||||
@ -22,27 +24,45 @@ set TimeStamp=%Hour%-%Min%-%Sec%
|
|||||||
REM Find PMS database location
|
REM Find PMS database location
|
||||||
for /F "tokens=2* skip=2" %%a in ('REG.EXE QUERY "HKCU\Software\Plex, Inc.\Plex Media Server" /v "LocalAppDataPath" 2^> nul') do set "PlexData=%%b\Plex Media Server\Plug-in Support\Databases"
|
for /F "tokens=2* skip=2" %%a in ('REG.EXE QUERY "HKCU\Software\Plex, Inc.\Plex Media Server" /v "LocalAppDataPath" 2^> nul') do set "PlexData=%%b\Plex Media Server\Plug-in Support\Databases"
|
||||||
if not exist "%PlexData%" (
|
if not exist "%PlexData%" (
|
||||||
if exist "%LOCALAPPDATA%\Plex Media Server\Plug-in Support\Databases" (
|
if exist "%LOCALAPPDATA%\Plex Media Server\Plug-in Support\Databases" (
|
||||||
set "PlexData=%LOCALAPPDATA%\Plex Media Server\Plug-in Support\Databases"
|
set "PlexData=%LOCALAPPDATA%\Plex Media Server\Plug-in Support\Databases"
|
||||||
) else (
|
) else (
|
||||||
echo Could not determine Plex database path.
|
echo Could not determine Plex database path.
|
||||||
echo Normally %LOCALAPPDATA%\Plex Media Server\Plug-in Support\Databases
|
echo Normally %LOCALAPPDATA%\Plex Media Server\Plug-in Support\Databases
|
||||||
echo.
|
echo.
|
||||||
goto :EOF
|
goto :EOF
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
REM Find PMS installation location.
|
REM Find PMS installation location.
|
||||||
for /F "tokens=2* skip=2" %%a in ('REG.EXE QUERY "HKCU\Software\Plex, Inc.\Plex Media Server" /v "InstallFolder" 2^> nul') do set "PlexSQL=%%b\Plex SQLite.exe"
|
for /F "tokens=2* skip=2" %%a in ('REG.EXE QUERY "HKCU\Software\Plex, Inc.\Plex Media Server" /v "InstallFolder" 2^> nul') do set "PlexSQL=%%b\Plex SQLite.exe"
|
||||||
|
|
||||||
if not exist "%PlexSQL%" (
|
if not exist "%PlexSQL%" (
|
||||||
if exist "%PROGRAMFILES%\Plex\Plex Media Server\Plex SQLite.exe" (
|
REM InstallFolder might be set under HKLM, not HKCU
|
||||||
set "PlexSQL=%PROGRAMFILES%\Plex\Plex Media Server\Plex SQLite.exe"
|
for /F "tokens=2* skip=2" %%a in ('REG.EXE QUERY "HKLM\Software\Plex, Inc.\Plex Media Server" /v "InstallFolder" 2^> nul') do set "PlexSQL=%%b\Plex SQLite.exe"
|
||||||
) else (
|
)
|
||||||
echo Could not determine SQLite path.
|
|
||||||
echo Normally %PROGRAMFILES%\Plex\Plex Media Server\Plex SQLite.exe
|
REM If InstallFolder wasn't set, or the resulting file doesn't exist, iterate through the
|
||||||
echo.
|
REM PROGRAMFILES variables looking for it. If we still can't find it, ask the user to provide it.
|
||||||
goto :EOF
|
if not exist "%PlexSQL%" (
|
||||||
)
|
if exist "%PROGRAMFILES%\Plex\Plex Media Server\Plex SQLite.exe" (
|
||||||
|
set "PlexSQL=%PROGRAMFILES%\Plex\Plex Media Server\Plex SQLite.exe"
|
||||||
|
) else (
|
||||||
|
if exist "%PROGRAMFILES(X86)%\Plex\Plex Media Server\Plex SQLite.exe" (
|
||||||
|
echo NOTE: 32-bit version of PMS detected on a 64-bit version of Windows. Updating to the 64-bit release of PMS is recommended.
|
||||||
|
set "PlexSQL=%PROGRAMFILES(X86)%\Plex\Plex Media Server\Plex SQLite.exe"
|
||||||
|
) else (
|
||||||
|
echo Could not determine SQLite path. Please provide it below
|
||||||
|
echo Normally %PROGRAMFILES%\Plex\Plex Media Server\Plex SQLite.exe
|
||||||
|
echo.
|
||||||
|
REM Last ditch effort, ask the user for the full path to Plex SQLite.exe
|
||||||
|
set /p "PlexSQL=Path to Plex SQLite.exe: "
|
||||||
|
if not exist "!PlexSQL!" (
|
||||||
|
echo "!PlexSQL!" could not be found. Cannot continue.
|
||||||
|
goto :EOF
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
REM Set temporary file locations
|
REM Set temporary file locations
|
||||||
|
|||||||
Binary file not shown.
@ -1059,7 +1059,7 @@ DoRepair() {
|
|||||||
[ -e $CPPL.blobs.db ] && mv $CPPL.blobs.db "$TMPDIR/$CPPL.blobs.db-BACKUP-$TimeStamp"
|
[ -e $CPPL.blobs.db ] && mv $CPPL.blobs.db "$TMPDIR/$CPPL.blobs.db-BACKUP-$TimeStamp"
|
||||||
|
|
||||||
Output "Making repaired databases active"
|
Output "Making repaired databases active"
|
||||||
WriteLog "Making repaired databases active"
|
WriteLog "Repair - Making repaired databases active"
|
||||||
mv "$TMPDIR/$CPPL.db-REPAIR-$TimeStamp" $CPPL.db
|
mv "$TMPDIR/$CPPL.db-REPAIR-$TimeStamp" $CPPL.db
|
||||||
mv "$TMPDIR/$CPPL.blobs.db-REPAIR-$TimeStamp" $CPPL.blobs.db
|
mv "$TMPDIR/$CPPL.blobs.db-REPAIR-$TimeStamp" $CPPL.blobs.db
|
||||||
|
|
||||||
|
|||||||
@ -28,6 +28,8 @@ v1.06.00
|
|||||||
|
|
||||||
"exit" or "quit" is still required in interactive use.
|
"exit" or "quit" is still required in interactive use.
|
||||||
|
|
||||||
|
3. Windows: DBRepair-Windows.bat now finds 32 bit PMS when installed on 64 bit Windows systems.
|
||||||
|
|
||||||
v1.05.02
|
v1.05.02
|
||||||
|
|
||||||
1. HOTIO image paths HOTIO images have again changed PMS executable location. This update
|
1. HOTIO image paths HOTIO images have again changed PMS executable location. This update
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user