Jump to content
theak

Detecting 32 vs 64 install button instances

Recommended Posts

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

This seems to be the info, if it is for the same version:

https://www-01.ibm.com/support/knowledgecenter/ssw_ibm_i_71/rzaij/rzaijinstldvd.htm

 

Share this post


Link to post
Share on other sites

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

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

    • By ozymandius257
      I'm trying to check the status of the checkbox for sharing a folder that you see when you right-click on a  folder, go to the sharing tab, then click on Advanced Sharing.

      The check box is labelled Share this folder, and looking at it using AutoIt window info, I get the following information..
      >>>> Control <<<<
      Class:    Button
      Instance:    1
      ClassnameNN:    Button1
      Name:    
      Advanced (Class):    [CLASS:Button; INSTANCE:1]
      ID:    1020
      Text:    &Share this folder
      Position:    15, 16
      Size:    306, 13
      ControlClick Coords:    57, 4
      Style:    0x50010003
      ExStyle:    0x00000004
      Handle:    0x0000000000420A52
      I'm using the following code..
      If ControlCommand("Sharing","","[CLASS:Button; INSTANCE:1]","IsChecked","") = 0 Then
          MsgBox(0, "", "not checked")
      Else
          MsgBox(0, "", "checked")
      EndIf
      But this insists the check box isn't checked when it is.  I have also tried ControlCommand("Sharing","","[ID:1020]","IsChecked","") and ControlCommand("Sharing","","Share this folder","IsChecked","") and ControlCommand("Sharing","","&Share this folder","IsChecked",""), with no joy.
       
      Any ideas?
    • By basictheprogram
      #include <Constants.au3> Func Install()    ConsoleWrite("Install EasyLog" & @LF)    Local $handle = WinWaitActive("EasyLog USB Device Driver Installer")    ConsoleWrite("Install EasyLog2 " & $handle & @LF)    Local $blah = ControlClick($handle, "", "[CLASS:Button; INSTANCE:1]", "Left", 1)    ConsoleWrite("Install EasyLog3 " & $blah & @LF)    WinClose($handle) EndFunc Install() ConsoleWrite("End of Install!" & @LF) Trying to get AutoIt to click "Install" on the EasyLogUSB Device Driver Installer window.
      Console displays:
      Install EasyLog
      Install EasyLog2 0x001B041E
      Install EasyLog3 1
      End of Install!
      Windows Info confirms the Handle is 0x001B041E

      Window Info for the Control

      For the life of me I cannot figure out why the script is not working. 
      Even $blah says the ControlClick succeeded.
      I've tried Send("{ENTER}") and MouseClick() those didn't work either.
      Any help would be appreciated.
      Thanks.
    • By AutoPM
      #RequireAdmin AutoItSetOption('MouseCoordMode', 0) If WinExists("newtitle") Then ControlClick('newtitle', '', 'Button1') EndIf a Simple script to click Button on GUI with title "newtitle". this script is working fine on my laptop on [windows 10, windows 7]
      but on a different laptop. script is not clicking this button, is there any alternative to control click then please tell. don't want to use mouseclick 
       
      Thank you
    • By tentacole
      Afternoon!
      This is my first post, so I apologize if this is in the wrong place. 
      I've created a while loop to click in a certain area of an application, and have the y axis change at the end of each loop. My loop continues to click at x:27, x:10, even though the $y is adding 15 at the end of each loop. I did a Send($x) and Send($y) into a Notepad to see if the $y had changed after each loop, and the 15 was being added to $y each loop. (If this makes sense)
       
      I'm unsure where I'm going wrong, and would be extremely grateful if someone can point me in the correct direction to fix this. 
      Local $rDirectory = "H:\oDemandProject\fList.txt" Local $rLine = _FileCountLines($rDirectory) Local $x = 27 Local $y = 10 While $rline > 0 WinActivate("OnDemand", "-> 1") WinWaitActive("OnDemand", "-> 1") ControlClick("OnDemand", "", "[CLASS:AfxFrameOrView120u; INSTANCE:1]", "left", 4, $x, $y) $y += 15 $rLine -= 1 WEnd  
    • 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???
×
×
  • Create New...