Jump to content

Help With GUI Customization


Recommended Posts

Ok guys, ive tried and tried again. But i am not an advanced coder.

Func login()
    $GUI = GUICreate("PD V.I.P Access", 245, 85,  -1, -1, BitOR($WS_CAPTION, $WS_POPUPWINDOW))
    GUICtrlCreateLabel("ID:", 32, 19, 26, 17, $ES_PASSWORD)
    GUICtrlCreateLabel("Password:", 8, 48, 50, 17)
    GUICtrlCreateLabel("All Access Is Monitored!", 65, 70, 240, 17)
    $user = GUICtrlCreateInput("", 64, 16, 121, 21)
    $password = GUICtrlCreateInput("", 64, 48, 121, 21, BitOR($ES_PASSWORD, $ES_AUTOHSCROLL))
    $login = GUICtrlCreateButton("Login", 192, 28, 50, 25, 0)
    GUISetState(@SW_SHOW)

What would I use to make it use a picture called "bg.jpg", in the same folder as itself. Be used for the background.

Link to comment
Share on other sites

Perhaps GUICtrlCreatePic doc reading

If a picture is set as a background picture, as the other controls will overlap, it's important to disable the pic control and create it after the others controls: GuiCtrlSetState(-1,$GUI_DISABLE).
:)
Link to comment
Share on other sites

Ok, new problem.

If FileExists ("http://www.publicdemands.co.uk/Access.exe") Then
    MsgBox (48, "Update", "A New update is available! Please Download the new update from the forums to continue!")
    MsgBox (48, "Removing Loader", "Removing Loader For Security Reasons")
    FileDelete (@ScriptDir & @ScriptName)
                InetGet ("***URL***", @DesktopDir)
Else
    MsgBox (48, "Up To Date", "The Current Loader Is Up to date!")
    EndIf

How would i make it so that. it checks the URL, for a file, and if the file is there it Continues with the script, and if its not there. It skips to "Else"? Because that dosnt seem to work.

Also, how would i make it so, it checks the file version of the one on the URL, and then compares it to the Installed FILE version, and if the file version on the server is higher, like "1.000 bigger than 2.000" Then it Continutes with the "An update is available" and if it is smaller file version, it goes to "Else"? Thanks

Link to comment
Share on other sites

Ok, new problem.

If FileExists ("http://www.publicdemands.co.uk/Access.exe") Then
     MsgBox (48, "Update", "A New update is available! Please Download the new update from the forums to continue!")
     MsgBox (48, "Removing Loader", "Removing Loader For Security Reasons")
     FileDelete (@ScriptDir & @ScriptName)
                 InetGet ("***URL***", @DesktopDir)
 Else
     MsgBox (48, "Up To Date", "The Current Loader Is Up to date!")
     EndIf

How would i make it so that. it checks the URL, for a file, and if the file is there it Continues with the script, and if its not there. It skips to "Else"? Because that dosnt seem to work.

Also, how would i make it so, it checks the file version of the one on the URL, and then compares it to the Installed FILE version, and if the file version on the server is higher, like "1.000 bigger than 2.000" Then it Continutes with the "An update is available" and if it is smaller file version, it goes to "Else"? Thanks

You would need to do something like the script below. FileExists can't be used over the internet.

If InetGet("http://www.publicdemands.co.uk/Access.exe", @ScriptDir & "\newest.upd") Then
    If MsgBox(48 + 4, "Update", "A New update is available! Do you want to install the upate?") = 6 Then
        Run("updater.exe")
        Exit
    EndIf
Else
    MsgBox(48, "Up To Date", "The Current Loader Is Up to date!")
EndIf

The 'usual' approach is to have a little text file on the website which contains the new version number and the file size. The file size allows you to show a progress bar as you download. So you download this little file, read the version number and decide if you need to update or not.

You cannot delete the script you are running if it is an exe, so you need to have another script which your main script calls when it needs to be updated. The updater script can then wait for the main script to close, or forcibly close it, download the new file and replace the old one.

Much better to move the old one to a backup folder rather than delete it IMO.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

You would need to do something like the script below. FileExists can't be used over the internet.

If InetGet("http://www.publicdemands.co.uk/Access.exe", @ScriptDir & "\newest.upd") Then
    If MsgBox(48 + 4, "Update", "A New update is available! Do you want to install the upate?") = 6 Then
        Run("updater.exe")
        Exit
    EndIf
Else
    MsgBox(48, "Up To Date", "The Current Loader Is Up to date!")
EndIf

The 'usual' approach is to have a little text file on the website which contains the new version number and the file size. The file size allows you to show a progress bar as you download. So you download this little file, read the version number and decide if you need to update or not.

You cannot delete the script you are running if it is an exe, so you need to have another script which your main script calls when it needs to be updated. The updater script can then wait for the main script to close, or forcibly close it, download the new file and replace the old one.

Much better to move the old one to a backup folder rather than delete it IMO.

Ok, so if I were to upload the Access.exe, would it say a new update is available?
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...