Announcement

Collapse
No announcement yet.

AMS and SF | HTTP.Download & HTTP.TestConnection Major 1st time Run bug 31 seconds?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • AMS and SF | HTTP.Download & HTTP.TestConnection Major 1st time Run bug 31 seconds?

    Hello, I've tested this several times on several machines including VMware. Before I begin please don't quickly run off and build a test AMS, or Setup Factory app
    You can only re-produce this bug IF <--- you have NEVER <--- used HTTP.Download, or HTTP.TestConnection on that PC before.

    This bug will only appear the first time ever running AMS/SF on a new PC, or Virtual PC.

    Once AMS/SF has downloaded, or tested the connection at least once on the same PC the bug then vanishes, you can even make new AMS apps, or Setup Installers and the bug doesn't happen on any of the newer apps, or setup installers once it's been at least run once.

    The 1 time bug This is for AMS and Setup Factory latest versions, and older versions.

    HTTP.Download
    HTTP.TestConnection


    If you have any HTTP.Download from a normal HTTP address it will take 31s for the file to appear at 0btyes and start to download. After the first time and every other time it's instant.
    If you have any HTTP.TestConnection it will completely ignore the "Timeout" and it will run for 20 seconds regardless if you put any other number. After the first time just like above it then abides by this "Timeout"

    You can only test this on a PC/VMware that hasn't run AMS HTTP.Download & HTTP.TestConnection beforeI would like to know what happens to make this bug vanish once it's been run at least once? I'm hoping the developers would jump in here, or at least tell me what gets set into the systems registry once it's been run once, so I can copy that data out and include it in my AMS/SF registry entries on startup.

    If anyone else has found this bug before, is there any plugins they could provide me that maybe bypasses the built in http.download action script that seems to be faulty.


  • #2
    Sorry the formatting got a little out of whack due to the advert, and it' cut off the bottom part where I said Thank you and for anyone who helps, or provides me some method to get around this quirky little bug... I'd greatly appreciate it.

    Comment


    • #3
      I use wget you have to write a temporary file some where for your http request but I fine it much faster and more stable then AMS’s HTTP functions

      I see that bug with ams even after the first time use the HTTP functions in ams are not that good.

      My advice is use a 3D party another reason I use wget is we can define the user agent but you can’t with AMS.
      Plugins or Sources MokoX
      BunnyHop Here

      Comment


      • #4
        This is a great hint Kingzooly

        I looked for Wget after you mentioned it and its a great tool

        Hope u can give us a quick hit how to use it with AMS.

        Comment


        • #5
          Already have in the past
          I've just installed LuaSocket so I could test the http.request function in order to read a webpage into string. Works great - but I'm just wondering if there's any real advantage to using this method, instead of AMS's built-in HTTP.Submit function to do the same thing? LuaSocket does look pretty cool


          Enjoy
          Plugins or Sources MokoX
          BunnyHop Here

          Comment


          • #6
            Another alternative to HTTP.TestConnection would be to use LuaSocket. Never tested it for speed comparison against WGET. But find it very good. Versatile as well!

            Attached is an example of how to use LuaSocket to test for an active internet-connection (with a 1 second timeout return).

            Nb.
            LuaSocket can also be used in place of HTTP.Download if u so wish.
            Attached Files

            Comment


            • #7
              Addendum:

              If your target platforms are all Win7 (and above), then you could also use the CommandLine plugin as an alternative to HTTP.Download, by executing Powershell commands directly from AMS. Something like this should work:

              Nb. Air code only - untested.
              Code:
              sInput = 'powershell -c "Invoke-WebRequest -Uri 'https://www.website.com/file.zip' -OutFile 'c:\temp\file.zip'"'
              CommandLine.Execute(sInput, 0);

              And, regardless of target platform, as a substitute for HTTP.TestConnection. Something like this should work:
              Nb. Air code only - untested.
              Code:
              tbl.StdOut = CommandLine.Execute("ping 8.8.8.8", 0);
              The plugin is here, if interested: https://forums.indigorose.com/filedata/fetch?id=300815

              Comment


              • #8
                Edit,
                In reference to the above powershell command, you'll need to escape those parentheses. Try this instead:
                Code:
                sInput = [[powershell -c "Invoke-WebRequest -Uri 'https://www.website.com/file.zip' -OutFile 'c:\temp\file.zip'"]]
                CommandLine.Execute(sInput, 0);

                Comment


                • #9
                  Hiya King & BioHazard. I'm really good friends with Colc he said if I posted this bug you guys would no doubt jump in

                  I've looked into wget it looks like something that may work as a solution, I am not that happy I have to include another 4mb file in my project to replace and patch up something that AMS|SF should do by default. Has this company simply let these programs, and all support in fixing these kinds of bugs just completely die?

                  I'd like to know, or have help investigating what must change on the users PC once the http.download, or Test.Connection has been run the 1 time for it to then work correctly afterwards?
                  It's only when you format the PC, or restore an image back, or re-store a snapshot back in VMware that this bug comes back. So it's got to be a really simple solution. Somehow capture the registry entries of what it must change? I've also downloaded your apz thank you. I've not run it yet, but you are saying i can use this LuaSocket as a working replacement for http.download?

                  IS this an available plugin BioHazard? Or, is it built into the programs by default?

                  KingZooly I'm struggling with your vague replies here bud, you said the following in your post.
                  I use wget you have to write a temporary file some where for your http request

                  Can you actually give an example of what you mean if you don't mind? Write a temporary file somewhere? For your http request?
                  When you say write a temp file somewhere do you mean use AMS to write it? Or command line to write it, or place a temp file somewhere and call on it via AMS

                  Just saying I use wget you have to write a temporary file some where really doesn't help anyone who's never used it before mate.

                  Comment


                  • #10
                    Originally posted by BioHazard View Post
                    Addendum:

                    If your target platforms are all Win7 (and above), then you could also use the CommandLine plugin as an alternative to HTTP.Download, by executing Powershell commands directly from AMS. Something like this should work:

                    Nb. Air code only - untested.
                    Code:
                    sInput = 'powershell -c "Invoke-WebRequest -Uri 'https://www.website.com/file.zip' -OutFile 'c:\temp\file.zip'"'
                    CommandLine.Execute(sInput, 0);
                    And, regardless of target platform, as a substitute for HTTP.TestConnection. Something like this should work:
                    Nb. Air code only - untested.
                    Code:
                    tbl.StdOut = CommandLine.Execute("ping 8.8.8.8", 0);
                    The plugin is here, if interested: https://forums.indigorose.com/filedata/fetch?id=300815
                    Hiya Bio! Funny enough i was just reading something very very similar to the powershell -c over on stackoverflow.
                    Yes, very interested in trying to get this to work correctly. And thank you for providing a link to the working plugin.

                    I've seen in my travels for the last 19 years so many amazing plugins for AMS then they've all just vanished. leaving us with nothing more than the bog standard ones that come with AMS
                    You would think the company, or someone who worked here would keep a plugin section actively going on this forum as plugins really make these programs amazing for the novice users.

                    Cheers guys for taking an active roll in this thread. And the solutions you provided. I've read somewhere on here [dead plugin] there was one for doing multi file downloads in the background without locking up the cascading flow of functions in AMS, like you could on start up actually set the downloads off, and still be-able to use the application front end, and execute back end actionscripts still.

                    Interested in learning more about LuaSocket for http.download Bio, and hoping this commandline plugin and script above will work fine

                    Comment


                    • #11
                      Originally posted by BioHazard View Post
                      Another alternative to HTTP.TestConnection would be to use LuaSocket. Never tested it for speed comparison against WGET. But find it very good. Versatile as well!

                      Attached is an example of how to use LuaSocket to test for an active internet-connection (with a 1 second timeout return).

                      Nb.
                      LuaSocket can also be used in place of HTTP.Download if u so wish.
                      Hmm... Sorry for multiple posts doesn't seem like you can even edit your own posts here.
                      I've just tried your APZ out wow... fantastic work! Could i maybe trouble you to show me how to convert this to http.download please?

                      example downloadfile() as a page function call

                      Then in globals basically have it so it downloads say as a pure example dolly.zip from www.google.com to say %TempFolder%
                      This would be awesome if you could help convert that lua apz to do this.

                      Comment


                      • #12
                        The only problems with wget and LunaSockets you do have to add files more to your project but sadly ya AMS has not fixed these problems for years.
                        Plugins or Sources MokoX
                        BunnyHop Here

                        Comment


                        • #13
                          Yes, but the lua scoket examples that bio provided them file sizes are tiny kb files and that's fine, instead of a whopping 4mb file.
                          I just need Bio, or someone who knows about lua sockets to convert that socket version of HTTP.TestConnection into http.Download version apz

                          Bio said Nb. LuaSocket can also be used in place of HTTP.Download if u so wish.<--- I cannot for the life of me work out how to convert his apz example to use his http.download method.
                          I don't think he's had chance to see, or look at this reply threat yet. Hoping he will help, or someone will come forward with a way to do this simple thing on start up.

                          download a zip file dolly.zip from www.google.com to say a temp folder, I can just change the zip name, the url address and the folder location myself.
                          This would be awesome if I can get this to work on a brand new PC first time without having this 31 seconds wait time bug before the file even reaches 0bytes.

                          Comment


                          • #14
                            @MikeJerry28
                            I've been trying to post a response to your questions but am being blocked for some weird reason.
                            Will try again later.

                            Comment


                            • #15
                              @MikeJerry28
                              Right, at the moment, when I try to load my original response to your questions, all I get is this extremely annoying response from vBulletin:



                              So, given that vBulletin is absolutely intent in blocking me from responding with my original post, we'll go about this another way. Attached below is a copy of the post I've been trying to load now for hours. Have simply reformatted it to PDF, and zipped it together with the APZ example which I've also been trying to post. It demonstrates how to use LuaSocket to download a file.

                              Have tried to address most of the questions you brought up in this thread via the enclosed PDF (which also contains a number of important links which you'll find useful). Apologies for the delayed response (and for having to do it this way) but it seems there's no other option at the moment. It's either this forum itself or something to do with vBulletin which blocks many of my posts. It's EXTREMELY annoying and has been ongoing for quite some time. Hint, hint IR!

                              @colc
                              Sorry, mate. If u haven't received any recent PMs from me, then those are being blocked, too. At the moment, I've no idea if my outgoing messages are even working. However, the zipped file attached below should answer the questions raised in your PM.
                              Attached Files

                              Comment

                              Working...
                              X