Jump to content
theak

Detecting 32 vs 64 install button instances

Recommended Posts

theak

I have an install that I'm trying to deploy on both 32 bit and 64 bit machines. Trying to move more to 64 bit but still curious about making this work for both at the same time.

This is the 32 bit version of the script. I tried to make this same script work for a 64 bit install but realized the button IDs were different. Same install exe though.

What's the smart way to detect the buttonIDs based on the OS architecture? I thought possibly having the button ID as a variable with case selects but I wasn't quite sure how to pull it off.

 

#Region
#AutoIt3Wrapper_Res_requestedExecutionLevel=requireAdministrator
#EndRegion

#include <FileConstants.au3>
#include <MsgBoxConstants.au3>

Run("\\servername\cofs\Organization\ITS\_Software & Hardware\AS400\DVD\Windows\cwblaunch.exe")
;WinWaitActive("Security Warning","",5)
;ControlClick("Open File - Security Warning","&Run",4426,"left",1)


WinWaitActive("Choose Setup Language","",5)
sleep(500)
ControlClick("Choose Setup Language","OK",1006,"left",1)
Do
    Sleep(10)
Until ControlCommand("IBM i Access for Windows 7.1 - InstallShield Wizard","&Next >","Button1","IsEnabled")
sleep(500)
;MsgBox($MB_OK,"Control Command Found","Sent for first wait hang")
ControlClick("IBM i Access for Windows 7.1 - InstallShield Wizard","&Next >",23467,"left",1)
sleep(500)
ControlClick("IBM i Access for Windows 7.1 - InstallShield Wizard","I &accept the terms in the license agreement",22951,"left",1)
sleep(500)
ControlClick("IBM i Access for Windows 7.1 - InstallShield Wizard","&Next >",23467,"left",1)
sleep(500)
ControlClick("IBM i Access for Windows 7.1 - InstallShield Wizard","&Next >",23467,"left",1)
sleep(500)
ControlClick("IBM i Access for Windows 7.1 - InstallShield Wizard","&Next >",23467,"left",1)
sleep(500)
ControlClick("IBM i Access for Windows 7.1 - InstallShield Wizard","&Next >",23467,"left",1)
sleep(500)
ControlClick("IBM i Access for Windows 7.1 - InstallShield Wizard","&Install",23546,"left",1)
;Wait for finish button to appear
Do
   $Finish = ControlGetHandle("IBM i Access for Windows 7.1 - InstallShield Wizard", "Finish", 23500)
   Sleep(100)
Until $Finish <> ""
sleep(500)
ControlClick("IBM i Access for Windows 7.1 - InstallShield Wizard", "Finish", 23500,"left",1)
;Start second part of install
Run("\\servername2\Apps$\AutoIT\AS400\AS400_2 Patch_1.exe"

 

Share this post


Link to post
Share on other sites
InunoTaishou

What is cwblaunch.exe? Do you have the website url for it? There's probably a silent installation for it as well as a x64 or x86 parameter.

Share this post


Link to post
Share on other sites
theak
3 minutes ago, InunoTaishou said:

What is cwblaunch.exe? Do you have the website url for it? There's probably a silent installation for it as well as a x64 or x86 parameter.

It's an ancient mainframe software. I doubt it actually does but I can contact our vendor to see. 

Share this post


Link to post
Share on other sites
InunoTaishou

Thanks @MilesAhead

These are the command line parameters that we want.

The /v/qn parameter is a silent install and should do what you want.

ShellExecute("\\servername\cofs\Organization\ITS\_Software & Hardware\AS400\DVD\Windows\cwblaunch.exe", "/v/qn")

And these look like some more command line parameters based on what to install. If you use any of these ones then use the double quotes in the parameter so it'd look like this:

ShellExecute("\\servername\cofs\Organization\ITS\_Software & Hardware\AS400\DVD\Windows\cwblaunch.exe", '"/v/qn ADDLOCAL=ALL"')

 

Edited by InunoTaishou

Share this post


Link to post
Share on other sites
theak
2 hours ago, InunoTaishou said:

Thanks @MilesAhead

These are the command line parameters that we want.

The /v/qn parameter is a silent install and should do what you want.

ShellExecute("\\servername\cofs\Organization\ITS\_Software & Hardware\AS400\DVD\Windows\cwblaunch.exe", "/v/qn")

And these look like some more command line parameters based on what to install. If you use any of these ones then use the double quotes in the parameter so it'd look like this:

ShellExecute("\\servername\cofs\Organization\ITS\_Software & Hardware\AS400\DVD\Windows\cwblaunch.exe", '"/v/qn ADDLOCAL=ALL"')

 

If I run it at the command line level I get the error that it's not a valid Win32 application.

Share this post


Link to post
Share on other sites
jdelaney

ControlGetHandle

IsHwnd

Logically look for one, if not present, get the other.


IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.

Share this post


Link to post
Share on other sites
theak
On 3/4/2016 at 10:23 AM, InunoTaishou said:

Thanks @MilesAhead

These are the command line parameters that we want.

The /v/qn parameter is a silent install and should do what you want.

ShellExecute("\\servername\cofs\Organization\ITS\_Software & Hardware\AS400\DVD\Windows\cwblaunch.exe", "/v/qn")

And these look like some more command line parameters based on what to install. If you use any of these ones then use the double quotes in the parameter so it'd look like this:

ShellExecute("\\servername\cofs\Organization\ITS\_Software & Hardware\AS400\DVD\Windows\cwblaunch.exe", '"/v/qn ADDLOCAL=ALL"')

 

Ok, awesome, I had to dig to find the right setup.exe according to the documentation but I got it to run. However, it pops up with this dialog box (attached) showing me the command line parameters, as if I'm incorrect.  installshield.JPG

It continues to run the install however, but seemingly without any of the command line parameters.

Here's the command I entered into the CMD prompt exactly:

"\\servername\cofs\Organization\ITS\_Software & Hardware\AS400\DVD\Windows\image64a\setup.exe",'"/v/qn ADDLOCAL=ALL"'

 

Edited by theak

Share this post


Link to post
Share on other sites
theak

Bump...

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

  • Similar Content

    • Yirrlaar
      By Yirrlaar
      #Include <WinAPI.au3> local $ClassName = _WinAPI_GetClassName(WinGetHandle(WinGetTitle("[ACTIVE]"))) ControlClick(WinGetTitle("[ACTIVE]"), "", "[CLASS:"&$ClassName&"; INSTANCE:1]", "primary") When I am running this script it just gives me a ConsoleWrite output of "0x001D04A8"
      When using "AutoIT v3 Window Info" all the info I need for the ControlClick is there and displayed perfectly as if I typed it in normally.
      Upon click the button it should be clicking it, I see the following inn the console window:
      If I replace the $ClassName with the actual ClassName of "WindowsForms10.BUTTON.app.0.3296db7_r14_ad1" it works just fine, any ideas???
    • Tats
      By Tats
      Hi everyone,
      I have a problem with ControlClick function. It doesn't work no matter how I tried all the possible combination of the parameters.
      Below is the scripts of possible parameter combination:
      ;ControlClick("title","text","controlID ","button","clicks","x","y") ;title= Title, Class, Handle ;controlID= Class, ClassNN, Instance ;Title here is empty when I check it with AutoIt Info ControlClick("", "", "[ScreenKeyboard::Button18]", "left", "1", "230","890") ControlClick("", "", "[CLASS:ScreenKeyboard::Button; INSTANCE:18]", "left", "1", "230","890") ControlClick("", "", "[INSTANCE:18]", "left", "1", "230","890") ;Title here is the Class of the window ControlClick("[ScreenKeyboard::SKFrame]", "", "[ScreenKeyboard::Button18]", "left", "1", "230","890") ControlClick("[ScreenKeyboard::SKFrame]", "", "[CLASS:ScreenKeyboard::Button; INSTANCE:18]", "left", "1", "230","890") ControlClick("[ScreenKeyboard::SKFrame]", "", "[INSTANCE:18]", "left", "1", "230","890") ;Title here is the Handle of the window ControlClick("[0x000907A0]", "", "[ScreenKeyboard::Button18]", "left", "1", "230","890") ControlClick("[0x000907A0]", "", "[CLASS:ScreenKeyboard::Button; INSTANCE:18]", "left", "1", "230","890") ControlClick("[0x000907A0]", "", "[INSTANCE:18]", "left", "1", "230","890") Am I coding it correctly?
      Thanks
    • MaximusCZ
      By MaximusCZ
      Hello, and apologies if this have been discussed before, but I googled and couldnt find anything relevant.
      I have a problem where I try to send a control clink into to a window. 
      Part of window I try to send clicks to looks like this . The black border is showing when I mouse over it Au3Info, I get following information:

      I am testing its interaction with code

      The result I get is that it makes control clicks trough first line, opens and closes menus, as expected.
      When It gets to second line, it does not click a single icon. I can tell that coords are correct as the dropdown menus (No view active) gets focused(altough not rolled out). Same behaviour happens if roughly 40<y<60, so I know I am hitting good height. You can look at how it behaves here: output.webm 
      Dropdown 1 focuses at around 8 sec mark, and 13 sec mark it changes to second dropdown, defocusing first one, seemingly not registering any clinks inbetween.
       
      Have you ever encountered similar behaviour? I need to click the Key button, first on second line, with controlclick (or any other way not hijacking the mouse). I cant trigger that button by keyboard and There is no other control having control over it.
      Help
       
    • Skysnake
      By Skysnake
      I need to automate a specific GUI from a legacy system written in C.
      The spy tool gives me this

      I use this code
      Local $swintit = WinGetTitle("[active]") ConsoleWrite("active Window " & $swintit & @CRLF) If $swintit = "FILES NOTES" Then ; If $swintit = "FILES NOTES" Then ; got Window, now atomate ConsoleWrite("got Window " & @CRLF) ; now focus, then click :) ;EditPaste ;ControlCommand("FILES NOTES", "", 404, $acno) ; paste acno GUICtrlSetState(404, $GUI_Focus) ControlCommand("FILES NOTES", "", 404, $acno) ; paste acno GUICtrlSetState(401, $GUI_Focus) ControlClick("FILES NOTES", "", 401, $acno) ; click okay EndIf ; If $swintit = "FILES NOTES" Then The idea is to paste the acno value into the edit box, then click an Okay button.
      I get a console write that the active Window is as expected, but my loop completes without ever writing anything into the GUI.
      I also tried the control ID as text "404" - same result
      What am I missing?
      Skysnake
       
×