Feature #2246
Mis à jour par Matthieu Decorde il y a environ 8 ans
The TXM Windows launcher builds the TXM user directory path using the %HOMEDRIVE% and %HOMEPATH% environment variables. See #1931 ticket.
If the user unplugs the network (cable/wifi) then the HOMESHARE=HOMEDRIVE+HOMEPATH directory does not exist (IF EXIST) and TXM can't start.
h3. Solution 1
A solution is to test the directory existence in the TXM.bat script and try the %USERPROFILE% path instead.
If the %USERPROFILE% path does not exist also, abort TXM launch.
<pre>
set installdir=%~dp0
set DEBUG=0
set USERHOME=%HOMEDRIVE%%HOMEPATH%
echo "USERHOME=%USERHOME%"
IF EXIST %USERHOME% GOTO USERHOMEOK
set USERHOME=%USERPROFILE%\
IF EXIST %USERHOME% GOTO USERHOMEOK2
echo "HOMEDRIVE+HOMEPATH = %HOMEDRIVE%%HOMEPATH% and USERPROFILE = %USERPROFILE% do not exist. Unable to find TXM configuration, aborting TXM launch."
exit
:USERHOMEOK2
echo "HOMEDRIVE+HOMEPATH = %HOMEDRIVE%%HOMEPATH% does not exist, using USERPROFILE = %USERPROFILE% value instead."
:USERHOMEOK
</pre>
h3. Solution 2
Windows environment variables:
* %HOMEDRIVE%%HOMEPATH% : any pc (first launch, next launches), connected, always access to the same distant drive TXM HOME directory
*
%USERPROFILE% : same pc (first launch, next launches), connected or not, always access to the same local drive (C:\) TXM HOME directory
Add a new NSIS install option "roaming profile" "installation type" with 2 values: false
* local account (default) and true
* roaming account
if "roaming profile" "local account" is set, the TXM.bat script will *always* try to always use the %HOMEDRIVE%%HOMEPATH% %USERPROFILE% directory (the script aborts if not available)
if not it "roaming account" is set, the TXM.bat script will *always* always try to use the %USERPROFILE% directory %HOMEDRIVE%%HOMEPATH% (the script aborts if not available)
h3. Solution 3
Drive TXM user home directory using TXM specific environment variables:
* TXMSHAREDHOME: the distant home directory to use
* TXMHOME: the local home directory to use
Then TXM.bat algorithm to set the user home directory is:
# to use %TXMSHAREDHOME%
# if %TXMSHAREDHOME% is not reachable to use %TXMHOME%
# if %TXMHOME% is not reachable to use %USERPROFILE%
If the user unplugs the network (cable/wifi) then the HOMESHARE=HOMEDRIVE+HOMEPATH directory does not exist (IF EXIST) and TXM can't start.
h3. Solution 1
A solution is to test the directory existence in the TXM.bat script and try the %USERPROFILE% path instead.
If the %USERPROFILE% path does not exist also, abort TXM launch.
<pre>
set installdir=%~dp0
set DEBUG=0
set USERHOME=%HOMEDRIVE%%HOMEPATH%
echo "USERHOME=%USERHOME%"
IF EXIST %USERHOME% GOTO USERHOMEOK
set USERHOME=%USERPROFILE%\
IF EXIST %USERHOME% GOTO USERHOMEOK2
echo "HOMEDRIVE+HOMEPATH = %HOMEDRIVE%%HOMEPATH% and USERPROFILE = %USERPROFILE% do not exist. Unable to find TXM configuration, aborting TXM launch."
exit
:USERHOMEOK2
echo "HOMEDRIVE+HOMEPATH = %HOMEDRIVE%%HOMEPATH% does not exist, using USERPROFILE = %USERPROFILE% value instead."
:USERHOMEOK
</pre>
h3. Solution 2
Windows environment variables:
* %HOMEDRIVE%%HOMEPATH% : any pc (first launch, next launches), connected, always access to the same distant drive TXM HOME directory
*
%USERPROFILE% : same pc (first launch, next launches), connected or not, always access to the same local drive (C:\) TXM HOME directory
Add a new NSIS install option "roaming profile" "installation type" with 2 values: false
* local account (default) and true
* roaming account
if "roaming profile" "local account" is set, the TXM.bat script will *always* try to always use the %HOMEDRIVE%%HOMEPATH% %USERPROFILE% directory (the script aborts if not available)
if not it "roaming account" is set, the TXM.bat script will *always* always try to use the %USERPROFILE% directory %HOMEDRIVE%%HOMEPATH% (the script aborts if not available)
h3. Solution 3
Drive TXM user home directory using TXM specific environment variables:
* TXMSHAREDHOME: the distant home directory to use
* TXMHOME: the local home directory to use
Then TXM.bat algorithm to set the user home directory is:
# to use %TXMSHAREDHOME%
# if %TXMSHAREDHOME% is not reachable to use %TXMHOME%
# if %TXMHOME% is not reachable to use %USERPROFILE%