MSFN Forum: Not an easy qns to solve but.. please help - MSFN Forum

Jump to content



Unattended CD/DVD Guide Homepage · MSFN Forum Rules

Welcome to the Applications Installs forum. Make sure you read the forum rules before you start posting.

Links/Requests to warez and/or any illegal material (porn, cracks, serials, etc..) will not be tolerated. Discussion of circumventing WGA/activation/timebombs/keygens or any other illegal activity will also not be tolerated.

We try our best to keep this forum clean of illegal content. If you see any illegal activity use the "report" button you find in every post to report the specific post to the moderators. If you ignore any of the rules you will be banned without notice.

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

Not an easy qns to solve but.. please help Rate Topic: -----

#1 User is offline   yong2579 

  • Junior
  • Pip
  • Group: Members
  • Posts: 62
  • Joined: 05-June 04

Posted 17 July 2004 - 03:59 AM

We have always been using

Start /wait application switches


to install products which will wait until the product is done installing before moving on to the next instruction in the batch file.

However, what if the application spawns another process out? The situation i'm experiencing is that the [Start /wait] command will think that the process is done and move on to execute the next instruction.

This means now there will be 2 processes at the same time, one from the process in the next instruction, and the another one from the spawn process.

Is there any way to make the instruction such that the computer will wait until the process from the spawn is done before moving on to the next instruction?


#2 User is offline   mazin 

  • MSFN Addict
  • Group: Supreme Sponsor
  • Posts: 1,952
  • Joined: 12-January 04

Posted 17 July 2004 - 04:06 AM

This is why people use SLEEP.EXE!

http://unattended.ms...files/sleep.zip

#3 User is offline   yong2579 

  • Junior
  • Pip
  • Group: Members
  • Posts: 62
  • Joined: 05-June 04

Posted 17 July 2004 - 06:03 AM

ya, i know sleep.exe, and i'm been avoiding it like a plague, cuz it's not accurate at all... i got very varying computer spec in the organization, some very slow, some very fast, if i use sleep, then i must set a different time for each comp'

like 1000 for fast computer
and 5000 for slow computer

something like that, i prefer accurate measurement... is there anyway to do so?

#4 User is offline   kenedy 

  • Member
  • PipPip
  • Group: Members
  • Posts: 123
  • Joined: 12-February 04

Posted 17 July 2004 - 06:18 AM

AutoIt: http://www.hiddensoft.com/autoit3/

Script like this could do it:
While ProcessExists ( "notepad.exe" ) = 1
   sleep (1000)
WEnd


#5 User is offline   yong2579 

  • Junior
  • Pip
  • Group: Members
  • Posts: 62
  • Joined: 05-June 04

Posted 17 July 2004 - 07:35 AM

i'm a total newbie at scripts... how do i insert this code into cmdlines.txt? What tools do I need?

#6 User is offline   FrankE9999 

  • Member
  • PipPip
  • Group: Members
  • Posts: 115
  • Joined: 16-March 04

Posted 17 July 2004 - 08:48 AM

If this is an Installshield installer you can use the following procedure to build a silent install. The key here is to use the /sms switch when installing the application.

o Extract the files from the original exe using winrar.
o Run the setup.exe /r to create the setup.iss file (by default it is created in the windir folder). You can also use setup.exe /r /f1"C:\setup.iss" to change the location of the iss file although this doesn't always work.
o Move the setup.iss file to the folder where you placed the extracted files
o To install the application use setup.exe /s /sms. The /sms option will wait for all child process to complete before returning.

Some other issues I have had are applications not installing once I burned them to CD. This was because it couldn't write the install log file. In these cases I used the /f2 option to redirect the log file to the C:\ drive. I can't remember the exact syntax but it was something like /f2"C:\appName.log".

If you are worried about space space you can build a self extracting executable using a program like 7zip.

#7 User is offline   yong2579 

  • Junior
  • Pip
  • Group: Members
  • Posts: 62
  • Joined: 05-June 04

Posted 17 July 2004 - 08:54 PM

i do that -SMS thing for adobe photoshop 6.0 and it's works, but this one doesn't' cuz it's not a installshield installer. I bet you guys also never heard of it before

UniCenter Remote Agent
UniCenter Software Delivery
UniCenter Asset Management

they belong to CA (Computer Associates) company. I try asking them but they did not reply me. This program specially UniCenter Asset Management uses its own installer... :)

#8 User is offline   kenedy 

  • Member
  • PipPip
  • Group: Members
  • Posts: 123
  • Joined: 12-February 04

Posted 18 July 2004 - 04:07 AM

yong2579, on Jul 17 2004, 07:35 AM, said:

i'm a total newbie at scripts... how do i insert this code into cmdlines.txt? What tools do I need?

First download AutoIt from link above.
Create text document with extension .au3 and insert script I gave you (replacing notepad.exe with correct process name)

Modify .bat file like that:
start /wait program1.exe
start /wait program2.exe -this creates additional process
start /wait autoit3.exe scriptname.au3

start /wait program3.exe
...................................

That is how it works: process program2.exe launches another process and ends.
Now AutoIt launches and checks if a process with name you specified exists. If exists - it pauses for a second and then checks again. And so on. When process is finished AutoIt exits and .bat file continues.
If you have multiple programs that behave like this - write a script where process name is variable and compile it to executable.

#9 User is offline   yong2579 

  • Junior
  • Pip
  • Group: Members
  • Posts: 62
  • Joined: 05-June 04

Posted 18 July 2004 - 08:10 AM

hey great thanks dude, i go try it out!

#10 User is offline   mazin 

  • MSFN Addict
  • Group: Supreme Sponsor
  • Posts: 1,952
  • Joined: 12-January 04

Posted 18 July 2004 - 09:12 PM

So, what difference is there if you sleep inside a script or outside a script?

gonna sleep, now! thanks!

#11 User is offline   Nologic 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 461
  • Joined: 07-October 03

Posted 18 July 2004 - 10:55 PM

Well I'd do as Kenny suggested in so far as:

start /wait autoit3.exe scriptname.au3


But the script I would do would look some thing like so:

Run("App_Name.exe /Switchs"); Orginal file execution
WinWaitActive	('Second_Process_Finish_Window Title'); Pause's script till this Window is Created, then exits.


My script executes the orginal file...along with any switch's it may have....then actively waits for the last window to be created....at that point the script is completed...then your "start /wait" would continue on as normal...tho in reality there maybe a second or two left that the program is still active....tho it should be just waiting for the finish window to exit.

So mine may jump the gun...but it shouldn't make a diff (normally) and you should be zipping through your install as quickly as possible.

#12 User is offline   mazin 

  • MSFN Addict
  • Group: Supreme Sponsor
  • Posts: 1,952
  • Joined: 12-January 04

Posted 19 July 2004 - 04:30 AM

yeah ... this is better, yet.

#13 User is offline   Nologic 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 461
  • Joined: 07-October 03

Posted 19 July 2004 - 09:52 AM

mazin -

Well after giving it more thought....kenedy is probably more correct than I am. :)

Since my method actually requires a window be created at some point...if no window is ever created then it just hangs. :D

So with that in mind and actually running with what kenedy has already outlined I'd suggest the following:

Func _App_Tick($at)
	While ProcessExists ($at) = 1
  Sleep  (250)
	WEnd
EndFunc

Run("App_Name.exe /Switchs"); Orginal file execution

_App_Tick(proc_1.exe)
_App_Tick(proc_2.exe)
_App_Tick(proc_3.exe)
...


All this does is create a fuction called _App_Tick but you can name it what ever...that just came to mind. :rolleyes: Which is used to save a tad bit on code...or a lot of code depending how many sub-proc's get spawned.

One should ideally just pass one active executable to the fuction...thus as one executable is exited...the newly created one should be passed to the fuction...so on and so forth.

So if you start "Setup_Photoshop.exe" you would then just pass that executable:

_App_Tick(Setup_Photoshop.exe)

Now lets say durning that time frame "Setup_Photoshop.exe" launch's a sub-proc "Setup_QuickTime.exe" but "Setup_Quicktime.exe" starts and finishs prior to "Setup_Photoshop.exe" being completed...in this case there would be no need to pass "Setup_QuickTime.exe" to the fuction, since "Setup_Photoshop.exe" would still keep the script sleeping.

Now lets say "Setup_Photoshop.exe" exits but in doing so "Setup_Remote_Agent.exe" is spawned...in this case we would pass "Setup_Remote_Agent.exe" to the fuction:

_App_Tick(Setup_Remote_Agent.exe)

We would continue to do this as long as one proc is killed off and a new one is spawned.

So we end up with some thing that looks roughly like so:

Func _App_Tick($at)
	While ProcessExists ($at) = 1
  Sleep  (250)
	WEnd
EndFunc

Run("Setup_Photoshop.exe /VERYSILENT"); Orginal file execution

_App_Tick(Setup_Photoshop.exe)
_App_Tick(Setup_Remote_Agent.exe)


Hehe any ways kenedy was right and I was wrong. :D

#14 User is offline   yong2579 

  • Junior
  • Pip
  • Group: Members
  • Posts: 62
  • Joined: 05-June 04

Posted 19 July 2004 - 10:06 AM

actually guys i must really thanks you all, but i figure it out actually i use a single line of code

ProcessWaitClose($command[1]);


then i compile it into an exe file (ProcessWait.exe) which later on i call in the batch file to track the process name NCSETUP.EXE

start /wait ProcessWait.exe NCSETUP.EXE


that works perfectly for my case. Thanks a lot guys! You guys give me a bit of idea about scripting! hehz'

#15 User is offline   Nologic 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 461
  • Joined: 07-October 03

Posted 19 July 2004 - 02:42 PM

yong2579 -

LOL good deal

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