Sign in to follow this  
Followers 0
jpalmerb

Silently installing program with no window title

8 posts in this topic

Hello,

I've got a problem installing a program silently. The program has prerequisites that if are already installed on the machine you get a window/msg box that says all prerequisites have already been installed. I've tried with autoit to close the window, but it doesn't work because there is no title and using $handle and wingethandle, but it doesn't work. It always then closes the wrong window! This is what I get from the Window info:

>>>> Window <<<<

Title:

Class: #32770

Position: 660, 463

Size: 365, 144

Style: 0x94C801C5

ExStyle: 0x00010101

Handle: 0x000E03CE

>>>> Control <<<<

Class: Button

Instance: 1

ClassnameNN: Button1

Name:

Advanced (Class): [CLASS:Button; INSTANCE:1]

ID: 2

Text: OK

Position: 263, 79

Size: 88, 26

ControlClick Coords: 47, 15

Style: 0x50030000

ExStyle: 0x00000004

Handle: 0x0020017E

>>>> Mouse <<<<

Position: 973, 582

Cursor ID: 0

Color: 0x87CEF0

>>>> StatusBar <<<<

>>>> ToolsBar <<<<

>>>> Visible Text <<<<

OK

Sie müssen keine erforderlichen Komponenten installieren.

>>>> Hidden Text <<<<

I simple just want to click ok!!!

Then I thouht, if this way doesn't work, I could somehow check if these programs are already installed and if not then only run the silent install for that particular program. The programs are:

MS .NET Framework 3.5 SP1

MS VC++ 2005 SP1 Redistributable x86

MS VC++ 2008 Redistributable x86

I have no idea though where to begin with this part. I get easily lost when scripting (unless it's very simple) and this is beyond my creativity scale.

Any help would be so greatly appreciated.

Thank you!

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

While installing :

you can monitor process windows with _WinAPI_EnumProcessWindows

If one is visible you will get his handle for click on it...

Edited by wakillon

AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites

Whats the name of the app? In many instances you can use command line to install your app and also use an answerfile. Second, you could make a script to look for what the installer is looking for. Run that first and then you could use a different install setup to account for the window in question. Hope this makes sense.

Share this post


Link to post
Share on other sites

MS .NET Framework 3.5 SP1

MS VC++ 2005 SP1 Redistributable x86

MS VC++ 2008 Redistributable x86

Check for file exist before attempting the install.

any file will work as long as it's specific to those required.

If FileExists("c:\location of required files") Then
        ;Slient install code goes here I suggest using a func
        Else
            ConsoleWrite(" File Test Failed " & @CR)
            exit 0
        EndIf

A true renaissance man

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

MS .NET Framework 3.5 SP1

MS VC++ 2005 SP1 Redistributable x86

MS VC++ 2008 Redistributable x86

Try checking for them in the registry. If they are in the Uninstall section, you can be reasonably sure that they are installed.

If Not RegKeyExists("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{CE2CDD62-0124-36CA-84D3-9F4DCF5C5BD9}") then _InstallFramework() ;MS .NET Framework 3.5 SP1
If Not RegKeyExists("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{710f4c1c-cc18-4c49-8cbf-51240c89a1a2}") then _InstallVC2005() ;Microsoft Visual C++ 2005 Redistributable
If Not RegKeyExists("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{1F1C2DFC-2D24-3E06-BCB8-725134ADF989}") then _InstallVC2008() ;Microsoft Visual C++ 2008 Redistributable - x86 9.0.30729.4148

Func RegKeyExists($TheKey)
    RegRead($TheKey,"")
    If @Error > 0 Then
        ;Key does not exist
        Return False
    Else
        ;Key does exist
        Return True
    EndIf
EndFunc

If you need to ensure a specific release, then check the Version or DisplayVersion values.

----- Edit -----

You might look here for other GUID codes MS has used.

http://www.gamedev.net/topic/548080-guid-or-product-code-for-visual-c-2008-redistributables/page__p__4530498#entry4530498

Edited by willichan

Share this post


Link to post
Share on other sites

Thank you Willichan, you got us on the right track and now it works!!!!

Try checking for them in the registry. If they are in the Uninstall section, you can be reasonably sure that they are installed.

If Not RegKeyExists("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{CE2CDD62-0124-36CA-84D3-9F4DCF5C5BD9}") then _InstallFramework() ;MS .NET Framework 3.5 SP1
If Not RegKeyExists("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{710f4c1c-cc18-4c49-8cbf-51240c89a1a2}") then _InstallVC2005() ;Microsoft Visual C++ 2005 Redistributable
If Not RegKeyExists("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{1F1C2DFC-2D24-3E06-BCB8-725134ADF989}") then _InstallVC2008() ;Microsoft Visual C++ 2008 Redistributable - x86 9.0.30729.4148

Func RegKeyExists($TheKey)
    RegRead($TheKey,"")
    If @Error > 0 Then
        ;Key does not exist
        Return False
    Else
        ;Key does exist
        Return True
    EndIf
EndFunc

If you need to ensure a specific release, then check the Version or DisplayVersion values.

----- Edit -----

You might look here for other GUID codes MS has used.

http://www.gamedev.net/topic/548080-guid-or-product-code-for-visual-c-2008-redistributables/page__p__4530498#entry4530498

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

Then I thouht, if this way doesn't work, I could somehow check if these programs are already installed and if not then only run the silent install for that particular program. The programs are:

MS .NET Framework 3.5 SP1

MS VC++ 2005 SP1 Redistributable x86

MS VC++ 2008 Redistributable x86

Went through all that work to do something those programs already do! Each already can be silently installed with switches of their own. They also will detect for the presence of them on the system before attempting to install. :mellow:

EDIT: Figured I'd post an example of how I install .Net Framework 4.0:

RunWait (@ComSpec & " /c c:\temp\sbar\dotnetfx40_full_x86_x64.exe /q /norestart")
Edited by Tripredacus

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
Sign in to follow this  
Followers 0