Page 1 of 1

Progress Bar for File Download

Posted: Mon Jun 15, 2015 7:49 am
by MaudDib
Dear Support

I've been trying to hookup a progress bar with a down load file command in the MSI Code designer. I'm doing this because what I would like to see in my custom dialog is a progress bar while a large file (or two) is downloading. I'm not sure if it is possible to do, but if so, would you be so kind as to give me an example or provide a link to a solution to solving this problem as i've not been able to find a clear example of how to do this.

Below is the code i've tried to get this to work with:

Code: Select all

~{A59B6E8D-ACB1-4950-83C5-BF6C51F0F94A}~
~Download File~
~{B15E7917-3720-48C2-80E4-4806AF97A6A1}~
~www.mybusinesswebsite.com/DemoDownloads/version01.msi,$DowloadFolder$,DownLoadSuccess,,,TRUE~
~mDown.dll\mDownExec.dll~
~Else~
~{D825C30C-E141-49C0-BF47-EB6FC2266807}~
~Download File~
~{36572F90-D108-419E-A2AB-D83753790A95}~
~www.mybusinesswebsite.com/DemoDownloads/version02.msi,$DowloadFolder$,DownLoadSuccess,,,TRUE~
~mDown.dll\mDownExec.dll~
~If~
~{FA05AA6D-C281-4D2E-A429-4D493D61296D}~
~VersionOptionEnterprise~
~0~
~TRUE~
~FALSE~
~Display Dialog~
~{F5E2E796-1641-43B9-80C4-668B44589035}~
~Progress 01 - File Download~
~~
~FALSE~
~~
~TRUE~
~FALSE~
~Set Variable~
~{A6A12188-B522-4BF2-9CC2-9B5EDEFC810F}~
~DownLoadProgress$MYAH$MYAH$FALSE~
~-1~
~Set Variable~
~{FD8EDD64-6232-469D-AF88-A136A265A0EA}~
~DownLoadSuccess$MYAH$MYAH$FALSE~
~FALSE~
~End~
~{36DD26A8-6AD1-49A3-A56F-F89A5FE7F7EB}~
~Create Folder~
~{44010DFC-EE99-4C0D-B3C3-D7F326E4B040}~
~C:\General\Installer~
~If~
~{987CEA4B-CBAF-490A-8E99-F61EBD33B39B}~
~InstallFolder~
~0~
~FALSE~
~FALSE~
~Does File/Folder Exist~
~{15BE9918-239F-48F5-B408-74877697EB6D}~
~InstallFolder~
~$DowloadFolder$~
~FALSE~


Also, here is a screen shot of the custom Dialog:

Progress 01.JPG
Progress 01.JPG (94.84 KiB) Viewed 9083 times


Progress 02.JPG
Progress 02.JPG (79.05 KiB) Viewed 9083 times


I really appreciate any help you can give me.

Re: Progress Bar for File Download

Posted: Tue Jun 16, 2015 12:20 pm
by FrancescoT
Dear MaudDib,

I am not able to paste your code, it seems not complete.

Anyway, the approach doesn't require any particular step to follow.
Of course, the custom variable used to control the custom progress-bar must be declared before the dialog is displayed.
Generally it's enough to declare it at the very beginning of the script.

Hope this helps you.

Re: Progress Bar for File Download

Posted: Wed Jun 17, 2015 5:38 am
by MaudDib
Hello Francesco

Thanks for your reply. My apologies for the code not working. I've soldiered on to try and get a solution to my question but unfortunately to no avail...

Concerning this issue that i'm having, let us focus on one thing at a time. Downloading a file and then hooking that up to a progress bar.

Firstly, here is an image of the code i'm using to test a file download. Thereafter is a copy and paste of the actual MSICode i'm using.

Download File 01.JPG
Download File 01.JPG (32.72 KiB) Viewed 9058 times


Code: Select all

~InstallAware Clipboard Data~
~End~
~{25DA207E-8E95-4C43-B6D9-49CD4B69D6CB}~
~MessageBox~
~{6E61855D-2554-4EB1-A7D1-A71F817480E4}~
~Download~
~Failed~
~0~
~1~
~~
~Else~
~{68A0CA46-9D33-43BA-BB63-2F358F2674AE}~
~MessageBox~
~{A84D9C71-087D-4FF7-A138-6F9E00887517}~
~Download~
~Success~
~0~
~1~
~~
~If~
~{0BC1BA46-F81D-4308-95C2-4778262F721B}~
~TestDownloadSuccess~
~0~
~TRUE~
~FALSE~
~Comment~
~{07063CB2-FCE5-4725-90D5-6FA4242F839D}~
~~
~Download File~
~{89F624FD-1506-4C87-B91D-675A5D37DEF4}~
~www.palladiumweb.co.za/DemoDownloads/testDownload.txt,$DownloadFolder$,TestDownloadSuccess,,,TRUE~
~mDown.dll\mDownExec.dll~
~Comment~
~{46321ABE-3A53-4928-82D2-9E1741E1BD3D}~
~~
~Set Variable~
~{3FDFBEC4-31C7-4607-A8B9-7DAE8161B501}~
~TestDownloadSuccess$MYAH$MYAH$FALSE~
~FALSE~
~Set Variable~
~{52C32E66-3FC7-47A6-AC94-D8DDFB44563A}~
~DownloadFolder$MYAH$MYAH$FALSE~
~C:\General\Installer~


(I'm not sure why but the copy and paste of the MSICode seems to reverse it when pasting into a text editor like note pad. An issue for another time perhaps or perhaps this is by design?)

Ok, so when i test the above code, the messagebox pops up indicating that the file did not download successfully. I also check the folder location and can confirm that the file wasn't downloaded. Also note that I commented out the variable DownloadFolder in the above code as i declare it elsewhere first.

I'm probably missing some simple command that i'm not aware of to get this file to download or perhaps i'm not wrapping it with the correct code block. In either case I'd appreciate your help again.

Also, I'm not sure that attempting to hook the file download to the progress bar is going to yield any good result just yet so i'm hoping we can have a re-look at it after this failed download issue is resolved.

Thanks again!

Re: Progress Bar for File Download

Posted: Wed Jun 17, 2015 1:25 pm
by FrancescoT
Dear MaudDib,

did you try to use a different file type (not a TXT file)?
For test purpose you may try with an INI file or a compressed archive.

Let me know.

Regards

Re: Progress Bar for File Download

Posted: Thu Jun 18, 2015 2:04 am
by MaudDib
Hello Francesco

I have tried both a compressed archive and an INI file but sadly neither have worked, see below:

Download File - 01.JPG
Download File - 01.JPG (17.16 KiB) Viewed 9046 times


Download File - 02.JPG
Download File - 02.JPG (16.57 KiB) Viewed 9046 times


Well, i'd appreciate any other idea? Is it perhaps got something to do with being a win 32 or win 64 machine?

Best regards

Re: Progress Bar for File Download

Posted: Thu Jun 18, 2015 1:01 pm
by FrancescoT
Dear MaudDib,

please try the attached test project, I was able to download your "testDownload.rar".

NOTE!
The script uses Native Engine to create the destination folder, for more details please have a look at the following link.
http://www.installaware.com/forum/viewtopic.php?f=2&t=10212


Regards

Re: Progress Bar for File Download

Posted: Fri Jun 19, 2015 2:55 am
by MaudDib
Hello Francesco

Thanks for the helpful link as well as the attachment.

It turns out that the download file command was not working due to it being used incorrectly on my part. Note, in the image, that the download file command was missing the name of the file in the location section.

Download File - 01.JPG
Download File - 01.JPG (18.1 KiB) Viewed 9030 times


Now that this is working, I would like to know if it be possible to hook up a progress bar so that i can build a custom dialog displaying the progress of downloading a number of files? If so, would you be able to give me a code sample or useful link?

Best regards

Re: Progress Bar for File Download

Posted: Fri Jun 19, 2015 1:11 pm
by FrancescoT
Dear MaudDib,

it's quite simple.

- Declare a custom variable to control the progress-bar
- Associate the variable to a custom progress control (as you have already done with your first post)
- Display the dialog (Modeless) that includes your custom progress control
- Finally increment your custom variable to display the job steps

Example

Code: Select all

Set Variable MYPROGRESS to 0
Display Dialog: progress, use as progress dialog (non-modal)
 
Comment: Do something
Set Variable MYPROGRESS to 20
Comment: Do something
Set Variable MYPROGRESS to 50
Comment: ...when completed
Set Variable MYPROGRESS to 100
 
Hide Dialog

Hope this helps you.

Regards

Re: Progress Bar for File Download

Posted: Mon Jun 22, 2015 8:04 am
by MaudDib
Hi Francesco

Thanks for your help so far. At the moment, i've had to change directions and perhaps will get back to this if need be.

Best regards

Re: Progress Bar for File Download

Posted: Tue Jun 23, 2015 12:10 pm
by FrancescoT
:D