locked
Web Setup with Custom Actions on IIS6/7 RRS feed

  • Question

  • User527279455 posted

    Hello,

    I have made a Web Setup project in Visual Studios 2008 and trying to install on machines running Server 2003( IIS6) and Server 2008( IIS7). While installing or after, I would like a custom action to occur that will do two things, change a folder’s authentication to Windows Authentication and make a virtual directory bound to a physical directory. Also after installing I am trying to get Internet Explorer to open with the installed application. I’ve tried using MWA (Microsoft Web Administration) to get the paths but it is IIS 7 specific. For authentication I am currently using DirectoryEntry and changing the AuthFlags of that entry:



    DirectoryEntry tree = new DirectoryEntry(metabasePath);

    tree.Properties["AuthFlags"].Value = MD_AUTH_NT;

    tree.CommitChanges();



    The problem with this is getting the Path that I need for this. When using MWA, the custom action worked, and the path was formatted as “ W3SVC/1/Root/AppName/Admin”. Now I need to find a way of getting this path.

    For opening IE after install, I am using:


    System.Diagnostics.Process.Start("C:\\Program Files\\Internet Explorer\\iexplore.exe", "http://localhost/" + /*Port*/ + targetvDir + "/Admin/");


    I am able to get the targetvDir by passing it to the custom action, but not able to get the Port number.


    Thanks,

    Mike

    Wednesday, July 22, 2009 1:17 PM

Answers

  • User372121194 posted

    Hi,

    The default port is 80. Do you allow customer to specify the port in the web setup install wizard? If so, you can use CustonActionData and set corresponding name/value pairs in User Interface, where customer can input port num and you can retrieve it in Custom Action.

    For example, we create Custom Action and use following CustonActionData:/PortValue="[Port]".

    Then we can get select value from Custom Action:
            public override void Install(System.Collections.IDictionary stateSaver)
            {
                base.Install(stateSaver);
                string str = Context.Parameters["PortValue"];
                ......
            }

     For related example, see http://msdn.microsoft.com/en-us/library/9cdb5eda.aspx


    I look forward to receiving your test results.

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, July 27, 2009 5:30 AM