Announcement

Collapse
No announcement yet.

Need a bit of help from the pro's. Esctract .iso

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

  • Need a bit of help from the pro's. Esctract .iso

    Hi.

    On my latest project I am trying to locate a .iso image and extract it's contents to a given folder.

    I know how to make a "Dialog.FileBrowse" search for a specific file.

    I have a code on a .cmd to extract a .iso file from a certain dir into another dir.
    using the 7zip files.

    What I would like to do is have the user browse for a .iso and extract it to a certain dir on the users PC.

    this is going to be an "imageX" project but my skills let me down.

    Can a pro help me out here with a pointer or two.

    Plus is it possible to set a visible progress bar for the duration of the extraction process ?

    Cheers.

  • #2
    been thinking about this all last night while at work.

    One way which my work, would be to copy the .iso image to a Temp DIR. One where my extract.cmd points to, enabling the files to be extracted.

    another is to change the .iso ext to .zip and see if that works.

    Also I got to thinking about a .iso plugin. I have looked through the plugin threads and not found one.
    There are plenty of others. So somebody is making them. I don't know what goes into making an AMS Plugin but I think I will investigate. Gimme summet to do...

    Comment


    • #3
      An ISO file is a disk image, not a compressed archive. Although utilities like WinZip, WinRAR and a few others may be able to unpack the contents of an ISO file to the hard drive, the Zip plugin can't do this. If you have a disk image, you would normally mount it as a drive to access its contents, instead of copying to another folder.

      Ulrich

      Comment


      • #4
        Thanks for that reply.
        Yep I realise the differences between .zip\.rar and a .iso image. :yes
        Like you say the main archivers are able to extract .iso images. My .cmd uses 7zip.dll and 7zip.exe in a given dir and by a simple double click on the .cmd the .iso is extracted.
        This works well.
        I made a simple button project to shell.execute my .cmd and it worked a treat.
        I have not had time to mess further today but hopefully will be doing later.
        Might have to rethink my ideas.

        My imagination is far better than my skills

        Comment


        • #5
          Just had a thought.

          If you make a dialogue.filebrowse, is there a way to take the folder dir say E:\ MyFiles\mydisc.iso and write this to my extract.cmd so it points to my chosen file ?

          Does that make sense.

          On my iPad at the mo. Later I will show my extract script.

          If this is possible it may be the solution but what this process is called I don't know.

          ?????

          Comment


          • #6
            Hey up..

            So here is my extract.cmd.

            7z x -y -oC:\DISM\7zip\files C:\DISM\7zip\pics.iso

            pause
            Obviously the "pause" will be omitted but I like to see what's going on at the beginning..

            What I just thought of a while back, can a filebrowse locate a file and write it's dir to my extract.cmd

            example.

            disc.iso is on a PC in
            F:\images\mydisc.iso
            can that dir be written to my extract.cmd

            so it would end up like

            7z x -y -oC:\DISM\7zip\files F:\images\mydisc.iso

            is that possible ?????????

            cheers..

            Comment


            • #7
              File browse is user orientated whereas file find is not.

              Comment


              • #8
                I have just tested my extract.cmd out.

                I placed my test iso image containing a few pics so it is not too big is size in dir
                E:\test
                made a new extract.cmd

                7z x -y -oC:\DISM\7zip\files E:\test\pics.iso

                pause
                Worked perfectly. :lol

                so it's just the other part, writing the dir to my extract.cmd.

                If this is possible what is the process called ?

                write string ?
                write field ?

                Off to open up AMS and look inside..

                Comment


                • #9
                  You could use execute any DOS command from AMS using the "File.Run" or "Shell.Execute functions.

                  If you need to have a feedback from the executed command (example, get the message returned by the command) use the CommandLine plugin.

                  In both cases, the command line can be explicit, example:

                  Code:
                  File.Run("7z.exe", "x -y -o C:\\DISM\\7zip\\files E:\\test\\pics.iso");
                  or can contain variables:

                  Code:
                  parameteres = "x -y -o ";
                  first_path = "C:\\DISM\\7zip\\files ";
                  second_path = "E:\\test\\pics.iso";
                  example: File.Run("7z.exe", parameteres..first_path..second_path);
                  example:

                  Code:
                  CommandLine.Execute("ping 127.0.0.1", 0);
                  or

                  Code:
                  var_a = "ping 127.0.0.1"
                  CommandLine.Execute(var_a, 0);
                  We are slowly invading your planet to teach lazy humans to read the user manual.
                  But don't be scared: we are here to help.

                  Comment


                  • #10
                    Originally posted by Cybergraph View Post
                    If you need to have a feedback from the executed command (example, get the message returned by the command) use the CommandLine plugin.
                    This also can be done with pure Lua, without any plugins:

                    Code:
                    local sCommand = "\"".._SystemFolder.."\\cmd.exe\"" .. " /c DIR " .. _TempFolder;
                    local sOutput = "";
                    
                    for sLine in io.popen(sCommand):lines() do
                       sOutput = sOutput .. sLine .. "\r\n";
                    end
                    Dialog.Message("Output", sOutput);
                    Ulrich

                    Comment


                    • #11
                      Thanks for those replies.

                      Will give them a good read.

                      Comment


                      • #12
                        been thinking about this and doing a lot of reading and testing.

                        I have gotten a little further but still a fair way to go.

                        So I have my .cmd
                        7z x -y -oC:\DISM\7zip\files C:\DISM\7zip\TEMP\*.iso
                        The first part is always going to be a constant
                        7z x -y -oC:\DISM\7zip\files
                        What I have is made a .cmd without the path to the .iso image.

                        Using a vbscript I have learnt to append my extract.cmd so it adds the path of the .iso to the end of the code allowing the ectraction to take place.

                        Option Explicit
                        Dim FSO, oFILE,x
                        Const READ=1,WRITE=2,APPEND=8
                        Set FSO = CreateObject("Scripting.FileSystemObject")

                        Set oFILE = FSO.OpenTextFile("C:\DISM\7zip\extract.cmd",APPEND )

                        oFile.Write " C:\DISM\7zip\TEMP\*.iso"
                        This is all well and good but I still need to be able to read to string the path of a chosen file then write it to my extract.cmd.

                        I am currently learning how to do this with a vbscript, thinking it might help me understand how to do it in AMS.

                        In AMS I know

                        Dialog.FileBrowse(true, "Locate File", _DesktopFolder, "All Files (*.*)|*.*|", "", "dat", false, false);
                        how , or is it possible to set the result of the file browse and the selection of a file to read the path of the given file.

                        This confuses me.
                        Is it read to string ?

                        I look in the help file and it mentions
                        File.GetAttributes
                        It does mention
                        Directory
                        boolean
                        True if the directory attribute is set.
                        but what this means I do not know.

                        Any more pointers please.

                        cheers..

                        Comment


                        • #13
                          AutoPlay Media Studio uses Lua, not VBScript. There is no need at all to mix languages, as string concatenation is easy in Lua - using the ".." operator, as already shown in this very topic.

                          If you use Dialog.FolderBrowse() to allow the user to locate a file, the documentation shows you that this action will return a table, where each element contains the full path to a selected file (in case you allowed multiple selection), or the text "CANCEL" as the first element in case the user aborted the selection.

                          One you have the full path to the file, you have to concatenate this path to the fixed "7z x -y -o" part to assemble the command line you wish to execute.

                          You don't need File.GetAttributes() for anything at this time. You also don't need to create a batch or cmd file, as there are actions like Shell.Execute() and File.Run() you can use to perform the extraction.

                          Ulrich

                          Comment


                          • #14
                            Sorry...

                            I understand some of what your saying.
                            I get the lua and vbs are totally different.

                            So let me see if I can explain what I do and do not understand.

                            I make a Dialog.FileBrowse
                            I give it a result varialble

                            filefound = Dialog.FileBrowse

                            this I understand.

                            So when the user browses for their chosen file and clickes "open" are you saying there is a table of the files information automaticly stored in the result "filefound"

                            in this table there is the full path of the file.

                            Am I understanding that correctly ?

                            If this is right how do I ask AMS to show me this table of information ?

                            I looked at "table"

                            it says

                            Table.Concat

                            Returns
                            (string) A string containing the table values, separated by the delimiter you chose. If an error occurs, a blank string "" is returned.

                            This is confusing me.

                            Am I on the right track ?

                            Let me thank you, please stick with me.

                            Comment


                            • #15
                              Please check the documentation - the examples provided in the help file - for Dialog.FileBrowse(). There are three examples, and you can find many more in this forum.

                              Ulrich

                              Comment

                              Working...
                              X