This commit is contained in:
Saifeddine ALOUI 2024-10-07 23:51:35 +02:00
parent c12a717990
commit 709125ab9f
2 changed files with 87 additions and 3 deletions

View File

@ -28,8 +28,9 @@ if %USE_MASTER%==1 (
) else ( ) else (
REM Download LollmsEnv installer REM Download LollmsEnv installer
echo Downloading LollmsEnv installer... echo Downloading LollmsEnv installer...
powershell -Command "Invoke-WebRequest -Uri 'https://github.com/ParisNeo/LollmsEnv/releases/download/V1.2.13/lollmsenv_installer.bat' -OutFile 'lollmsenv_installer.bat'" powershell -Command "Invoke-WebRequest -Uri 'https://github.com/ParisNeo/LollmsEnv/releases/download/V1.3.0/lollmsenv_installer.bat' -OutFile 'lollmsenv_installer.bat'"
REM Install LollmsEnv REM Install LollmsEnv
echo --- Installing lollmsenv
call lollmsenv_installer.bat --dir "%LOLLMSENV_DIR%" -y call lollmsenv_installer.bat --dir "%LOLLMSENV_DIR%" -y
) )
@ -145,8 +146,6 @@ echo cd lollms-webui >> lollms_cmd.bat
echo cmd /k >> lollms_cmd.bat echo cmd /k >> lollms_cmd.bat
cd lollms_webui cd lollms_webui
echo --- current folder
echo %cd%
REM Binding selection menu REM Binding selection menu
echo Select the default binding to be installed: echo Select the default binding to be installed:
echo 1) None (install the binding later) echo 1) None (install the binding later)

View File

@ -0,0 +1,85 @@
[Setup]
AppName=L🪶LLMS
AppVersion=1.0
DefaultDirName={pf}\L🪶LLMS
DefaultGroupName=L🪶LLMS
OutputDir=userdocs:Inno Setup Examples Output
[Files]
Source: "lollmsenv_installer.bat"; DestDir: "{app}"; Flags: external
[Code]
const
LollmsEnvInstallerUrl = 'https://github.com/ParisNeo/LollmsEnv/releases/download/V1.2.13/lollmsenv_installer.bat';
function DownloadFile(Url, FileName: string): Boolean;
var
ResultCode: Integer;
begin
if not FileExists(FileName) then
begin
Result := True;
if not Exec(ExpandConstant('{sys}\powershell.exe'),
Format('-Command "Invoke-WebRequest -Uri ''{0}'' -OutFile ''{1}''"', [Url, FileName]),
'', SW_HIDE, ewWaitUntilTerminated, ResultCode) then
begin
Result := False;
end;
end
else
Result := True;
end;
procedure InstallLollmsEnv;
var
ResultCode: Integer;
begin
if Exec(ExpandConstant('{app}\lollmsenv_installer.bat'),
'--dir "' + ExpandConstant('{app}\lollmsenv') + '" -y',
'', SW_SHOW, ewWaitUntilTerminated, ResultCode) then
begin
// LollmsEnv installed successfully
end
else
begin
MsgBox('Failed to install LollmsEnv', mbError, MB_OK);
end;
end;
procedure CreatePythonEnvironment;
var
ResultCode: Integer;
begin
if Exec(ExpandConstant('{app}\lollmsenv\bin\lollmsenv.bat'),
'create-env lollms_env',
'', SW_SHOW, ewWaitUntilTerminated, ResultCode) then
begin
// Python environment created successfully
end
else
begin
MsgBox('Failed to create Python environment', mbError, MB_OK);
end;
end;
// Add more procedures for other installation steps...
procedure CurStepChanged(CurStep: TSetupStep);
begin
if CurStep = ssPostInstall then
begin
if DownloadFile(LollmsEnvInstallerUrl, ExpandConstant('{app}\lollmsenv_installer.bat')) then
begin
InstallLollmsEnv;
CreatePythonEnvironment;
// Call other installation procedures...
end
else
begin
MsgBox('Failed to download LollmsEnv installer', mbError, MB_OK);
end;
end;
end;
[Run]
Filename: "{app}\lollms.bat"; Description: "Run L🪶LLMS"; Flags: postinstall nowait skipifsilent