[ Index ] |
PHP Cross Reference of Unnamed Project |
[Summary view] [Print] [Text view]
1 echo off 2 REM batch file for apps-only-installs 3 REM contributed by Gerhard Hofmann, gerhard.hofmann@planat.de 4 REM Release 2008.07.29 5 REM History 6 REM ======= 7 REM 01-Feb-2005 8 REM first release 9 REM 02-Feb-2005 10 REM now Z_USER and Z_PATH are set as environment variables 11 REM 03-Feb-2005 12 REM fixed invocation of perl.bat 13 REM if activating autologin, given user will be created 14 REM 17-Mar-2005 15 REM moved all files from \\server\install to \\server\install\bin 16 REM moved download location for the script to the Unattended WIKI http://www.ubertechnique.com/unattended/Scripts 17 REM find out a free drive letter instead of hard coded z: 18 REM use %USERNAME% as autologin user 19 REM 21-Apr-2005 20 REM in some cases c:\netinst and c:\netinst\logs directories were not created -> fixed 21 REM %USERDOMAIN% is now passed as an argument when invoking autolog.pl 22 REM 04-May-2005 23 REM multi-choice-dialog will now explicitely call choice.exe file in \\server\install\bin, 24 REM it turned out that Windows 2003 Server has its own choice.exe that has different parameters 25 REM 12-May-2005 26 REM handle existing c:\netinst\todo.txt 27 REM 18-May-2005 28 REM hide the autologin password while it is being typed 29 REM 23-May-2005 30 REM better handling of install dir mapping 31 REM 31-May-2005 32 REM fixed Z_PATH setting 33 REM 16-Sep-2005 34 REM show a list of already used drive letters 35 REM 20-Mar-2006 36 REM use %SystemDrive% instead of hard-coded c: 37 REM skipped usage of /persistent:no flag because of problems with Vista Preview Releases 38 REM 27-Mar-2006 39 REM added conf. section 40 REM optional deletion of existing drive mappings (will "free" drive z:) 41 REM 42 REM 02-Jul-2008 43 REM *** integration of appsonly script into official CVS repository *** 44 REM 03-Jul-2008 45 REM autologin now always turned off after application installation 46 REM 11-Jul-2008 47 REM added possibility to directly pass autologin password and up to 8 .bat 48 REM file names (suppresses any dialogs) 49 REM 29-Jul-2008 50 REM fix: autologin now correcty set when providing autologin password by command line argument 51 52 REM ==== conf. section begin ==== 53 REM delete existing mappings? (no/yes) 54 set deleteexistingmappings=yes 55 REM ==== conf. section end ====== 56 57 58 REM Download and usage 59 REM ================== 60 REM up-to-date version always here: http://unattended.cvs.sourceforge.net/unattended/unattended/install/bin/ 61 REM place appsonly.bat, appsonly.pl, choice.exe, setenv.exe, pathman.exe into \\server\install\bin 62 REM invoke the script with -> Start -> Run -> \\server\install\bin\appsonly.bat 63 REM - OR - 64 REM double click appsonly.bat to run from an already mapped network drive 65 REM 66 REM avoiding dialogs: 67 REM \\server\install\bin\appsonly.bat autologinpassword scriptfile1.bat scriptfile2.bat... 68 69 70 REM delete existing mappings if configured 71 if %deleteexistingmappings%==yes net use * /delete /y 72 73 74 REM make sure that directories %SystemDrive%\netinst and %SystemDrive%\netinst\logs exist 75 if not exist %SystemDrive%\netinst md %SystemDrive%\netinst 76 if not exist %SystemDrive%\netinst\logs md %SystemDrive%\netinst\logs 77 78 REM preferrably, we will use drive z: for install dir mapping 79 set z=z: 80 81 REM I assume that this batch file is called as UNC path 82 REM \\server\install\bin\appsonly.bat 83 REM \\server\install will be mapped to z: or other free drive 84 set scriptdir=%~dp0 85 set scriptdir=%scriptdir%* 86 set scriptdir=%scriptdir:\*=% 87 set scriptdir=%scriptdir:\bin=% 88 89 REM if script was called as "z:\bin\appsonly.bat" we can just keep the mapping 90 if exist %z%\bin\appsonly.bat goto mappingdone 91 92 REM if %z%\bin\appsonly.bat does not exist we have to run net use command to map install dir 93 net use %z% %scriptdir% 94 if errorlevel 1 goto userinput 95 if errorlevel 0 goto mappingdone 96 REM too bad, mapping failed, will have to ask user for free drive letter and UNC path 97 :userinput 98 echo showing list of already used drive letters... 99 net use 100 set /p z="Please enter a free driver letter for install dir mapping (with trailing colon): " 101 set /P scriptdir="Please enter UNC path of your install share, for example \\server\install: " 102 REM try it again with user-provided data 103 net use %z% %scriptdir% 104 REM still no success? -> abort everything 105 if errorlevel 1 goto end 106 107 :mappingdone 108 109 REM set Z, Z_USER, Z_PATH variables permanently for PCs 110 REM where OS was *not* installed with unattended 111 REM set some variables *only for the current* to directly pass 112 REM parameters (autologin password, .bat file names) to appsonly.pl 113 set path=%path%;%scriptdir%\bin 114 setenv -m Z_USER %username% 115 setenv -m Z_PATH %scriptdir% 116 set Z_PATH=%scriptdir% 117 setenv -m Z %Z% 118 REM pass command line arguments (if given) to appsonly.pl 119 REM for installs without any dialogs 120 set autologinpwd=%1 121 set script1=%2 122 set script2=%3 123 set script3=%4 124 set script4=%5 125 set script5=%6 126 set script6=%7 127 set script7=%8 128 set script8=%9 129 130 131 REM check for existing todo.txt 132 if not exist %SystemDrive%\netinst\todo.txt goto proceed 133 echo Have found an existing todo.txt, probably from a previous, defective run, 134 echo press a key to view the file 135 pause 136 more %SystemDrive%\netinst\todo.txt 137 %z%\bin\choice.exe /C:dk (d)elete or (k)eep the file? If unsure, choose (d)elete: 138 if errorlevel 2 goto proceed 139 if errorlevel 1 del %SystemDrive%\netinst\todo.txt 140 :proceed 141 142 if exist %SystemDrive%\perl\bin\perl.exe goto runperlscript 143 call %z%\scripts\perl.bat 144 145 :runperlscript 146 %z%\bin\appsonly.pl 147 148 :end
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Tue Mar 17 22:47:18 2015 | Cross-referenced by PHPXref 0.7.1 |