Automate Wizard Installation
-
- Posts: 15
- Joined: 25 Dec 2014, 08:24
Re: Automate Wizard Installation
Makes sense, AutoHotkey is waiting for the msi file to launch, but that can only happen after the user clicks past the system's security dialog, so only then does the execution reach Loc #2 (assuming you didn't click Cancel on the security dialog, in which case you should get an error).
Re: Automate Wizard Installation
That's what I was thinking. I just don't know how to get past the security window.
-
- Posts: 15
- Joined: 25 Dec 2014, 08:24
Re: Automate Wizard Installation
You could do this:
The problem with that is how to hide the console window (unless it doesn't bother you).
Code: Select all
Run cmd /c "C:\Users\<User Name>\Desktop\AutoHotKey\mysql-essential-5.1.73-winx64.msi"
Re: Automate Wizard Installation
TadGhostal wrote:You could do this:The problem with that is how to hide the console window (unless it doesn't bother you).Code: Select all
Run cmd /c "C:\Users\<User Name>\Desktop\AutoHotKey\mysql-essential-5.1.73-winx64.msi"
The third parameter of the Run command allows hiding of the console window (Hide). Just add the extra commas to reach it
"What is suitable automation? Whatever saves your day for the greater matters."
Barcoder - Create QR Codes and other Barcodes using only Autohotkey !!
Archmage Gray - A fantasy shooter game fully coded in AutoHotkey
Barcoder - Create QR Codes and other Barcodes using only Autohotkey !!
Archmage Gray - A fantasy shooter game fully coded in AutoHotkey
Re: Automate Wizard Installation
if none works.
try this:
hope this helps, now
use a timer before handThat's what I was thinking. I just don't know how to get past the security window.
try this:
Code: Select all
MsgBox, 4, Install MySQL Essentials, Would you like to install MySQL Essentials?
IfMsgBox Yes
{
MsgBox, Loc #1
SetTimer, WaitngForSecurity, 200
Run, C:\Users\<User Name>\Desktop\AutoHotKey\mysql-essential-5.1.73-winx64.msi
MsgBox, Loc #3
}
return
WaitngForSecurity:
IfWinExist Open File - Security Warning
{
Sleep 100
ControlClick, Button1, Open File - Security Warning
MsgBox, Loc #2
SetTimer,, Off
}
return
Re: Automate Wizard Installation
Using a combination of everyone's suggestions I was able to get it to work with the code below.
I was unable to get the ControlClick functionality to work so I had to go this route.
I hopefully have one last question for this project. After I make it through the security window, how can I regain control of the MySQL server prompt so that I can work with it.
The code I tried is in between the arrows (minus the arrows of course). I'm slightly confused on the structure of the code now that I am using WaitingForSecurity.
Thanks everyone for your help!
Code: Select all
MsgBox, 4, Install MySQL Essentials, Would you like to install MySQL Essentials?
IfMsgBox Yes
{
SetTimer, WaitingForSecurity, 200
Run C:\Users\<User Name>\Desktop\AutoHotKey\mysql-essential-5.1.73-winx64.msi
-> IfWinExist MySQL Server 5.1 - Setup Wizard
{
Sleep 100
SendInput {Enter}
} <-
}
return
WaitingForSecurity:
IfWinExist Open File - Security Warning
{
ControlFocus Open File - Security Warning
Sleep 100
SendInput {Tab}
Sleep 100
SendInput {Tab}
Sleep 100
SendInput {Tab}
Sleep 100
SendInput {Tab}
SendInput {Enter}
SetTimer, WaitingForSecurity, Off
}
return
I hopefully have one last question for this project. After I make it through the security window, how can I regain control of the MySQL server prompt so that I can work with it.
The code I tried is in between the arrows (minus the arrows of course). I'm slightly confused on the structure of the code now that I am using WaitingForSecurity.
Thanks everyone for your help!
Re: Automate Wizard Installation
I know that you hate WinWait but just for this time:
replace
with:
or
I think as you said, it's a question of construction now.
good luck
replace
Code: Select all
IfWinExist MySQL Server 5.1 - Setup Wizard
{
Sleep 100
SendInput {Enter}
}
Code: Select all
WinWait, MySQL Server 5.1 - Setup Wizard
;this would wait for the window to exist
Code: Select all
WinWaitActive, MySQL Server 5.1 - Setup Wizard
;this would wait for the window to be active
good luck
Re: Automate Wizard Installation
Hi all!
I got my script working just like I needed it to. There are a few issues that I am having and I was wondering if there was a way to make it more reliable. A couple of the issues I am having are as follows:
--> Using the code below sometimes the program does not execute. I can see the "tabs" working and moving to the correct position but it hangs up on "Next" and doesn't hit enter. If I manually hit enter it will continue normally. I believe this is a timing issue. I tried changing the times and still had the problem.
--> Is there any way to allow the user to continue to use the computer? I understand that I am using hotkeys, but is there a way to ignore the user from interacting with the script so the script can run and the user can use the computer without interfering?
--> Occasionally as the program is running, even after it is supposed to have finished. It will start back up again. This may be a coding issue but I do not see where. If it would help, I can copy and paste the code and see what you think.
--> Reliability is still an issue. Since I am using keyboard movements. Are there any ideas on ways to increase reliability?
Thanks again for all your help!
I got my script working just like I needed it to. There are a few issues that I am having and I was wondering if there was a way to make it more reliable. A couple of the issues I am having are as follows:
--> Using the code below sometimes the program does not execute. I can see the "tabs" working and moving to the correct position but it hangs up on "Next" and doesn't hit enter. If I manually hit enter it will continue normally. I believe this is a timing issue. I tried changing the times and still had the problem.
Code: Select all
WaitingForSecurity:
IfWinExist Open File - Security Warning
{
ControlFocus Open File - Security Warning
Sleep 100
SendInput {Tab}
Sleep 100
SendInput {Tab}
Sleep 100
SendInput {Tab}
Sleep 100
SendInput {Tab}
SendInput {Enter}
SetTimer, WaitingForSecurity, Off
}
return
--> Occasionally as the program is running, even after it is supposed to have finished. It will start back up again. This may be a coding issue but I do not see where. If it would help, I can copy and paste the code and see what you think.
--> Reliability is still an issue. Since I am using keyboard movements. Are there any ideas on ways to increase reliability?
Thanks again for all your help!
Re: Automate Wizard Installation
you need to change your approach, since you're not using hotkeys, you're sending keys to the active window, that has the keyboard input focus, so the program's window has to stay active, you may need to try some the ideas that were given before, using ControlSend, ControlClick... things like that which is not working as you stated before for some reason, not sure if this was suggested before, but could you try using Click instead of tabs and enter, you'll have to find the button's position.Is there any way to allow the user to continue to use the computer? I understand that I am using hotkeys, but is there a way to ignore the user from interacting with the script so the script can run and the user can use the computer without interfering?
if it's not the program itself that does that, it might be an enter key that's sent when the program's window closes, and the selected item in the explorer is the program, so it gets executed again, to see the script might be helpful to some degreeOccasionally as the program is running, even after it is supposed to have finished. It will start back up again. This may be a coding issue but I do not see where. If it would help, I can copy and paste the code and see what you think.
Re: Automate Wizard Installation
Since this is FAR after the thread seems to have died off i am going to assume none of the original people are going to see this but for anyone who is running into this issue i did solve it.
For some reason or another i was never able to get the original script to find the button or the window BUT if i put a wait in and then had the 1st script launch a 2nd script (whose sole purpose was to deal with the security window) that seemed to work, provided that the security window had already popped up.
Hope that helps!
For some reason or another i was never able to get the original script to find the button or the window BUT if i put a wait in and then had the 1st script launch a 2nd script (whose sole purpose was to deal with the security window) that seemed to work, provided that the security window had already popped up.
Hope that helps!
Re: Automate Wizard Installation
still here
Re: Automate Wizard Installation
I know this isn't really an AHK solution but quite a few installers accept the 'silent' command line option. Which auto accepts all default options.
Try this:
Or This:
Try this:
Code: Select all
C:\Users\<User Name>\Desktop\AutoHotKey\mysql-essential-5.1.73-winx64.msi /s
Code: Select all
C:\Users\<User Name>\Desktop\AutoHotKey\mysql-essential-5.1.73-winx64.msi /silent
Who is online
Users browsing this forum: filipemb, Google [Bot], Joey5, ShatterCoder, Xaucy and 193 guests