Announcement
Collapse
No announcement yet.
Need a bit of help from the pro's. Esctract .iso
Collapse
X
-
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]);
Just need to write to string...
cheers...
Comment
-
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);
Ulrich
Comment
-
Originally posted by Ulrich View PostYou 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);
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);
Another step closer....
Thank you..
Comment
-
local sCmdLineArgs = "x -y -o\"" .. filefound[1] .. "\"";
Dialog.Message("Info", "I need to run 7zip with this command line: " .. sCmdLineArgs);
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);
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
-
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.
UlrichAttached Files
Comment
-
@ 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
-
Originally posted by Old Fellow View PostCan 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
Ulrich
Comment
-
@ 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
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
-
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
Totally amature-ish
cheers..
Comment
-
-
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
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
Comment