Jump to content

Help with RunWait


teeboi
 Share

Recommended Posts

I am installing Windows Media Player silently & to install this i need to use the following command line & i need to know how should i quote this. I Need help to use the following command line with RunWait. Can someone please advise.

wmp11-windowsxp-x86-enu.exe /Q:A /R:N /C:"setup_wm.exe /Q:A /R:N"

Link to comment
Share on other sites

Link to comment
Share on other sites

Thanks WilliChan looks like its working. Since the install is all silent i was thinking maybe creating a progress bar for this untill the install finishes. How hard would it be to show the progress bar while it's installing?

Link to comment
Share on other sites

Use Run() instead of RunWait(), save the PID, and then loop on your progress bar until the PID is closed.

But how will you know what the current progress status is? Are you just going to advance the progress on an assumed time it should take?

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

You could use the $PBS_MARQUEE style on a progress bar with _SendMessage.

Example:

#include <GUIConstantsEx.au3>
#include <ProgressConstants.au3>
#include <WindowsConstants.au3>
#include <SendMessage.au3>

$iPID = Run('wmp11-windowsxp-x86-enu.exe /Q:A /R:N /C:"setup_wm.exe /Q:A /R:N"')

$hForm = GUICreate("Software Installation", 320, 90, -1, -1, BitOR($WS_CAPTION,$WS_POPUP,$WS_BORDER,$WS_CLIPSIBLINGS), BitOR($WS_EX_TOOLWINDOW,$WS_EX_TOPMOST,$WS_EX_WINDOWEDGE))
GUICtrlCreateLabel("Installing [Software Name]...", 20, 10, 310, 20)
GUICtrlCreateProgress(20, 30, 280, 25, $PBS_MARQUEE)
_SendMessage(GUICtrlGetHandle(-1), $PBM_SETMARQUEE, True, 60) ; final parameter is update time in ms. Sends message to run the progress bar.
;~ GUICtrlCreateLabel("Label2", 20, 60, 310, 20) ;2nd label if needed
GUISetState(@SW_SHOW)

ProcessWaitClose($iPID)
GUIDelete($hForm)

Adam

Link to comment
Share on other sites

Since you really have no way of getting a real status from a silently installing app, the marquee looks like the best way to me.

Link to comment
Share on other sites

Since you really have no way of getting a real status from a silently installing app, the marquee looks like the best way to me.

No, not unless the program makes that information available and it does defeat the purpose of a silent install. There are other params (at least with msi) that give you a quiet install, you may want to look into that.

As suggested, you can know then the process ends, thus the install has finished.

Post your code because code says more then your words can. SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y. Use Opt("MustDeclareVars", 1)[topic="84960"]Brett F's Learning To Script with AutoIt V3[/topic][topic="21048"]Valuater's AutoIt 1-2-3, Class... is now in Session[/topic]Contribution: [topic="87994"]Get SVN Rev Number[/topic], [topic="93527"]Control Handle under mouse[/topic], [topic="91966"]A Presentation using AutoIt[/topic], [topic="112756"]Log ConsoleWrite output in Scite[/topic]

Link to comment
Share on other sites

No, not unless the program makes that information available and it does defeat the purpose of a silent install.

Actually, if you run the sample code that AdamUL provided, you will see that it just scrolls to indicate that there is activity, rather than showing an actual status. Since there is no way in this case to get status during the install to indicate how far along it is, the marquee gives the best solution, with no progress status needed. It just continues to scroll until the install process is done, then it can be closed.
Link to comment
Share on other sites

Or you could use an animated .gif, like the animation that Windows Explorer uses while copying files. You have many options to just show "in progress" if you don't have to indicate a quantitative value for progress.

Also, some installers have a "basic" mode with a switch like "/QB", where you see some GUI to indicate progress but no dialogs or user interaction is required.

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

I guess we are going to stick with the silent install without any progress bar. $PBS_MARQUEE cause teh progress bar to stay on top of the window which will annoy our users. Animated gif is one of the option i would consider only if i would knew how to do this. SO far i am able to Run the Program silently and RegWrite few registries but i am stuck on Reg_Binary with a hex value. Can someone help me with this please. I am copying the reg file data that i exported from regedit.

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\MediaPlayer\Preferences]

"SendUserGUID"=hex:00,00,00,00

Link to comment
Share on other sites

RegWrite("HKEY_CURRENT_USER\Software\Microsoft\MediaPlayer\Preferences","SendUserGUID","REG_BINARY", Binary("0x00000000"))
Worked for me. Thanks for your support guys.

How hard would be to write a Script which will silently go to control panel & check Windows Media Player as my default?

"CONTROL PANEL\ADD OR REMOVE PROGRAMS\SET PROGRAM ACCESS & DEFAULT\CUSTOM\CHOOSE A DEFAULT MEDIA PLAYER\WindowsMediaPlayer"

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...