Jump to content

Autoit Otomatik Program Kurdurmak


johncher
 Share

Recommended Posts

Microsoftun Visual C 2010 gibi eklentilerini otomatik kurduruyorum. Ancak daha önce kurulu olan varsa hata verip exe duruyor.

WinWait($title,$text)  ;başlık ve texti bekliyor. Ben burada text ve text2 kodları if döngüsüyle nasıl farklılaştırabilirim. Program kurulu değilse üstteki gibi kurulu ise alttaki resimdeki gibi, kodlar resimlerden sonra şimdiden çok sağolun.

Spoiler

OQv4yI.jpg

Spoiler

OQzViN.jpg

 

#RequireAdmin
Opt("TrayMenuMode",1)
TraySetToolTip("Programınız Kuruluyor Lütfen Bekleyiniz..")
$titles="Ek Programlar"
TrayTip("Ek Programların Kurulumuna Başlandı..","....",5,1)
;************************************************************************************************************
$title="Microsoft Visual C++ 2010  x86 Redistributable Setup"
$text="I have read and &accept the license terms."
$text1="Installation Is Complete"
$text2="&Repair Microsoft Visual C++ 2010  x86 Redistributable to its original state." ;kurulu ise

ShellExecute(@WorkingDir & "\vcredist_x86.exe") ;burda kurulum başlıyor
WinWait($title,$text)  ;başlık ve texti bekliyor. Ben burada text ve text2 kodları if döngüsüyle nasıl farklılaştırabilirim.
WinSetTrans($title,$text,0)
ControlClick($title,$text,"Button3")
ControlClick($title,$text,"Button6")

WinWait($title,$text1)
WinSetTrans($title,$text1,0)
ControlClick($title,$text1,"Button8")
sleep(1000)

; burdada diğer microsoft eklentilerini kurdurmaya aynı şekilde devam ediyor

 

Link to comment
Share on other sites

ben biraz armadan sonra regedit te aratarak programın bilgisayarda olup olmadığına bakıp varsa direk kurdurmadan diğer programa geçmek için kullanabileceğim kodu buldum lazım olan varsa benim kadar aramasın, iyi geceler

if _IsInstalled($SearchFor_1)=false then

    ;false geldiğinden kurulu olmadığı anlaşılıyor burda kurduracağım.

endif

$title="Microsoft Visual C++ 2010  x86 Redistributable"

    Const $SearchFor_1 = $title


    MsgBox(0, "Search Results", "Search for '" & $SearchFor_1 & "' AddRemove Programs entry result: " & @CRLF & _IsInstalled($SearchFor_1)) 
; true yada false değer dönüyor _IsInstalled($SearchFor_1) 'de


#Region #include <AddRemove.au3>
    #include-once

    Func _IsInstalled($DisplayName)

        Local $i = 1

        If @AutoItX64 Then; Adjust for x64 process
            Local $RegPath = "\Microsoft\Windows\CurrentVersion\Uninstall"
            Local $RegRoot86 = "HKLM\SOFTWARE\Wow6432Node"
            Local $RegRoot64 = "HKLM64\SOFTWARE"
        Else; Adjust for x86 process
            Local $RegPath = "\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"
            Local $RegRoot86 = "HKLM"
            Local $RegRoot64 = "HKLM64"
        EndIf

        $IsSoftwareFound = __RegBranchSearch($RegRoot86 & $RegPath, 'DisplayName', $DisplayName);   <== Search the 32 bit registry

        If $IsSoftwareFound Then Return True
        If @ProcessorArch = "X86" Then Return False;    <== We are done if OS Arch is x86

        ;## If we are here then the current OS Arch is 64 bit and the script is running as a 32 bit process.

        $IsSoftwareFound = __RegBranchSearch($RegRoot64 & $RegPath, 'DisplayName', $DisplayName);   <== Search the 64 bit registry

        If $IsSoftwareFound Then Return True
        Return False
    EndFunc   ;==>_IsInstalled

    #Region Internal Use Only
        Func __RegBranchSearch($RegPath, $RegName, $RegValue)
            Local $RegKey, $ThisRegValue
            Local $i = 1

            Do
                $RegKey = RegEnumKey($RegPath, $i)
                If @error <> 0 Then ExitLoop

                $ThisRegValue = RegRead($RegPath & '\' & $RegKey, $RegName)

                If StringInStr($ThisRegValue, $RegValue) <> 0 Then Return True

                $i += 1
            Until @error <> 0
            Return False
        EndFunc
    #EndRegion Internal Use Only
#EndRegion #include <AddRemove.au3>

 

  • Thanks 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...