MSFN Forum: Batch file can't find installers - MSFN Forum

Jump to content



Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Batch file can't find installers Rate Topic: -----

#1 User is offline   Patches7o9 

  • Group: Members
  • Posts: 7
  • Joined: 20-April 07

Posted 25 April 2007 - 12:54 PM

So, I have a Unattended Windows XP Install, which works fine, with a batch file that runs in SVCPACK.inf. I tested the batch file with the apps outside the installer whcih works fine. Then I tested on the install image and got an "Windows cannot find the file" error, which is odd since the files are present in the SVCPACK folder. After the install finished I ran the batch file again, off of the CD image, and it ran without any errors. Any idea why an error would occur only during the install?


#2 User is offline   Yzöwl 

  • Wise Owl
  • Group: Super Moderator
  • Posts: 4,195
  • Joined: 13-October 04
  • OS:Windows 7 x64

Posted 25 April 2007 - 01:31 PM

If you don't provide us with information, you are unlikely to get worthy responses.
What have you added to svcpack.inf?
Is the svcpack folder source names in dosnet.inf?

#3 User is offline   Patches7o9 

  • Group: Members
  • Posts: 7
  • Joined: 20-April 07

Posted 26 April 2007 - 07:39 AM

View PostYzöwl, on Apr 25 2007, 04:31 PM, said:

If you don't provide us with information, you are unlikely to get worthy responses.
What have you added to svcpack.inf?
Is the svcpack folder source names in dosnet.inf?

Sorry about the lack of information. I'm following the instructions on the MSFN site to make an unattended XP SP2 installer, and the Windows installer (with all the current hotfixes) works fine. I've been testing it under the latest version of Virtual PC.

The error occurs right after the hotfixes finish installing and it brings a dialog box saying "Windows cannot find x. make sure you typed the name correctly, and then try again. To search for a file, click the Start button, and then click Search.", where x is the application installer. The applications are named correctly and they are in the svcpack folder. The batch file works correctly when I run it outside of the windows installer.

To svcpack.inf I added, after the hotfixes and qchain, I added my apps batch file.
Yes, I have the svcpack folder source name in dosnet.inf.
If there is anymore information that would be helpful for you guys helping me out then let me know.
Thanks.

#4 User is offline   phkninja 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 466
  • Joined: 28-February 05

Posted 26 April 2007 - 07:56 AM

you will have to give us an example of the code you added to the svcpacl.inf file, not just a description. Your problem could lie in the way you call the installer

#5 User is offline   Patches7o9 

  • Group: Members
  • Posts: 7
  • Joined: 20-April 07

Posted 26 April 2007 - 08:01 AM

 
;Windows XP
[Version] 
Signature="$Windows NT$"
MajorVersion=5
MinorVersion=1
BuildNumber=2600

[SetupData]
CatalogSubDir="\i386\SVCPACK"

[ProductCatalogsToInstall]

[SetupHotfixesToRun]
KB931261.exe /q /n /z
KB931784.exe /q /n /z
KB931836.exe /q /n /z
KB932168.exe /q /n /z
qchain.exe
apps.bat 


That's my SVCPACK.inf file (though I removed most of the hotfixes to save space).

 
@echo off
title Batch File Applications Installer

echo.
echo Begin Installation:

echo.
echo Mozilla Firefox 2
echo Please wait...
start "Firefox" /wait "Firefox Setup 2.0.0.1.exe" /S

echo.
echo Adobe Reader 8
echo Please wait...
start "Adobe Reader" /wait "AdbeRdr80_en_US.exe" /sAll
echo Deleting Desktop Shortcut
DEL "&ALLUSERSPROFILE&\Desktop\Adobe Reader 8.Ink"

echo.
echo WinSCP
echo Please wait...
start "WinSCP" /wait "winscp382setup.exe" /sp- /silent /norestart

echo.
echo Putty
echo Please wait...
copy putty.exe "&ALLUSERSPROFILE&\Desktop\"

echo.
echo Installation Finished

echo.
echo Restarting in 60 seconds
shutdown.exe /r /f /t:60 /c "Restarting to finish application installation"

exit 


And that's my apps batch file.

This post has been edited by Patches7o9: 26 April 2007 - 08:01 AM


#6 User is offline   gunsmokingman 

  • MSFN Master
  • Group: Super Moderator
  • Posts: 2,020
  • Joined: 02-August 03
  • OS:none specified
  • Country: Country Flag

Posted 26 April 2007 - 08:13 AM

Try to change this &ALLUSERSPROFILE&
to this %ALLUSERSPROFILE%

#7 User is offline   Yzöwl 

  • Wise Owl
  • Group: Super Moderator
  • Posts: 4,195
  • Joined: 13-October 04
  • OS:Windows 7 x64

Posted 26 April 2007 - 09:51 AM

Is there a reason why you are naming it aps.bat as opposed to apps.cmd?

#8 User is offline   nmX.Memnoch 

  • MSFN Master
  • Group: Moderator
  • Posts: 2,086
  • Joined: 15-September 04
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 26 April 2007 - 09:57 AM

Using "start" won't work correctly unless he uses .cmd instead of .bat anyway.

Also, qchain.exe shouldn't be necessary either.

#9 User is offline   Patches7o9 

  • Group: Members
  • Posts: 7
  • Joined: 20-April 07

Posted 26 April 2007 - 10:52 AM

I'll try out those suggestions above and let you know if it helps.
Thanks again.

#10 User is offline   Patches7o9 

  • Group: Members
  • Posts: 7
  • Joined: 20-April 07

Posted 26 April 2007 - 12:25 PM

It still says that it cannot find the files with the error "Windows cannot find x. Make sure you typed the name correctly, and then try again. To search for a file, click the Start button, and then click Search."

Maybe I should just have it run at a different stage of the installation?

#11 User is offline   phkninja 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 466
  • Joined: 28-February 05

Posted 26 April 2007 - 12:32 PM

the only other problem i could see is that you dont have the exe's in the correct path.

so create a folder on the disk for install, then
@echo off
title Batch File Applications Installer
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:\win51ip.SP2 set CDROM=%%i:
SET InstallPath=%CDROM%\Install

echo.
echo Begin Installation:

echo.
echo Mozilla Firefox 2
echo Please wait...
start "Firefox" /wait "%InstallPath%\Firefox Setup 2.0.0.1.exe" /S

echo.
echo Adobe Reader 8
echo Please wait...
start "Adobe Reader" /wait "%InstallPath%\AdbeRdr80_en_US.exe" /sAll
echo Deleting Desktop Shortcut
DEL "&ALLUSERSPROFILE&\Desktop\Adobe Reader 8.Ink"

echo.
echo WinSCP
echo Please wait...
start "WinSCP" /wait "%InstallPath%\winscp382setup.exe" /sp- /silent /norestart

echo.
echo Putty
echo Please wait...
copy %InstallPath%\putty.exe "&ALLUSERSPROFILE&\Desktop\"

echo.
echo Installation Finished

echo.
echo Restarting in 60 seconds
shutdown.exe /r /f /t:60 /c "Restarting to finish application installation"

exit


#12 User is offline   Patches7o9 

  • Group: Members
  • Posts: 7
  • Joined: 20-April 07

Posted 26 April 2007 - 12:43 PM

View Postphkninja, on Apr 26 2007, 03:32 PM, said:

the only other problem i could see is that you dont have the exe's in the correct path.

so create a folder on the disk for install, then
(code snip)


I find the problem really odd though, since I can run the batch script fine in any other situation, but just when the installation runs it doesn't work.
I'll try the code above and see if it works.
Thanks.

#13 User is offline   gunsmokingman 

  • MSFN Master
  • Group: Super Moderator
  • Posts: 2,020
  • Joined: 02-August 03
  • OS:none specified
  • Country: Country Flag

Posted 26 April 2007 - 03:11 PM

This will not work as it is not correct

Quote

copy %InstallPath%\putty.exe "&ALLUSERSPROFILE&\Desktop\"


This will work as it is correct

Quote

copy %InstallPath%\putty.exe "%ALLUSERSPROFILE%\Desktop\"

Posted Image

#14 User is offline   IcemanND 

  • MSFN Junkie
  • Group: Super Moderator
  • Posts: 3,249
  • Joined: 24-September 03
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 26 April 2007 - 03:28 PM

View PostPatches7o9, on Apr 26 2007, 02:43 PM, said:

I find the problem really odd though, since I can run the batch script fine in any other situation, but just when the installation runs it doesn't work.
I'll try the code above and see if it works.
Thanks.


when you run it manually it is running from the folder in which the installers reside, when running from svcpack.inf it is being called when the relative path is more likely c:\windows\system32 so any executable the bathc would look for it would look in that folder not your folder with the installers.

You could solve that problem by adding a change directory command to the beginning of the script.

#15 User is offline   phkninja 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 466
  • Joined: 28-February 05

Posted 26 April 2007 - 06:12 PM

Thanks Patches :) Didnt realise i forgot to fix his original error (just copied and pasted the code)

Like IceMan says svcpack calls the programs from the system or system32 directory. By using a directory like the one i suggested above it means the apps install from cd and dont need to be copied to the hard drive at all. Either way its just a personal preference.

e.g.
my way

CD Layout
I386
Install
  |_(Apps)
........


using svcpack alone
i386
  |_SVCPACK
	   |__(Apps)


ou can fix the problem by adding the apps into the svcpack folder on the disk, or do as i said above and add them to the Install folder onm the disk, making the changes to the apps.bat to make the installers run from the cd.

#16 User is offline   Patches7o9 

  • Group: Members
  • Posts: 7
  • Joined: 20-April 07

Posted 27 April 2007 - 10:29 AM

I used the original code you gave (I'll modify the ALLUSERPROFILES thing next) and it works perfectly.
Thanks a bunch everybody.

This post has been edited by Patches7o9: 27 April 2007 - 10:29 AM


Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2011 msfn.org
Privacy Policy