Feature #1931

Updated by Matthieu Decorde over 2 years ago

During TXM post-installation, System.getProperty("user.home") may point to a wrong directory (can't read, write, does not exist)

h3. Solution 1

- First build the user home directory to use in TXM.bat :
- call TXM launcher with the "-Duser.home=<user home>" option or with "set _JAVA_OPTIONS=-Duser.home=%HOMEDRIVE%%HOMEPATH%"

**user home**

Notre hypoth├Ęse courante est la suivante (see https://groupes.renater.fr/wiki/txm-info/public/documentation/documentation_c#file_utilities) :
* USERPROFILE = HOMEDRIVE + HOMEPATH (local profile)
* HOMESHARE = HOMEDRIVE + HOMEPATH (roaming profile)

So we'll use HOMEDRIVE + HOMEPATH as user home directory.

h3. Solution 2

II) add a test at the beginning of the post-installation, if it is not possible to create the TXM user directory then ask the user a directory with write access where the TXM user directory will be created.

Dialog:
title: TXM user directory installation
content: TXM can't create the TXM user directory in "C:/Users/stud". Please select another directory.
[ ] [...] -> open DirectoryDialog
[Cancel] -> abort post-installation and quit TXM?
[OK] -> Continue the installation, ask again if the new directory is not ok

h3. Solution 3

If the user unplug the network (cable/wifi) or if the roaming profile is not reachable, the HOMESHARE=HOMEDRIVE+HOMEPATH HOMEDRIVE+HOMEPATH path point to nothing and TXM can't start.

A solution is to add Add an existing directory test in the TXM.bat TXM.bar script and use the local profile instead. profile.

If the local profile is also not usable (read&write rights), abort TXM launch.

Back