ungoogled-chromium icon indicating copy to clipboard operation
ungoogled-chromium copied to clipboard

Read default command line arguments from text file in exe directory

Open rtllxndr opened this issue 1 year ago • 2 comments

Description

Ability to provide default command line arguments for portable launch

Who's implementing?

  • Someone who can build it from source and write some cpp code

The problem

I am launching chromium exe with specific parameters, including --user-data-dir etc. I would like to provide these parameters in a text file so it would be possible to just launch exe file and it would use parameters from the file. Also, there should be a way to provide a relative path in this file for user-data-dir

Possible solutions

When app starts, check if a file with specific name exists in exe directory, read it and append to arguments. For --user-data-dir value, additionally check if it is absolute path or relative to exe dir or cwd, exists or not and expand it to existing path. Path, relative to exe_dir should have priority over cwd, (if it exists). The goal is to make thumbdrive edition of application. Possibly, add the same resolve procedure for other similar flags, that are useful for making portable setup. File could be named command_line_arguments.txt It will also solve some issues on windows, related to pinning exe to taskbar, making shortcut to exe, registering exe as default handler for files and protocols.

Alternatives

No response

Additional context

No response

rtllxndr avatar Oct 23 '23 10:10 rtllxndr

There is workaround that does the same and more but it patches compiled chrome, https://github.com/Bush2021/chrome_plus/tree/main

rtllxndr avatar Oct 23 '23 19:10 rtllxndr

  1. You can extract ungoogled-chromium_119.0.6045.159-1.1_windows_x64.zip to D:\Programs\Ungoogled Chromium\App, for example.
  2. A directory need to be created at D:\Programs\Ungoogled Chromium\Data.
  3. Put the following batch script into D:\Programs\Ungoogled Chromium\. The script can be named Ungoogled_Chromium.bat.
START "" "%~dp0App\Chrome.exe" --user-data-dir="%~dp0Data" --allow-outdated-plugins --disable-logging --disable-breakpad --disable-encryption --disable-machine-id

When you want to use Ungoogled Chromium, you can just double click the Ungoogled_Chromium.bat. The script will set the user data directory to D:\Programs\Ungoogled Chromium\Data and it will also set extra arguments if you want. Then it will open Ungoogled Chromium.

You can also type chrome://version/ in the address bar of Ungoogled Chromium to check those arguments.

JaHIY avatar Dec 01 '23 04:12 JaHIY