Need Help

  • Vielleicht anstatt

    [autoit]

    ControlClick("Bitte erwerben Sie eine Lizenz für WinRAR", "", "[Class:Button; Textchließen]")

    [/autoit]


    das hier:

    [autoit]

    ControlClick("Bitte erwerben Sie eine Lizenz für WinRAR", "", "[Class:Button;Text schließen]")

    [/autoit]


    oder:

    [autoit]

    Send("{ALTDOWN}{F4}{ALTUP}")

    [/autoit]
  • Hab mir mal auf Basis der rar.exe und tar.exe (+fsum.exe) einen ent/packer geschrieben, ich würde dir auch vorschlagen, steig auf kommandozeile um.
    die datein benötigst du natürlich, bzw du streichst den code einfach.

    oder du machst was eigenes hieraus:

    [autoit]

    ShellExecuteWait(@ScriptDir & "\rar.exe", ' x -o- "' & $Folder[$i] & '"', @ScriptDir, "open", @SW_HIDE)

    [/autoit]


    hier komplett:

    Spoiler anzeigen
    [autoit]

    #NoTrayIcon
    #Include <File.au3>
    #Include <Array.au3>

    [/autoit] [autoit][/autoit] [autoit]

    If $CmdLine[0] <= 0 Then
    _PackTar()
    Else
    Select
    Case $CmdLine[1] = "-kill"
    If $CmdLine[0] = 2 Then
    _Kill($CmdLine[2])
    ElseIf $CmdLine[0] = 1 Then
    _Kill0r()
    EndIf
    Case $CmdLine[1] = "-rar"
    _DePack()
    Case $CmdLine[1] = "+rar"
    If $CmdLine[0] = 4 Then
    _PackRar($CmdLine[2], $CmdLine[3], $CmdLine[4])
    ElseIf $CmdLine[0] = 3 Then
    _PackRar($CmdLine[2], $CmdLine[3])
    ElseIf $CmdLine[0] = 2 Then
    _PackRar($CmdLine[2])
    ElseIf $CmdLine[0] = 1 Then
    _PackRar()
    EndIf
    Case Else
    Exit
    EndSelect
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    Func _PackTar()
    FileInstall("tar.exe", "tar.exe")
    $Folder =_FileListToArray(@ScriptDir, "*", 2)
    If @Error Then Exit
    If $Folder[0] <= 0 Then Exit

    While ProcessExists("tar.exe") Or ProcessExists("rar.exe")
    Sleep(30000)
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    For $i = 1 To $Folder[0]
    ShellExecuteWait(@ScriptDir & "\tar.exe", ' -cf "' & $Folder[$i] & '.tar" ' & $Folder[$i], @ScriptDir, "open", @SW_HIDE)
    Next

    [/autoit] [autoit][/autoit] [autoit]

    _FileCreate(@ScriptDir & '\Fertig mit packen!')
    FileDelete(@ScriptDir & "\tar.exe")
    Exit
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func _DePack()
    FileInstall("rar.exe", "rar.exe")

    $Folder =_FileListToArray(@ScriptDir, "*.rar", 1)
    If @Error Then Exit

    [/autoit] [autoit][/autoit] [autoit]

    While ProcessExists("tar.exe") Or ProcessExists("rar.exe")
    Sleep(30000)
    WEnd

    For $i = 1 To $Folder[0]
    ShellExecuteWait(@ScriptDir & "\rar.exe", ' x -o- "' & $Folder[$i] & '"', @ScriptDir, "open", @SW_HIDE)
    Next

    [/autoit] [autoit][/autoit] [autoit]

    _FileCreate(@ScriptDir & '\Fertig mit entpacken!')
    FileDelete(@ScriptDir & "\rar.exe")
    Exit
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func _PackRar($CmdLine2 = 50, $CmdLine3 = 0, $CmdLine4 = 1)
    FileInstall("rar.exe", "rar.exe")
    FileInstall("fsum.exe", "fsum.exe")

    [/autoit] [autoit][/autoit] [autoit]

    $Folder =_FileListToArray(@ScriptDir, "*")
    If $CmdLine4 > $Folder[0] Then Exit
    If Not $CmdLine3 = 0 Then
    Else
    $CmdLine3 = $Folder[$CmdLine4]
    EndIf
    If @Error Then Exit

    [/autoit] [autoit][/autoit] [autoit]

    While ProcessExists("tar.exe") Or ProcessExists("rar.exe")
    Sleep(30000)
    WEnd

    $bytes = $CmdLine2 * 1000000

    ShellExecuteWait(@ScriptDir & "\rar.exe", ' a -m0 -mdA-G -vn -v' & $bytes & 'b "' & $CmdLine3 & '.rar" "' & $Folder[$CmdLine4] & '"y', @ScriptDir, "open", @SW_HIDE)
    Sleep (1000)
    _FileCreate("SFVBatch.bat")
    FileWrite("SFVBatch.bat", "@echo off" & @CRLF)
    FileWrite("SFVBatch.bat", 'fsum -js "' & $CmdLine3 & '.r*" > "' & $Folder[$CmdLine4] & '.sfv"' & @CRLF)
    FileWrite("SFVBatch.bat", "del SFVBatch.bat")
    ShellExecuteWait(@ScriptDir & "\SFVBatch.bat", "", @ScriptDir, "open", @SW_HIDE)

    _FileCreate(@ScriptDir & '\Fertig mit packen!')
    FileDelete(@ScriptDir & "\rar.exe")
    FileDelete(@ScriptDir & "\fsum.exe")
    Exit
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func _Kill0r()
    Do
    $PIDCMD = ProcessExists("Cmd.exe")
    ProcessClose($PIDCMD)
    Until $PIDCMD = 0
    Do
    $PIDTAR = ProcessExists("tar.exe")
    ProcessClose($PIDTAR)
    Until $PIDTAR = 0
    Do
    $PIDRAR = ProcessExists("rar.exe")
    ProcessClose($PIDRAR)
    Until $PIDRAR = 0
    If _Singleton(@ScriptName, 1) = 0 Then
    Do
    $PID = ProcessExists(@ScriptName)
    If $PID = @AutoItPID Then ContinueLoop
    ProcessClose($PID)
    Until ($PID <> 0)
    EndIf
    Exit
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func _Kill($CmdLine2)
    Do
    $PID = ProcessExists($CmdLine2)
    ProcessClose($PID)
    Until $PID = 0
    EndFunc

    [/autoit]