Does VS 2008 or 2010 Express edition come with any kind of usable from console http downloading util?

98 views Asked by At

I want to create a simple project setup script. I assume user (which owns a PC with VS2008 or 2010 on board (Express)) can download a .BAT file with my set up script from the internet. I wonder is there any standart utill that comes with VS that would be capable to download needed for my project setup source and project files via http on some commatnd call in BAT file (which is ran from VS consol)?

1

There are 1 answers

1
sehe On

nope. I suppose you should get somewhere

  • doing a 6-line C# program, e.g. to download prime numbers to 100k:

    using System;
    using System.Net;
    using System.Linq;
    
    class MainClass
    {
        public static void Main (string[] args)
        {
            using (var wc = new WebClient())
                foreach (Uri url in args.Select(a => new Uri(a)))
                    wc.DownloadFile(url.ToString(), url.Segments.LastOrDefault()?? "unnamed");
        }
    }
    
    • Compile: csc.exe Downloader.cs; voilĂ , minimalist wget.net (on Mono, use gmcs.exe Downloader.cs. Both executables will run on Mono on Linux, Solaris and MacOs just as well.

    • Call it with e.g. Downloader.exe "http://www.mathsisfun.com/includes/primes-to-100k.zip" "http://www.mathsisfun.com/includes/primes-to-200k.zip" ...

    • TODO: error handling

  • using NuGet (download the standalone .exe)

  • using PowerShell (install the MSI; this does a lot more)

My recommendation is to install some kind of UNIX shell + userland subset. Weapon of choice: Cygwin (http://cygwin.com), but several others exist (UnxUtils, MingW ports and dozens others)

Google for wget.exe + windows and you shall find them

HTH