Progress Bar for File Download

Got a problem you cannot solve? Try here.
MaudDib
Posts: 16
Joined: Wed Jun 10, 2015 2:50 am

Progress Bar for File Download

Postby MaudDib » Mon Jun 15, 2015 7:49 am

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 9070 times


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


I really appreciate any help you can give me.

FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: Progress Bar for File Download

Postby FrancescoT » Tue Jun 16, 2015 12:20 pm

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.
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE

MaudDib
Posts: 16
Joined: Wed Jun 10, 2015 2:50 am

Re: Progress Bar for File Download

Postby MaudDib » Wed Jun 17, 2015 5:38 am

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 9045 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!

FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: Progress Bar for File Download

Postby FrancescoT » Wed Jun 17, 2015 1:25 pm

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
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE

MaudDib
Posts: 16
Joined: Wed Jun 10, 2015 2:50 am

Re: Progress Bar for File Download

Postby MaudDib » Thu Jun 18, 2015 2:04 am

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 9033 times


Download File - 02.JPG
Download File - 02.JPG (16.57 KiB) Viewed 9033 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

FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: Progress Bar for File Download

Postby FrancescoT » Thu Jun 18, 2015 1:01 pm

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
Attachments
Downloadtest.rar
(517.14 KiB) Downloaded 785 times
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE

MaudDib
Posts: 16
Joined: Wed Jun 10, 2015 2:50 am

Re: Progress Bar for File Download

Postby MaudDib » Fri Jun 19, 2015 2:55 am

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 9017 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

FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: Progress Bar for File Download

Postby FrancescoT » Fri Jun 19, 2015 1:11 pm

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
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE

MaudDib
Posts: 16
Joined: Wed Jun 10, 2015 2:50 am

Re: Progress Bar for File Download

Postby MaudDib » Mon Jun 22, 2015 8:04 am

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

FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: Progress Bar for File Download

Postby FrancescoT » Tue Jun 23, 2015 12:10 pm

:D
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE


Return to “Technical Support”

Who is online

Users browsing this forum: Google [Bot] and 135 guests