Jump to content

Windows 7 post-installation


Recommended Posts

Still learning unattended W7 setup... So far I have created "autounattend.xml" which runs ok on my VM. Now, in order to move to the next step I need your recommendations on installation of Windows updates (hotfixes), drivers and my favourite applications AFTER basic W7 setup is complete. Btw, I don't intend to use any R7Lite-kind of apps to manipulate install.wim, etc. - only Windows AIK tools for now...

So, I guess one of the options to achieve this is through a so-called "setupcomplete.cmd" looking just as below (code snippet taken from another thread):


@echo off

setlocal enableextensions disabledelayedexpansion

(set CDROM=)

for %%i in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do (if exist %%i:\sources\install.wim set "CDROM=%%i:")

if not defined CDROM goto :eof
start /wait %CDROM%\Updates\IE9-Windows7-x64-enu.exe /passive /norestart /update-no
start /wait wusa.exe %CDROM%\Updates\AMD64-all-ie9-windows6.1-kb2530548-x64.msu /quiet /norestart /nobackup
start /wait wusa.exe %CDROM%\Updates\AMD64-all-ie9-windows6.1-kb2559049-x64.msu /quiet /nobackup /norestart
start /wait wusa.exe %CDROM%\Updates\AMD64-all-windows6.1-kb2533552.msu /quiet /norestart /nobackup
start /wait %CDROM%\Updates\AMD64_X86-all-silverlight.exe /q

del %0

Now the questions are:

(1) Shall I prefer "setupcomplete.cmd" to insertion of files through "WSIM // Packages" option into "Autounattend.xml"?

(2) How to successfully install drivers in unattended W7 setup environment? Any methods or guides available?!?

(3) I got more than 200 hotfixes (.MSU) for W7 SP1 (from SoLoR's update pack) stored on my USB drive. Considering the number of files, HOW do I know (i) which switch (/quiet, /norestart, etc.) must be used in "setupcomplete.cmd" with a particular KBxxxxxx.exe and (ii) whether I need to restart Windows after a specific hotfix is installed?

Thank you very much in advance!!!

Edited by Tripredacus
removed link
Link to comment
Share on other sites


I would slipstream the updates using the waik. There are a few that can not be though. Those are the .net 4.0 stuff and the like 1 or 2 regular updates. .Net 3.0 stuff can be slipstreamed just fine. I would not slipstream IE9 though, it has an odd bug that will always open the welcome wizard every single IE run. Although you can use registry fixes to stop it I would rather not as I do not know if that will end up breaking something in the future. As for as doing the setup complete for each update thats going to take a year and a day to run unless you specify system restore is turned off during the unattended install. With system restore on it wants to create a restore point for every single update which is a waste of time and disk space. So in short slipstream what you can and what you cant just put in setupcomplete. I am more interested in getting the firstlogoncommands thing to work. So far I havent found a sure fire method that makes this work on a 64-bit setup.

Link to comment
Share on other sites

Thank you guys for your prompt replies!!!

@Tripredacus: Technet articles instruct to include "unattend.xml" containing setup instructions for a package or a driver into the WIM image. But is it possible NOT to include XML into the image and simply put "autounattend.xml" into the root of setup DVD? This would be very useful since (i) mounting/unmounting INSTALL.WIM takes too long; and (ii) I would be able to regularly update my update package and drivers offline untouching "install.wim".

Also, Technet recommends to apply updates at offlineServicing pass but I think "setupcomplete.cmd" activates at oobeSystem. Right?

And one more question: what do you mean by this:

Hotfixes are not redistributable.

@gotenks98: Can you advise how to turn off system restore in "Autounattend.xml"? Or, turn it off using a registry tweak just before running "setupcomplete.cmd"?

Thank you!

Link to comment
Share on other sites

Thank you guys for your prompt replies!!!

@Tripredacus: Technet articles instruct to include "unattend.xml" containing setup instructions for a package or a driver into the WIM image. But is it possible NOT to include XML into the image and simply put "autounattend.xml" into the root of setup DVD? This would be very useful since (i) mounting/unmounting INSTALL.WIM takes too long; and (ii) I would be able to regularly update my update package and drivers offline untouching "install.wim".

Also, Technet recommends to apply updates at offlineServicing pass but I think "setupcomplete.cmd" activates at oobeSystem. Right?

And one more question: what do you mean by this:

Hotfixes are not redistributable.

@gotenks98: Can you advise how to turn off system restore in "Autounattend.xml"? Or, turn it off using a registry tweak just before running "setupcomplete.cmd"?

Thank you!

amd64_Microsoft-Windows-SystemRestore-Main on the Waik

Link to comment
Share on other sites

Thank you guys for your prompt replies!!!

@Tripredacus: Technet articles instruct to include "unattend.xml" containing setup instructions for a package or a driver into the WIM image. But is it possible NOT to include XML into the image and simply put "autounattend.xml" into the root of setup DVD? This would be very useful since (i) mounting/unmounting INSTALL.WIM takes too long; and (ii) I would be able to regularly update my update package and drivers offline untouching "install.wim".

Also, Technet recommends to apply updates at offlineServicing pass but I think "setupcomplete.cmd" activates at oobeSystem. Right?

And one more question: what do you mean by this:

Hotfixes are not redistributable.

Well there are multiple ways to do it. By injecting the updates into the WIM, it will shorten your deployment time.

Regarding hotfixes, noticed I removed the link in your post. See the forum rules:

1.b Respect the requests of companies who do not permit redistribution of their products without express permission - including unmodified hotfix/feature pack packages. Download sources for official software should be from the vendor directly where possible.
Link to comment
Share on other sites

  • 2 weeks later...

I saw gotenks98 made a reference to a first run command. Here is a little tutorial I wrote that I have never had an issue with:

Sometimes it is necessary to use a FirstRun.cmd instead of the SETUPCOMPLETE.cmd when integrating your silent apps in a custom build. The reason for this is some applications need the user to be logged in to install correctly. Here is a short tutorial to show you how to create a FirstRun.cmd.

First, you must get the apps you want to install. (make sure they are silent if you want it to be an unattended installation).

Second, if you want to include registry tweaks in the install, you need to make a .reg file containing the tweaks you want.

Now, with Notepad++ we are going to make the first batch file. It should look something like this:

@echo off

ren "%programdata%\Microsoft\Windows\Start Menu\Programs\StartUp\Start.bat" "temp.TMP"

DEL /F /Q "%programdata%\Microsoft\Windows\Start Menu\Programs\StartUp\temp.TMP"
DEL /F /Q "%windir%\Setup\scripts\AppName1.EXE"
DEL /F /Q "%windir%\Setup\scripts\AppName2.EXE"
DEL /F /Q "%windir%\Setup\scripts\AppName3.EXE"

Shutdown /r /f

*AppName* is the FULL name of the apps install .exe you want.

Save this file as Install.bat

With your Windows image mounted, you will save this .bat file, all of your silent apps and your reg tweak file in:

Windows/Setup/Scripts (you will have to create the Scripts folder in the Setup folder.

Next, we will create the Start.bat

Open Notepad++ again.

This file should look like this:

@echo off
TITLE scott45333's Post Install Configurator
echo.
echo Please wait while the post install configures your system...
echo ... the configuration process may take up to 10 minutes and will reboot automatically when finished.
echo.

cmd /c REGEDIT /S %windir%\Setup\scripts\Tweaks.reg

START /WAIT %windir%\Setup\scripts\AppName1.EXE
START /WAIT %windir%\Setup\scripts\AppName2.EXE
START /WAIT %windir%\Setup\scripts\AppName3.EXE
START /WAIT %windir%\Setup\scripts\install.bat
END

Save this file as Start.bat

With Windows still mounted, this file will be saved in:

ProgramData/Microsoft/Windows/StartMenu/Programs/StartUp

Now, when Windows is install and the user logs on for the first time, all tweaks and apps will be installed silently and the temporary files deleted after the computer restarts.

Link to comment
Share on other sites

  • 1 year later...

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...