mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Do a more sensible venv search on Windows, and don't update the
registry upon installation.
This commit is contained in:
parent
fc295f94a3
commit
73988bcece
3
Make.bat
3
Make.bat
@ -242,6 +242,9 @@ GOTO:EOF
|
|||||||
ECHO HELP_PATH = '../../../docs/en_US/html/' >> "%PGBUILDPATH%\web\config_distro.py"
|
ECHO HELP_PATH = '../../../docs/en_US/html/' >> "%PGBUILDPATH%\web\config_distro.py"
|
||||||
ECHO MINIFY_HTML = False >> "%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...
|
ECHO Building docs...
|
||||||
MKDIR "%PGBUILDPATH%\docs\en_US\html"
|
MKDIR "%PGBUILDPATH%\docs\en_US\html"
|
||||||
IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%
|
IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%
|
||||||
|
@ -52,19 +52,6 @@ Root: HKLM; Subkey: "Software\{#MyAppName}\{#MyAppVersion}"; ValueType: string;
|
|||||||
Root: HKLM; Subkey: "Software\{#MyAppName}\{#MyAppVersion}"; ValueType: string; ValueName: "Version"; ValueData: "{#MyAppFullVersion}"
|
Root: HKLM; Subkey: "Software\{#MyAppName}\{#MyAppVersion}"; ValueType: string; ValueName: "Version"; ValueData: "{#MyAppFullVersion}"
|
||||||
|
|
||||||
[Code]
|
[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
|
// find current version before installation
|
||||||
function InitializeSetup: Boolean;
|
function InitializeSetup: Boolean;
|
||||||
var
|
var
|
||||||
|
@ -67,7 +67,7 @@ Server::Server(quint16 port)
|
|||||||
// Append the path, if it's not already there
|
// Append the path, if it's not already there
|
||||||
if (!python_path.contains(pymodules_path))
|
if (!python_path.contains(pymodules_path))
|
||||||
{
|
{
|
||||||
if (!python_path.isEmpty())
|
if (!python_path.isEmpty() && !python_path.endsWith(";"))
|
||||||
python_path.append(";");
|
python_path.append(";");
|
||||||
|
|
||||||
python_path.append(pymodules_path);
|
python_path.append(pymodules_path);
|
||||||
@ -83,24 +83,33 @@ Server::Server(quint16 port)
|
|||||||
QString app_dir = qApp->applicationDirPath();
|
QString app_dir = qApp->applicationDirPath();
|
||||||
|
|
||||||
// Build (and canonicalise) the virtual environment path
|
// 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
|
QFileInfo path1(app_dir + "/../venv/Lib");
|
||||||
QString path1 = (app_dir + "/../venv/Lib/site-packages");
|
QFileInfo path2(app_dir + "/../venv/DLLs");
|
||||||
QString path2 = (app_dir + "/../venv/Lib");
|
QFileInfo path3(app_dir + "/../venv/Lib/site-packages");
|
||||||
QString path3 = (app_dir + "/../venv/DLLs");
|
|
||||||
QFileInfo fi1(path1);
|
|
||||||
QFileInfo fi2(path2);
|
|
||||||
QFileInfo fi3(path3);
|
|
||||||
QString pymodules_path = fi1.canonicalFilePath() + ";" + \
|
|
||||||
fi2.canonicalFilePath() + ";" + \
|
|
||||||
fi3.canonicalFilePath();
|
|
||||||
|
|
||||||
// Append the path, if it's not already there
|
// Append paths, if they're not already there
|
||||||
if (!python_path.contains(pymodules_path))
|
if (!python_path.contains(path1.canonicalFilePath()))
|
||||||
{
|
{
|
||||||
if (!python_path.isEmpty())
|
if (!python_path.isEmpty() && !python_path.endsWith(";"))
|
||||||
python_path.append(";");
|
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
|
#endif
|
||||||
|
|
||||||
@ -122,8 +131,11 @@ Server::Server(quint16 port)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
qDebug() << "Full Python path: " << python_path;
|
||||||
|
|
||||||
python_path = settings.value("PythonPath").toString();
|
python_path = settings.value("PythonPath").toString();
|
||||||
qDebug() << "Python path: " << python_path;
|
qDebug() << "User Python path: " << python_path;
|
||||||
}
|
}
|
||||||
|
|
||||||
Server::~Server()
|
Server::~Server()
|
||||||
|
Loading…
Reference in New Issue
Block a user