vnavna Posted March 23, 2007 Share Posted March 23, 2007 I am installing Office 2007 to our computers here and a colleague of mine asked me if I could play some simple music during the install. I am using the SoundPlay command which works great. The problem that I am having is that not all of the installs are going at the same speed. The slower computers take longer to install so I would like to have another song to be played during the install. I am unable to get the RunWait to work to shutdown the music when the install is done. Here is my script. TraySetState(2) SoundPlay("\\UNC-Path1 Mutiny.wma",0) SoundPlay("\\UNC-Path\13 Betrayal & Desolation.wma",0) RunWait("\\UNC-PATH\Office-2007\setup.exe") If I use only one song it works fine. SoundPlay("\\UNC-Path1 Mutiny.wma",1) How can I play another if the time runs long on the install, or loop the song until the RunWait is done? Link to comment Share on other sites More sharing options...
BillLuvsU Posted March 23, 2007 Share Posted March 23, 2007 (edited) create a loop that checks constantly if the process is still their and if the song is still playing than if the song is over play a new song (maybe a random one from a directory) and if the process is gone than exit =] Edit: In other words don't use runwait Edited March 23, 2007 by fear1313 [center][/center]Working on the next big thing.Currently Playing: Halo 4, League of LegendsXBL GT: iRememberYhslaw Link to comment Share on other sites More sharing options...
vnavna Posted March 23, 2007 Author Share Posted March 23, 2007 The problem with that is that it will be running msiexec.exe which is usually running in task manager. So I will not be able to do that. Here is my original script that works. TraySetState(2) Run("\\UNC-Path\Office-2007\setup.exe") SoundPlay("\\UNC-Path1 Mutiny.wma",1) This one will work fine on the powerful computers but ends about 5-9 minutes to soon on the slower ones. Link to comment Share on other sites More sharing options...
therks Posted March 23, 2007 Share Posted March 23, 2007 Hmm... try runnning two scripts? Have one script filled with SoundPlays and music. Or two parts to one script. I just wrote this, seems to work fine. #NoTrayIcon If $CmdLine[0] > 0 And $CmdLine[1] = 'music' Then While 1 SoundPlay('D:\Music\`Misc\Carl Orff - Carmina Burana - O Fortuna.mp3', 1) SoundPlay('D:\Music\`Misc\The Who - Baba O''Riley.mp3', 1) SoundPlay('D:\Music\`Misc\DeVotchKa - First Push.mp3', 1) SoundPlay('D:\Music\`Misc\Massive Attack - Teardrop.mp3', 1) SoundPlay('D:\Music\`Misc\Yaz - Situation.mp3', 1) WEnd Else If @Compiled Then $iMusicPID = Run(@AutoItExe & ' music') Else $iMusicPID = Run(@AutoItExe & ' ' & FileGetShortName(@ScriptFullPath) & ' music') EndIf RunWait('notepad') ProcessClose($iMusicPID) EndIf My AutoIt Stuff | My Github Link to comment Share on other sites More sharing options...
vnavna Posted March 27, 2007 Author Share Posted March 27, 2007 I have yet to work with $CmdLine so this is going to take me some time. This stuff is so easy to work with but I get stuck once in a while. THX for your help. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now