diff options
author | Rich Megginson <rmeggins@redhat.com> | 2012-07-25 20:34:56 -0600 |
---|---|---|
committer | Rich Megginson <rmeggins@redhat.com> | 2012-07-25 20:37:00 -0600 |
commit | 14748057b040ce3c7073de0088a3fe8b75fd6a89 (patch) | |
tree | fe075fd35166de0926c63e96034380eb8d66a3a6 /answerfiles | |
parent | 792e1312636cbcd78be3a12953b0ea009f116364 (diff) | |
download | auto-win-vm-ad-14748057b040ce3c7073de0088a3fe8b75fd6a89.tar.gz auto-win-vm-ad-14748057b040ce3c7073de0088a3fe8b75fd6a89.tar.xz auto-win-vm-ad-14748057b040ce3c7073de0088a3fe8b75fd6a89.zip |
use cdrom instead of floppy
first pass at passsync installer
split out AD installer from postinstall
fixes for nextscript
parameterize SETUP_PATH in all cmd files
Diffstat (limited to 'answerfiles')
-rw-r--r-- | answerfiles/SetupComplete.cmd.in (renamed from answerfiles/SetupComplete.cmd) | 4 | ||||
-rw-r--r-- | answerfiles/nextscript.cmd.in | 33 | ||||
-rw-r--r-- | answerfiles/postinstall.cmd.in | 13 | ||||
-rw-r--r-- | answerfiles/setuppass2.cmd | 7 | ||||
-rw-r--r-- | answerfiles/setupscript1.cmd.in | 3 | ||||
-rw-r--r-- | answerfiles/setupscript2.cmd.in | 4 | ||||
-rw-r--r-- | answerfiles/setupscript3.cmd.in (renamed from answerfiles/setuppass3.cmd) | 5 | ||||
-rw-r--r-- | answerfiles/specialize.cmd.in (renamed from answerfiles/specialize.cmd) | 2 | ||||
-rw-r--r-- | answerfiles/win2k8x8664.xml.in | 8 |
9 files changed, 51 insertions, 28 deletions
diff --git a/answerfiles/SetupComplete.cmd b/answerfiles/SetupComplete.cmd.in index 70cfe12..0c3fc10 100644 --- a/answerfiles/SetupComplete.cmd +++ b/answerfiles/SetupComplete.cmd.in @@ -2,8 +2,8 @@ echo hello from SetupComplete.cmd rem echo Disable LUA rem reg add HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA /t REG_DWORD /d 0 /f rem echo Setup AD as Domain Controller -rem dcpromo.exe /unattend:a:\dcinstall.ini > c:\dcinstall.log 2>&1 +rem dcpromo.exe /unattend:@SETUP_PATH@\dcinstall.ini > c:\dcinstall.log 2>&1 rem echo Install Enterprise Root CA -rem cscript a:\Setupca.vbs /IE +rem cscript @SETUP_PATH@\Setupca.vbs /IE rem echo Enable LUA rem reg add HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA /t REG_DWORD /d 1 /f diff --git a/answerfiles/nextscript.cmd.in b/answerfiles/nextscript.cmd.in new file mode 100644 index 0000000..531e0b4 --- /dev/null +++ b/answerfiles/nextscript.cmd.in @@ -0,0 +1,33 @@ +rem echo in %0 +set next=%1 +set reboot=%~2 +set max=99 +set nextscript= +echo off +for /L %%i in (%next%,1,%max%) do ( + if EXIST @SETUP_PATH@\setupscript%%i.cmd ( + set nextscript=@SETUP_PATH@\setupscript%%i.cmd + set idx=%%i + goto runscript + ) +) +echo on +echo No more scripts + +:runscript +echo on +if DEFINED reboot ( + if DEFINED nextscript ( + rem echo setup runonce for %nextscript% + reg add HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnce /v SetupPass%idx% /t REG_SZ /d "cmd /c %nextscript% > c:\setuppass%idx%.log 2>&1" + ) + echo %reboot% + shutdown -r -f -t 60 -c "Shutting down in 1 minute %reboot%" + rem echo reboot in 1 minute +) else ( + if DEFINED nextscript ( + rem no reboot - just call the next script + echo run %nextscript% + call %nextscript% > c:\setuppass%idx%.log 2>&1 + ) +) diff --git a/answerfiles/postinstall.cmd.in b/answerfiles/postinstall.cmd.in index 5dd05fd..67fb88f 100644 --- a/answerfiles/postinstall.cmd.in +++ b/answerfiles/postinstall.cmd.in @@ -2,15 +2,4 @@ echo these are commands to be run upon first login post installation rem echo activate windows with the product key rem cscript c:\Windows\System32\slmgr.vbs /ipk "@PRODUCT_KEY@" rem cscript c:\Windows\System32\slmgr.vbs /ato -echo Setup AD as Domain Controller -%SystemRoot%\System32\dcpromo.exe /unattend:a:\dcinstall.ini > c:\dcinstall.log 2>&1 -rem echo Disable LUA -rem reg add HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA /t REG_DWORD /d 0 /f -echo Install Standalone Root CA -cscript a:\Setupca.vbs /IS -rem echo Enable LUA -rem reg add HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA /t REG_DWORD /d 1 /f -echo add setuppass2 RunOnce script -reg add HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnce /v SetupPass2 /t REG_SZ /d "cmd /c a:\setuppass2.cmd > c:\setuppass2.log 2>&1" -echo Reboot in 2 minutes because AD install require a reboot to complete -shutdown -r -f -t 120 -c "Shutting down in 2 minutes - Reboot required for AD installation to complete" +@SETUP_PATH@\nextscript.cmd 1 diff --git a/answerfiles/setuppass2.cmd b/answerfiles/setuppass2.cmd deleted file mode 100644 index 42426c6..0000000 --- a/answerfiles/setuppass2.cmd +++ /dev/null @@ -1,7 +0,0 @@ -echo these are commands to be run upon second login post installation -echo Install Standalone Root CA -cscript a:\Setupca.vbs /IS -echo add setuppass3 RunOnce script -reg add HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnce /v SetupPass3 /t REG_SZ /d "cmd /c a:\setuppass3.cmd > c:\setuppass3.log 2>&1" -echo Reboot in 2 minutes because CA install requires a reboot to complete -shutdown -r -f -t 120 -c "Shutting down in 2 minutes - Reboot required for CA installation to complete" diff --git a/answerfiles/setupscript1.cmd.in b/answerfiles/setupscript1.cmd.in new file mode 100644 index 0000000..b2b8e65 --- /dev/null +++ b/answerfiles/setupscript1.cmd.in @@ -0,0 +1,3 @@ +echo Setup AD as Domain Controller +%SystemRoot%\System32\dcpromo.exe /unattend:@SETUP_PATH@\dcinstall.ini > c:\dcinstall.log 2>&1 +@SETUP_PATH@\nextscript.cmd 2 "Reboot to complete Active Directory setup" diff --git a/answerfiles/setupscript2.cmd.in b/answerfiles/setupscript2.cmd.in new file mode 100644 index 0000000..feeed8d --- /dev/null +++ b/answerfiles/setupscript2.cmd.in @@ -0,0 +1,4 @@ +echo do this just after AD has been set up +echo Install Standalone Root CA +cscript @SETUP_PATH@\Setupca.vbs /IS +@SETUP_PATH@\nextscript.cmd 3 "Reboot to complete Cert Services setup" diff --git a/answerfiles/setuppass3.cmd b/answerfiles/setupscript3.cmd.in index d93377e..6eae277 100644 --- a/answerfiles/setuppass3.cmd +++ b/answerfiles/setupscript3.cmd.in @@ -1,6 +1,6 @@ -echo these are commands to be run upon third login post installation +echo these are commands to be run after setting up the CA echo create cert request for AD, sign it, and install it -certreq -v -q -new a:\adcertreq.inf c:\adcertreq.req +certreq -v -q -new @SETUP_PATH@\adcertreq.inf c:\adcertreq.req certreq -v -q -submit -attrib "CertificateTemplate:DomainController" c:\adcertreq.req echo this assumes the request ID is 2 - request 1 was the creation of the CA cert itself echo not sure how it is possible to capture the request ID from the certreq -submit output @@ -10,3 +10,4 @@ certreq -v -q -retrieve %requestid% c:\ad.cer c:\ad.p7b certreq -v -q -accept c:\ad.p7b certutil -store my echo you should now be able to access AD via TLS/SSL +@SETUP_PATH@\nextscript.cmd 4 diff --git a/answerfiles/specialize.cmd b/answerfiles/specialize.cmd.in index c6f252a..6a54bb2 100644 --- a/answerfiles/specialize.cmd +++ b/answerfiles/specialize.cmd.in @@ -3,4 +3,4 @@ echo these are commands run during the specialize phase of windows install echo better to use RunSynchronous in most cases echo create our SetupComplete.cmd md c:\windows\setup\scripts -copy a:\SetupComplete.cmd c:\windows\setup\scripts +copy @SETUP_PATH@\SetupComplete.cmd c:\windows\setup\scripts diff --git a/answerfiles/win2k8x8664.xml.in b/answerfiles/win2k8x8664.xml.in index 54918db..0355f98 100644 --- a/answerfiles/win2k8x8664.xml.in +++ b/answerfiles/win2k8x8664.xml.in @@ -63,7 +63,7 @@ <!-- <Description>Setup AD as Domain Controller</Description> <Order>1</Order> - <Path>%SystemRoot%\System32\dcpromo.exe /unattend:a:\dcinstall.ini</Path> + <Path>%SystemRoot%\System32\dcpromo.exe /unattend:@SETUP_PATH@\dcinstall.ini</Path> --> <!-- <WillReboot>OnRequest</WillReboot> 2012-07-17 14:31:27, Error [setup.exe] SMI data results dump: Source = Name: Microsoft-Windows-Setup, Language: neutral, ProcessorArchitecture: amd64, PublicKeyToken: 31bf3856ad364e35, VersionScope: nonSxS, /settings/RunSynchronous/RunSynchronousCommand/[Order="1"]/WillReboot @@ -97,7 +97,7 @@ <RunSynchronousCommand wcm:action="add"> <Description>Run Specialization commands</Description> <Order>1</Order> - <Path>cmd /c a:\specialize.cmd > c:\specialize.log 2>&1</Path> + <Path>cmd /c @SETUP_PATH@\specialize.cmd > c:\specialize.log 2>&1</Path> </RunSynchronousCommand> </RunSynchronous> </component> @@ -107,7 +107,7 @@ <RunSynchronous> <RunSynchronousCommand wcm:action="add"> <Order>1</Order> - <Path>cmd /c a:\audituser.cmd > c:\audituser.log 2>&1</Path> + <Path>cmd /c @SETUP_PATH@\audituser.cmd > c:\audituser.log 2>&1</Path> </RunSynchronousCommand> </RunSynchronous> </component> @@ -150,7 +150,7 @@ </AutoLogon> <FirstLogonCommands> <SynchronousCommand wcm:action="add"> - <CommandLine>cmd /c a:\postinstall.cmd > c:\postinstall.log 2>&1</CommandLine> + <CommandLine>cmd /c @SETUP_PATH@\postinstall.cmd > c:\postinstall.log 2>&1</CommandLine> <Order>1</Order> <Description>Run Post-Install commands</Description> </SynchronousCommand> |