win32ss / supermium

Chromium fork for Windows XP/2003 and up
https://win32subsystem.live/supermium/
BSD 3-Clause "New" or "Revised" License
2.41k stars 83 forks source link

How to move User Data to the Supermium folder (with exes)? #630

Open oleedd opened 5 months ago

opzch commented 5 months ago

You can move it and add --user-data-dir="./(whatever name the folder has)" to the shortcut's target (will not work if not launched via shortcut) image

If your OS supports directory junctions, you can also move the folder and create a link: mklink /j "C:\Users\User\AppData\Local\Supermium\Profile" "С:\Program Files\Supermium\Profile" or use something like chrlauncher. Configuring this policy: https://chromeenterprise.google/policies/?policy=UserDataDir or adding REG_SZ value UserDataDir under HKLM\SOFTWARE\Policies\Chromium should also work, but will affect other Chromium browsers.

oleedd commented 5 months ago

Thanks. But would be nice to be able to do without a shortcut and so that it keeps working after moving Supermium to another directory.

XakerTwo commented 5 months ago

wrong info about junctions cuz i missed keeps working after moving Supermium to another directory part

... you may try one weird way that i use for some programs - override %localAppData% via bat file and launch browser using this bat. BUT it's not so solid cuz there a lot of ways to launch browser plus i don't know how chromium will react on this.

not tested for this case, but should works. place it in target exe directory and set same name as for target exe

@echo off
rem overrides %localAppData%
set batLocation=%~dp0
set LOCALAPPDATA=%batLocation:~0,-1%
rem runs exe-file with same name as this bat file and redirect all arguments to it
start "" "%~dpn0.exe" %*

UPD: because of %localAppData% not presented before Windows Vista, here is another way to run chromium browser via bat/cmd file using --user-data-dir argument supplied with bat value. It's more dynamic but again not so solid nor liked by you :D

this bat file also should be placed in target exe file location but name can be any cuz target name hard-coded inside

@echo off
start "" "%~dp0chrome.exe" --user-data-dir="%~dp0Profile" %*
oleedd commented 5 months ago

It is interesting and useful, but I hate launching with cmd. I request this for chrome://flags.

XakerTwo commented 5 months ago

if remember correct - it's not possible cuz flags data stored in user-data-dir and to run with flag that define user-data-dir, user-data-dir should be provided first :rofl: So the only way is to use another storage such as registry or group policies. But, as i understand, you are trying to make it absolutely portable with "onboard" user data, so launch argument in this case is the only way. Also note that extensions will be dropped on new machine cuz some validation info stored in registry (not sure how it behaves with disable-machine-id and other similar flags, but saw some users complains about dropped extensions). To be more precise - all data that stored under HKEY_CURRENT_USER\Software\Supermium\PreferenceMACs\* keys

oleedd commented 5 months ago

if remember correct - it's not possible cuz flags data stored in user-data-dir and to run with flag that define user-data-dir, user-data-dir should be provided first 🤣

Oh, maybe that is why all portable versions use launchers.

I know about the problem with extensions. I found that it is related to the Secure Preferences file. And after you launch Chrome on another system, the installed extensions will not be available even on the initial system. So it is another request - to fix this.

Half-Modern commented 5 months ago

...or adding REG_SZ value UserDataDir under HKLM\SOFTWARE\Policies\Chromium should also work, but will affect other Chromium browsers.

Actually you need to name it "Supermium" instead of "Chromium", since that's how it's been implemented into this browser.

opzch commented 5 months ago

...or adding REG_SZ value UserDataDir under HKLM\SOFTWARE\Policies\Chromium should also work, but will affect other Chromium browsers.

Actually you need to name it "Supermium" instead of "Chromium", since that's how it's been implemented into this browser.

Did you try it yourself?

Half-Modern commented 5 months ago

...or adding REG_SZ value UserDataDir under HKLM\SOFTWARE\Policies\Chromium should also work, but will affect other Chromium browsers.

Actually you need to name it "Supermium" instead of "Chromium", since that's how it's been implemented into this browser.

Did you try it yourself?

Why wouldn't I? That's how I use my browser.

oleedd commented 5 months ago

With just registry (Policies) after moving to another directory, it will not work.

whindsaks commented 5 months ago

So the only way is to use another storage such as registry or group policies

Applications with portable and normal mode often trigger the portable mode by having a file or configuration set in the exe directory.

Darthagnon commented 5 months ago

You might be interested in using henrypp's chrlauncher for a portable Supermium