Computing.Net > Forums > Disk Operating System > Testing for a file during installation

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Testing for a file during installation

Reply to Message Icon

Name: Milkman
Date: July 21, 2002 at 15:08:54 Pacific
Comment:

I am trying to create a batchfile installer which runs an exe file which installs a programme on the PC & then installs a large number of files in a folder on the c:\ drive. It takes a number of minutes after the programme is installed for the files to be unpacked & appear in the new folder which it creates. I want the batch file to wait until the files have appeared before flashing a message to the user saying "Installation Complete".
I have tried the following:

install.exe

:loopinst

if not exist c:\folder\index.htm then goto loopinst

echo Installation Complete


If the file doesn't exist then I get a "bad command or filename" error. If the file is there (i.e. rerun after installation) the process runs through ok, without thowing an error. It looks like the loop process isn't working, any ideas?

Thanks,

Milkman



Sponsored Link
Ads by Google

Response Number 1
Name: Aptiva-386
Date: July 21, 2002 at 16:31:06 Pacific
Reply:


There is no THEN before a command in DOS batch-speak. It should read:
if not exist c:\folder\index.htm goto loopinst
Also, keep in mind install.exe will run to completion before instructions in loopinst are entered.


0

Response Number 2
Name: Miskva
Date: July 22, 2002 at 04:25:30 Pacific
Reply:

Hi,

I used to do similar things in batchfiles, if the check you are running is checking on the existance of a file or directory (or both, or multiple files) you can do something like this :

:start_chk
sleep 10
if exist file.exe goto inst_ok
goto start_chk
:inst_ok

The 'sleep' command is not native DOS, if you look for it on i-net you will find it easily. But it will work without I guess, but then the program may be quite busy.

If this is what you are looking for .. otherwise, pls reply



0

Response Number 3
Name: Renaissance Man
Date: July 22, 2002 at 05:13:17 Pacific
Reply:

You can replace sleep with choice

choice /N/T:y,#>nul where # is a number of seconds between 1 and 99

You might also want to add something like this before install.exe:

echo Now installing. This will take a few minutes; please be patient.


0

Response Number 4
Name: milkman
Date: July 22, 2002 at 05:22:17 Pacific
Reply:

Thanks for the prompt replies.
The install.exe file has not completed by the time the batch file ends. In fact the exe file takes 2-4 mins to run depending on the spec of the PC. Also this makes it difficult to simply use a timer, hence the need to check for the appearance of a file.

I'll take out the "then" & give it a try.

Once again thanks.

Milkman


0

Response Number 5
Name: Milkman
Date: July 23, 2002 at 04:00:16 Pacific
Reply:

All,

Thanks for the suggestions. What I have done is:

:loopxy
choice/n/t:y,20>nul
if not exist c:\folder\file.htm goto loopxy

This works fine, except for one thing.

If I run the installation exe file standalone it takes about 1:30 mins to install the programme & associated html files.

When I run the exe from the batch file & test for when the files are installed it runs for about 8 mins!! I have tried playing with the seconds value in choice but this makes little/no difference. It looks like the loop process is having a big overhead!! CPU runs flat out!!

Anyone any ideas how to reduce this?

What I ended up doing was
a: running the install.exe from start/w.
b: downloaded a prog called doze.exe (similar to sleep) & used this for the timing loop.

Install time now down to original + 20secs (approx)

Once again thanks

Milkman


0

Related Posts

See More



Response Number 6
Name: Miskva
Date: July 24, 2002 at 06:22:17 Pacific
Reply:

Hmm, to me this seems the 'timing' utility is eating some CPU

I experience somewhat the same, when I run my copy of sleep.exe in a similar way, maybe it is this .. Anyway, using 'choice' to get the waiting time is not a bad .. 'choice', after all, this is standard window. Do try some version of sleep.exe as well

And what you can also try, is just using the same code, but without the 'wait' command whatever you are using ...

Try to determine where exactly the program is running slow


0

Response Number 7
Name: Secret_Doom
Date: July 31, 2002 at 11:25:59 Pacific
Reply:

I don't see why this wouldn't do it:

START /w install.exe
echo Installation Complete

-- Leonardo Pignataro - Secret_Doom --

secret_doom@hotmail.com
www.batch.hpg.com.br


0

Sponsored Link
Ads by Google
Reply to Message Icon

can't boot to dos Booting dos in winme



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Disk Operating System Forum Home


Sponsored links

Ads by Google


Results for: Testing for a file during installation

Searching for a file? www.computing.net/answers/dos/searching-for-a-file/14715.html

Testing for a net share www.computing.net/answers/dos/testing-for-a-net-share/12852.html

Manual for a file posted a while ag www.computing.net/answers/dos/manual-for-a-file-posted-a-while-ag/15456.html