Hi all.
I have been on with a project for a little while now and I feel its coming together quite nicely. You may well have seen my other posts asking for help and advice as I got stuck.
Not exactly stuck at this time but there is one thing I feel would just top things off and that's a progress bar.
What happens is...
A .svf or .iso image is browsed for and then loaded.
Once loaded we now can calculate the checksum value of the image. This is done using the existing Windows 10 Certutil.exe with lives in all Windows 10 machines. NO third party software.
Calculate checksum value script
Hope this all makes some sort of sense and you have an idea of calculating checksum values via the command prompt.
the process of calculating the checksum value depends on the size of the image and the speed of the PC. For me between 10 seconds to 1 minute.
This is where I would like the progress bar to come in, to indicate how the calculation is going.
Hope you can understand what I am after and somebody can help.
I have made an example with a .iso image , under 400MB in size....
Well never thought that would be too large to be honest.
So my example will now NOT include the .iso image.
Hoping somebody can help.....
I do have a couple of examples downloaded. I will look at these some more. It may come to me..
Verihash - Progress Bar Help Example.apz
I have been on with a project for a little while now and I feel its coming together quite nicely. You may well have seen my other posts asking for help and advice as I got stuck.
Not exactly stuck at this time but there is one thing I feel would just top things off and that's a progress bar.
What happens is...
A .svf or .iso image is browsed for and then loaded.
Code:
Image_Browse = Dialog.FileBrowse(true, "Locate File", "AutoPlay\\iso_iamge", "Image Files (*.iso,.svf)|*.iso;*.svf|", "", "dat", false, false); if (Image_Browse[1]) == "CANCEL" then Input.SetText("ImageInput", ""); Paragraph.SetText("ImageName",""); elseif (Image_Browse[1]) ~= "CANCEL" then for i,bFilePath in pairs(Image_Browse) do bFileParts = String.SplitPath(bFilePath); bDrive = bFileParts.Drive; bFolder = bFileParts.Folder; bFileName = bFileParts.Filename; bFileExtension = bFileParts.Extension; bFullFileName = bFileName..bFileExtension; bCurrentFolder = bDrive..bFolder Input.SetText("ImageInput", Image_Browse[1]); Paragraph.SetText("ImageName", bFullFileName); Label.SetEnabled("Calculate SHA1 Checksum Value", true); end end
Calculate checksum value script
Code:
Paragraph.SetText("CalculatedSHA1ChecksumValue", ""); -- Calculate SHA1 Checksum Value Image_input = Input.GetText("ImageInput"); SHA1DOSCommand_bare = 'certutil -hashfile "#" SHA1' SHA1DOSCommand = String.Replace(SHA1DOSCommand_bare, "#", Image_input, false); StatusDlg.Show(MB_ICONNONE, false); StatusDlg.ShowProgressMeter(true); StatusDlg.SetTitle("Calculating SHA1 Checksum Value"); StatusDlg.SetMessage("Please wait"); SHA1DOSCommandOutput = CommandLine.Execute(SHA1DOSCommand, 0); if (SHA1DOSCommandOutput ~= nil ) then local my_string = (SHA1DOSCommandOutput.StdOut); local all_lines = {}; for line in my_string:gmatch("[^\r\n]+") do all_lines[#all_lines + 1] = line; SHA1ChecksumValue = Table.Concat(all_lines, ";", 2, 2); -- Removes gaps from the calculated checksum value if run on Windows 7 CalculatedSHA1ChecksumValue = String.Replace(SHA1ChecksumValue, " ", "", false); Paragraph.SetText("CalculatedSHA1ChecksumValue", CalculatedSHA1ChecksumValue); Label.SetEnabled("EnterKnownSHA1ChecksumValue", true); Image.SetEnabled("Search_png", true); Image.SetOpacity("Search_png", 100); StatusDlg.Hide(); end else StatusDlg.Hide(); Dialog.Message("Error", "Sorry. Failed to calculate the checksum value.", MB_OK, MB_ICONNONE, MB_DEFBUTTON1); end -- End Of Calculate SHA1 Checksum Value
the process of calculating the checksum value depends on the size of the image and the speed of the PC. For me between 10 seconds to 1 minute.
This is where I would like the progress bar to come in, to indicate how the calculation is going.
Hope you can understand what I am after and somebody can help.
I have made an example with a .iso image , under 400MB in size....
Well never thought that would be too large to be honest.
So my example will now NOT include the .iso image.
Hoping somebody can help.....
I do have a couple of examples downloaded. I will look at these some more. It may come to me..
Verihash - Progress Bar Help Example.apz
Comment