Jump to content

HowTo: Unattended Installation using FTP


Recommended Posts

well, this is where i need your help or whoevers...as far as I can see, its now done...I did have to make some changes after posting, but to me, it looks complete...but, I dont know about the cleanup...and also, dont really know if it all flows (ie, if it will work, it should in theory...)...as for the cleanup, there might be some strangling url files somewhere...like in system32 dir...but other than that, I think its done...give it a test, I guess...I would test it, but I dont have a web server up yet....Also, another thing, if using runonceex, most people are gonna have $OEM$...so why not dump devcon and unrar in the system32 folder in there...$$\system32?

I'm going to edit yours a bit to include defaults & error checking, but its looking good :) As far as using $OEM$ folders, I used those on my old installations but I'm just booting from winPE & then installing nowadays and I can add whatever I need from there. Currently my winPE install CD obtains it's configuration files & needed EXEs from an ftp server, partitions per config file, formats per config file, and starts a silent installation of winXP pro, & then runs ftp.cmd @ GUIRUNONCE.

Link to comment
Share on other sites


hopefully someone can help me out here...the ftp starts up but once it gets to the tools it craps out and I have to interact

230 User logged in, proceed.
ftp>
ftp> lcd C:\WINDOWS\system32
Local directory now C:\WINDOWS\system32.
ftp>cd unattend
550 /unattend: No such file or directory.
ftp> cd tools
250 Directory change to /tools
ftp> mget *.*
200 Type set to A.
meget UnRAR.exe? ftp>

I'm thinking i could put unrar.exe in the system32 folder in $OEM$\$$\ and then have it start right on the building of the FTP script rather than the getting required files however I just want to know why its not working :)

Any help would be much appreciated.

Link to comment
Share on other sites

I used this method the other day and it worked pretty good. I'm gonna take out the prom command though so it asks me on the packages, that way I don't have to install everything I have on my ftp server onto every machine I have. It isnt' completely unattended then but its kind of like windows post installation wizard in a way.

I also couldn't get logged into the ftp server for the life of me the way the script was. It accepted my username but wouldn't recognise my password at all. I had to add the -n paramater before the -s: and then on the second line of my ftp_scr I put the word user followed by my username and then password all on the same line. That lets my login fine.

I liked before when my reg tweaks got installed to the default user account from cmdlines.txt so I'm thinking of maybe calling this script modified a bit to download just my reg tweaks from cmdlines.txt. I just have to find out if a batch file called from cmdlines.txt can use ftp.cmd and if network connectivity is possible at that point.

I've been thinking of trying out runonceex too and if ftp works from cmdlines.txt I might go ahead and use that method. Or maybe I won't worry about it or the reg tweaks.

Link to comment
Share on other sites

If you don't want to install something, you can change the file extension of the package to .rar_ and it won't download it. If you use multiple cds for different pc types then you could change %PAK_DIR% to reflect different sets of packages.

set PAK_DIR=unattend_chipset1

set PAK_DIR=unattend_chipset2

Link to comment
Share on other sites

I just went ahead and took out all the ftp commands except for the login stuff I do it by hand now. I didn't want to make seperate directories and different cd's and such.

I'm also using an idea from your wget install. On the cd I'm gonna have cmdlines.txt call setup.cmd. Setup.cmd is going to download the ftp script from the ftp server. I'm doing it that way so that if I want to change something in the script I can without burning a whole new cd.

Then from cmdlines.txt I am going to call the ftp script which will pretty much be unchanged except for the cleanup part, thats not gonna happen.

My packages are all going to have commands.txt still but the commands are going to be RunOnceEx commands. Your ftp script will create the installation script like normal but all its going to do when it executes it is add the entries to the registry.(I'm doing it that way so that I can control the program installation order better. As it is now I renamed the folders, like netframework became aanetframework so it would be first and symantec became zzsymantec so it would be last.)

Your ftp script is still going to add the registry entries but since its running from cmdlines.txt the reg entries will apply to all users created.

I haven't finished changing the commands.txt files to RunOnceEx commands yet when ever I finish I'll post my results.

Link to comment
Share on other sites

I haven't finished changing the commands.txt files to RunOnceEx commands yet when ever I finish I'll post my results.

Looking forward to seeing it :) I'm in the process of making the script use FTP or WGET to d/l the packages, I've also set it up to get it's variables from an ini file, I will post when done.

Link to comment
Share on other sites

I finished up yesterday and ran it and it worked flawlessly. Thanks for the main part of this edg21 pretty much all of it is your work I just modified it a bit. I'm going to post the contents of all the files I used if anyone has any questions post and when I see them I'll answer.

cmdlines.txt


[COMMANDS]
"setup.cmd"
"ftpscript.cmd"
"regscript.cmd"
"useraccounts.cmd"

setup.cmd


@ECHO OFF

set FTP_ADDY=1.1.1.1
set FTP_USER=****
set FTP_PASS=****
set PAK_DIR=unattend
set TOP_DIR=%SYSTEMDRIVE%\install
set FTP_SCR=%TOP_DIR%\ftp_scr.txt

md %TOP_DIR%

ECHO Building FTP Script ...
> %FTP_SCR% ECHO open %FTP_ADDY%
>>%FTP_SCR% ECHO user %FTP_USER% %FTP_PASS%
>>%FTP_SCR% ECHO bin
>>%FTP_SCR% ECHO prom
>>%FTP_SCR% ECHO cd %PAK_DIR%
>>%FTP_SCR% ECHO lcd %TOP_DIR%
>>%FTP_SCR% ECHO get ftp.cmd
>>%FTP_SCR% ECHO bye

ECHO.
ECHO Downloading per FTP_CMD.TXT ....
%WINDIR%\system32\ftp.exe -n -s:%FTP_SCR%
del %FTP_SCR%

:END

ftpscript.cmd


call %systemdrive%\install\ftp.cmd

ftp.cmd


@ECHO OFF
ECHO.
ECHO Setting variables ...

set FTP_ADDY=1.1.1.1
set FTP_USER=****
set FTP_PASS=****
set FTP_CANC=undefined
set PAK_DIR=unattend

set TOP_DIR=%SYSTEMDRIVE%\install
set FTP_SCR=%TOP_DIR%\ftp_scr.txt
set FTP_TSCR=%TOP_DIR%\ftp_tscr.txt
set FTP_OUT=%TOP_DIR%\ftp_out.txt
set INSTALL_SCR=%TOP_DIR%\install.cmd
set PACK_SCR=commands.txt
set TOOL_SCR=%TOP_DIR%\tool_scr.txt

set TOOL_DIR=%WINDIR%\system32
set APP_DIR=%TOP_DIR%\apps
set UPD_DIR=%TOP_DIR%\updates
set TWK_DIR=%TOP_DIR%\tweaks
set MOD_DIR=%TOP_DIR%\mods
set DRV_DIR=%TOP_DIR%\drivers

:: SETTING VARIABLES FOR VIDEO DRIVERS
set VID_DRV=undefined
set ATI_DRV=ati.rar
set NVI_DRV=nvidia.rar

:: CREATING DIRECTORIES FOR PACKAGES
ECHO.
ECHO Creating directories ...
md %APP_DIR%
md %UPD_DIR%
md %TWK_DIR%
md %DRV_DIR%
md %MOD_DIR%

ECHO Building FTP Script ...
> %FTP_SCR% ECHO open %FTP_ADDY%
>>%FTP_SCR% ECHO user %FTP_USER% %FTP_PASS%
>>%FTP_SCR% ECHO bin
>>%FTP_SCR% ECHO prom
>>%FTP_SCR% ECHO cd %PAK_DIR%
>>%FTP_SCR% ECHO lcd %APP_DIR%
>>%FTP_SCR% ECHO cd apps
>>%FTP_SCR% ECHO mget *.rar
>>%FTP_SCR% ECHO lcd %UPD_DIR%
>>%FTP_SCR% ECHO cd ../updates
>>%FTP_SCR% ECHO mget *.rar
>>%FTP_SCR% ECHO lcd %TWK_DIR%
>>%FTP_SCR% ECHO cd ../tweaks
>>%FTP_SCR% ECHO mget *.reg
>>%FTP_SCR% ECHO lcd %MOD_DIR%
>>%FTP_SCR% ECHO cd ../mods
>>%FTP_SCR% ECHO mget *.rar
>>%FTP_SCR% ECHO lcd %DRV_DIR%
>>%FTP_SCR% ECHO cd ../drivers
>>%FTP_SCR% ECHO mget *.rar
>>%FTP_SCR% ECHO bye
::END BUILDING FTP SCRIPT

ECHO.
ECHO Downloading per FTP_CMD.TXT ....
%WINDIR%\system32\ftp.exe -n -s:%FTP_SCR%
del %FTP_SCR%

ECHO.
ECHO Extracting Packages ...
for %%i in (%APP_DIR%\*.rar) do UNRAR x %%i %APP_DIR%
for %%i in (%UPD_DIR%\*.rar) do UNRAR x %%i %UPD_DIR%
for %%i in (%DRV_DIR%\*.rar) do UNRAR x %%i %DRV_DIR%
for %%i in (%MOD_DIR%\*.rar) do UNRAR x %%i %MOD_DIR%
for %%i in (%APP_DIR%\*.rar %UPD_DIR%\*.rar %DRV_DIR%\*.rar %MOD_DIR%\*.rar) do DEL %%i

ECHO.
ECHO Building installation script ...
> %INSTALL_SCR% ECHO @Echo Off
>> %INSTALL_SCR% ECHO SET KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx
>> %INSTALL_SCR% ECHO REG ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx /V TITLE /D "Installing Programs" /f
for /d %%i in (%APP_DIR%\*.*) do type "%%i\%PACK_SCR%" >> %INSTALL_SCR%
for /d %%i in (%UPD_DIR%\*.*) do type "%%i\%PACK_SCR%" >> %INSTALL_SCR%
for /d %%i in (%DRV_DIR%\*.*) do type "%%i\%PACK_SCR%" >> %INSTALL_SCR%
for /d %%i in (%MOD_DIR%\*.*) do type "%%i\%PACK_SCR%" >> %INSTALL_SCR%
>> %INSTALL_SCR% ECHO REG ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx\120 /VE /D "Registry Tweaks" /f
>> %INSTALL_SCR% ECHO REG ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx\120 /V 1 /D "REGEDIT /S %systemdrive%\install\tweaks\regtweaks.reg" /f

call %INSTALL_SCR%

:END

ftpscript.cmd


call %systemdrive%\install\ftp.cmd

regscript.cmd


call REGEDIT /S %systemdrive%\install\tweaks\regtweaks.reg

cmdlines.txt first calls setup.cmd which downloads the ftp.cmd. I do that incase I want to change something in ftp.cmd and/or a mistake was made in ftp.cmd it lets me not have to burn a new cd.

cmdlines.txt then calls the ftp script when then calls ftp.cmd which downloads all the packages, and reg files, extracts them and builds my runonceex commands script. Pretty much what edg21 had.

Then cmdlines.txt runs the regscript which just does the reg tweaks. I kind of messed up at this part. I thought about it when I was at work but when I got home to work on it I forgot that edg21's ftp.cmd already ran the regtweaks so I wrote in here to run the regtweaks. The first time I ran it the regtweaks got applied twice. I now have the applying registry files ommitted from the ftp.cmd. If I ever need to reburn the cd for any reason I'll probably take out the regscript part of cmdlines.txt and put it back in the ftp.cmd.

It worked pretty nicely though. It lets me apply regtweaks to the default user so that all created users get the tweaks and it lets me install applications in the order that I want since RunOnceEx is numbered. Heres a sample of a commands.txt from my .net folder

REG ADD %KEY%\001 /VE /D ".NET Framework v1.1" /f
REG ADD %KEY%\001 /V 1 /D "%SYSTEMDRIVE%\install\apps\NetFramework\netfx.msi /qb" /f
REG ADD %KEY%\001 /V 2 /D "%SYSTEMDRIVE%\install\apps\NetFramework\NDP1.1sp1-KB867460-X86.exe /Q" /f
REG ADD %KEY%\001 /V 3 /D "net user aspnet /delete" /f

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...