theak

Detecting 32 vs 64 install button instances

9 posts in this topic

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



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
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

#5 ·  Posted (edited)

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
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

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

#8 ·  Posted (edited)

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

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

    • Ubermensch
      By Ubermensch
      Hello,
      I am currently trying to automatically click the "Yes" button in the ActiveX prompt/popup message after opening the IE (html).
      At 1st, I encounter the "Allow Blocked Content". I already resolve it just by changing settings in the IE Options. But after resolving the "Allow Blocked Content", there's a popup message appear.
      I have attached the ActiveX Prompt.
      Here is the 1st code that I try to use.
      #include <IE.au3> #include <MsgBoxConstants.au3> #include <WinAPI.au3> _IECreate("C:\Users\april\Documents\Logo\JRB\AutoIt\AutoBOT\AWD10\sampleAWD10.html",0,1,0) Local $oIE = _IEAttach("", "instance", 1) _IELoadWait($oIE) AdlibRegister("_ActiveXRun",250) Local $oLastName = _IEGetObjByName($oIE, "Text4") Local $oGetItem = _IEGetObjByName($oIE, "getitem") _IEAction($oGetItem, "click") MsgBox($MB_SYSTEMMODAL, "Form Element Value", _IEFormElementGetValue($oGetItem)) Func _ActiveXRun() $retWin = WinGetHandle("[Class:Button]","") $winTitle = "[HANDLE:" & $retWin &"]" $ctrlHandle = ControlGetHandle($winTitle,"", "[CLASS:Button; INSTANCE:2]") $ctrlTitle = "HANDLE:" & $ctrlHandle &"]" WinWaitActive($ctrlTitle,"[CLASS:Button; INSTANCE:2]",10) $k = ControlGetPos($winTitle, "","[CLASS:Button; INSTANCE:2]") $x = $k[0] $y = $k[1] WinActivate ($winTitle,"An ActiveX control on this page might be unsafe to interact with other parts of the page. Do you want to allow this interaction?") ControlFocus($winTitle,"An ActiveX control on this page might be unsafe to interact with other parts of the page. Do you want to allow this interaction?","[CLASS:Button; INSTANCE:2]") ControlClick($winTitle, "","[CLASS:Button; INSTANCE:2]","primary",1,$x,$y) ControlSend($winTitle, "", "[CLASS:Button; INSTANCE:2]", "{ENTER}", 0) EndFunc Here is the console output.
      >"C:\Program Files (x86)\AutoIt3\SciTE\..\AutoIt3.exe" "C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.au3" /run /prod /ErrorStdOut /in "C:\Users\april\Documents\Logo\JRB\AutoIt\AutoBOT\AWD10\AWD10.1.au3" /UserParams +>12:44:11 Starting AutoIt3Wrapper v.17.224.935.0 SciTE v.3.7.3.0 Keyboard:00000409 OS:WIN_10/ CPU:X64 OS:X64 Environment(Language:0409) CodePage:0 utf8.auto.check:4 +> SciTEDir => C:\Program Files (x86)\AutoIt3\SciTE UserDir => C:\Users\april\AppData\Local\AutoIt v3\SciTE\AutoIt3Wrapper SCITE_USERHOME => C:\Users\april\AppData\Local\AutoIt v3\SciTE >Running AU3Check (3.3.14.2) from:C:\Program Files (x86)\AutoIt3 input:C:\Users\april\Documents\Logo\JRB\AutoIt\AutoBOT\AWD10\AWD10.1.au3 +>12:44:11 AU3Check ended.rc:0 >Running:(3.3.14.2):C:\Program Files (x86)\AutoIt3\autoit3.exe "C:\Users\april\Documents\Logo\JRB\AutoIt\AutoBOT\AWD10\AWD10.1.au3" --> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop "C:\Users\april\Documents\Logo\JRB\AutoIt\AutoBOT\AWD10\AWD10.1.au3" (31) : ==> Subscript used on non-accessible variable.: $x = $k[0] $x = $k^ ERROR ->12:44:24 AutoIt3.exe ended.rc:1 +>12:44:24 AutoIt3Wrapper Finished. >Exit code: 1 Time: 13.76 I also tried a simpler code.
      include <IE.au3> #include <MsgBoxConstants.au3> #include <WinAPI.au3> _IECreate("C:\Users\april\Documents\Logo\JRB\AutoIt\AutoBOT\AWD10\sampleAWD10.html",0,1,0) Local $oIE = _IEAttach("", "instance", 1) _IELoadWait($oIE) $k = ControlGetPos("[CLASS:#32770]", "","[CLASS:Button; INSTANCE:2]") $x = $k[0] $y = $k[1] ControlClick("[CLASS:#32770]", "","[CLASS:Button; INSTANCE:2]","primary",1,$x,$y) Local $oLastName = _IEGetObjByName($oIE, "Text4") Local $oGetItem = _IEGetObjByName($oIE, "getitem") _IEAction($oGetItem, "click") MsgBox($MB_SYSTEMMODAL, "Form Element Value", _IEFormElementGetValue($oGetItem)) There's no error in the console output for the 2nd code I have tried.
      And here is the Window Info for the ActiveX prompt.
      >>>> Window <<<< Title: Internet Explorer Class: #32770 Position: 580, 338 Size: 376, 146 Style: 0x94C808C4 ExStyle: 0x00010101 Handle: 0x00000000001516FA >>>> Control <<<< Class: Button Instance: 2 ClassnameNN: Button2 Name: Advanced (Class): [CLASS:Button; INSTANCE:2] ID: 1 Text: &Yes Position: 184, 77 Size: 80, 22 ControlClick Coords: 37, 12 Style: 0x50010000 ExStyle: 0x00000004 Handle: 0x00000000001215DE >>>> Mouse <<<< Position: 228, 120 Cursor ID: 0 Color: 0xFFFFFF >>>> StatusBar <<<< >>>> ToolsBar <<<< >>>> Visible Text <<<< &No An ActiveX control on this page might be unsafe to interact with other parts of the page. Do you want to allow this interaction? &Yes >>>> Hidden Text <<<<  

    • VeryGut
      By VeryGut
      I am unable to access an annyoing pop-up window an press the "No" button. So far I have tried a combination (including using coordinates etc.) of the following:
      ControlClick("[TITLE: Worksite; CLASS: #32770]", "&No", "[CLASS: Button2]")
      Doesnt seem to be working :C
      >>>> Window <<<< Title: WorkSite Class: #32770 Position: 786, 471 Size: 356, 162 Style: 0x94C801C5 ExStyle: 0x00010101 Handle: 0x00000000000209E2 >>>> Control <<<< Class: Button Instance: 2 ClassnameNN: Button2 Name: Advanced (Class): [CLASS:Button; INSTANCE:2] ID: 7 Text: &No Position: 158, 96 Size: 88, 26 ControlClick Coords: 40, 11 Style: 0x50010000 ExStyle: 0x00000004 Handle: 0x000000000004075E >>>> Mouse <<<< Position: 987, 604 Cursor ID: 0 Color: 0x3687CE >>>> StatusBar <<<< >>>> ToolsBar <<<< >>>> Visible Text <<<< &Yes &No Cancel Do you want to save the changes you made to 'TEST.xls'? >>>> Hidden Text <<<<
    • SorryButImaNewbie
      By SorryButImaNewbie
      Hello,
      I'm developing again (everybody ruuun! )
      I would like to develope a script that goes through basicly every user control on a window, and log things that happens, and maybe do some screenshots. I did something like this before.
      My problem, which I would like to avoid this time (to improve my understanding and skill) , was that when I was unable to get a ControlID or handler or anything, I simply did some math and clicked on the coordinates it should have been (for example, maxing the window, and knowing the initial set up I was ablo to calculate given control position). I know that this is a bad solution for a number of reasons. 
      Now I got authorization to install autoIT here, and i started to the work, AU3Info was unable to find anything on the window (this could be a problem, since autoIT doesn't see anything on it then, if I understood the help file) So I got the SimpleSpy script (source:
      )
      I added a bit of code to the original to display ID as well, what I received is this:
      Mouse position is retrieved 115-207
      At least we have an element title: [ADD] class: [Button] ID: [50000] (<-- coded this to display ID here as well)
      Having the following values for all properties: 
      Title is: <ADD>    Class   := <Button>    controltype:= <UIA_ButtonControlTypeId>    ,<50000>    , (0000C350)    10;187;120;35
      *** Parent Information top down ***
      3: Title is: <Compass>    Class   := <Window>    controltype:= <UIA_WindowControlTypeId>    ,<50032>    , (0000C370)    -8;-8;1936;1056
      "Title:=Compass;controltype:=UIA_WindowControlTypeId;class:=Window""    
      2: Title is: <>    Class   := <MainView>    controltype:= <UIA_CustomControlTypeId>    ,<50025>    , (0000C369)    0;23;1920;1017
      "Title:=;controltype:=UIA_CustomControlTypeId;class:=MainView""    
      1: Title is: <>    Class   := <TileNavigationView>    controltype:= <UIA_CustomControlTypeId>    ,<50025>    , (0000C369)    0;23;1920;967
      "Title:=;controltype:=UIA_CustomControlTypeId;class:=TileNavigationView""    
      0: Title is: <>    Class   := <AreasView>    controltype:= <UIA_CustomControlTypeId>    ,<50025>    , (0000C369)    0;132;1920;858
      "Title:=;controltype:=UIA_CustomControlTypeId;class:=AreasView""
       
      so far I wrote this script:
      WinActivate('Test') ;It works!! :D first official interaction Sleep(1000) ;1 sec sleep to be sure ControlClick('Test', '', '50000') If @error Then MsgBox($MB_SYSTEMMODAL, 'Error', 'ControlClick error') EndIf Sleep(1000) MsgBox(1,"Tracer message", 'ControlClick has happened') ;MouseClick() ;ControlCommand() AutoIt activates the window, but the click on the given button doesnt happen (I tried to write 50000 without ' ' on ID).
      M'I doing the @error part correctly ? (no error Msg has been displayed), sorry I rarely use AutoIT and seems to forget less and less after each neglect, but still I'm far from a proffessional
       
      Any help or suggestion is welcome, thank you for your time and insight!
    • ur
      By ur
      if ControlClick("[CLASS:MsiDialogCloseClass]"," ","[CLASS:SysTreeView32; INSTANCE:1]") Then $htreeview=ControlGetHandle($hwnd,"","[CLASS:SysTreeView32; INSTANCE:1]") ControlTreeView($hwnd," ",$htreeview,"Select","#4") The above code worked well to enable the martupgrade feature on windows 7.
      As part of our Installation Testing Automation before delivering the installer to end user.To confirm whether all the screens are working good.

      But it is not working on windows 10.
       
      $h= ControlTreeView($hwnd," ",$htreeview,"Select","#4") The $h is getting value 1,which means error.
    • Gordi300
      By Gordi300
      Hey everyone!! 
      I'm trying to make a program in VB.NET that click inside a picturebox of an app without moving the mouse (using ControlClick).
      My code is this:
      1) ControlClick("Form1", "", "[CLASS:PictureBox; INSTANCE:12]", "left", 1, 5, 5) 2) ControlClick("Form1", "", "[CLASS:PictureBox; INSTANCE:1]", "left", 1, 5, 5) The code is correct  but the problem is that 1) works perfectly and 2) doesn't work. 
      '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
      Here I leave you the summary of each picturebox:
      >>>> Window <<<<
      Title:    Form1
      Class:    Form
      Position:    168, 0
      Size:    1030, 780
      Style:    0x16CA0000
      ExStyle:    0x00040100
      Handle:    0x00000000000B0092
       
      >>>> Control <<<<                PICTUREBOX 12
      Class:    PictureBox
      Instance:    12
      ClassnameNN:    PictureBox12
      Name:    
      Advanced (Class):    [CLASS:PictureBox; INSTANCE:12]
      ID:    28
      Text:    
      Position:    305, 721
      Size:    40, 40
      Style:    0x56010000
      ExStyle:    0x00000004
      Handle:    0x0000000000040520
       
      >>>> Control <<<<                PICTUREBOX 1
      Class:    PictureBox
      Instance:    1
      ClassnameNN:    PictureBox1
      Name:    
      Advanced (Class):    [CLASS:PictureBox; INSTANCE:1]
      ID:    4
      Text:    
      Position:    4, 176
      Size:    700, 533
      Style:    0x56010000
      ExStyle:    0x00000004
      Handle:    0x00000000000E02BE
       
      Thank you for you help!!!