Jump to content

Autoit


hohner

Recommended Posts

I've been working on an autoit script and I'm pretty happy with the outcome, it works fine.

Is there a way to hide all the output windows though? I know you can use the WinSetState command but the window this applies to is still visible for a short while until this command is reached.

Link to comment
Share on other sites


Sorry about the lack of info, hopefully this post is better.

Thanks for helping but that didn't do it.

It gave me this error: Unable to execute the external program and it points to the first line

Run("SETUP.EXE", -1, @SW_HIDE)
I don't understand what -1 is for. Doesn't the second entry refer to the working dir?
Run

--------------------------------------------------------------------------------

Runs an external program.

Run ( "filename" [, "workingdir" [, flag]] )

Parameters

filename The name of the executable (EXE, BAT, COM, or PIF) to run.

workingdir [optional] The working directory.

flag [optional] The "show" flag of the executed program:

  @SW_HIDE = Hidden window

  @SW_MINIMIZE = Minimized window

  @SW_MAXIMIZE = Maximized window

My autoit code is to run the setup for my Radeon video card with selected features installed. The code is as follows..

Run("SETUP.EXE")
WinWaitActive("ATI Software", "Wizard will install ATI Software")
send ("!N")
WinWaitActive("ATI Software", "PLEASE READ THIS LICENSE CAREFULLY BEFORE")
SEND("!y")
WinWaitActive("ATI Software", "the component you want to install")
send("{TAB}")
send("{ENTER}")
WinWaitActive("ATI Software", "Select the components you want to install")
send("{TAB 3}")
send("{DOWN 2}")
send("{SPACE}")
send("{DOWN 3}")
send("{SPACE}")
send("!N")
WinWaitActive("Setup Complete")
send("{TAB}")
send("{DOWN}")
send("{ENTER}")

Link to comment
Share on other sites

Run("SETUP.EXE", "", @SW_HIDE)

If anything, this may hide the intial window. Though the success always seems low. A way of not showing what is happening, could be to WinMove() the setup window off screen.

WinMove ( "title", "text", x, y)

Link to comment
Share on other sites

I was thinking about this the other day as I wouldn't mind doing this myself. An idea that came to mind would be to set up a GUI window with some sort of full-screen image and make the GUI "always on top". Then any active windows will be hidden behind your GUI. I haven't researched or tried this, so I've no idea how it would work.

Link to comment
Share on other sites

I was thinking about this the other day as I wouldn't mind doing this myself.  An idea that came to mind would be to set up a GUI window with some sort of full-screen image and make the GUI "always on top".  Then any active windows will be hidden behind your GUI.  I haven't researched or tried this, so I've no idea how it would work.

I dunno what the possibilities are of AutoIt but can you take some kind of screenshot of the desktop (or just search for the background image), take the part you need and as you said and put it above the installation window (not full screen). BUT MHz's solution of moving the window seems A LOT easier :D

edit:

it seems you can use negative positions with winmove, so here ya go:

WinWaitActive("title of window", "some text in window")
$pos = WinGetPos("title of window", "some text in window")
WinMove("title of window", "some text in window", -$pos[2], -$pos[3])

I tested it, and no traces of installation anymore!

Link to comment
Share on other sites

Would you have to do that with every window, though? Seems every time you enter in a command for "Next", or whatever, that a new window would come up. Would that new window appear in the same location as the previous one, or revert back to the original location?

Link to comment
Share on other sites

edit:

it seems you can use negative positions with winmove, so here ya go:

WinWaitActive("title of window", "some text in window")
$pos = WinGetPos("title of window", "some text in window")
WinMove("title of window", "some text in window", -$pos[2], -$pos[3])

I tested it, and no traces of installation anymore!

I just tried this method but you still see the window before it gets moved. So the result is no different from using winsetstate,

WinWaitActive("ATI Software", "Wizard will install ATI Software")
WinSetState("("ATI Software", "Wizard will install ATI Software", @SW_HIDE)
send ("!N")

The problem I think, is that we are still waiting for the window to become active and then either moving or hiding it. So we can only expect to see the active window for a small moment. I want to hide or move the window without seeing it at all.

Also.. shouldn't

WinWaitActive("title of window", "some text in window")
$pos = WinGetPos("title of window", "some text in window")
WinMove("title of window", "some text in window", -$pos[2], -$pos[3])

be this..

WinWaitActive("title of window", "some text in window")
$pos = WinGetPos("title of window", "some text in window")
WinMove("title of window", "some text in window", -$pos[0], -$pos[1])

As I believe that [0]=x, [1]=y, [2]=width, [3]=height.

Taken from Autoit Help:

Return Value

Success: Returns a 4-element array containing the following information:

$array[0]= X position

$array[1] = Y position

$array[2] = Width

$array[3] = Height

Link to comment
Share on other sites

"-1" is the default value. :) Dunno if it works on Run tho.

-1 is a default value for interger, where allowed.

"" is default value for strings, where allowed.

I was thinking about this the other day as I wouldn't mind doing this myself.  An idea that came to mind would be to set up a GUI window with some sort of full-screen image and make the GUI "always on top".  Then any active windows will be hidden behind your GUI.  I haven't researched or tried this, so I've no idea how it would work.

This could be done. Are the windows that ugly?

i'm french and i want to know how to hide the autoit script like /S or other

thanks and sorry for my language

Are you meaning Silent Install by using Autoit?

Try this modded USSF(including source). I just put USSF.exe on the desktop, and drag any setup.exe onto it. It should give you a report on the recognized installer, then give an option on a template Au3 script, which is extracted to the same directory as the setup.exe (or whatever setup.exe is called). Just replace any question marks, with the needed information.

USSF with Au3 Silent Install Templates.4 templates only. Inno Setup, NSIS, Wise and MSI.

Would you have to do that with every window, though?  Seems every time you enter in a command for "Next", or whatever, that a new window would come up.  Would that new window appear in the same location as the previous one, or revert back to the original location?

With WinSetState(), you need to everytime. But WinMove(), the installer should remember it's position.

Link to comment
Share on other sites

I was thinking about this the other day as I wouldn't mind doing this myself.  An idea that came to mind would be to set up a GUI window with some sort of full-screen image and make the GUI "always on top".  Then any active windows will be hidden behind your GUI.  I haven't researched or tried this, so I've no idea how it would work.

This could be done. Are the windows that ugly?

It's not that the appearance is good or bad, it's more about simulating a silent install. There are quite a few applications that are a real pain in the rear to install silently, if they will at all, so AutoIt easily covers that base.

BTW, thanks for the clarification on WinMove().

Link to comment
Share on other sites

It's not that the appearance is good or bad, it's more about simulating a silent install.  There are quite a few applications that are a real pain in the rear to install silently, if they will at all, so AutoIt easily covers that base.

BTW, thanks for the clarification on WinMove().

Ok, use this

Opt("WinWaitDelay", 100)

It is normally 250.

You should not quite see the window, before Autoit will WinMove() it. As djbe stated, move it off screen to the negative side, no resolution change problems then, it should be almost the closet to a silent install as possible?

Link to comment
Share on other sites

I've given up on this one.

I can 'winmove' the windows off screen, but the install doesn't remember the position and I must move every window.

Now, as the windows are still seen for a short moment before being moved I don't see the point in moving them because when autoit runs through the setup windows without moving them, the display time for each window is pretty much the same as when being moved.

I guess I'll just have to put up with seeing the setup screens. :(

Link to comment
Share on other sites

  • 3 years later...

Here's a possible idea I thought of, if no one has ever thought of it before. I don't know if they even exist, but what about:

a) A virtual desktop manager, that allows you to have one desktop that will never be shown.

B) A virtual monitor, which looks like a real monitor to the OS, but is really just a scratch space to display stuff that should always be hidden.

In either of these two cases, you would need some sort of command line program to send the output of a program to that space. Then the program could function the same as normal, except for off-screen. If anyone knows if this is possible, that would be a great idea. Basically, now I'm looking for one too, as I've now got a script to try to hide stuff on.

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
  • Recently Browsing   0 members

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