Jump to content
JuanFelipe

Online updates for your program

Recommended Posts

JuanFelipe

Updates for your program.

Hello a few days ago I started with the task of hosting my program on a host, in order to launch updates from there, thanks to the help I received in the forum I did and now I want to share how my code was.
:lol::lol:
First I did it verifying the version and opened the download page in the default browser, today what I did was a new version in which you download the file from a window with a progress bar and it automatically starts with the installation, it means that it does not open a browser but downloads directly with InetGet (). I know it will not be an expert's code, but maybe someone will help you. I do not speak English so I use Google translator, I mention this in case some things are poorly translated.  :sweating:

 

And this is the function with which everything is done.

 

Func _actualizacion()
   Local $iPing = Ping("www.google.com", 3000)

   If $iPing Then

      Local $dData = InetRead("https://sourceforge.net/projects/sala-de-videos/files/Version.txt")
      Local $iBytesRead = @extended
      Local $sData = BinaryToString($dData)

      If $version<$sData Then
         $update1=""
         $update1&="Hay una versión más reciente del software"&@CRLF
         $update1&="Desea descargarla?"&@CRLF
         $update=MsgBox(4, "Update", $update1)
         If($update=6)Then
            Local $parte1= Run("Update.exe")
            Exit
         Exit
         Else
         EndIf
      Else
         MsgBox($MB_SYSTEMMODAL, "Update", "Usted cuenta con la última versión actualizada.")
      EndIf

   Else
      MsgBox(16, "", "No hay conexión a internet error: " & @error)
   EndIf

EndFunc   ;==>Example

It is noteworthy that the versions of the software and every time I do an update I host them in https://sourceforge.net/ so luck for those of us who are starting in this.

 

En español para algunos que lo necesitamos

Actualizaciones para tu programa.

 

Hola hace unos días empecé con la tarea de alojar mi programa en un host, con el fin de lanzar actualizaciones desde allí, gracias a la ayuda que recibí en el foro lo hice y ahora quiero compartirles como quedó mi código.

Primero lo realicé verificando la versión y abría en el navegador predeterminado la página de descarga, hoy lo que hice fue una nueva versión en la que descarga el archivo desde una ventana con una barra de progreso y automáticamente empieza con la instalación, quiere decir que ya no abre un explorador si no que descarga directamente con InetGet(). Sé que no será el código de un experto, pero quizá a alguien le sirva como ayuda. No se hablar inglés así que uso Google traductor, esto lo menciono por si algunas cosas quedan mal traducidas.

Es de resaltar que las versiones del software y cada vez que hago alguna actualización las alojo en https://sourceforge.net/ así que suerte para los que estamos empezando en esto.

 

_webDownloader.au3

Update.au3

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

  • Similar Content

    • SharpDressedMan
      By SharpDressedMan
      Hello,
      Is there any way to check for validity of a pointer to a DllStruct ?
      In the above code, a DllStruct is created from an invalid pointer. How to prevent from doing this ?
      local $tStruct = DllStructCreate("int i") DllStructSetData($tStruct, "i", 123) local $pStruct = DllStructGetPtr($tStruct) $tStruct = 0 ; destroy DllStruct ==> $pStruct becomes invalid ; how to check here for validity of $pStruct and prevent from doing the following ? $tStruct = DllStructCreate("int i", $pStruct) ; create DllStruct from invalid pointer... MsgBox(0, @ScriptName, @error) ; displays '0' : invalid pointer is not detected by DllStructCreate() MsgBox(0, @ScriptName, IsDllStruct($tStruct)) ; displays '1' : tStruct is assumed as a valid DllStruct object, which is not Thanks for help
    • nooneclose
      By nooneclose
      I need to send a string of text to this popup and click on the ok button to save it.
      Here is the code I have so far:
      ;Start IE Sleep(7000) $oIE = _IECreate("http://www.google.com") Sleep(500) _IELoadWait($oIE) $hIE = _IEPropertyGet($oIE, "hwnd") ; Get Handle of the IE window Sleep(500) WinSetState($hIE, "", @SW_MAXIMIZE) ;Wait for a browser page load to complete Sleep(3000) _IENavigate($oIE, "https://properURL.com") Sleep(8000) _IELoadWait($oIE) ;Attach to a browser control embedded in another window $oIE = _IEAttach("https://"properURL.com", url") ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $oIE = ' & $oIE & @CRLF & '>Error code: ' & @error & ' Extended code: 0x' & Hex(@extended) & @CRLF) ;### Debug Console Sleep(2000) ;Get the title of the webpage ;Local $wTitle = _IEPropertyGet($oIE, "title") ;MsgBox($MB_SYSTEMMODAL, "Webpage title:", $wTitle) ;Clicks the new button Sleep(3000) _IEAction($nWorkOrderB, "focus") _IEAction($nWorkOrderB, "click") Sleep(5000) ;Store the Element names where the important data will be sent ;Store the long description button Local $wLongDButton = _IEGetObjById($oIE, "m65d795a4-img") ;Store the long Description field id Local $wComments = _IEGetObjById($oIE, "ma6499a9c-rte_iframe") ;Store the ok button id that is in the long description Local $wCommOk = _IEGetObjById($oIE, "m74031266-pb") ;******************************************************************************* ; Send the stored data to the proper field ;******************************************************************************* ;Click the long description button Sleep(300) _IEAction($wLongDButton, "focus") _IEAction($wLongDButton, "click") Sleep(300) ;Sends the Comments Sleep(500) _IEAction($wComments, "focus") _IEAction($wComments, "click") Sleep(500) _IEFormElementSetValue($wComments, "hello darkness my old friend") ;Click the ok button Sleep(500) _IEAction($wCommOk, "focus") _IEAction($wCommOk, "click") Sleep(500)  
      Here is the popup:

    • yasha
      By yasha
      i want am trying to select a nimber to run a program and then select where to save the excel result at before hand
      the problem is that it does not save in the folder i want but the folder before any solutions
      #.................
      $sFolder = ""
          ; Create a constant variable in Local scope of the message to display in FileSelectFolder.
          Local Const $sMessage = "Select a folder"
          ; Display an open dialog to select a file.
          $sFileSelectFolder = FileSelectFolder($sMessage, $sFolder)
          If @error Then
              ; Display the error message.
              MsgBox($MB_SYSTEMMODAL, "", "No folder was selected.")
          Else
              ; Display the selected folder.
              MsgBox($MB_SYSTEMMODAL, "", "You chose the following folder:" & @CRLF & $sFileSelectFolder)
          EndIf
      .......
      ........
      $oExcel = ObjCreate("Excel.Application")                   ; Create an Excel Object
      $oExcel.Visible = 1                                        ; Let Excel show itself
      $oExcel.Workbooks.Open("J:\OPS\OPS_Share\Planners\2 - Weekly Reports\Auto download\"& $YY & $MM & $DD & " ORDER.xls",0)
      $oExcel.ActiveWorkbook.Saveas ( $sFileSelectFolder,""& $YY & $MM & $DD & " ORDER.xlsx", 1)
      $oExcel.ActiveWorkBook.Close
      $oExcel.Quit
      i only want to save it as ddmmyy order inside documents but it saves in libraries as documents ddmmyy order.
    • vynce1982
      By vynce1982
      I am trying to make a simple installer script for my understanding.  I would just like to understand how to deal with multiple possible windows. In the case of installing VLC, I might get a window saying VLC is already installed. I have also tried a switch with no luck.  I would just like to understand some methods for dealing with the possible existence of unexpected windows. 
       
      ;INSTALL VLC VIEWER
      Run(@ScriptDir & '\bin\VLCViewer_2.2.4_3.EXE')
      AutoItSetOption('MouseCoordMode', 0)
      sleep(4000)
      WinWait("VLC Viewer 2.2.4")

           ; this window will pop up if vlc is already installed
          If WinExists( "VLC Viewer 2.2.4", "VLC 2.2.4 Already Installed") Then
                ConsoleWrite ("already installed")
                WinActivate ('VLC Viewer 2.2.4','Already Installed')
                MouseClick ('primary', 93, 83, 1, 0)
                
          EndIf
       
            ; this window will pop up if installer finishes sucessfully
           If WinExists( "VLC Viewer 2.2.4", "VLC Viewer 2.2.4 Installed") Then 
                ConsoleWrite ("already installed")
                WinActivate ('VLC Viewer 2.2.4','VlC Installed')
                MouseClick ('primary', 93, 83, 1, 0)
         EndIf

       
       
       
    • TrashBoat
      By TrashBoat
      After i create my GUI i cant set the color anymore.  help?
      $hBarGUI1 = GUICreate("", 50, 1, 91, 188, 0x80000000, 0x08000080) $g = GUICtrlCreateLabel("", 1, 1, 1, 1) GUICtrlSetBkColor(-1, $color) GUISetBkColor($color, $hBarGUI1) WinSetTrans($hBarGUI1, '', 0) WinSetState($hBarGUI1, '', @SW_SHOWNOACTIVATE) WinMove($hBarGUI1, '', -1, -1) WinSetTrans($hBarGUI1, '', 254) WinSetOnTop($hBarGUI1, "", 1) I see that my problem has to do something with WinSetState but have no clue how to fix it already tried to set it to @SW_UNLOCK and @SW_SHOWNORMAL.
      @swa
×