Windows: Make path discovery better

DBRepair (Win)  now understands mixed mode (32 bit on 64 bit OS)
This commit is contained in:
ChuckPa 2024-05-05 00:51:26 -04:00
parent 852fdfc0d5
commit 1a3228e648
No known key found for this signature in database
GPG Key ID: 3CE28A0F6BC31B5B
4 changed files with 40 additions and 18 deletions

View File

@ -7,7 +7,9 @@ REM
REM -- WARNNING -- WARNING -- WARNING
REM
REM This is stable working software but not "Released" software. Development will continue.
REM
setlocal enabledelayedexpansion
REM ### Create Timestamp
set Hour=%time:~0,2%
set Min=%time:~3,2%
@ -34,16 +36,34 @@ if not exist "%PlexData%" (
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"
if not exist "%PlexSQL%" (
REM InstallFolder might be set under HKLM, not HKCU
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"
)
REM If InstallFolder wasn't set, or the resulting file doesn't exist, iterate through the
REM PROGRAMFILES variables looking for it. If we still can't find it, ask the user to provide it.
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 (
echo Could not determine SQLite path.
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
set "DBtmp=%PlexData%\dbtmp"

Binary file not shown.

View File

@ -1059,7 +1059,7 @@ DoRepair() {
[ -e $CPPL.blobs.db ] && mv $CPPL.blobs.db "$TMPDIR/$CPPL.blobs.db-BACKUP-$TimeStamp"
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.blobs.db-REPAIR-$TimeStamp" $CPPL.blobs.db

View File

@ -28,6 +28,8 @@ v1.06.00
"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
1. HOTIO image paths HOTIO images have again changed PMS executable location. This update