Jump to content

Recommended Posts

Posted

Hi

I have Java 8 installer 

I want to automate it's installation process. 

I have found silent installation method but I want to install it using controls clicking like as normal user do 

But I don't find any control using  AutoIt v3 Window Info 

How I can find it's control buttons ?

Thank you :blink:

Posted

Look for unatentded instalation switches

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted

Thank you dear
although i have found this solution 
like this 
first i have to record it's state 

jdk-8u101-nb-8_1-windows-x64.exe --record state.xml

then i can use like this 

jdk-8u101-nb-8_1-windows-x64.exe --silent --state state.xml

Or 
 

<?xml version="1.0" encoding="UTF-8"?><!--
  DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.

  Copyright 1997-2010 Oracle and/or its affiliates. All rights reserved.

  Oracle and Java are registered trademarks of Oracle and/or its affiliates.
  Other names may be trademarks of their respective owners.

  The contents of this file are subject to the terms of either the GNU General Public
  License Version 2 only ("GPL") or the Common Development and Distribution
  License("CDDL") (collectively, the "License"). You may not use this file except in
  compliance with the License. You can obtain a copy of the License at
  http://www.netbeans.org/cddl-gplv2.html or nbbuild/licenses/CDDL-GPL-2-CP. See the
  License for the specific language governing permissions and limitations under the
  License.  When distributing the software, include this License Header Notice in
  each file and include the License file at nbbuild/licenses/CDDL-GPL-2-CP.  Oracle
  designates this particular file as subject to the "Classpath" exception as provided
  by Oracle in the GPL Version 2 section of the License file that accompanied this code.
  If applicable, add the following below the License Header, with the fields enclosed
  by brackets [] replaced by your own identifying information:
  "Portions Copyrighted [year] [name of copyright owner]"
  
  Contributor(s):
  
  The Original Software is NetBeans. The Initial Developer of the Original Software
  is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun Microsystems, Inc. All
  Rights Reserved.
  
  If you wish your version of this file to be governed by only the CDDL or only the
  GPL Version 2, indicate your decision by adding "[Contributor] elects to include
  this software in this distribution under the [CDDL or GPL Version 2] license." If
  you do not indicate a single choice of license, a recipient has the option to
  distribute your version of this file under either the CDDL, the GPL Version 2 or
  to extend the choice of license to its licensees as provided above. However, if you
  add GPL Version 2 code and therefore, elected the GPL Version 2 license, then the
  option applies only if the new code is made subject to such option by the copyright
  holder.
--><state xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="state-file.xsd">
<components>
        <product platform="windows linux solaris-sparc solaris-x86 macosx-ppc macosx-x86" status="to-be-installed" uid="nb-base" version="8.1.0.0.201510222201">
            <properties>
                <property name="installation.location.windows">C:\Program Files\NetBeans 8.1</property>
                <property name="minimum.jdk.version">1.7.0</property>
                <property name="jdk.location">C:\Program Files\Java\jdk1.8.0_101</property>
                <property name="installation.timestamp">1476539814627</property>
                <property name="start.menu.shortcut.location">all.users</property>
                <property name="installation.location.macosx">$N{install}/NetBeans/NetBeans 8.1.app</property>
                <property name="installation.location">$N{install}/netbeans-8.1</property>
                <property name="desktop.shortcut.location">all.users</property>
                <property name="netbeans.summary.message.text"/>
            </properties>
        </product>
        <product platform="windows-x64" status="to-be-installed" uid="jdk" version="1.8.0.101.1364">
            <properties>
                <property name="jdk.win.installed">true</property>
                <property name="jre.win.installed">true</property>
                <property name="installation.location">$N{install}/jdk1.8.0_101</property>
                <property name="javadb.win.installed">true</property>
                <property name="installation.location.windows">C:\Program Files\Java\jdk1.8.0_101</property>
            </properties>
        </product>
        <product platform="windows linux solaris-sparc solaris-x86 macosx-ppc macosx-x86" status="to-be-installed" uid="nb-extide" version="8.1.0.0.201510222201">
            <properties>
                <property name="show-in-wizard">false</property>
                <property name="installation.location">C:\Program Files\NetBeans 8.1</property>
            </properties>
        </product>
        <product platform="windows linux solaris-sparc solaris-x86 macosx-ppc macosx-x86" status="to-be-installed" uid="nb-javase" version="8.1.0.0.201510222201">
            <properties>
                <property name="jre.allowed">false</property>
                <property name="installation.location">C:\Program Files\NetBeans 8.1</property>
            </properties>
        </product>
    </components>
</state>

But as you know the packege that i have downloaded has JDK/JRE netbeans so it can take too much time for installation.
And a user who don't know much about these things he would be thinking what is going on :P 
so that is way i was thinking to make installer like a normal user install like autoit help contain a example winzip installation :D 
but thank you for reply :D :)

Posted

Did you try JABSimple.Spy on my W10 this works see below on javacpl what is the output of first few lines?

F:\Program Files\Java\jre1.8.0_102
We are using X64 at cpu X64 Autoit 64 bit version 1
  Windows accessbridge 32 opened 1
 0 initializeAccessBridge is finishedWindows_run passed :
+>20:20:53 Starting AutoIt3Wrapper v.14.801.2025.0 SciTE v.3.4.4.0   Keyboard:00020409  OS:WIN_81/  CPU:X64 OS:X64    Environment(Language:0413)
+>         SciTEDir => C:\Program Files (x86)\AutoIt3\SciTE   UserDir => \AppData\Local\AutoIt v3\SciTE\AutoIt3Wrapper   SCITE_USERHOME => \AppData\Local\AutoIt v3\SciTE 
>Running AU3Check (3.3.14.2)  from:C:\Program Files (x86)\AutoIt3  input:\Documents\UIA\JABSimpleSpy.au3
+>20:20:54 AU3Check ended.rc:0
>Running:(3.3.14.2):C:\Program Files (x86)\AutoIt3\autoit3_x64.exe "\Documents\UIA\JABSimpleSpy.au3"    
--> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop
F:\Program Files\Java\jre1.8.0_102
We are using X64 at cpu X64 Autoit 64 bit version 1
  Windows accessbridge 32 opened 1
 0 initializeAccessBridge is finishedWindows_run passed :
0hello  name: <Settings...>
  description: <<html>Modify settings for temporary files</html>>
  role: <push button>
  role_en_US: <push button>
  states: <enabled,focusable,visible,showing,opaque>
  states_en_US: <enabled,focusable,visible,showing,opaque>
  indexInParent: <0>
  childrenCount: <0>
  x: <1028>
  y: <447>
  width: <83>
  height: <0>
0hello  name: <Security>
  description: <>
  role: <page tab>
  role_en_US: <page tab>
  states: <enabled,focusable,visible,showing,focused,selectable>
  states_en_US: <enabled,focusable,visible,showing,focused,selectable>
  indexInParent: <3>
  childrenCount: <1>
  x: <827>
  y: <197>
  width: <50>
  height: <0>

 

 

Posted

may be i am not using it in right way 
but when i run this was the output 

--> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop
C:\Program Files\Java\jre1.8.0_111
We are using X64 at cpu X64 Autoit 64 bit version 1
  Windows accessbridge 32 opened 1
 0 initializeAccessBridge is finishedWindows_run passed :

And on press ctrl + w while mouse was on jdk-8u101-nb-8_1-windows-x64.exe Installer, It returns nothing 
not any thing in Scite output window or not even in Simple UIA Spy Editbox  (Or may be empty response)

Posted (edited)

using controlclick is very not the correct way to install software, it's not very reliable.

Instead use java's silent switch / parameter, to automatic silently install it:

FileGetShortName(@UserProfileDir & "\java.exe /s")

 

I wrote a little function to obtain the link to the latest java version:'

(i'm using psexec to run the java installation as the system user. you may ask why. It's because we are using software restrictions, so to bypass them, I run it as the system account.

;Download and install latest java version


install_latest_java_version()

func install_latest_java_version()
SplashTextOn("Opdater Java", "Vent venligst" & @CRLF & @CRLF & "Installere Java: " & @CRLF & @CRLF & latest_java_version(), -1, -1, -1, -1, "", "", 24)
if FileExists(@UserProfileDir & "\java.exe") then FileDelete(@UserProfileDir & "\java.exe") ;makes sure we gets the

$readtext = InetRead("https://java.com/inc/BrowserRedirect1.jsp?locale=en",1)
$source = BinaryToString($readtext)
$text =  _StringBetween($source,'<a title="Download Java software for Windows Offline" href="', '">')
$latest_version = $text[0]

InetGet($latest_version, @UserProfileDir & "\java.exe")
;RunWait(@UserProfileDir & "\java.exe /s")

_RunDos(FileGetShortName(@UserProfileDir & "\PsExec.exe") & " -i -s /accepteula " & FileGetShortName(@UserProfileDir & "\java.exe /s"))

SplashOff()
EndFunc

;---------------------------------------------------------------------------------------------------------------------------------

;Get the name of latest java version

func latest_java_version()
if FileExists(@UserProfileDir & "\java.exe") then FileDelete(@UserProfileDir & "\java.exe") ;makes sure we gets the

$readtext = InetRead("https://java.com/inc/BrowserRedirect1.jsp?locale=en",1)
$source = BinaryToString($readtext)
$text =  _StringBetween($source,'<h4 class="sub">Recommended ', '</h4>')
$latest_version = $text[0]
Return($latest_version)
EndFunc

 

Edited by legend
  • 4 months later...

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
×
×
  • Create New...