Comments (4)
Is the goal to backup these folders?
- `AppData/Local/Logos/Data//
- `AppData/Local/Logos/Documents//
- `AppData/Local/Logos/Users//
And then maybe restore them by passing a new to the restore
command to properly set the destination? Or, assuming Logos is already installed, the restore
command could just find the (or could be saved as part of the config file, as I think @thw26 has already suggested)?
from logoslinuxinstaller.
Here is the relevant bash code:
You need to find the Logos User, too, which is earlier in the code:
LOGOS_USER="\$(find "\${HERE}"/data/wine64_bottle/drive_c/users/*/AppData/Local/Logos -name Data | sed -r "s@\${HERE}/data/wine64_bottle/drive_c/users/(.*)/AppData/Local/Logos/Data@\1@")"; export LOGOS_USER;
Notice particularly here:
/drive_c/users/(.*)/AppData/Local/Logos/Data@\1@
This sed replaces the (.*)
with \1
, for clarity.
This UID is only available after logging in once.
The reason you need this is that the LOGOS_USER field is a random ID created on install, and therefore different every time. If you restore in an existing install, you need to restore to the same ID, but if you do a new install, that number changes.
So we could just back up the data files you linked, but how do we know which account to restore them to if we don't have the right UID?
The code does this:
- You can see in the bash code that we first determine if the user has logged in (so that we have a working UID, likely placed in some local SQL database).
- Then we set our source and destination dirs, using the Logos UID.
- Then we determine the disk space and ask the user to confirm.
- Then we sync.
If I could make this better, I would want to have our backups be timestamped and possibly set up rotation as well as hardlinks between backups, so as to minimize disk usage.
Then, ideally, we need to figure out someway of handling the Logos UID problem.
from logoslinuxinstaller.
On a new Logos install, if those 3 folders (and their contents) are present from a previous installation before Logos launches the first time, then Logos will start immediately rather than present the login window. So the randomly-named folder just under Data/
, Documents/
, and Users/
(called $LOGOS_UID
in the bash script) can be reused across (re-)installations. Put another way, on a clean installation of Logos, the user doesn't have to first log in before we can restore those folders; they can be restored before login, and then the user will already be logged in when the app runs because the backed up files include the relevant account information. NOTE: This assumes that the backup set only includes files for a single Logos user.
We exploit this in the logos10-unofficial
snap, where we allow Logos user data to be stored outside of Logo's wine folder tree (partly to solve the problem of data loss if the WINEPREFIX has to be reinstalled), but then just after Logos installation and just before it launches the first time, we create symlinks for those folders from that outside location (~/logos-data/
) into where they should be in the wine folder tree:
# If ~/logos-data exists, ask user if they want to link to it.
if [[ -n "$SNAP_NAME" ]]; then
home="$SNAP_REAL_HOME"
else
home="$HOME"
fi
LOGOS_DATA="${home}/logos-data"
LOGOS_INSTALL_DIR=$(dirname "$LOGOS_EXE")
if [[ -d "$LOGOS_DATA" || -L "$LOGOS_DATA" ]]; then
yad --title="Use existing Logos data folder?" --width=400 --center --auto-kill \
--button=gtk-no:1 --button=gtk-yes:0 --borders=15 \
--text="You have a Logos data folder at $LOGOS_DATA. Do you want to link this installation to it?"
use_logos_data=$?
if [[ $use_logos_data -eq 0 ]]; then
# Symlink to $LOGOS_DATA.
content_dirs=( "Data" "Documents" "Users" )
for d in "${content_dirs[@]}"; do
rm -rf "${LOGOS_INSTALL_DIR:?}/${d}"
ln -s "$LOGOS_DATA/${d}" "${LOGOS_INSTALL_DIR}/${d}"
done
fi
fi
The user runs logos10-unofficial
, it prompts them about using data stored in ~/logos-data
, if the user accepts, then those symlinks are made, Logos starts, and it opens right into the main app rather than the login window.
I don't personally know what happens if multiple Logos accounts are present on a single Logos installation. I assume that there would be multiple $LOGOS_UID
folders within Data/
, etc. But if we're only concerned about a single Logos account at a time, then I think we can ignore both $LOGOS_USER
and $LOGOS_UID
.
But maybe handling multiple accounts is important? You can find the $LOGOS_UID
and user "Display Name" in Users/UserMetadata
as JSON. So that would be the place to look first if someone has multiple accounts.
from logoslinuxinstaller.
So there is no need for an initial login? Interesting.
If the restore routine you have in place for the snap has been working, then let's just mirror it. I'm glad you have a symlink setup, too, as that saves a lot of disk.
from logoslinuxinstaller.
Related Issues (20)
- Potential GUI Improvements HOT 1
- Updating Non-AppImage Wine Binaries
- Beautify the GUI
- Installer should exit if connection times out
- Status Messages
- Installer Hangs While Checking for an Existing Install HOT 4
- Installer Fails to Create the Log File on Initial Run HOT 1
- Installer Fails to Create Shortcut Due to Missing Verbum Icon
- Running the install action crashes kde on kubuntu HOT 4
- GUI doesn't update "Install" button to "Run" after installation.
- Logos Itself Throws Error When Updating HOT 7
- Arch on python version < 3.12, causing install script to error HOT 3
- SteamOS: `pacman` Hits Locked Database HOT 1
- Allow Setting a Target Install Directory
- Slow Non-Responsive UI HOT 6
- Add Switch To Testing Branch
- ToolTip Incorrect in GUI on an Uninitiated Install
- Incorporate unit testing HOT 1
- Endless loop when glob() encounters a symlink loop HOT 3
- Self-update might result in broken binary
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from logoslinuxinstaller.