Page 1 of 1 1
Topic Options
#138123 - 2005-04-19 09:45 AM a simple if statement.
Bjoern_ Offline
Lurker

Registered: 2005-04-19
Posts: 2
Greetings! I must be stupid, but I can't figure out how to do a certain thing here..

Code:

;if this old version of this file exists
If EXIST = ("C:\program files\[a certain program]\[a certain file]")
?"Removing old program"
RUN ("C:\WINDOWS\IsUninst.exe -y -a -f"C:\Program Files\[a certain program\a certain uninstall file location]\Uni114.isu" ")
?"Installing new program"
RUN (""\\network_path_to_current_file_server\newprogram.msi" /s")
EndIf



First, I would gladly accept help with the RIGHT way to type this since I currently lack the knowledge of it,
second, a question about run; does run wait until the execution is done, or does the script continue directly?

Before you say, RTFM, I did, but.. Like I said, I am stupid =)


Top
#138124 - 2005-04-19 11:26 AM Re: a simple if statement.
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
Code:
If EXIST("C:\program files\[a certain program]\[a certain file]")
"Removing old program"+@CRLF
Shell 'C:\WINDOWS\IsUninst.exe -y -a -f"C:\Program Files\[a certain program\a certain uninstall file location]\Uni114.isu"'
"Installing new program"+@CRLF
Shell '"\\network_path_to_current_file_server\newprogram.msi" /s'
EndIf



Quote:

second, a question about run; does run wait until the execution is done, or does the script continue directly?




Nope, RUN always returns immediately. Shell will wait, but only if the process that you run does not detach from the terminal. If it does you will need to use additional trickery to force it to wait.

All this information and more is documented in both the manual and the FAQ forum. If you couldn't find it in the manual, read the articles in the FAQ forum as they are more real world issues.

Top
#138125 - 2005-04-19 12:04 PM Re: a simple if statement.
Bjoern_ Offline
Lurker

Registered: 2005-04-19
Posts: 2
in the FAQ Forum, gotcha! Thanks a bunch!
Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 837 anonymous users online.
Newest Members
ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder, M_Moore
17887 Registered Users

Generated in 0.05 seconds in which 0.023 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org