Announcement

Collapse
No announcement yet.

Download zip file from Google Drive, unzip it, run CMD script

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

  • Download zip file from Google Drive, unzip it, run CMD script

    Hello, Support Team!

    We need a script to deploy our custom application packages on the target computers. Those custom application packages are just zip files containing all the required installation files plus a CMD script to install the application with our custom settings. That CMD has to be run with local Admin permissions and is configured to provide a full log of the installation. We use corporate Google Drive to distribute them.

    The script has to do the following:
    • Download the single .zip file from the provided Google Drive URL
    • Unzip all the files and folders to a temporary folder.
    • Run the extracted "Install.cmd" script.
    Could you please create the requested script?

    Thanks a lot in advance for your kind help!

    Regards,
    -- Javier Llorente
    Endpoint Security - Devoteam

  • #2
    Hi DevoteamEndpointSecurity,

    Thanks for your script request. We have asked our script developers to check and provide update.

    Kind Regards,
    PremJK

    Comment


    • #3
      Hi DevoteamEndpointSecurity,

      Our script developers are requesting package to test the script, can you please provide us that in private message.

      Kind Regards,
      PremJK

      Comment


      • #4
        Hi PremJkumar !

        I've just sent you the requested information through a private message.

        Thanks a lot in advance for your kind help!

        Regards,
        -- Javier Llorente
        Endpoint Security - Devoteam

        Comment


        • #5
          Hi DevoteamEndpointSecurity,

          Thank you so much, we have shared those file to our script developers.

          Kind Regards,
          PremJK

          Comment


          • #6
            Hi DevoteamEndpointSecurity,

            Please run this script prepared by our script developers and let us know if the script suffices your needs
            https://scripts.itarian.com/frontend...ile-from-cloud

            Kind Regards,
            PremJK

            Comment


            • #7
              Hi PremJkumar

              Thanks a lot for the provided script. We'll test it and come back with the testing result as soon as possible.

              Have a great day!

              Regards,
              -- Javier Llorente
              Endpoint Security - Devoteam

              Comment


              • #8
                Hi PremJkumar

                We have tested thoroughly the provided script. It works fine, but we have a couple of concerns about it:

                1. The script looks for a .cmd script file in all the extracted folder and all the subfolders. Our script is always located in the extracted folder, there is no need to look in the subfolders. This might even be an issue, as we have a couple of packages that have .cmd scripts in the subfolder that are intended to be called by the main script. It seems that the current procedure starts looking for the script in the subfolders, so it could run the secondary script instead of the main one.

                We want to change this behaviour, so the procedure only looks for the .cmd script file in the extracted folder (and not in its subfolders). If the developers prefer to make the procedure ask for the script name, for us, it's also OK.

                2. The output of our script does not appear in the Procedure logs.

                We wish to change this behaviour too, so the procedure logs show the output of our script.

                Is it possible to do the requested modifications, please?

                Thanks a lot in advance for your kind help!

                Regards,
                -- Javier Llorente
                Endpoint Security - Devoteam

                Comment


                • #9
                  Hi DevoteamEndpointSecurity,

                  Thanks for providing your valuable input. We have shared the same modifications with our script developers and will try to provide the updated script.

                  Kind Regards,
                  PremJK

                  Comment


                  • #10
                    Hi DevoteamEndpointSecurity,

                    Please try this script prepared by our script developers provided in JSON file and provide your input
                    20210628-install.json

                    Note : Change the cmd_file_name variable for the name of cmd

                    Kind Regards,
                    PremJK

                    Comment


                    • #11
                      Hi PremJkumar

                      Thanks a lot for the provided script. We'll test it and come back with the testing result as soon as possible.

                      Have a great day!

                      Regards,
                      -- Javier Llorente
                      Endpoint Security - Devoteam

                      Comment


                      • #12
                        Is there any feedback from using this script? I can't get it to work. I can see that it downloads my ZIP file, then extracts it, but doesn't run it?
                        Many thanks,

                        Stewart

                        Comment


                        • DevoteamEndpointSecurity
                          DevoteamEndpointSecurity commented
                          Editing a comment
                          Which version are you using? The one in the script repository (https://scripts.itarian.com/frontend...ile-from-cloud) or the one provided by PremJKumar in message #10 (20210628-install.json)? We have tried both and both work fine, though the second one needs the .cmd file to be located in the root folder of the .zip file, that is, not inside any subfolder inside the file.

                      • #13
                        Hi Devoteam!

                        I am using the script from the url you have provided. I have a ZIP file with a .cmd file inside it, no folders. Uploaded to google drive and amended the procedure line 1 for the download URL (modified Google drive to force download) and then amended line 61 to my own zip file name.

                        When I run on a test machine, the file downloads and extracts to the ProgramData\extraction folder, but doesn't run it.

                        I then receive the following error in the execution log:

                        Downloaded succesfully to C:\ProgramData\extraction_file\PROTECTAgentInstall er.zip file unzipped to C:\ProgramData\extraction_file
                        Traceback (most recent call last): File "<string>", line 96, in <module> TypeError: 'NoneType' object has no attribute '__getitem__'

                        I attach the my script in .txt format.

                        Many thanks!
                        Attached Files

                        Comment


                        • #14
                          I managed to amend the lower part of this procedure to something extremely basic which works for me. I attach the txt file here for those that may require it. The whole proceedure seems a bit overly complex to me, but thats most likely because I don't code at all in Python. So copied code from other examples and run it on a variety of environments until I had complete sucess. This will download a file to c:\programdata\extraction_file then run your executable from there. I have managed to rollout my agent with 100% sucess rate - thanks!
                          Attached Files

                          Comment

                        Working...
                        X