1

Our team at work has written a wrapper application/interface to install a series of msi's silently using msiexec.

My issue relates to installing the msi's directed at IIS.

I keep getting the following error

Error 1314. The specified path 'Default Web Site/ROOT/someVirtual' is unavailable. The Internet Information Server might not be running or the path exists and is redirected to another machine. Please check the status of this virtual directory in the Internet Services Manager.

The msi gets executed with the following parameters set as follows

msiexec.exe /i "D:\SOME.msi" UseShellExecute="false" TARGETSITE="Default Web Site" TARGETVDIR="someVirtual" TARGETAPPPOOL="DefaultAppPool" /qn /l* D:\SOME_log.txt

I realize this issue is stricly IIS related as I'm probably missing some setting/option that i need to setup.

As far as I can see my virtual is in this location "NT4334RB\Sites\Default Web Site\someVirtual", so my best guess would be that "Default Web Site/ROOT/someVirtual" - ROOT is the issue and needs to be set, but to what? and how?

I just came across this line in the logfile - I think this might be of use?

Getting AppRoot From Url key 'TARGETURL'

Rohan Büchner
  • 5,333
  • 4
  • 62
  • 106
  • 1
    What tools are you using to generate this MSI. MSI does not natively support IIS so this functionality is provided by custom logic. I see that you are running the apps silently. It might be useful to run them interactively and double check all the properties that the installer sets\gathers from the user *before* it moves to the InstallExecuteSequence. On another note, the UseShellExecute property is mixed case and therefore private. Setting it on the command line will probably have no effect on a silent installation. – Stephen Connolly Oct 15 '12 at 11:45
  • 1
    Thanks for the advice. See my accepted answer if you're interested. We are using the native VS2010 deployment projects to create the MSI's. Our need was to auto deploy our application to an alpha environment once its been built. The MSI ran fine when I ran the installer using the GUI, and as far as I can see it required those parameters listed in my question. I needed to add the UseShellExecute property to allow the setting of some of the parameters, as the installation failed without it. – Rohan Büchner Oct 16 '12 at 07:33

1 Answers1

0

Seemed like my issue was related to me not specifying the metabase path correctly. I ended up adding a helper in my code to the likes of this.

Found various solutions on SO (this got me thinking in the right direction), & I also installed something called IIS Metabase Explorer which was quite useful

//Added for reference purposes
//HasRequiredOption("site|s=", "The site location", c =>
//AddOrUpdateAdditionalMsiProperty("TARGETSITE", BuildMetabasePath(c)));

//apppool => TARGETAPPPOOL
//virtualdir => TARGETVDIR

/// <summary>
/// Builds the meta-base path.
/// </summary>
/// <param name="websiteName">Name of the website.</param>
/// <returns>The fully constructed meta-base path</returns>
private string BuildMetabasePath(string websiteName)
{
    return "/LM/W3SVC/" + this.GetWebSiteId(websiteName);
}

/// <summary>
/// Gets the web site id.
/// </summary>
/// <param name="websiteName">Name of the website.</param>
/// <param name="serverName">Name of the server. Defaults to: localhost if none specified</param>
/// <returns>The website id</returns>
private string GetWebSiteId(string websiteName, string serverName = "localhost")
{
    using (var entries = new DirectoryEntry(string.Format("IIS://{0}/w3svc", serverName)))
    {
        var children = entries.Children.Cast<DirectoryEntry>();
        var sites =
           (from de in children
             where
             de.SchemaClassName == "IIsWebServer" &&
             de.Properties["ServerComment"].Value.ToString() == websiteName
             select de).ToList();

       if (sites.Any())
       {
          return sites.First().Name;
       }
   }

  return "-1";
}
Community
  • 1
  • 1
Rohan Büchner
  • 5,333
  • 4
  • 62
  • 106