Sign in to follow this  
Followers 0
Guest chi77

need help

4 posts in this topic

#1 ·  Posted (edited)

hi all,

my first one is finished :-) if someone knows how to tune it up a little bit... you´re welcome. i´m sure there are a lot of mistakes in - but working... pls help me to get better :-) cheers, chi

... when u start it checks some values like os, screenresolution, directx,... and if the rwviewer.exe exists on @programfilesdir\test . if exists - plays a demofile with rwviewer.exe.... if not - it downloads the viewer from the internet / install it / and plays the demofile with rwviewer.exe ... thats all, thx

#include <GuiConstants.au3>
#NoTrayIcon

Opt("RunErrorsFatal", 0)

$osv = @OSVersion
$dwidth = @DesktopWidth
$dhight = @DesktopHeight
$drefresh = @DesktopRefresh
$ddepth = @DesktopDepth
$dxver = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\DirectX", "Version")
$viewerfound = ("ver 1.9.885")
;thx wus :-)
global $crtset
$crtset = RegEnumKey ( "HKEY_LOCAL_MACHINE\SYSTEM", 1)
dim $vide, $vidcard
$vide = "HKEY_LOCAL_MACHINE\SYSTEM\" & $crtset & "\Control\Class\{4D36E968-E325-11CE-BFC1-08002BE10318}\0000"
$vidcard = "" & regread ( $vide , "driverdesc" )
;thx end

If $dxver = ("4.09.00.0904") Then
    $dxver = ("9.0c")
EndIf

If $dxver = ("4.09.00.0903") Then
    $dxver = ("9.0c")
EndIf

If $dxver = ("4.09.00.0902") Then
    $dxver = ("9.0b")
EndIf

If $dxver = ("4.09.00.0901") Then
    $dxver = ("9.0a")
EndIf

If $dxver = ("4.09.00.0900") Then
    $dxver = ("9.0")
EndIf

If $dxver = ("4.08.02.0134") Then
    $dxver = ("8.2")
EndIf

If $dxver = ("4.08.01.0901") Then
    $dxver = ("8.1a/b")
EndIf

If $dxver = ("4.08.01.0881") Then
    $dxver = ("8.1")
EndIf

If $dxver = ("4.08.01.0810") Then
    $dxver = ("8.1")
EndIf



GuiCreate("KompatibilitätsCheck", 320, 315,(@DesktopWidth-320)/2, (@DesktopHeight-315)/2 , $WS_OVERLAPPEDWINDOW + $WS_VISIBLE)
GuiCtrlCreateLabel("Betriebssystem  =", 10, 17, 122, 19, $SS_RIGHT)
GuiCtrlCreateLabel("Bildschirmauflösung  =", 10, 42, 122, 19, $SS_RIGHT)
GuiCtrlCreateLabel("Farbtiefe  =", 10, 67, 122, 19, $SS_RIGHT)
GuiCtrlCreateLabel("DirectX Version  =", 10, 92, 122, 19, $SS_RIGHT)
GuiCtrlCreateLabel("Grafikkarte  =", 10, 117, 122, 19, $SS_RIGHT)
GuiCtrlCreateLabel("Test-Browser  =", 10, 182, 122, 19, $SS_RIGHT)
GuiCtrlCreateInput("", 140, 15, 90, 19,$ES_READONLY)
GuiCtrlCreateInput("",140, 40, 33, 19,$ES_READONLY)
GuiCtrlCreateLabel("x", 179, 43)
GuiCtrlCreateInput("", 190, 40, 33, 19,$ES_READONLY)
GuiCtrlCreateLabel("@", 228, 43)
GuiCtrlCreateInput("", 190, 40, 33, 19,$ES_READONLY)
GuiCtrlCreateLabel("Hz", 280, 43)
GuiCtrlCreateInput("", 245, 40, 33, 19,$ES_READONLY)
GuiCtrlCreateLabel("Bit", 176, 68)
GuiCtrlCreateInput("",140, 65, 33, 19)
GuiCtrlCreateInput("",140, 90, 90, 19)
GuiCtrlCreateInput("",140, 115, 138, 46)
GuiCtrlCreateInput("",140, 180, 82, 19)
Sleep(100)
GuiCtrlCreateInput($osv,140, 15, 90, 19, $ES_READONLY + $SS_CENTER)
Sleep(300)
GuiCtrlCreateInput($dwidth,140, 40, 33, 19, $ES_READONLY + $SS_CENTER)
GuiCtrlCreateInput($dhight,190, 40, 33, 19, $ES_READONLY + $SS_CENTER)
GuiCtrlCreateInput($drefresh,245, 40, 33, 19, $ES_READONLY + $SS_CENTER)
Sleep(300)
GuiCtrlCreateInput($ddepth,140, 65, 33, 19, $ES_READONLY + $SS_CENTER)
Sleep(600)
GuiCtrlCreateInput($dxver ,140, 90, 90, 19, $ES_READONLY + $SS_CENTER)
Sleep(600)
GuiCtrlCreateInput("" & $vidcard ,140, 115, 138, 46, $ES_READONLY + $SS_CENTER + $ES_MULTILINE)
Sleep(600)
If FileExists(@ProgramFilesDir & "\Test\RWViewer.exe") = 0 Then
    $viewerfound = ("nicht installiert")
EndIf
GuiCtrlCreateInput($viewerfound,140, 180,82, 19, $ES_READONLY + $SS_CENTER)
Sleep(800)




If FileExists(@ProgramFilesDir & "\Test\RWViewer.exe") Then
    GUICtrlCreateLabel("Check abgeschlossen... starte Demo", 65, 241)
    FileCopy("demo.exe", @ProgramFilesDir & "\Test")
    FileCopy("demo.rwd", @ProgramFilesDir & "\Test")
    FileCopy("demo.rwi", @ProgramFilesDir & "\Test")
    FileCopy("demo.cfg", @ProgramFilesDir & "\Test")
    FileCopy("debug.out", @ProgramFilesDir & "\Test")
    Run(@ProgramFilesDir & "\Test\RWViewer.exe demo.rwd", "")
    ProcessSetPriority("RWViewer.exe", 4)
    WinWaitActive("Currently Playing")
    WinMove("Currently Playing","",(@DesktopWidth-234)/4, (@DesktopHeight-130)/4)

Exit

Else

    GuiCreate("Test Downloader", 234, 130,(@DesktopWidth-234)/2, (@DesktopHeight-130)/2 , $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS)
$downloadedSoFarInput = GUICtrlCreateInput(0, 28, 55, 30, 20, $ES_RIGHT + $ES_READONLY)
$downloadedSoFar = GUICtrlCreateLabel("MB / 1.59MB heruntergeladen...", 60, 58, 200)
    GUICtrlCreateLabel("Test-Browser wurde nicht gefunden", 16, 22)
$button = GUICtrlCreateButton("Download", 40, 97, 60, 20, $BS_CENTER + $BS_VCENTER + $BS_DEFPUSHBUTTON)
$cancel = GUICtrlCreateButton("Cancel", 130, 97, 60, 20, $BS_CENTER + $BS_VCENTER)
    GUICtrlSetState($cancel, $GUI_DISABLE)
$progressBar = GUICtrlCreateProgress(10, 80, 214, 10)
    GUISetState()
EndIf



While 1
        $msg = GUIGetMsg()
    If $msg = $GUI_EVENT_CLOSE Then
        InetGet("abort")
        FileDelete(@ProgramFilesDir & "\Test\ViewerSetup.exe")
        MsgBox(64, "Fehler", "Ohne Test-Browser kann die Datei nicht geöffnet werden...")
        FileDelete(@ProgramFilesDir & "\Test\ViewerSetup.exe")
    ExitLoop
    EndIf

    If $msg = $cancel Then
        InetGet("abort")
        FileDelete(@ProgramFilesDir & "\Test\ViewerSetup.exe")
    EndIf

   If $msg = $button Then
      Call("download")
      GUICtrlSetState($button, $GUI_DISABLE)
      GUICtrlSetState($cancel, $GUI_ENABLE)
  EndIf
WEnd

Func download()
    DirCreate(@ProgramFilesDir & "\Test")
    Global $size = InetGetSize("http://www.mysite.com/ViewerSetup.exe")
    InetGet("http://www.mysite.com/ViewerSetup.exe", @ProgramFilesDir & "\Test\ViewerSetup.exe", 1, 1)
    AdlibEnable("progress", 1000)
EndFunc ;==>download


Func progress()
If @InetGetActive Then

    GUICtrlSetData($downloadedSoFarInput, StringFormat("%.2f", (@InetGetBytesRead / 1024) / 1024))
    GUICtrlSetData($progressBar, (@InetGetBytesRead / $Size) * 100)

EndIf


If @InetGetActive = 0 Then
    GUICtrlSetState($button, $GUI_ENABLE)
    GUICtrlSetState($cancel, $GUI_DISABLE)
    AdlibDisable()
    if FileGetSize(@ProgramFilesDir & "\Test\ViewerSetup.exe") = $Size Then
    GUICtrlSetState($button, $GUI_DISABLE)
    GUICtrlSetState($cancel, $GUI_DISABLE)
    RunWait(@ProgramFilesDir & "\Test\ViewerSetup.exe")
    FileDelete(@ProgramFilesDir & "\Test\ViewerSetup.exe")
    FileCopy("demo.exe", @ProgramFilesDir & "\Test")
    FileCopy("demo.rwd", @ProgramFilesDir & "\Test")
    FileCopy("demo.rwi", @ProgramFilesDir & "\Test")
    FileCopy("demo.cfg", @ProgramFilesDir & "\Test")
    FileCopy("debug.out", @ProgramFilesDir & "\Test")
    FileCreateShortcut(@ProgramFilesDir & "\Test\demo.exe",@DesktopDir & "\RWDemo.lnk",@ProgramFilesDir & "\Test\","", "Test RWDemo", "", "", "")
    Run(@ProgramFilesDir & "\Test\RWViewer.exe demo.rwd", "")
    ProcessSetPriority("RWViewer.exe", 4)
    WinWaitActive("Currently Playing")
    WinMove("Currently Playing","",(@DesktopWidth-234)/4, (@DesktopHeight-130)/4)
    Exit
EndIf
EndIf
EndFunc ;==>progress
Exit
Edited by chi77

Share this post


Link to post
Share on other sites



Clean up a bit

could use and tags (reverse those) ... that would clean it up a bit (for the forum at least. :whistle: )

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites

could use and tags (reverse those) ... that would clean it up a bit (for the forum at least.  :whistle: )

<{POST_SNAPBACK}>

could also (just for laughs) say what it is supposed to do? i see that it's playing with registry, changing versions etc... is this a driver updater? or something that just mucks around with registry values to see what happens? Just because not everybody wants to read through all of your code to figure out the purpose of it, and i'm definitely not going to just run it to see what happens.

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

there´s a problem with the "GuiCtrlCreateInput"... when u click in it - the text is gone ?!?... i´m sure its because i createt first some empty inputs - but i dont know how to solve this better ....

omg sorry for my bad english ... should listened more in school

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