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

  • #16
    Originally posted by Ulrich View Post
    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
    examples ??

    Who knew....Nice one..

    Comment


    • #17
      you know this is what I want..

      I am not after, "please do it for me".

      Pointers !!!!!

      You pointed and I followed.

      One step further.

      filefound = Dialog.FileBrowse(true, "Locate File", _DesktopFolder, "All Files (*.*)|*.*|", "", "dat", false, false);
      Dialog.Message("Notice", filefound[1]);
      I get a message of the file path...Brilliant.

      Just need to write to string...

      cheers...

      Comment


      • #18
        You don't need to "write to a string". You need to concatenate the strings.

        Code:
        local sCmdLineArgs = "x -y -o\"" .. filefound[1] .. "\"";
        Dialog.Message("Info", "I need to run 7zip with this command line: " .. sCmdLineArgs);
        Once you have the argument, and you know where your 7zip program is placed, you need to use Shell.Execute() or File.Run() to execute the desired command. No need to write anything... unless you absolutely want to write to a text file.

        Ulrich

        Comment


        • #19
          Originally posted by Ulrich View Post
          You don't need to "write to a string". You need to concatenate the strings.

          Code:
          local sCmdLineArgs = "x -y -o\"" .. filefound[1] .. "\"";
          Dialog.Message("Info", "I need to run 7zip with this command line: " .. sCmdLineArgs);
          Once you have the argument, and you know where your 7zip program is placed, you need to use Shell.Execute() or File.Run() to execute the desired command. No need to write anything... unless you absolutely want to write to a text file.

          Ulrich
          @Ulrich

          Cheers for that extra bit of info. I will surely give it a good read and see if I can understand it.

          Just before I read the last post from you I did get my head round writing a string from a table.

          It worked a treat.

          gotit = Dialog.FileBrowse(true, "Locate File", _DesktopFolder, "All Files (*.*)|*.*|", "", "dat", false, false);
          TextFile.WriteFromTable("C:\\Users\\Malc's PC\\Desktop\\new.txt", gotit, false);
          With what you just put I know it is not exactly what I want\need but I am happy a little bit more as sunk in and I have learnt summet knew.

          Another step closer....

          Thank you..

          Comment


          • #20
            local sCmdLineArgs = "x -y -o\"" .. filefound[1] .. "\"";
            Dialog.Message("Info", "I need to run 7zip with this command line: " .. sCmdLineArgs);
            Been looking at this and sorry, It is just not sinking in.
            I have added Shell.Execute(), put my 7z.exe path all over and I just keep getting errors.

            using my Heath Robbinson method

            TextFile.WriteFromString("C:\\Users\\Malc's PC\\Desktop\\new.cmd", " ", true);
            gotit = Dialog.FileBrowse(true, "Locate File", _DesktopFolder, "All Files (*.*)|*.*|", "", "dat", false, false);
            TextFile.WriteFromTable("C:\\Users\\Malc's PC\\Desktop\\new.cmd", gotit, true);
            Dialog.Message("Notice", gotit[1]);
            result = File.Run("C:\\Users\\Malc's PC\\Desktop\\new.cmd", "", "", 0, false);
            This actually works.

            But immediately runs into trouble. If I try to select another file the .cmd code is all to cock and messed up.

            I need to learn how to delete the string the file browse is creating from the table.


            But really. I need to figure out your coding. I am sure it is fool proof.

            it's getting late, or early in the morning so soon off

            Comment


            • #21
              Well just found another problem with my method.

              When choosing a file from a dir with spaces in the names it does not work.
              appending the .cmd manually adding the "" helps it to work.

              I have learnt summet but not the right thing. Not yet !

              Comment


              • #22
                I already showed you how to use parameters with spaces, didn't I? It appears that you are hardly looking at the code which is given to you and just insist in doing it "your way". Maybe it would be better if you follow the tutorials which are offered on this web site and learn how to use this product in a more organized way, instead of running in circles, and using trial and error to see what works.

                I mentioned repeatedly that you don't need to write a batch, yet there you are again, insisting in writing a text file. And you are doing it incorrectly, as you are always attaching new text instead of rewriting the command, of course.

                I present here a working example. I suggest that you try to understand what is being given to you.

                Ulrich
                Attached Files

                Comment


                • #23
                  Cheers for that post.

                  I feel my wrist has been slapped.

                  I will read through all the posts and try to understand it a bit more.

                  Will look at that example very shortly, just on the old iPad at the mo. Need to crank the PC up.

                  Cheers Ulrich.

                  Comment


                  • #24
                    @ Ulrich

                    Just looked at the scripting from your attached example.

                    It looks pretty darn good. I recon I can read it and make my own to suit my needs but let me thank you for doing that.

                    Can I ask how long have you been playing with AMS ?
                    I see your join date is 2005 so at least 9 years, nice.

                    thank's

                    Comment


                    • #25
                      Originally posted by Old Fellow View Post
                      Can I ask how long have you been playing with AMS ?
                      I see your join date is 2005 so at least 9 years, nice.

                      thank's
                      I registered in the forums after purchasing licenses for Setup Factory and TrueUpdate. I started using AutoPlay Media Studio in early 2008, which was version 7.0 if I recall correctly.

                      Ulrich

                      Comment


                      • #26
                        @ Ulrich

                        :yes

                        I downloaded your example. I did not want to use any of your scripts in my own project, simply because it would not have been my work.

                        I looked, read. Looked, read. Read again and again and again.

                        Adapted it to fit my needs. Did not work.

                        Tried again and again and again. Finally it sunk in !!!
                        I could look and see where I was typing the destination folder wrongly.
                        I could look and see where I was writing the Shell.Execute wrongly.

                        I amended my script and bingo it bloody worked.

                        isofound = Dialog.FileBrowse(true, "Locate File", _DesktopFolder, "All Files (*.*)|*.*|", "", "dat", false, false);
                        if (isofound[1] ~= "CANCEL") then
                        local sCmdLineArgs = "x \"" .. isofound[1] .. "\" -y -o\"" .. "C:\\DISM\\7zip\\files" .. "\"";
                        Shell.Execute("C:\\DISM\\7zip\\7z.exe", "", sCmdLineArgs, "", 0, true)
                        end
                        My "Heath Robbinson" method is well out of the window.

                        This is great and I just know I will be able to apply this sort of thing later on down the line in my new project.

                        Looking at my script\code Ulrich, can you see where I could make it neater\better ?
                        I suppose I could add a "if folder does not exist, make it" but if all goes well that DIR will definitely exist.

                        What do you recon, is my script\code OK ?

                        Thank's

                        Comment


                        • #27
                          Just to add.

                          I know at the mo it will let me select any file, I will write the "Dialog.FileBrowse" to only look for .iso files..

                          Comment


                          • #28
                            Been messing about and testing it out on various .iso images and I noticed summet.

                            While extracting the Win 7 image it obviously took a while but there was no way of telling the user this.

                            So I tested out trying to add a progress bar. urrrrrrr, could not do it.

                            So I decided to go down the status dialogue route.

                            Even with the StatusDlg.ShowProgressMeter set to true, it did nothing.

                            my script\code now looks like this

                            -- opens a file browse window to select the iso image

                            isofound = Dialog.FileBrowse(true, "Locate File", _DesktopFolder, "iso images (*.iso)|*.iso|", "", "iso", false, true);
                            if (isofound[1] ~= "CANCEL") then
                            local sCmdLineArgs = "x \"" .. isofound[1] .. "\" -y -o\"" .. "C:\\DISM\\7zip\\files" .. "\"";

                            -- displays a message informing the iso is being extracted
                            StatusDlg.Show(MB_ICONINFORMATION, false);
                            StatusDlg.SetTitle("iso Extraction");
                            StatusDlg.SetMessage("Working...");
                            StatusDlg.SetStatusText("Please Wait. Extracting Files.");
                            StatusDlg.ShowProgressMeter(false);

                            --Executes the command to extract the iso image
                            Shell.Execute("C:\\DISM\\7zip\\7z.exe", "open", sCmdLineArgs, "", 0, true)

                            -- Closes the message regard the files being extracted
                            StatusDlg.Hide();

                            --Displays a timed mess to show the job is complete
                            Dialog.TimedMessage("Files Extracted", "Done", 2000, MB_ICONINFORMATION);

                            end
                            What does anybody think.

                            Totally amature-ish

                            cheers..

                            Comment


                            • #29
                              You can display the progress of the 7-Zip extraction in the interface of your own application, but this probably isn't a script which you would create easily without having a bit more experience.

                              Click image for larger version

Name:	SNAP-2014-02-03-01.png
Views:	1
Size:	23.5 KB
ID:	284152

                              Click here for a demo (it will take a moment to load). The project is attached.

                              Ulrich

                              Comment


                              • #30
                                Ulrich. Ulrich. Ulrich..

                                You are a frigging star !!

                                How complicated does that look. I would never have figured that script out.

                                If I may can I use it in my project and any future ones I may do ?
                                I know it won't be my work, I can put a "Thanks to Ulrich" on my "extract ISO" page..

                                Been trying to work summet else out.

                                on the "local sCmdLineArgs" can the arguments be words ? or do they have to be letters.
                                Hope that does not sound dumb.

                                I have this script on a .cmd Which starts DISM and mounts a windows install.wim file.

                                dism /mount-wim /wimfile:%~dp0install.wim\install.wim /index:1 /mountdir:%~dp0mount
                                For the last couple of days I have been trying to figure out which bit would go where in the "local sCmdLineArgs". Every thing I have tried as come up not working.

                                Is that sort of thing possible or not ?

                                Thanks Ulrich.


                                Just realised summet. That DISM command HAS to run as ADMIN.
                                My project is not set to invoke that.... I better change it and test things all over again..

                                Comment

                                Working...
                                X