Jump to content
Sign in to follow this  
Björn_2

Script doesn't pause

Recommended Posts

Björn_2

Hello,

I have another problem with my unattended software installation.

During the process, a windows pops up and show me the state of copying files.

If I ignore this windows in my script, the files won't copy.

So I have to tell my script, that it have to wait till the files are copied.

Hier is my script:

run("setup.exe")
WinWait("Willkommen zur Installation")
ControlClick("Willkommen zur Installation", "Fortsetzen", "Button1")
WinWait("Verzeichnis")
ControlSetText("Verzeichnis", "", "Edit1", "C:\Software\Agenda")
ControlClick("Verzeichnis", "OK", "Button1")
WinWait("Verzeichnis erstellen ?")
;This is the last to do until the window will pop up
ControlClick("Verzeichnis erstellen ?", "Ja", "Button1")

; Here is the window, which follows
[attachmentid=822]

;I tried the three functions below:
WinWaitActive("Installation läuft ...")
;WinWaitClose("Installation läuft ...", "", 5)
;WinWaitClose("Installation läuft ...")

;This is the window after the installation process:
WinWait("Zugang - Menüverwaltung")

I hope, anybody could help me

Thanks

Björn

Share this post


Link to post
Share on other sites
nobby

Try to add this to check if the window is still opened:

run("setup.exe")
WinWait("Willkommen zur Installation")
ControlClick("Willkommen zur Installation", "Fortsetzen", "Button1")
WinWait("Verzeichnis")
ControlSetText("Verzeichnis", "", "Edit1", "C:\Software\Agenda")
ControlClick("Verzeichnis", "OK", "Button1")
WinWait("Verzeichnis erstellen ?")
;This is the last to do until the window will pop up
ControlClick("Verzeichnis erstellen ?", "Ja", "Button1")

; Here is the window, which follows
[attachmentid=822]

;check if window exists every 1 second
$i = 1
While $i = 1
    $i = WinExists("Installation läuft ...")
    Sleep(1000)
WEnd


;This is the window after the installation process:
WinWait("Zugang - Menüverwaltung")

Hope it helps


CheersNobby

Share this post


Link to post
Share on other sites
Björn_2

It doesn't work.

In my opinion, autoit doesn't recognize the window "Installation läuft...".

If I install the software without the script, the windows "Installation läuft..." appears and after 3-4 seconds the window "Zugang Menüverwaltung" appears.

Why doesn't appear the window "Installation läuft..."?

Where could be the difference between manual and unattended?

How could I find out which windows appear between "Verzeichnis erstellen ?" and "Zugang Menüverwaltung"?

Björn

Share this post


Link to post
Share on other sites
Blue_Drache

If I ignore this windows in my script, the files won't copy.

So I have to tell my script, that it have to wait till the files are copied.

So the window "Installation läuft" has to be activated and up front for the installation to continue?

CODE

$i = 1

While $i = 1

$i = WinExists(Installation läuft")

WinActivate(Installation läuft")

Sleep(1000)

WEnd

Maybe that would help?

In my opinion, autoit doesn't recognize the window "Installation läuft...".

WindowSpy!!! Try that. If you can get text from window spy, then AutoIt can see and manipulate it.

Edited by Blue_Drache

Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

Share this post


Link to post
Share on other sites
Björn_2

CODE

$i = 1

While $i = 1

    $i = WinExists(Installation läuft")

    WinActivate(Installation läuft")

    Sleep(1000)

WEnd

It's nearly the same, I tried before. The function WinExists() doesn't get the window, because it doesn't appear.

WindowSpy!!!  Try that.  If you can get text from window spy, then AutoIt can see and manipulate it.

In the regular installation the window "Installation läuft..." appears and WindowSpy can see it.

Björn

Share this post


Link to post
Share on other sites
Blue_Drache

Try using the classname of the window then as a last-ditch effort. I have a program that I have to access via classname instead of window title......

AutoItSetOption("WinTitleMatchMode",4)
WinActivate("classname=blahblah")

Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

Share this post


Link to post
Share on other sites
herewasplato

Why doesn't appear the window "Installation läuft..."?

I would concentrate on this section:

;This is the last to do until the window will pop up
ControlClick("Verzeichnis erstellen ?", "Ja", "Button1")

That seems to be the section that is not making the next window even appear.

Once you get the script to make the proper window appear,

try this slight change: (was missing some ")

WinWait("Installation läuft")
While WinExists("Installation läuft") = 1
    Sleep(200)
WEnd

later....


[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites
Björn_2

Thanks for all your answers. I will try it on Thursday. I will tell you about the result.

Thanks

Björn

Share this post


Link to post
Share on other sites
Björn_2

I have a new guess:

The setup.exe uses a setup.ini. In the setup.ini the destination folder and the files to be copied are named. If I install the software manually the destination (of the .ini-file) is used. If I install with autoit, the destination isn't used.

So if I install with autoIt the setup-program doesn't use the setup.ini and so the setup-program doesn't know the files to be copied.

How can I tell the setup-programm to use the setup.ini?

Thanks

Share this post


Link to post
Share on other sites
MHz

Autoit may not recognize the accented a character.

Instead of

WinWaitActive("Installation läuft ...")
Just use
WinWaitActive("Installation")

Edit corrected letter

Edited by MHz

Share this post


Link to post
Share on other sites
Björn_2

I have resolved the problem :idiot:

The problem was that the setup.exe hadn't found the setup.ini. So I run the setup.exe as follows:

run("full qualified setup.exe path", "full qualified setup-Dir")

So the setup knows, where it can find the setup.ini and so it knows which files have to be copied.

But there is another problem:

How can I find out the driveletter of the cdrom during the installation?

Share this post


Link to post
Share on other sites
Björn_2

the parameter @ScriptDir did it

Thanks for all

Share this post


Link to post
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
Sign in to follow this  

×