Replace the code I listed with these two Functions.

1. Populate the Listbox with the Collection:

  private static ApplicationCollection GetApplications(Site site)
     {
         //HttpContext.Current.Trace.Warn("Site ID3: " + site + "/n");

         ApplicationCollection appColl = site.Applications;

         return appColl;
     }

2. Iterate the collection, and match it with this:

private static Site GetSite(string siteName)
     {
         Site site = (from s in (new ServerManager().Sites) where  
s.Name == siteName select s).FirstOrDefault();

         if (site == null)
             throw new Exception("The Web Site Name \"" + siteName +  
"\" could not be found in IIS!");

         return site;
     }

If you want the host name use:

private static String GetHostName(Site site)
     {
         BindingCollection bindings = site.Bindings;

         String bind = null;

         foreach (Binding binding in bindings)
             if (binding.Host != null)
                 return binding.ToString();

         return bind;
     }

Once Site or Bind is Returned, set INSTALLDIR to site or bind.  I  
can't guide you further until we test it, as I don't know if site can  
be converted from a string to the virtual path.  Test the Custom  
Action by writing the output to a StreamWriter, and I'll help further.


Quoting Tony Jose Mampilly <kooltonyj...@gmail.com>:

> Hi Carter,
>
> If you know a fix for this issue can you please direct me in right
> direction, as I am not too good at Wix and custom actions. I came up with
> this issue when I was building some setups for my project as VS2012 has
> stopped support for setup and deployment project.
> Thanks in advance
>
> Regards
> Tony Jose



------------------------------------------------------------------------------
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to