diff --git a/Make.bat b/Make.bat index a725c0871..b7eefaff2 100644 --- a/Make.bat +++ b/Make.bat @@ -242,6 +242,9 @@ GOTO:EOF ECHO HELP_PATH = '../../../docs/en_US/html/' >> "%PGBUILDPATH%\web\config_distro.py" ECHO MINIFY_HTML = False >> "%PGBUILDPATH%\web\config_distro.py" + ECHO Creating config_local.py + ECHO # Add any configuration changes to this file. > "%PGBUILDPATH%\web\config_local.py" + ECHO Building docs... MKDIR "%PGBUILDPATH%\docs\en_US\html" IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL% diff --git a/pkg/win32/installer.iss.in b/pkg/win32/installer.iss.in index 724294fa5..42dff254f 100644 --- a/pkg/win32/installer.iss.in +++ b/pkg/win32/installer.iss.in @@ -52,19 +52,6 @@ Root: HKLM; Subkey: "Software\{#MyAppName}\{#MyAppVersion}"; ValueType: string; Root: HKLM; Subkey: "Software\{#MyAppName}\{#MyAppVersion}"; ValueType: string; ValueName: "Version"; ValueData: "{#MyAppFullVersion}" [Code] -procedure CurStepChanged(CurStep: TSetupStep); -var - value : string; - begin - if CurStep = ssInstall then begin - value := ExpandConstant('{app}') + '\venv\Lib\site-packages' + ';' + - ExpandConstant('{app}') + '\venv\Lib' + ';' + - ExpandConstant('{app}') + '\venv\Lib\lib-tk' + ';' + - ExpandConstant('{app}') + '\venv\DLLs'; - RegWriteStringValue(HKEY_CURRENT_USER,'Software\pgAdmin Development Team\pgAdmin 4', 'PythonPath', value); - end; -end; - // find current version before installation function InitializeSetup: Boolean; var diff --git a/runtime/Server.cpp b/runtime/Server.cpp index 09200b73f..286c4dc08 100644 --- a/runtime/Server.cpp +++ b/runtime/Server.cpp @@ -67,7 +67,7 @@ Server::Server(quint16 port) // Append the path, if it's not already there if (!python_path.contains(pymodules_path)) { - if (!python_path.isEmpty()) + if (!python_path.isEmpty() && !python_path.endsWith(";")) python_path.append(";"); python_path.append(pymodules_path); @@ -83,24 +83,33 @@ Server::Server(quint16 port) QString app_dir = qApp->applicationDirPath(); // Build (and canonicalise) the virtual environment path - // C:\Program Files (x86)\pgAdmin 4\v1\venv\Lib\site-packages;C:\Program Files (x86)\pgAdmin 4a\v1\venv\Lib;C:\Program Files (x86)\pgAdmin 4\v1\venv\DLLs - QString path1 = (app_dir + "/../venv/Lib/site-packages"); - QString path2 = (app_dir + "/../venv/Lib"); - QString path3 = (app_dir + "/../venv/DLLs"); - QFileInfo fi1(path1); - QFileInfo fi2(path2); - QFileInfo fi3(path3); - QString pymodules_path = fi1.canonicalFilePath() + ";" + \ - fi2.canonicalFilePath() + ";" + \ - fi3.canonicalFilePath(); + QFileInfo path1(app_dir + "/../venv/Lib"); + QFileInfo path2(app_dir + "/../venv/DLLs"); + QFileInfo path3(app_dir + "/../venv/Lib/site-packages"); - // Append the path, if it's not already there - if (!python_path.contains(pymodules_path)) + // Append paths, if they're not already there + if (!python_path.contains(path1.canonicalFilePath())) { - if (!python_path.isEmpty()) + if (!python_path.isEmpty() && !python_path.endsWith(";")) python_path.append(";"); - python_path.append(pymodules_path); + python_path.append(path1.canonicalFilePath()); + } + + if (!python_path.contains(path2.canonicalFilePath())) + { + if (!python_path.isEmpty() && !python_path.endsWith(";")) + python_path.append(";"); + + python_path.append(path2.canonicalFilePath()); + } + + if (!python_path.contains(path3.canonicalFilePath())) + { + if (!python_path.isEmpty() && !python_path.endsWith(";")) + python_path.append(";"); + + python_path.append(path3.canonicalFilePath()); } #endif @@ -122,8 +131,11 @@ Server::Server(quint16 port) #endif } } + + qDebug() << "Full Python path: " << python_path; + python_path = settings.value("PythonPath").toString(); - qDebug() << "Python path: " << python_path; + qDebug() << "User Python path: " << python_path; } Server::~Server()