Page 1 of 1
Start my application with parameters
Posted: Tue Mar 18, 2025 3:59 pm
by ericktux
Good morning, my friend Salvador, and everyone. I have a question: Is there a way to start my app automatically with parameters? For example, I tried this without success:
Code: Select all
GlobalCEFApp.AddCustomCommandLine('--password-store=basic');
To prevent the Ubuntu "gnome keyring" "keystore" box from popping up, but it doesn't work. Currently, I run it like this and it works fine:
But I would like to know if there is a way to start my app with commands without needing the terminal or extra files?
Please help.

Re: Start my application with parameters
Posted: Tue Mar 18, 2025 4:35 pm
by salvadordf
Hi,
Try adding this before the GlobalCEFApp.StartMainProcess call :
Code: Select all
GlobalCEFApp.AddCustomCommandLine('--password-store', 'basic');
You'll see that switch if you navigate to chrome://version
Re: Start my application with parameters
Posted: Tue Mar 18, 2025 5:12 pm
by ericktux
Thanks a lot, Salvador. I see that it appears in:
chrome://version
but the "gnome keyring" window keeps appearing. If I run it as a parameter from the terminal, it works. Do you know of any way to integrate that parameter into my app without the terminal?
Re: Start my application with parameters
Posted: Wed Mar 19, 2025 2:22 pm
by ericktux
I found this solution, so far it works well on Windows and Linux.
Code: Select all
program project1;
{$mode objfpc}{$H+}
uses
{$IFDEF UNIX}
cthreads,
{$ENDIF}
{$IFDEF HASAMIGA}
athreads,
{$ENDIF}
Interfaces, // this includes the LCL widgetset
Forms, unit1, process
{ you can add units after this };
{$R *.res}
procedure RelaunchWithParam;
var
AProcess: TProcess;
begin
AProcess := TProcess.Create(nil);
try
AProcess.Executable := ParamStr(0); // Ruta del ejecutable
AProcess.Parameters.Add('--password-store=basic'); // Agregar parĂ¡metro
//AProcess.Options := [poWaitOnExit]; // No esperar a que termine
AProcess.Execute; // Ejecutar nueva instancia
finally
AProcess.Free;
end;
Halt; // Detener la instancia original
end;
begin
// Si no hay parĂ¡metros, relanzamos con "--password-store=basic"
if ParamCount = 0 then
RelaunchWithParam;
RequireDerivedFormResource:=True;
Application.Scaled:=True;
Application.Initialize;
Application.CreateForm(TForm1, Form1);
Application.Run;
end.
Re: Start my application with parameters
Posted: Wed Mar 19, 2025 3:08 pm
by salvadordf
Hi,
I just updated CEF4Delphi with a new GlobalCEFApp.PasswordStorage property for Linux. It adds the correct command line switch to select the password storage.
I added GlobalCEFApp.PasswordStorage := psBasic; to the TinyBrowser2 demo and the debug log in verbose mode shows this :
Code: Select all
[11721:11721:0319/155317.710266:VERBOSE1:key_storage_linux.cc(116)] Selected backend for OSCrypt: BASIC_TEXT
If I comment the GlobalCEFApp.PasswordStorage line then the debug log shows this :
Code: Select all
[11528:11528:0319/155229.476760:VERBOSE1:key_storage_linux.cc(116)] Selected backend for OSCrypt: GNOME_LIBSECRET
I was using the latest Ubuntu version.
Re: Start my application with parameters
Posted: Sat Mar 22, 2025 3:40 am
by ericktux
Thank you very much, my friend Salvador. I will check it out.