@set MYTEXMF=
@set MYVTEXMF=
@set MYLTEXMF=
@set MYLBIN=\miktex\bin
@if NOT "%SOURCE%"=="" cd %SOURCE%
@copy pwd source.bat
@cd >>source.bat
@call source
@del source.bat
@if "%SOURCE%"=="" set SOURCE="%ORIGIN%"

@if EXIST %SOURCE%\inputs\frlicense.dat goto EXISTS
@echo Le fichier source %%SOURCE%%\inputs\frlicense.dat n'est pas trouve !
@set SOURCE=
@set ROOT=
@goto FIN

:EXISTS
@if NOT "%ROOT%"=="" goto OKROOT
@cd ..
@cd ..
@if NOT "%ROOT%"=="" cd %ROOT%
@copy %SOURCE%\target %SOURCE%\root.bat
@cd >>%SOURCE%\root.bat
@call %SOURCE%\root
@del %SOURCE%\root.bat
@if NOT "%ROOT%"=="" goto OKROOT
@if "%ROOT%"=="" set ROOT="%ORIGOUT%"
@echo
@echo Vous devez eventuellement preciser (variable %%ROOT%%) ou se trouve 
@echo votre repertoire cible TEXMF-LOCAL pour l'installation de FrenchPro ;
@echo peut-etre s'agit-il de :
@echo %ROOT%

:OKROOT
@cd %SOURCE%
@copy pwd root.bat
@cd %ROOT%
@cd >>%SOURCE%\root.bat
@cd %SOURCE%
@echo . 
@echo      B I E N V E N U E pour l'installation de FrenchPro 
@echo .
@echo Installation de FrenchPro depuis le repertoire 
@echo source %SOURCE% (variable %%SOURCE)
@echo et selon l'architecture TDS (localtexmf)
@echo (formats a faire par le bouton Build)
@echo qui a pour racine %ROOT% (variable %%ROOT).
@echo Ok pour continuer ? (sinon Ctrl-C)
@pause

@cd %ROOT%
mkdir %ROOT%%MYTEXMF%\tex
mkdir %ROOT%%MYTEXMF%\tex\generic 
mkdir %ROOT%%MYTEXMF%\tex\generic\hyphen 

mkdir %ROOT%%MYLTEXMF%\doc 
mkdir %ROOT%%MYLTEXMF%\doc\french 
cd %SOURCE%\inputs
copy keyboard.dat french.keyboard.dat
cd %SOURCE%\inputs
latex frlicense.dat
del frlicense.log
cd %SOURCE%
mkdir %SOURCE%\bin
mkdir %SOURCE%\bin
mkdir %ROOT%%MYLTEXMF%%MYLBIN%
mkdir %ROOT%%MYLTEXMF%\tex
mkdir %ROOT%%MYLTEXMF%\tex\french
mkdir %ROOT%%MYLTEXMF%%MYLBIN%
mkdir %ROOT%%MYTEXMF%\tex\generic\hyphen
cd %SOURCE%\initex
copy frhyph.tex %ROOT%%MYTEXMF%\tex\generic\hyphen
copy frhyph1.tex %ROOT%%MYTEXMF%\tex\generic\hyphen
copy zerohyph.tex %ROOT%%MYTEXMF%\tex\generic\hyphen
mkdir %ROOT%%MYLTEXMF%\tex\french\base
copy ecplain.tex %ROOT%%MYLTEXMF%\tex\french\base
copy frpdftexconfig.tex %ROOT%%MYLTEXMF%\tex\french\base
copy hyconfig.tex %ROOT%%MYLTEXMF%\tex\french\base
cd %SOURCE%\inputs
mkdir %ROOT%%MYLTEXMF%\tex\french\config
cd %SOURCE%\inputs
copy frlicense.dat %ROOT%%MYLTEXMF%\tex\french\config
copy language.dat %ROOT%%MYLTEXMF%\tex\french\config
cd %SOURCE%\inputs
copy english.keyboard.dat %ROOT%%MYLTEXMF%\tex\french\config
copy french.keyboard.dat %ROOT%%MYLTEXMF%\tex\french\config
copy keyboard.dat %ROOT%%MYLTEXMF%\tex\french\config
cd %SOURCE%\initex
copy iniproto %ROOT%%MYLTEXMF%\tex\french\config\frelatex.ini
copy iniproto %ROOT%%MYLTEXMF%\tex\french\config\fretex.ini
copy iniproto %ROOT%%MYLTEXMF%\tex\french\config\frlatex.ini
copy iniproto %ROOT%%MYLTEXMF%\tex\french\config\frpdflatex.ini
copy iniproto %ROOT%%MYLTEXMF%\tex\french\config\frpdftex.ini
copy iniproto %ROOT%%MYLTEXMF%\tex\french\config\frtex.ini
copy iniproto %ROOT%%MYLTEXMF%\tex\french\config\frtexcm.ini
copy iniproto %ROOT%%MYLTEXMF%\tex\french\config\frtexec.ini
copy iniproto %ROOT%%MYLTEXMF%\tex\french\config\frxelatex.ini
copy iniproto %ROOT%%MYLTEXMF%\tex\french\config\frxetex.ini
copy iniproto %ROOT%%MYLTEXMF%\tex\french\config\mltex.ini
copy hyphen.cfg %ROOT%%MYLTEXMF%\tex\french\config
copy plaintex.cfg %ROOT%%MYLTEXMF%\tex\french\config
copy frelatex.fr %ROOT%%MYLTEXMF%\tex\french\config
copy fretex.fr %ROOT%%MYLTEXMF%\tex\french\config
copy frlatex.fr %ROOT%%MYLTEXMF%\tex\french\config
copy frpdflatex.fr %ROOT%%MYLTEXMF%\tex\french\config
copy frpdftex.fr %ROOT%%MYLTEXMF%\tex\french\config
copy frtex.fr %ROOT%%MYLTEXMF%\tex\french\config
copy frtexcm.fr %ROOT%%MYLTEXMF%\tex\french\config
copy frtexec.fr %ROOT%%MYLTEXMF%\tex\french\config
copy frxelatex.fr %ROOT%%MYLTEXMF%\tex\french\config
copy frxetex.fr %ROOT%%MYLTEXMF%\tex\french\config
copy mltex.fr %ROOT%%MYLTEXMF%\tex\french\config
mkdir %ROOT%%MYLTEXMF%\tex\french\base
cd %SOURCE%
copy %SOURCE%\bin\kb7to8.exe %ROOT%%MYLTEXMF%%MYLBIN%
copy %SOURCE%\bin\kb8to7.exe %ROOT%%MYLTEXMF%%MYLBIN%
cd %SOURCE%
mkdir %ROOT%%MYLTEXMF%\doc\french\base
mkdir %ROOT%%MYLTEXMF%\doc\french\base
copy ALIRE.pdf frenchpro.pdf
copy frenchpro.pdf %ROOT%%MYLTEXMF%\doc\french\base\frenchpro.pdf
del frenchpro.pdf
copy %SOURCE%\doc\frguide.pdf %ROOT%%MYLTEXMF%\doc\french\base\frguide.pdf
copy %SOURCE%\doc\frenchle.pdf %ROOT%%MYLTEXMF%\doc\french\base\frenchle.pdf
mkdir %ROOT%%MYLTEXMF%\tex\french\base
cd %SOURCE%
mkdir %ROOT%%MYTEXMF%\tex\latex\frenchle
cd %SOURCE%\inputs
copy french.ldf %ROOT%%MYTEXMF%\tex\latex\frenchle
copy frenchle.ldf %ROOT%%MYTEXMF%\tex\latex\frenchle
copy frenchle.sty %ROOT%%MYTEXMF%\tex\latex\frenchle
copy frenchle.cfg %ROOT%%MYTEXMF%\tex\latex\frenchle
cd %SOURCE%\inputs
copy copyrigh.tex %ROOT%%MYLTEXMF%\tex\french\base
cd %SOURCE%\inputs
copy frabbrev.tex %ROOT%%MYLTEXMF%\tex\french\base
copy french-msg.tex %ROOT%%MYLTEXMF%\tex\french\base
copy french_french-msg.tex %ROOT%%MYLTEXMF%\tex\french\base
copy frhyphex.tex %ROOT%%MYLTEXMF%\tex\french\base
copy fxabbrev.tex %ROOT%%MYLTEXMF%\tex\french\base
copy german_french.msg.tex %ROOT%%MYLTEXMF%\tex\french\base
copy fenglish.sty %ROOT%%MYLTEXMF%\tex\french\base
copy frbabel.sty %ROOT%%MYLTEXMF%\tex\french\base
copy french.sty %ROOT%%MYLTEXMF%\tex\french\base
copy frenchle.sty %ROOT%%MYLTEXMF%\tex\french\base
copy frenchpro.sty %ROOT%%MYLTEXMF%\tex\french\base
copy pmfrench.sty %ROOT%%MYLTEXMF%\tex\french\base
copy french.all %ROOT%%MYLTEXMF%\tex\french\base
copy french.chk %ROOT%%MYLTEXMF%\tex\french\base
copy french.cmd %ROOT%%MYLTEXMF%\tex\french\base
copy enbib.ldf %ROOT%%MYLTEXMF%\tex\french\base
copy frbib.ldf %ROOT%%MYLTEXMF%\tex\french\base
copy french.ldf %ROOT%%MYLTEXMF%\tex\french\base
copy frenchle.ldf %ROOT%%MYLTEXMF%\tex\french\base
copy frenchpro.ldf %ROOT%%MYLTEXMF%\tex\french\base
copy french.dmy %ROOT%%MYLTEXMF%\tex\french\base
cd %SOURCE%\inputs
copy frbabel.sty %ROOT%%MYLTEXMF%\tex\french\base\babel.sty
cd %SOURCE%\inputs
copy french_keyboard-msg.tex %ROOT%%MYLTEXMF%\tex\french\base
copy frenchfc.tex %ROOT%%MYLTEXMF%\tex\french\base
copy kbconfig.tex %ROOT%%MYLTEXMF%\tex\french\base
copy keyboard-msg.tex %ROOT%%MYLTEXMF%\tex\french\base
copy keyboard.tex %ROOT%%MYLTEXMF%\tex\french\base
copy keyboard.sty %ROOT%%MYLTEXMF%\tex\french\base
copy TeX.kbc %ROOT%%MYLTEXMF%\tex\french\base
copy ansinew.kbc %ROOT%%MYLTEXMF%\tex\french\base
copy applemac.kbc %ROOT%%MYLTEXMF%\tex\french\base
copy ascii.kbc %ROOT%%MYLTEXMF%\tex\french\base
copy cp850.kbc %ROOT%%MYLTEXMF%\tex\french\base
copy decmulti.kbc %ROOT%%MYLTEXMF%\tex\french\base
copy latin1.kbc %ROOT%%MYLTEXMF%\tex\french\base
copy latin9.kbc %ROOT%%MYLTEXMF%\tex\french\base
copy next.kbc %ROOT%%MYLTEXMF%\tex\french\base
copy qwerty.kbc %ROOT%%MYLTEXMF%\tex\french\base
copy utf8.kbc %ROOT%%MYLTEXMF%\tex\french\base
copy TeX.kbc %ROOT%%MYLTEXMF%\tex\french\base\french.TeX.kbc
copy qwerty.kbc %ROOT%%MYLTEXMF%\tex\french\base\english.TeX.kbc
copy ansinew.kbc %ROOT%%MYLTEXMF%\tex\french\base\french.ansinew.kbc
copy qwerty.kbc %ROOT%%MYLTEXMF%\tex\french\base\english.ansinew.kbc
copy applemac.kbc %ROOT%%MYLTEXMF%\tex\french\base\french.applemac.kbc
copy qwerty.kbc %ROOT%%MYLTEXMF%\tex\french\base\english.applemac.kbc
copy ascii.kbc %ROOT%%MYLTEXMF%\tex\french\base\french.ascii.kbc
copy qwerty.kbc %ROOT%%MYLTEXMF%\tex\french\base\english.ascii.kbc
copy cp850.kbc %ROOT%%MYLTEXMF%\tex\french\base\french.cp850.kbc
copy qwerty.kbc %ROOT%%MYLTEXMF%\tex\french\base\english.cp850.kbc
copy decmulti.kbc %ROOT%%MYLTEXMF%\tex\french\base\french.decmulti.kbc
copy qwerty.kbc %ROOT%%MYLTEXMF%\tex\french\base\english.decmulti.kbc
copy latin1.kbc %ROOT%%MYLTEXMF%\tex\french\base\french.latin1.kbc
copy qwerty.kbc %ROOT%%MYLTEXMF%\tex\french\base\english.latin1.kbc
copy latin9.kbc %ROOT%%MYLTEXMF%\tex\french\base\french.latin9.kbc
copy qwerty.kbc %ROOT%%MYLTEXMF%\tex\french\base\english.latin9.kbc
copy next.kbc %ROOT%%MYLTEXMF%\tex\french\base\french.next.kbc
copy qwerty.kbc %ROOT%%MYLTEXMF%\tex\french\base\english.next.kbc
copy qwerty.kbc %ROOT%%MYLTEXMF%\tex\french\base\french.qwerty.kbc
copy qwerty.kbc %ROOT%%MYLTEXMF%\tex\french\base\english.qwerty.kbc
copy utf8.kbc %ROOT%%MYLTEXMF%\tex\french\base\french.utf8.kbc
copy qwerty.kbc %ROOT%%MYLTEXMF%\tex\french\base\english.utf8.kbc
cd %SOURCE%\inputs
copy msg.sty %ROOT%%MYLTEXMF%\tex\french\base
copy french_msg-msg.tex %ROOT%%MYLTEXMF%\tex\french\base
copy german_msg-msg.tex %ROOT%%MYLTEXMF%\tex\french\base
copy msg-msg.tex %ROOT%%MYLTEXMF%\tex\french\base
copy norsk_msg-msg.tex %ROOT%%MYLTEXMF%\tex\french\base
cd %SOURCE%\inputs
copy mlp-01.sty %ROOT%%MYLTEXMF%\tex\french\base
copy mlp-31.sty %ROOT%%MYLTEXMF%\tex\french\base
copy mlp-33.sty %ROOT%%MYLTEXMF%\tex\french\base
copy mlp-49.sty %ROOT%%MYLTEXMF%\tex\french\base
copy mlp-49n.sty %ROOT%%MYLTEXMF%\tex\french\base
copy mlp-opts.sty %ROOT%%MYLTEXMF%\tex\french\base
copy mlp.sty %ROOT%%MYLTEXMF%\tex\french\base
copy deutschx.mlp %ROOT%%MYLTEXMF%\tex\french\base
copy francais.mlp %ROOT%%MYLTEXMF%\tex\french\base
copy internat.mlp %ROOT%%MYLTEXMF%\tex\french\base
copy ndeutsch.mlp %ROOT%%MYLTEXMF%\tex\french\base
copy noesterr.mlp %ROOT%%MYLTEXMF%\tex\french\base
copy oesterre.mlp %ROOT%%MYLTEXMF%\tex\french\base
cd %SOURCE%\inputs
copy epreuve.sty %ROOT%%MYLTEXMF%\tex\french\base
cd %SOURCE%
mkdir %ROOT%%MYLTEXMF%\tex\french\base
cd %SOURCE%\inputs
copy fridx1.ist %ROOT%%MYLTEXMF%\tex\french\base
cd %SOURCE%
cd %SOURCE%\inputs
copy keyboard.dat french.keyboard.dat
cd %SOURCE%\inputs
copy keyboard.dat french.keyboard.dat
@echo LICENCE D'UTILISATION VALABLE 1 MOIS, A L'ESSAI.

@echo Fin de la procedure d'installation
@echo Il vous reste un peu de travail manuel...
@echo - verifier dans le repertoire %ROOT%\tex\french\config
@echo   les fichiers language.dat, hyphen.cfg et plaintex.cfg
@echo - verifier que %ROOT%\miktex\config\miktex.ini
@echo   existe et contient les sections :
@echo   [frtex] [frlatex] [frpdflatex] ...
@echo   et commencent par :
@echo   Input Dirs=.;%ROOT%\tex\french//; ...
@echo   (le reste est inchange)
@echo - puis Demarrer/Programmes/MikTeX/MikTeX Options
@echo   1/ Refresh Filename Database
@echo   2/ TeXFormats/frlatex/Build ...
@echo Bonne finition et bon (La)TeX.

:FIN
@pause
