Maggus Posted May 28, 2013 Share Posted May 28, 2013 Hi all, I'm really new in this family, so be patient please. I've did a lot of research in this forum and tried to find the solutions myself...until now I want to run an msi and hide the window. because an silent parametet did'nt not work with this installer. The installation didn't run with the command "Run", so I did an"ShellExecute". The installer runs, and the ProgressBar runs and ends before the installation has finished. Here is my snippet: $_PID = ShellExecute('msiexec', '/i "IBM SPSS Statistics 21.msi" /qb LICENSETYPE=Network LSHOST=XXX.XXX.de COMPANYNAME=XXX COMMUTE_MAX_LIFE=3 TRANSFORMS=1031.mst /norestart /l* "\\XXX\MACHINE\LOG\SPSS21\' & $Logfile & '.txt" ', $srcdirx86) WinWait("Windows Installer") WinSetState("Windows Installer","", @SW_HIDE) ProgressOn ( "Progress Bar", "Installation von SPSS 21", "Bitte warten..." ) While ProcessExists ( $_PID ) $_DirSize = DirGetSize ( $programdirx86 & '\IBM' ) If $_DirSize Then $_Percent = $_DirSize*100/816492021 $_Percent = _Max ( _Min ( $_Percent, 99 ), 1 ) ProgressSet ( $_Percent ) EndIf Sleep ( 100 ) WEnd ProgressSet ( 100, "Abgeschlossen !" ) Sleep ( 2000 ) ProgressOff ( ) Regards Maggus Link to comment Share on other sites More sharing options...
JohnOne Posted May 28, 2013 Share Posted May 28, 2013 What is the progress % based on? AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Maggus Posted May 28, 2013 Author Share Posted May 28, 2013 (edited) Thanks for your fast reply. It's based on the filequota (directory) of an finished Installation, in bytes. Edited May 28, 2013 by Maggus Link to comment Share on other sites More sharing options...
JohnOne Posted May 28, 2013 Share Posted May 28, 2013 Does the msi installer itself have a progress bar, maybe you can read and use it. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Maggus Posted May 28, 2013 Author Share Posted May 28, 2013 Yes, the msi has got an own progress bar, but how could I read it? Which commands did I've to use? Link to comment Share on other sites More sharing options...
JohnOne Posted May 28, 2013 Share Posted May 28, 2013 Control* functions perhaps. You might be able to loop ControlGetText() for example. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Solution Maggus Posted May 28, 2013 Author Solution Share Posted May 28, 2013 Thanks for your help. I've did it with the "run" command, because it seems that "ShellExecute" doesn't provide an PID. $_PID = Run('msiexec /i "\\XXX\de\x86\IBM SPSS Statistics 21.msi" /qb LICENSETYPE=Network LSHOST=XXX COMPANYNAME=XXX COMMUTE_MAX_LIFE=3 TRANSFORMS=1031.mst /norestart /l* "\\XXX\LOG\SPSS21\' & $Logfile & '.txt" ', $srcdirx86) WinWait("Windows Installer") WinSetState("Windows Installer","", @SW_HIDE) ProgressOn ( "Installations Assistent", "Installation von SPSS 21. Bitte warten..." ) While ProcessExists ( $_PID ) $_DirSize = DirGetSize ( $programdirx86 & '\IBM' ) If $_DirSize Then $_Percent = $_DirSize / 816492021 * 100 ProgressSet ( $_Percent, "Prozent: " &Round($_Percent) & "%") EndIf Sleep ( 100 ) WEnd ProgressSet ( 100, "Installation wird Abgeschlossen!" ) Sleep ( 2000 ) ProgressOff ( ) 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