Guest User

Untitled

a guest
Oct 19th, 2017
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 10.50 KB | None | 0 0
  1. Func _audioManager()
  2.     MsgBox(266304, "Audio Manager", "Teste die Audio-Funktionalität und Starte die Audio-Tool.", 0)
  3.  
  4.  
  5.     ; Set volume to 100% (Windows actually does 2 steps increments for the volume)
  6.     Local $i = 0
  7.     While $i <= 50
  8.         Send("{VOLUME_UP}", 0)
  9.         $i = $i + 1
  10.     WEnd
  11.  
  12.     ; Sets the system wave volume to 100%. This controls the Wave volume, not the master volume control. Also, a value of Zero does not set mute status.
  13.     SoundSetWaveVolume(100)
  14.  
  15.     ; Play one of the default sytem sounds
  16.     SoundPlay(@WindowsDir & "\media\tada.wav", 1)
  17.  
  18.     ; Set volume from 100% to 50%
  19.     Local $i = 0
  20.     While $i <= 25
  21.         Send("{VOLUME_Down}", 0)
  22.         $i = $i + 1
  23.     WEnd
  24.  
  25.     ; Sets the system wave volume to 100%. This controls the Wave volume, not the master volume control. Also, a value of Zero does not set mute status.
  26.     SoundSetWaveVolume(100)
  27.  
  28.     ; Play one of the default sytem sounds
  29.     SoundPlay(@WindowsDir & "\media\tada.wav", 1)
  30.  
  31.     ; Set volume to 100% (Windows actually does 2 steps increments for the volume)
  32.     Local $i = 0
  33.     While $i <= 50
  34.         Send("{VOLUME_UP}", 0)
  35.         $i = $i + 1
  36.     WEnd
  37.  
  38.  
  39.     If @OSArch = "X86" Then
  40.         ;insert X86 files after this
  41.         $ProgramFileDir = "Program Files (x86)"
  42.         MsgBox(266304, "Starte Audio Tools", "Audio Tools für " & @OSArch & " wird gestartet", 0)
  43.  
  44.         $realtek = @HomeDrive & "\" & $ProgramFileDir & "\Realtek\Audio\HDA\RAVCpl64.exe"
  45.         $realtek2 = @HomeDrive & "\" & $ProgramFileDir & "\Realtek\Audio\AP\RtkNGUI.exe"
  46.         $smartaudio = @HomeDrive & "\" & $ProgramFileDir & "\CONEXANT\SAII\SmartAudio.exe"
  47.         $ifileexistsrealtek = FileExists($realtek)
  48.         $ifileexistsrealtek2 = FileExists($realtek2)
  49.         $ifileexistssmartaudio = FileExists($smartaudio)
  50.         If $ifileexistsrealtek Then
  51.             ShellExecute($realtek)
  52.         ElseIf $ifileexistsrealtek2 Then
  53.             ShellExecute($realtek2)
  54.         ElseIf $ifileexistssmartaudio Then
  55.             ShellExecute($smartaudio)
  56.         Else
  57.             MsgBox(48, "Nicht vorhanden", "Audio Tools möglichweise nicht installiert !", 0)
  58.         EndIf
  59.  
  60.  
  61.     ElseIf @OSArch = "X64" Then
  62.         $ProgramFileDir = "Program Files"
  63.         MsgBox(266304, "Starte Audio Tools", "Audio Tools für " & @OSArch & " wird gestartet", 0)
  64.         $realtek = @HomeDrive & "\" & $ProgramFileDir & "\Realtek\Audio\HDA\RAVCpl64.exe"
  65.         $realtek2 = @HomeDrive & "\" & $ProgramFileDir & "\Realtek\Audio\AP\RtkNGUI.exe"
  66.         $smartaudio = @HomeDrive & "\" & $ProgramFileDir & "\CONEXANT\SAII\SmartAudio.exe"
  67.         $ifileexistsrealtek = FileExists($realtek)
  68.         $ifileexistsrealtek2 = FileExists($realtek2)
  69.         $ifileexistssmartaudio = FileExists($smartaudio)
  70.         If $ifileexistsrealtek Then
  71.             ShellExecute($realtek)
  72.         ElseIf $ifileexistsrealtek2 Then
  73.             ShellExecute($realtek2)
  74.         ElseIf $ifileexistssmartaudio Then
  75.             ShellExecute($smartaudio)
  76.         Else
  77.             MsgBox(48, "Nicht vorhanden", "Audio Tools möglichweise nicht installiert !", 0)
  78.         EndIf
  79.     Else
  80.         $ProgramFileDir = "Program Files"
  81.         MsgBox(266304, "Starte Audio Tools", "Audio Tools für " & @OSArch & " wird gestartet", 0)
  82.         ;insert x64 files after this
  83.         $realtek = @HomeDrive & "\" & $ProgramFileDir & "\Realtek\Audio\HDA\RAVCpl64.exe"
  84.         $realtek2 = @HomeDrive & "\" & $ProgramFileDir & "\Realtek\Audio\AP\RtkNGUI.exe"
  85.         $smartaudio = @HomeDrive & "\" & $ProgramFileDir & "\CONEXANT\SAII\SmartAudio.exe"
  86.         $ifileexistsrealtek = FileExists($realtek)
  87.         $ifileexistsrealtek2 = FileExists($realtek2)
  88.         $ifileexistssmartaudio = FileExists($smartaudio)
  89.         If $ifileexistsrealtek Then
  90.             ShellExecute($realtek)
  91.         ElseIf $ifileexistsrealtek2 Then
  92.             ShellExecute($realtek2)
  93.         ElseIf $ifileexistssmartaudio Then
  94.             ShellExecute($smartaudio)
  95.         Else
  96.             MsgBox(48, "Nicht vorhanden", "Audio Tools möglichweise nicht installiert !", 0)
  97.         EndIf
  98.     EndIf
  99.  
  100. EndFunc   ;==>_audioManager
  101.  
  102. Func _GetBIOSInfo()
  103.     Local $objWMI, $colItems, $objItem
  104.     Local $sBIOSVersion, $sSerialNumber
  105.     Local $aReturn[3]
  106.     Local $sModelName = '', $sVersion = ''  ; Werte aus $sBIOSVersion
  107.     Local $iPos
  108.     $objWMI = ObjGet("winmgmts:{impersonationLevel=impersonate}!\\" & @ComputerName & "\root\cimv2")
  109.     $colItems = $objWMI.ExecQuery("SELECT * FROM Win32_BIOS", "WQL", 0x10 + 0x20)
  110.     If IsObj($colItems) Then
  111.         For $objItem In $colItems
  112.             $sBIOSVersion = "X751SA.705" ;$objItem.SMBIOSBIOSVersion
  113.             $sManufacturer = $objItem.Manufacturer
  114.             $sSerialNumber = StringReplace(StringReplace($objItem.SerialNumber, "SSN12345678901234567", "Nicht vorhanden !"), "na", "Nicht vorhanden !")
  115.             ; ModelName und Version aus $sBIOSVersion ermitteln :
  116.             ; ----------------------------------------------------
  117.             ; Prüfen, ob in $sBIOSVersion ein Punkt vorkommt, also z.B. X751SA.705
  118.             ; Falls ja :
  119.             ; -> String von hinten auswerten, und beim ersten Vorkommen aufteilen
  120.             ; Falls nicht :
  121.             ; -> $sModelName mit $sBIOSVersion besetzen
  122.             ; -> damit ist $sModelName zwar identisch wie $sBIOSVersion, aber egal.
  123.             ; -> $sVersion leerlassen
  124.             $iPos = StringInStr($sBIOSVersion, '.', 0, -1)
  125.             If $iPos > 0 Then
  126.                 $sModelName = StringLeft($sBIOSVersion, $iPos - 1)
  127.                 $sVersion = StringRight($sBIOSVersion, StringLen($sBIOSVersion) - $iPos)
  128.             Else
  129.                 $sModelName = $sBIOSVersion
  130.             EndIf
  131.             ; Rückgabearray besetzen :
  132.             $aReturn[0] = $sSerialNumber
  133.             $aReturn[1] = $sModelName
  134.             $aReturn[2] = $sVersion
  135.             Return $aReturn
  136.         Next
  137.     Else
  138.         SetError(1)
  139.     EndIf
  140. EndFunc ;==>_GetBIOSInfo
  141.  
  142. Func _BiosCheck($bios, $model)
  143.     $sFile = @WorkingDir & "WTP\finaltest\NB_BIOS.txt"
  144.     $sRead = FileRead($sFile)
  145.     $aString = StringRegExp($sRead, $model & " = (.*)", 3)
  146.     If Not ($bios = $aString[0]) Then
  147.         $bios_check = MsgBox(52, "Bios Version Check", "Bios aktualisieren" & @CRLF & "AKTUELL: " & $bios & @CRLF & "NEU: " & $aString[0] & @CRLF & "WinFlash ausführen ?", 0)
  148.         Switch $bios_check
  149.             Case 6
  150.                 MsgBox(52, "the link is:", $aString[0])
  151.             Case 7
  152.             Case 2
  153.         EndSwitch
  154.     EndIf
  155. EndFunc   ;==>_BiosCheck
  156.  
  157. Func _kbbacklightflash()
  158.     If @OSArch = "X86" Then
  159.         $kbbb = MsgBox(4132, "Keyboard Backlight Flasher " & @CPUArch, "Soll das Keyboard Backlight auf " & @CPUArch & " Ebene geflasht werden?", 0)
  160.         Switch $kbbb
  161.             Case 6 ;YES
  162.                 ShellExecute(@WorkingDir & "WTP\finaltest\kbBacklightFlash.bat.lnk")
  163.             Case 7 ;NO
  164.                 ;Your code here...
  165.         EndSwitch
  166.     ElseIf @OSArch = "X64" Then
  167.         $kbbb = MsgBox(4132, "Keyboard Backlight Flasher " & @CPUArch, "Soll das Keyboard Backlight auf " & @CPUArch & " Ebene geflasht werden?", 0)
  168.         Switch $kbbb
  169.             Case 6 ;YES
  170.                 ShellExecute(@WorkingDir & "WTP\finaltest\kbBacklightFlash64.bat.lnk")
  171.             Case 7 ;NO
  172.                 ;Your code here...
  173.         EndSwitch
  174.     Else
  175.         $kbbb = MsgBox(4132, "Keyboard Backlight Flasher " & @CPUArch, "Soll das Keyboard Backlight auf " & @CPUArch & " Ebene geflasht werden?", 0)
  176.         Switch $kbbb
  177.             Case 6 ;YES
  178.                 ShellExecute(@WorkingDir & "WTP\finaltest\kbBacklightFlash64.bat.lnk")
  179.             Case 7 ;NO
  180.                 ;Your code here...
  181.         EndSwitch
  182.     EndIf
  183. EndFunc   ;==>_kbbacklightflash
  184.  
  185. Func _findkeydef()
  186.     $keydefus = @WorkingDir & "WTP\asus-wtp\bin\keydef\keydef" & $getModelName & "us.ini"
  187.     $keydefeu = @WorkingDir & "WTP\asus-wtp\bin\keydef\keydef" & $getModelName & "eu.ini"
  188.     $ifileexistsus = FileExists($keydefus)
  189.     $ifileexistseu = FileExists($keydefeu)
  190.     If $ifileexistsus Then
  191.         _WinAPI_ShellOpenFolderAndSelectItems($keydefus)
  192.         ShellExecute($keydefus)
  193.     ElseIf $ifileexistseu Then
  194.         _WinAPI_ShellOpenFolderAndSelectItems($keydefeu)
  195.         ShellExecute($keydefeu)
  196.     Else
  197.         MsgBox(16, "Nicht vorhanden", "Es wurde kein Keyboard-Layout gefunden! " & $getModelName, 0)
  198.     EndIf
  199. EndFunc   ;==>_findkeydef
  200.  
  201. Func _fixbios()
  202.     $comparefix = MsgBox(36, "Bios-Fix", "Möchtest du den Bios-Compare-Fix durchführen?", 0)
  203.     Switch $comparefix
  204.         Case 6 ;YES
  205.             $rc = FileCopy(@WorkingDir & "WTP\finaltest\NB_BIOS.txt", @WorkingDir & "WTP\asus-wtp\bin\conf\", 1)
  206.             If $rc > 0 Then
  207.                 MsgBox(64, "Erfolgreich", "Bios-Compare-Fix wurde erfolgreich durchgeführt!", 0)
  208.             Else
  209.                 MsgBox(16, "Fehler", "Bios-Compare-Fix konnte nicht durchgeführt werden!", 0)
  210.             EndIf
  211.         Case 7 ;NO
  212.             ;Your code here...
  213.     EndSwitch
  214. EndFunc   ;==>_fixbios
  215.  
  216. Func _BiosCheat()
  217.     $biosfile = @WorkingDir & "WTP\asus-wtp\bin\conf\NB_BIOS.txt"
  218.     $ifileexist = FileExists($biosfile)
  219.     If $ifileexist Then
  220.         _WinAPI_ShellOpenFolderAndSelectItems($biosfile)
  221.         ShellExecute($biosfile)
  222.     Else
  223.         $comparefix = MsgBox(20, "Nicht vorhanden", "Es wurde kein Bios-File gefunden? Soll der Compare-Fix ausgeführt werden?", 0)
  224.         Switch $comparefix
  225.             Case 6 ;YES
  226.                 _fixbios()
  227.             Case 7 ;NO
  228.                 ;Your code here...
  229.         EndSwitch
  230.     EndIf
  231. EndFunc   ;==>_BiosCheat
  232.  
  233. Func _2ndinjection()
  234.     $serial = StringStripWS($getSerial, 8)
  235.     MsgBox(64, "Seriennummer", "Die Seriennummer " & $serial & " wurde in die Zwischenablage kopiert!", 0)
  236.     ClipPut($serial)
  237. EndFunc   ;==>_2ndinjection
  238.  
  239. Func _tpInstall()
  240.     $sinstall = MsgBox(49, "Touchpad", "Soll der Touchpad-Treiber nachinstalliert werden?" & @CRLF & "" & @CRLF & "1. Touchpad-Treiber wird zwangsweise deinstalliert." & @CRLF & "2. Touchpad-Treiber wird nachinstalliert." & @CRLF & "" & @CRLF & "Sollte nach der Installation weiterhin keine Reaktion im Touchpad-Test gezeigt werden, einmal das Gerät neustarten.", 0)
  241.     Switch $sinstall
  242.         Case 1 ;OK
  243.             ShellExecute(@WorkingDir & "WTP\finaltest\tp\uninstall.bat.lnk")
  244.         Case 2 ;CANCEL
  245.             ;Your code here...
  246.     EndSwitch
  247. EndFunc   ;==>_tpInstall
  248.  
  249. Func _dragsysprepwindow()
  250.     Local $alang[5][2]
  251.     $stext = "(Sysprep)"
  252.     $ifound = _ArraySearch($alang, @OSLang)
  253.     If $ifound <> -1 Then $stext = $alang[$ifound][1]
  254.     WinWait("[CLASS:#32770]", $stext)
  255.     $hwnd = WinGetHandle("[CLASS:#32770]", $stext)
  256.     $apos = WinGetPos($hwnd)
  257.     WinMove($hwnd, "", @DesktopWidth - $apos[2] - 15, @DesktopHeight - $apos[3] - (@DesktopHeight - 267 - 15))
  258. EndFunc   ;==>_dragsysprepwindow
  259.  
  260. Func _dragwindowsactivewindow()
  261.     WinWait("[CLASS:#32770; TITLE:WindowsActive]")
  262.     $hwnd = WinGetHandle("[CLASS:#32770; TITLE:WindowsActive]")
  263.     $apos = WinGetPos($hwnd)
  264.     WinMove($hwnd, "", @DesktopWidth - $apos[2] - 15, @DesktopHeight - $apos[3] - (@DesktopHeight - 284 - 267 - 10 - 15))
  265. EndFunc   ;==>_dragwindowsactivewindow
  266.  
  267. Func _dragfinaltesttoolswindow()
  268.     WinWait("[TITLE:Final Test Tools v3]")
  269.     $hwnd = WinGetHandle("[TITLE:Final Test Tools v3]")
  270.     $apos = WinGetPos($hwnd)
  271.     WinMove($hwnd, "", @DesktopWidth - $apos[2] - (@DesktopWidth - 430 - 12), @DesktopHeight - $apos[3] - (@DesktopHeight - 499 - 269 - 25))
  272. EndFunc   ;==>_dragfinaltesttoolswindow
Add Comment
Please, Sign In to add comment