InstallSite Forum


Forum Rules Only for (pure) InstallScript projects

THIS SECTION IS NOT FOR MSI (WINDOWS INSTALLER) PROJECTS, not even for "InstallScript MSI"

  Reply to this topicStart new topicStart Poll

> How to Download a file from the web., How to Download a file from the web.
rjprasadch
  Posted: 2010-07-26 10:55
Quote Post





Group: Full Members
Posts: 20
Member No.: 14880
Joined: 2008-08-27



Hi,

We are using installshield and we are having one installscript project. We have a below requirement.

One text file will be there in a particualar website and we need to download that text file from the web and need to copy the file in c:\ drive in the local machine. For this requirement, we are trying with XCopyFile(), but it is not working. Can anyone please let me know how we can download a file from the web in Installscript projects. Whether we can use XCOpy file or any other features are there.

For example, my requirement is “need to download a file “Test.txt” from www.yahoo.com and copy the downloaded file in C:\ drive in local machine.How to do this in installscript projects.

Thanks for your help in advance
PMEmail Poster
Top
Taco Bell
Posted: 2010-07-26 14:39
Quote Post


IS6 Expert


Group: Moderators
Posts: 1190
Member No.: 1868
Joined: 2001-10-12



I would recommend that you try using CopyFile() instead of XCopyFile() since it's just one file and since I've successfully used that to download files from a web site.


--------------------
user posted image
PMEmail PosterUsers WebsiteAOLMSN
Top
rjprasadch
Posted: 2010-07-26 15:20
Quote Post





Group: Full Members
Posts: 20
Member No.: 14880
Joined: 2008-08-27



QUOTE (Taco Bell @ 2010-07-26 14:39)
I would recommend that you try using CopyFile() instead of XCopyFile() since it's just one file and since I've successfully used that to download files from a web site.

Thanks for your rely. Using XCopyfile, i have tried with following piece of code.But it is not working. Can you please let me know if i am missing anything in the below code. Can you please let me know whether URL mentioned is in the correct format.

#define SDIR "https:\\www\\yahoo.com\"
#define TDIR "C:\\File Download\\"

STRING szSrcFile;

begin

szSrcFile = "Test.txt";

if (XCopyFile (SDIR ^ szSrcFile, TDIR ^ "*.*", COMP_NORMAL) < 0) then
MessageBox ("XCopyFile failed", SEVERE);
else
MessageBox ("Text files successfully copied.", INFORMATION);
endif;

end;
PMEmail Poster
Top
Taco Bell
Posted: 2010-07-27 14:59
Quote Post


IS6 Expert


Group: Moderators
Posts: 1190
Member No.: 1868
Joined: 2001-10-12



Well, looking at your code, I was using a unsecured web site as opposed to a secure web site.

However, I also see a typo in the SDIR constant as it should be "www.yahoo" instead of "www\\yahoo".


--------------------
user posted image
PMEmail PosterUsers WebsiteAOLMSN
Top
Glytzhkof
Posted: 2010-07-28 02:07
Quote Post





Group: Moderators
Posts: 1322
Member No.: 5425
Joined: 2002-10-30



Just for the record: downloading files from the Internet from your setup.exe is considered very bad practice. If you are targeting larger corporations with the software it is a great way to get your product axed since solving these designs for deployment via system accounts over the network is a bleeding nightmare. I have worked with deployment solutions in large companies, and deployment problems is high on the list of reasons to eliminate products when selecting...

I would only consider doing this if the target group does not include large corporations, the installation base is small and the design genuinely contributes positively to the overall "ease of use" for the user. In other words it really eliminates tedious manual setup for the user.

A simple alternative solution is to have your main application EXE file perform the download of the file after the installation is complete. Apart from corporate deployment problems, Internet usage from the setup can also trigger serious deployment problems in relation to anti virus software, firewalls and perhaps even network issues with NAT translation (though this isn't so much of a problem these days I think).

A failed setup experience means your product literally never gets evaluated and appreciated for whatever it is. The setup failure is a great place to give up for people with options.


--------------------
Regards
-Stein Åsmul
PMEmail Poster
Top

InstallShield & AdminStudio Training

Kurse in deutscher Sprache hier.

Courses in English, French and Italian language here.


« Next Oldest | "InstallScript" Projects in InstallShield X and above | Next Newest »

Topic Options Reply to this topicStart new topicStart Poll