@set MYTEXMF=\texmf
@set MYVTEXMF=\texmf-var
@set MYLTEXMF=\texmf-local
@set MYLBIN=\bin
@if "%1%"=="DOS" goto DOS
@echo L'installation de FrenchPro " a la unix "  peut etre
@echo realisee directement en ligne (qq minutes sur internet pour le
@echo transfert des executables, puis qq dizaines de minutes ensuite).
@echo Ok pour continuer ? (sinon Ctrl-C et "install DOS" ou "mikinstall")
@pause
@call bin\setupunx.bat
@exit

:DOS
@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
@cd ..
@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 Cette procedure automatique d'installation ne fonctionnera pas
@echo si les commandes (et formats) frtex et frlatex n'existent pas ;
@echo voir a ce sujet engines\tetex.pdf.
@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 (texmf-local sauf 
@echo pour les formats qui iront dans texmf-var) qui
@echo 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
mkdir %SOURCE%\miktex\config
mkdir %ROOT%%MYLTEXMF%\miktex\config
copy %SOURCE%\miktex\config\formatsfp.ini %ROOT%%MYLTEXMF%\miktex\config
mkdir %ROOT%%MYLTEXMF%\miktex\config
copy %SOURCE%\miktex\config\formatsfp.ini %ROOT%%MYLTEXMF%\miktex\config
mkdir %ROOT%%MYLTEXMF%\miktex\config
copy %SOURCE%\miktex\config\frtex.ini %ROOT%%MYLTEXMF%\miktex\config
mkdir %ROOT%%MYLTEXMF%\miktex\config
copy %SOURCE%\miktex\config\frlatex.ini %ROOT%%MYLTEXMF%\miktex\config
cd %SOURCE%\inputs
latex -no-mktex=FMT frlicense.dat
del frlicense.log
cd %SOURCE%
mkdir %SOURCE%\bin
mkdir %SOURCE%\bin
mkdir %ROOT%%MYLTEXMF%%MYLBIN%
mkdir %ROOT%%MYLTEXMF%\mltex
mkdir %ROOT%%MYLTEXMF%\mltex\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
copy hypht1.tex %ROOT%%MYTEXMF%\tex\generic\hyphen
mkdir %ROOT%%MYLTEXMF%\mltex\french\base
copy ecplain.tex %ROOT%%MYLTEXMF%\mltex\french\base
copy frpdftexconfig.tex %ROOT%%MYLTEXMF%\mltex\french\base
copy hyconfig.tex %ROOT%%MYLTEXMF%\mltex\french\base
cd %SOURCE%\inputs
mkdir %ROOT%%MYLTEXMF%\mltex\french\config
cd %SOURCE%\inputs
copy frlicense.dat %ROOT%%MYLTEXMF%\mltex\french\config
copy language.dat %ROOT%%MYLTEXMF%\mltex\french\config
cd %SOURCE%\inputs
copy english.keyboard.dat %ROOT%%MYLTEXMF%\mltex\french\config
copy french.keyboard.dat %ROOT%%MYLTEXMF%\mltex\french\config
copy keyboard.dat %ROOT%%MYLTEXMF%\mltex\french\config
cd %SOURCE%\initex
copy iniproto %ROOT%%MYLTEXMF%\mltex\french\config\frelatex.fpi
copy iniproto %ROOT%%MYLTEXMF%\mltex\french\config\fretex.fpi
copy iniproto %ROOT%%MYLTEXMF%\mltex\french\config\frlatex.fpi
copy iniproto %ROOT%%MYLTEXMF%\mltex\french\config\frpdflatex.fpi
copy iniproto %ROOT%%MYLTEXMF%\mltex\french\config\frpdftex.fpi
copy iniproto %ROOT%%MYLTEXMF%\mltex\french\config\frtex.fpi
copy iniproto %ROOT%%MYLTEXMF%\mltex\french\config\frtexcm.fpi
copy iniproto %ROOT%%MYLTEXMF%\mltex\french\config\frtexec.fpi
copy iniproto %ROOT%%MYLTEXMF%\mltex\french\config\frxelatex.fpi
copy iniproto %ROOT%%MYLTEXMF%\mltex\french\config\frxetex.fpi
copy iniproto %ROOT%%MYLTEXMF%\mltex\french\config\mltex.fpi
copy hyphen.cfg %ROOT%%MYLTEXMF%\mltex\french\config
copy plaintex.cfg %ROOT%%MYLTEXMF%\mltex\french\config
copy frelatex.fr %ROOT%%MYLTEXMF%\mltex\french\config
copy fretex.fr %ROOT%%MYLTEXMF%\mltex\french\config
copy frlatex.fr %ROOT%%MYLTEXMF%\mltex\french\config
copy frpdflatex.fr %ROOT%%MYLTEXMF%\mltex\french\config
copy frpdftex.fr %ROOT%%MYLTEXMF%\mltex\french\config
copy frtex.fr %ROOT%%MYLTEXMF%\mltex\french\config
copy frtexcm.fr %ROOT%%MYLTEXMF%\mltex\french\config
copy frtexec.fr %ROOT%%MYLTEXMF%\mltex\french\config
copy frxelatex.fr %ROOT%%MYLTEXMF%\mltex\french\config
copy frxetex.fr %ROOT%%MYLTEXMF%\mltex\french\config
copy mltex.fr %ROOT%%MYLTEXMF%\mltex\french\config
mkdir %ROOT%%MYLTEXMF%\mltex\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%\mltex\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%\mltex\french\base
cd %SOURCE%\inputs
copy frabbrev.tex %ROOT%%MYLTEXMF%\mltex\french\base
copy french-msg.tex %ROOT%%MYLTEXMF%\mltex\french\base
copy french_french-msg.tex %ROOT%%MYLTEXMF%\mltex\french\base
copy frhyphex.tex %ROOT%%MYLTEXMF%\mltex\french\base
copy fxabbrev.tex %ROOT%%MYLTEXMF%\mltex\french\base
copy german_french-msg.tex %ROOT%%MYLTEXMF%\mltex\french\base
copy fenglish.sty %ROOT%%MYLTEXMF%\mltex\french\base
copy frbabel.sty %ROOT%%MYLTEXMF%\mltex\french\base
copy french.sty %ROOT%%MYLTEXMF%\mltex\french\base
copy frenchle.sty %ROOT%%MYLTEXMF%\mltex\french\base
copy frenchpro.sty %ROOT%%MYLTEXMF%\mltex\french\base
copy pmfrench.sty %ROOT%%MYLTEXMF%\mltex\french\base
copy french.all %ROOT%%MYLTEXMF%\mltex\french\base
copy french.chk %ROOT%%MYLTEXMF%\mltex\french\base
copy french.cmd %ROOT%%MYLTEXMF%\mltex\french\base
copy enbib.ldf %ROOT%%MYLTEXMF%\mltex\french\base
copy frbib.ldf %ROOT%%MYLTEXMF%\mltex\french\base
copy french.ldf %ROOT%%MYLTEXMF%\mltex\french\base
copy frenchle.ldf %ROOT%%MYLTEXMF%\mltex\french\base
copy frenchpro.ldf %ROOT%%MYLTEXMF%\mltex\french\base
copy french.dmy %ROOT%%MYLTEXMF%\mltex\french\base
cd %SOURCE%\inputs
copy frbabel.sty %ROOT%%MYLTEXMF%\mltex\french\base\babel.sty
cd %SOURCE%\inputs
copy french_keyboard-msg.tex %ROOT%%MYLTEXMF%\mltex\french\base
copy frenchfc.tex %ROOT%%MYLTEXMF%\mltex\french\base
copy german_keyboard-msg.tex %ROOT%%MYLTEXMF%\mltex\french\base
copy kbconfig.tex %ROOT%%MYLTEXMF%\mltex\french\base
copy keyboard-msg.tex %ROOT%%MYLTEXMF%\mltex\french\base
copy keyboard.tex %ROOT%%MYLTEXMF%\mltex\french\base
copy keyboard.sty %ROOT%%MYLTEXMF%\mltex\french\base
copy TeX.kbc %ROOT%%MYLTEXMF%\mltex\french\base
copy ansinew.kbc %ROOT%%MYLTEXMF%\mltex\french\base
copy applemac.kbc %ROOT%%MYLTEXMF%\mltex\french\base
copy ascii.kbc %ROOT%%MYLTEXMF%\mltex\french\base
copy cp850.kbc %ROOT%%MYLTEXMF%\mltex\french\base
copy decmulti.kbc %ROOT%%MYLTEXMF%\mltex\french\base
copy latin1.kbc %ROOT%%MYLTEXMF%\mltex\french\base
copy latin9.kbc %ROOT%%MYLTEXMF%\mltex\french\base
copy next.kbc %ROOT%%MYLTEXMF%\mltex\french\base
copy qwerty.kbc %ROOT%%MYLTEXMF%\mltex\french\base
copy utf8.kbc %ROOT%%MYLTEXMF%\mltex\french\base
copy TeX.kbc %ROOT%%MYLTEXMF%\mltex\french\base\french.TeX.kbc
copy qwerty.kbc %ROOT%%MYLTEXMF%\mltex\french\base\english.TeX.kbc
copy ansinew.kbc %ROOT%%MYLTEXMF%\mltex\french\base\french.ansinew.kbc
copy qwerty.kbc %ROOT%%MYLTEXMF%\mltex\french\base\english.ansinew.kbc
copy applemac.kbc %ROOT%%MYLTEXMF%\mltex\french\base\french.applemac.kbc
copy qwerty.kbc %ROOT%%MYLTEXMF%\mltex\french\base\english.applemac.kbc
copy ascii.kbc %ROOT%%MYLTEXMF%\mltex\french\base\french.ascii.kbc
copy qwerty.kbc %ROOT%%MYLTEXMF%\mltex\french\base\english.ascii.kbc
copy cp850.kbc %ROOT%%MYLTEXMF%\mltex\french\base\french.cp850.kbc
copy qwerty.kbc %ROOT%%MYLTEXMF%\mltex\french\base\english.cp850.kbc
copy decmulti.kbc %ROOT%%MYLTEXMF%\mltex\french\base\french.decmulti.kbc
copy qwerty.kbc %ROOT%%MYLTEXMF%\mltex\french\base\english.decmulti.kbc
copy latin1.kbc %ROOT%%MYLTEXMF%\mltex\french\base\french.latin1.kbc
copy qwerty.kbc %ROOT%%MYLTEXMF%\mltex\french\base\english.latin1.kbc
copy latin9.kbc %ROOT%%MYLTEXMF%\mltex\french\base\french.latin9.kbc
copy qwerty.kbc %ROOT%%MYLTEXMF%\mltex\french\base\english.latin9.kbc
copy next.kbc %ROOT%%MYLTEXMF%\mltex\french\base\french.next.kbc
copy qwerty.kbc %ROOT%%MYLTEXMF%\mltex\french\base\english.next.kbc
copy qwerty.kbc %ROOT%%MYLTEXMF%\mltex\french\base\french.qwerty.kbc
copy qwerty.kbc %ROOT%%MYLTEXMF%\mltex\french\base\english.qwerty.kbc
copy utf8.kbc %ROOT%%MYLTEXMF%\mltex\french\base\french.utf8.kbc
copy qwerty.kbc %ROOT%%MYLTEXMF%\mltex\french\base\english.utf8.kbc
cd %SOURCE%\inputs
copy msg.sty %ROOT%%MYLTEXMF%\mltex\french\base
copy french_msg-msg.tex %ROOT%%MYLTEXMF%\mltex\french\base
copy german_msg-msg.tex %ROOT%%MYLTEXMF%\mltex\french\base
copy msg-msg.tex %ROOT%%MYLTEXMF%\mltex\french\base
copy norsk_msg-msg.tex %ROOT%%MYLTEXMF%\mltex\french\base
cd %SOURCE%\inputs
copy mlp-01.sty %ROOT%%MYLTEXMF%\mltex\french\base
copy mlp-31.sty %ROOT%%MYLTEXMF%\mltex\french\base
copy mlp-33.sty %ROOT%%MYLTEXMF%\mltex\french\base
copy mlp-49.sty %ROOT%%MYLTEXMF%\mltex\french\base
copy mlp-49n.sty %ROOT%%MYLTEXMF%\mltex\french\base
copy mlp-opts.sty %ROOT%%MYLTEXMF%\mltex\french\base
copy mlp.sty %ROOT%%MYLTEXMF%\mltex\french\base
copy deutschx.mlp %ROOT%%MYLTEXMF%\mltex\french\base
copy francais.mlp %ROOT%%MYLTEXMF%\mltex\french\base
copy internat.mlp %ROOT%%MYLTEXMF%\mltex\french\base
copy ndeutsch.mlp %ROOT%%MYLTEXMF%\mltex\french\base
copy noesterr.mlp %ROOT%%MYLTEXMF%\mltex\french\base
copy oesterre.mlp %ROOT%%MYLTEXMF%\mltex\french\base
cd %SOURCE%\inputs
copy epreuve.sty %ROOT%%MYLTEXMF%\mltex\french\base
cd %SOURCE%
mkdir %ROOT%%MYLTEXMF%\mltex\french\base
cd %SOURCE%\inputs
copy fridx1.ist %ROOT%%MYLTEXMF%\mltex\french\base
cd %SOURCE%
cd %SOURCE%\inputs
copy keyboard.dat french.keyboard.dat
mkdir %SOURCE%\miktex\config
mkdir %ROOT%%MYLTEXMF%\miktex\config
copy %SOURCE%\miktex\config\formatsfp.ini %ROOT%%MYLTEXMF%\miktex\config
mkdir %ROOT%%MYLTEXMF%\miktex\config
copy %SOURCE%\miktex\config\formatsfp.ini %ROOT%%MYLTEXMF%\miktex\config
mkdir %ROOT%%MYLTEXMF%\miktex\config
copy %SOURCE%\miktex\config\frpdftex.ini %ROOT%%MYLTEXMF%\miktex\config
mkdir %ROOT%%MYLTEXMF%\miktex\config
copy %SOURCE%\miktex\config\frpdflatex.ini %ROOT%%MYLTEXMF%\miktex\config
cd %SOURCE%\inputs
copy keyboard.dat french.keyboard.dat
mkdir %SOURCE%\miktex\config
mkdir %ROOT%%MYLTEXMF%\miktex\config
copy %SOURCE%\miktex\config\formatsfp.ini %ROOT%%MYLTEXMF%\miktex\config
mkdir %ROOT%%MYLTEXMF%\miktex\config
copy %SOURCE%\miktex\config\formatsfp.ini %ROOT%%MYLTEXMF%\miktex\config
mkdir %ROOT%%MYLTEXMF%\miktex\config
copy %SOURCE%\miktex\config\fretex.ini %ROOT%%MYLTEXMF%\miktex\config
mkdir %ROOT%%MYLTEXMF%\miktex\config
copy %SOURCE%\miktex\config\frelatex.ini %ROOT%%MYLTEXMF%\miktex\config
@echo LICENCE D'UTILISATION VALABLE 1 MOIS, A L'ESSAI.


@echo Fin de la procedure d'installation

:FIN
@pause 
