cantab

How do I install software from DVD?

12 posts in this topic

How can I automatically install software directly from a customized Windows 7 DVD? I know that I can run installers either from an unattend xml file or using a batch script, but all examples I've seen have involved first copying the installers to the hard drive, which I want to avoid due to disk space constraints on some target PCs.

0

Share this post


Link to post
Share on other sites

Here you can see an example where the DVD drive is located, then next will run something from the disc.

0

Share this post


Link to post
Share on other sites

Create the following folder structure once you have finalized your Windows setup by integrating driver, updates and whatever else you want to integrate into the WIM file :-
<disc_root>\sources\$OEM$\$$\SETUP\SCRIPTS\SETUPCOMPLETE.CMD
<disc_root>\Apps
Here, disc_root is your working directory/folder.

Now whatever applications you want to install without copying them over to the HDD, you put them in the Apps folder. Write code to call these application installers in the SETUPCOMPLETE.CMD file.

My sample SETUPCOMPLETE.CMD is below. If I want to abort the installation, I simply have to remove/detach the installation media from the PC be it an external HDD, DVD or a USB drive. The application setups are executed from the disc directly.
 

cmdow @ /HID@echo offFOR %%i IN (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:\CD.txt SET CDROM=%%i:REG ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceExSET KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceExREG ADD %KEY% /V TITLE /D "Removing Setup Disc Will Cancel Installation." /fREG ADD %KEY%\001 /VE /D "7-Zip 9.20" /fREG ADD %KEY%\001 /V 1 /D "%CDROM%\Apps\7z920.exe" /fREG ADD %KEY%\002 /VE /D "Java Runtime Environent 7 Update 17" /fREG ADD %KEY%\002 /V 1 /D "%CDROM%\Apps\JRE7u17.exe -ai -gm2" /fREG ADD %KEY%\003 /VE /D "K-Lite Codec Mega 9.75" /fREG ADD %KEY%\003 /V 1 /D "%CDROM%\Apps\K-Lite_Codec_Pack_975_Mega.exe" /fREG ADD %KEY%\004 /VE /D "Google Chrome" /fREG ADD %KEY%\004 /V 1 /D "%CDROM%\Apps\ChromeStandaloneSetup.exe /silent /install" /fREG ADD %KEY%\005 /VE /D "Microsoft Redistributable Packages" /fREG ADD %KEY%\005 /V 1 /D "%CDROM%\Apps\VBCFJRedist_AIO_x86_x64.exe /y" /fREG ADD %KEY%\006 /VE /D "dotNet Framework 4" /fREG ADD %KEY%\006 /V 1 /D "%CDROM%\Apps\dotNetFx40_Full_x86_x64_silent.exe" /fREG ADD %KEY%\007 /VE /D "ImgBurn 2.5.7.0" /fREG ADD %KEY%\007 /V 1 /D "%CDROM%\Apps\iBurn257.exe" /fREG ADD %KEY%\008 /VE /D "DirectX" /fREG ADD %KEY%\008 /V 1 /D "%CDROM%\Apps\dxrtfull.exe" /fREG ADD %KEY%\009 /VE /D "Adobe Reader 11" /fREG ADD %KEY%\009 /V 1 /D "%CDROM%\Apps\adober11002.exe -ai" /fREG ADD %KEY%\010 /VE /D "Adobe Flash Player" /fREG ADD %KEY%\010 /V 1 /D "%CDROM%\Apps\AdobeFlash.exe" /fREG ADD %KEY%\011 /VE /D "Search Everything" /fREG ADD %KEY%\011 /V 1 /D "%CDROM%\Apps\Everything.exe /S" /fREG ADD %KEY%\012 /VE /D "WinCDEmu 3.6" /fREG ADD %KEY%\012 /V 1 /D "%CDROM%\Apps\WinCDEmu-3.6-silent" /fREG ADD %KEY%\013 /VE /D "Office 2010 ProPlus" /fREG ADD %KEY%\013 /V 1 /D "%CDROM%\Apps\Office_2010x86\setup.exe /adminfile Basic_Modal.MSP" /f::REG ADD %KEY%\014 /V 2 /D "%CDROM%\Apps\Office_2010x86\SetupOfficeTabEnterprise.exe /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-" /f::REG ADD %KEY%\014 /V 3 /D "%CDROM%\Apps\Office_2010x86\MicrosoftToolkit.exe /EZ-ActivatorOffice" /f%~dp0"Program Install.exe" /s::CLEAN-UPcd %~dp0attrib -R -A -S -H *.*SHUTDOWN /R /T 5cd..RMDIR /S /Q "%WINDIR%\Setup\Scripts"EXIT

See attachment for installation screen during first logon.

EDIT 1 - The CD.txt file mentioned in the 3rd line of the code is a dummy file. I have actually written the changes made to the setup in it. If you don't want to use it then you can change it to point to an installer in your apps folder.

FOR %%i IN (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:\Apps\7z920.exe SET CDROM=%%i:

7z920.exe is one of the installers I am calling in the SETUPCOMPLETE.CMD
Have commented the Office 2010 entries. They work but was unable to get the activator to run silently.

EDIT 2 - %~dp0"Program Install.exe" /s This file is copied to C:\WINDOWS\Setup\Scripts folder and is then executed from the C drive. It executes before the last restart (Windows is finalizing settings window of setup) after which the machine boots up for first logon. On the installation media, this file is located along with the SETUPCOMPLETE.CMD file in the <disc_root>\sources\$OEM$\$$\SETUP\SCRIPTS\ folder. More programs can be executed this way. The user cannot prevent the execution as these are executed from the HDD. The last CLEAN-UP portion deletes these copied files.

EDIT 3 - Some important links.

1 - http://unattended.msfn.org/unattended.xp/view/web/18/2 - http://unattended.msfn.org/unattended.xp/view/web/31/3 - http://unattended.msfn.org/unattended.xp/view/web/59/

Successfully seen this method working with Windows XP SP2, Windows 7 x86 & x64, and Windows 7 SP1 x86 & x64.

EDIT 4 - RunOnceEx entries to execute registry files and command prompt commands.

REG ADD %KEY%\001 /V 1 /D "cmd.exe /c del /Q C:\Adobe Reader 6.0.lnk" /fREG ADD %KEY%\002 /V 1 /D "regedit /s %CDROM%\Apps\begin.reg" /f

EDIT 5 -  The 2nd attached image of Finalizing Installation is when "Program Install.exe" is executed. Then the PC restarts and boots from the HDD. Then before/at FirstLogon, the RunOnceEx entries software is executed from the install media (CD/USB) as shown in first image.

 

PS:- Ignore the title of the window shown in the attachment. Have changed it in the code. The title of the window supports only limited characters. Image is of a test install. If anyone knows how to change the "Windows is now setting up the following items" text shown in the attachment, please let me know.

 

                                   Image 1                                                                       Image 2

post-340994-0-49489200-1368010840_thumb.            post-340994-0-13559200-1417368393_thumb.

Edited by Harshad
2

Share this post


Link to post
Share on other sites

Thanks both. Harshad's method has worked great and let me port over my RunOnceEx commands from my unattended Windows XP.

I'm not sure what this bit of the code is for though. I left it out of my setupcommands.cmd.

cd %~dp0
attrib -R -A -S -H *.*
SHUTDOWN /R /T 5
cd..
RMDIR /S /Q "%WINDIR%\Setup\Scripts"

EXIT

0

Share this post


Link to post
Share on other sites

Harshad posted an example, not a full solution. There may be portions of his script that is not applicable to what you want to do.

0

Share this post


Link to post
Share on other sites

Removed as information contained in this post has been added to original post above.

Edited by Harshad
0

Share this post


Link to post
Share on other sites

Hi there, would you help me understand the file named "program install.exe /s"

%~dp0"Program Install.exe" /s

::CLEAN-UP

cd %~dp0

attrib -R -A -S -H *.*

SHUTDOWN /R /T 5

cd..

RMDIR /S /Q "%WINDIR%\Setup\Scripts"

EXIT

Thanks!

Edited by kingshawn
0

Share this post


Link to post
Share on other sites

In other words -

whatever-your-progam-name-is.EXE

Another "example". ;)

0

Share this post


Link to post
Share on other sites

Hi there, would you help me understand the file named "program install.exe /s"

%~dp0"Program Install.exe" /s

::CLEAN-UP

cd %~dp0

attrib -R -A -S -H *.*

SHUTDOWN /R /T 5

cd..

RMDIR /S /Q "%WINDIR%\Setup\Scripts"

EXIT

Thanks!

 

Was away from this forum for a really long time.

 

"Program Install.exe" is located on the disc along with the SETUPCOMPLETE.CMD file. During installation it gets copied to "%WINDIR%\Setup\Scripts" folder on the PC.

 

For example.

Program Install.exe is AutoIt setup. So I install it. Then when the machine restarts and RunOnce entries are executed, I could have uncompiled AutoIT scripts doing the installation. The scripts are called through RunOnce entries.

Edited by Harshad
0

Share this post


Link to post
Share on other sites

Here is my take on the alphabet loop from powershell. 

65..90 | Foreach {$tag = "Sources\Install.wim";$drive = [char]$_+':'; $test = $drive + '\' + $tag; If (Test-Path $test){write-warning $drive}}
0

Share this post


Link to post
Share on other sites

 

Here is my take on the alphabet loop from powershell. 

 

 

Does it work (if you have an occasion to test it) on machines with media card readers or suffers from the same issue as the "IF EXIST"?

See around here:

http://www.msfn.org/board/topic/137714-install-xp-from-a-ram-loaded-iso-image/page-5#entry895361

and here:

http://www.msfn.org/board/topic/144069-batch-find-file-on-the-cd-roms/

 

jaclaz

0

Share this post


Link to post
Share on other sites

Not sure, maybe someone with that type of hardware can report back. 

 

EDIT: Can verify it works in a VM with a non-loaded A: drive floppy disk.  I see an A: in explorer, when I click on it, it says please insert a disk or some such.  When I run the script no errors.

Edited by MrJinje
0

Share this post


Link to post
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.