Download component if file does not exist with different folders?

Mar 23, 2009 at 2:31 AM

Hi there,

is there a way to tell the dotNetInstaller to download a file X to a specific location (like the TEMP-Path) if a file does not exist in a different location then the download destination?
The situation is that I have some support files like the .Net 3.5 installer in the default directory structure (SupportFiles/...). Now I want the bootstrapper to check if that file (and/or) path exists and if not, show the download dialog. The problem with having checking and destination folder the same is that I can not be sure to have write access at the folder where I do the file-exists-check.

Thanks,
Tom

Coordinator
Mar 23, 2009 at 1:25 PM
This makes sense. There's no support for this right now. File a feature request.
Mar 23, 2009 at 3:40 PM
done :)
Coordinator
Apr 27, 2009 at 5:06 PM
This is done in revision 22878. 1.6 beta has been updated.
http://dotnetinstaller.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=23955

Took a slightly different approach. Added sourcepath that's checked first in a download component. If that exists, doesn't download the file but uses sourcepath to copy it from. This is the only way to let the component itself have a single executable location. I think it accomplishes the same end result.

Let me know if this works.

Apr 28, 2009 at 11:05 PM
Edited Apr 29, 2009 at 4:05 PM

Hi,

thank you very much. I tryed the last version but did not get it to work. I tryed putting both, the whole path with and without the the fileaname (e. g. "#APPPATH\SupportFiles\dotNet3.5_CF\NETCFSetupv35.msi" and "#APPPATH\SupportFiles\dotNet3.5_CF\", into "sourcepath". Both did not work. In particular the download dialog is shown after pressing "Install" in the compiled bootstrapper and if I press "start" (the last version I tryed the download dialog was not shown if the file exists locally) a message box pops up. This messagebox says:
"Error copying"
>The path I entered in "sourcepath" with #APPPATH correctly substituted<
"The system cannot find the stated path." (or sth. similar, I tested only the german "version" of my bootsrapper).

After pressing "OK" I get the message that an error occured while installing the component and if I want to continue with other componenents (which seams correct).

Regards and again, thank you very much,
Tom

Edit: The problem was due to using not only "#TEMPPATH" as "destionationpath" but also sub folders like "#TEMPPATH\SupportFiles\dotNet3.5_CF" - it seams that the directories are not created if they do not exist. Strange is that the download dialog does now appear again and I have to click "start" to copy the file to to the destinationfolder. Could you please hide the download-dialog again if all files are locally available?

Edit #2: Strange, it seams that everything works as expected :P - the download dialog does not appear anymore. So no problem anymore.

Regards & thanks,
Tom

Coordinator
Apr 29, 2009 at 5:38 AM
I think you might be onto a problem here. I think that the download dialog might actually still be appearing if sourcepath exists. Then you have to press Start if it doesn't have auto-start. Then maybe there's a problem with creating subdirectories. I'll test this.
Coordinator
Apr 30, 2009 at 2:02 PM
Tested and fixed. Now the download dialog will not appear at all of sourcepath exists.
May 2, 2009 at 2:24 PM
Perfect, thank you very much!
May 3, 2009 at 5:12 PM

I am sorry to come up with this again, but somehow the download is now broken. I spent some time to get it right, but no success. If the file exists it gets installed, but if not an error appears that the component failed to install. The relevant part of the log file is (the file did not exist locally):

2009-05-03 18:09:43 --Executing component: Microsoft .NET Compact Framework 3.5
2009-05-03 18:09:43 Opening Download Dialog: Microsoft .NET Compact Framework 3.5 - Herunterladen der Komponenten
2009-05-03 18:09:43 DestinationFullFileName: F:\Temp\{1AE1B926-9E42-4CE0-9FBF-70AD74D40EAA}\NETCFSetupv35.msi
2009-05-03 18:09:43 FileExists: False
2009-05-03 18:09:43 Copy: True
2009-05-03 18:09:43 SourcePath: E:\src\Setup\Release\SupportFiles\dotNet3.5_CF\NETCFSetupv35.msi
2009-05-03 18:09:43 DestinationPath: F:\Temp\{1AE1B926-9E42-4CE0-9FBF-70AD74D40EAA}
2009-05-03 18:09:43 DestinationFullFileName: F:\Temp\{1AE1B926-9E42-4CE0-9FBF-70AD74D40EAA}\NETCFSetupv35.msi
2009-05-03 18:09:43 AlwaysDownload: False
2009-05-03 18:09:43 FileExists: False
2009-05-03 18:09:43 ***Component ERROR ON DOWNLOAD OR EXECUTING

And once more, with the file locally available:

2009-05-03 18:08:24 --Executing component: Microsoft .NET Compact Framework 3.5
2009-05-03 18:08:24 Opening Download Dialog: Microsoft .NET Compact Framework 3.5 - Herunterladen der Komponenten
2009-05-03 18:08:24 DestinationFullFileName: F:\Temp\{8868B8F4-57EB-4581-968D-CE95C3F547CD}\NETCFSetupv35.msi
2009-05-03 18:08:24 FileExists: False
2009-05-03 18:08:24 Copy: True
2009-05-03 18:08:24 SourcePath: E:\src\Setup\Release\SupportFiles\dotNet3.5_CF\NETCFSetupv35.msi
2009-05-03 18:08:24 DestinationPath: F:\Temp\{8868B8F4-57EB-4581-968D-CE95C3F547CD}
2009-05-03 18:08:24 DestinationFullFileName: F:\Temp\{8868B8F4-57EB-4581-968D-CE95C3F547CD}\NETCFSetupv35.msi
2009-05-03 18:08:24 AlwaysDownload: False
2009-05-03 18:08:24 FileExists: False
2009-05-03 18:08:24 Executing: msiexec /I "F:\Temp\{8868B8F4-57EB-4581-968D-CE95C3F547CD}\NETCFSetupv35.msi"

The thing that is strange on the second log (or I don't understand it :P) is why is "FileExists: False" written there after the file has been copyed?

The whole component is a MSI component with a download dialog and one download file.

Regards,
Tom

Coordinator
May 7, 2009 at 12:11 AM
My bad. Fixed the first part, new build uploaded. Let me know if you still see any of these two issues.
May 8, 2009 at 9:26 AM

Great, thank you very much. It works flawlessly again.

Regards,
Tom