Jump to content

Recommended Posts

Posted

Does someone have a script to update you're program...

Thanks

Well that depends on the program. If you are talking about AutoIt then there is AutoUpdateIt. (Should be included in your installation. Under Extras menu in the start menu).

If you are talking about some random program then I suggest you search the Scripts and Scraps forum for an already written and shared script for updating "said" program.

JS

AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Posted

Well that depends on the program. If you are talking about AutoIt then there is AutoUpdateIt. (Should be included in your installation. Under Extras menu in the start menu).

If you are talking about some random program then I suggest you search the Scripts and Scraps forum for an already written and shared script for updating "said" program.

JS

It for a random program, I did search the site, but with the search "update program" it came up with 1000. and con't find a good one (in the first 100) so any sugestions?
Posted

I use a stub for all my apps.

Call it yourapp.com

When run, it downloads the latest version of your app (only if its newer than the one on the system) and runs it.

Here is the code change it for your own use

#Include <Constants.au3>
#include<guiconstants.au3>
#include<File.au3>
#NoTrayIcon

$filestoget='http://www.qualit-uk.com/servers/download/eaengine.exe'
$filestosave='eaengine.exe'
update()

if FileExists(@TempDir&"\eaengine.exe") Then
$size = FileGetSize(@TempDir&"\eaengine.exe")
if $size=0 Then FileDelete(@TempDir&"\eaengine.exe")
EndIf

if FileExists(@TempDir& "\eaengine.exe") Then
    SplashOff()
    
    $auto=0
if $cmdline[0] > 0 Then
If $CmdLine[1] = "/auto" then $auto=1
endif
    if $auto = 1 Then 
    run(@tempdir&"\eaengine.exe /auto", @TempDir)
Else
    run(@tempdir&"\eaengine.exe", @TempDir)
Endif
    
else
        SplashOff()
        msgbox(262144,"EaseVPN","An error occurred contacting Qual-IT. This software requires a working Internet connection and needs" &@crlf&"to login to the Qual-IT Server in order to connect you to your own server."&@crlf&@crlf&"Please try again later or contact Qual-IT support at support@qualit-uk.com.",120)

EndIf

; Download any updated files with a progress GUI
func Update ()
    $prog = GuiCreate('EaseVPN is updating...', 228, 103,-1, -1 , BitOR($WS_DLGFRAME, $WS_CLIPSIBLINGS, $WS_BORDER))
    $Progress_1 = GuiCtrlCreateProgress(10, 40, 210, 50)
    $Label_2 = GuiCtrlCreateLabel("Downloading updates...", 10, 10, 210, 20)
    $remotesize=InetGetSize ( $filestoget )
    $localsize=Filegetsize(@TempDir & "\" & $filestosave)
    if $localsize <> $remotesize then
        GuiSetState()
        InetGet($filestoget, @TempDir & "\" & $filestosave, 1, 1)
        While @InetGetActive
            $lastupdate=$filestosave
            GUICtrlSetData($Progress_1, (100 / $remotesize * @InetGetBytesRead) )
            GuiCtrlSetData ($Label_2 , $filestosave & " Updating! = " & @InetGetBytesRead )
            Sleep(10)
        Wend
    endif
GUIDelete($prog)
EndFunc
Posted

You don't need any other suggestions. My code is the dogs dangly bits

and when get the program copied to its dir... beacause now it is on the dir Temp..but it must go te program files/...
Posted

This is my script, given to you as a gesture of good will to help you. You will have to put some effort in im not going to write yours for you!

As I said change it around for your own use, replace @tempdir with @programfilesdir or whatever you like @programfilesdir & '\myapp\' etc

Posted

This is my script, given to you as a gesture of good will to help you. You will have to put some effort in im not going to write yours for you!

As I said change it around for your own use, replace @tempdir with @programfilesdir or whatever you like @programfilesdir & '\myapp\' etc

ok thank you
  • 4 years later...
Posted

Update Function Updated to use inetgetinfo:

Replace in Script above:

func Update ()
    $WS_DLGFRAME=0x00400000;
    $WS_CLIPSIBLINGS=0x04000000;
    $WS_BORDER=0x00800000;

    $prog = GuiCreate('EaseVPN is updating...', 228, 103,-1, -1 , BitOR($WS_DLGFRAME, $WS_CLIPSIBLINGS, $WS_BORDER))
    $Progress_1 = GuiCtrlCreateProgress(10, 40, 210, 50)
    $Label_2 = GuiCtrlCreateLabel("Downloading updates...", 10, 10, 210, 20)
    $remotesize=InetGetSize ( $filestoget )
    $localsize=Filegetsize(@TempDir & "\" & $filestosave)
    if $localsize <> $remotesize then
        GuiSetState()
        $hDownload= InetGet($filestoget, @TempDir & "\" & $filestosave, 1, 1)
        ; While @InetGetActive
        Do
            $lastupdate=$filestosave
            GUICtrlSetData($Progress_1, (100 / $remotesize *  inetgetinfo($hDownload,0) ) )
            GuiCtrlSetData ($Label_2 , $filestosave & " Updating! = " & inetgetinfo($hDownload,0) )
            Sleep(10)
        ; Wend

    until inetgetinfo($hDownload,2)

    endif
GUIDelete($prog)
EndFunc

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
  • Recently Browsing   0 members

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