Advertisement
bunam

pdfcreator

Jan 10th, 2018
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 2.20 KB | None | 0 0
  1. @echo off
  2.  
  3. REM Encodage: Europe occidentale / OEM 863 : francais -> finalement abandon des accents
  4. REM Objet : Installatiqon de PDFCreator en un seul batch
  5. REM licence : BSD (Borlet Software Distribution and is like real BSD)
  6. REM (c) Emmanuel Borlet 2016
  7. REM
  8. REM Pour generer le fichier pdfcreator.inf executer, et faire l'install... :
  9. REM PDFCreator-2_3_2-Setup.exe /SAVEINF="pdfcreator.inf"
  10. REM s'assurer qu'il y ai dans le fichier
  11. REM Toolbar=0
  12. REM Offer=0
  13.  
  14. REM TODO verifier la version en cours par rapport a celle disponible
  15.  
  16. REM on telechargera dans le dossier courant du script
  17.  
  18. REM test si droit admin
  19. net session >nul 2>&1
  20. if %errorLevel% == 0 (
  21. goto :start
  22. ) else (
  23. echo Il faut etre membre du groupe admin.
  24. echo Aucune installation n'a ete faite.
  25. pause
  26. goto :EOF
  27. )
  28.  
  29. :start
  30. set curdir=%CD%
  31. cd %curdir%
  32.  
  33. REM url ou on peut telecharger la derniere version
  34. set urldownload=http://download.pdfforge.org/download/pdfcreator/PDFCreator-stable?download
  35.  
  36. echo Telechargement automatique de PDFCreator ?
  37. echo depuis : %urldownload%
  38. pause
  39. echo Telechargement en cours patienter...
  40. REM l'astuce pour passer la variable...
  41. powershell -Command "Set-Variable -name url -value %urldownload% ; (New-Object Net.WebClient).DownloadFile($url, 'PDFCreator-last-Setup.exe')"
  42. if %ERRORLEVEL% == 0 goto :install
  43. echo Erreur lors du telechargement, code d'erreur : %errorlevel%
  44. pause
  45. EXIT /B %ERRORLEVEL%
  46.  
  47. :install
  48. echo Installation automatique de PDFCreator ?
  49. echo Depuis : %curdir%\PDFCreator-last-Setup.exe
  50. pause
  51. REM heredoc a 2 bales
  52. echo [Setup]^
  53.  
  54. Lang=French^
  55.  
  56. Dir=C:\Program Files\PDFCreator^
  57.  
  58. Group=PDFCreator^
  59.  
  60. NoIcons=0^
  61.  
  62. SetupType=custom^
  63.  
  64. Components=program^
  65.  
  66. Tasks=desktopicon,desktopicon\common,winexplorer^
  67.  
  68. Printername=PDFCreator^
  69.  
  70. Toolbar=0^
  71.  
  72. Offer=0^
  73.  
  74. > pdfcreator.heredoc.inf
  75.  
  76. start /wait %curdir%\PDFCreator-last-Setup.exe /LOADINF="pdfcreator.heredoc.inf" /SILENT /norestart
  77. if %ERRORLEVEL% == 0 goto :fin
  78. REM code d'erreur -100 a l'installation signifie OK apres une installation par desssu
  79. if %ERRORLEVEL% == -100 goto :fin
  80. echo Erreur lors de l'installation, code d'erreur : %errorlevel%
  81. pause
  82. EXIT /B %ERRORLEVEL%
  83.  
  84. :fin
  85. echo C'est termine, tout est OK
  86. pause
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement