Feature #1931
Mis à jour par Matthieu Decorde il y a plus de 8 ans
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 * I) instead of using System.getProperty("user.home") use a native operating system API to ask for special directories. That is use in TXM.bat :
- call TXM launcher with the "-Duser.home=<user home>" option
**user home**
Notre hypothèse courante est la suivante (see https://groupes.renater.fr/wiki/txm-info/public/documentation/documentation_c#file_utilities) :
"AppDirs":https://github.com/harawata/appdirs Java library that does exactly that for Windows, Mac OS X and Linux through JNA.
* 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 1
- First build the user home directory * I) instead of using System.getProperty("user.home") use a native operating system API to ask for special directories. That is use in TXM.bat :
- call TXM launcher with the "-Duser.home=<user home>" option
**user home**
Notre hypothèse courante est la suivante (see https://groupes.renater.fr/wiki/txm-info/public/documentation/documentation_c#file_utilities) :
"AppDirs":https://github.com/harawata/appdirs Java library that does exactly that for Windows, Mac OS X and Linux through JNA.
* 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