Share via


Modifying package deployment method via command line

So as mentioned previously there are three ways to deploy Bootstrapper prequisites.  Just to review:

SameSite - They exist on the same URL as the Bootstrapper
HomeSite - Packages are downloaded from their own vendor's websites
ComponentsURL - All packages are downloaded from a seperate URL

Did you know that you can configure which method the Bootstrapper will use after the Bootstrapper has been built?  The Bootstrapper supports modification of how it will obtain package files via the command line.  Before I can go into how to change it, let me first supply some pseudo code for how the Bootstrapper chooses where to download packages from.

// pkg.RelativePath = "dotnetfx\dotnetfx.exe"
foreach (PackageFile pkg in packagesToDownload)
{
   if (m_useHomeSite == true)
   {
      if (pkg.HomeSiteURL != null)
         Download(pkg, pkg.HomeSiteURL);
      else
         Download(pkg, m_applicationURL + pkg.RelativePath);
   }
   else
   {
      if (m_componentsURL != null)
         Download(pkg, m_componentsURL + pkg.RelativePath);
      else
         Download(pkg, m_applicationURL + pkg.RelativePath);
   }
}

The ApplicationURL can be thought of as the 'working directory' for the Bootstrapper, except it is burned in at build time.  (Because if setup.exe is launched from a web the official working directory will be the IE cache.)  This property is automatically set by ClickOnce deployments and is equal to the ClickOnce InstallationURL.

So if SameSite is chosen, then HomeSite is false and the ComponentsURL is not set.  This way all packages are downloaded relative to the ApplicationURL.  Selecting ComponentsURL as the package deployment method however means that all packages are downloaded relative to that seperate, ComponentsURL.  HomeSite means use the package's HomeSite if available otherwise use SameSite (ApplicationURL).

Now that you know how the ApplicationURL, ComponentsURL, and HomeSite values are used by the Bootstrapper, we can begin setting them via the command line.

To set the ApplicationURL:
setup.exe -url=<new application url>

To set the ComponentsURL:
setup.exe -componentsurl=<new components url>

To set the HomeSite flag:
setup.exe -homesite=<true / false>

Note that you can also check the current values by typing:
setup.exe -url

The only caveat is that if you change the HomeSite, ComponentsURL, or ApplicationURL via the command line the Bootstrapper will modify itself.  Meaning that any existing authenticode signature will be invalidated.  So don't alter the Bootstrapper on the command line unless absolutely nessecary.

Comments

  • Anonymous
    October 18, 2005
    Changing via the -homesite=false doesn't seem to work with VS2005 RC installers.
  • Anonymous
    October 19, 2005
    The comment has been removed