Beispiel #1
0
        public override void Install(IDictionary stateSaver)
        {
            base.Install(stateSaver);

            //
            // Create context parameter object.
            //
            InstallerParams options = new InstallerParams(Context);

            options.Save(stateSaver);

            //
            // Load app.config from the installation directory.
            //
            Configuration            config  = ConfigurationManager.OpenExeConfiguration(options.AssemblyPath);
            ServiceModelSectionGroup section = (ServiceModelSectionGroup)config.GetSectionGroup("system.serviceModel");

            //
            // Update all endpoint addresses with the value determined by setup.
            //
            foreach (ChannelEndpointElement endpoint in section.Client.Endpoints)
            {
                SetupLog(string.Format("Updating endpoint address for {0}: URL = {1}", endpoint.Name, options.GetSoapEndpoint()));
                endpoint.Address = new Uri(options.GetSoapEndpoint());
            }

            //
            // Write the modified client configuration back to disk.
            //
            config.Save();
        }
Beispiel #2
0
 public override void Uninstall(IDictionary savedState)
 {
     base.Uninstall(savedState);
     InstallerParams options = new InstallerParams(savedState);
 }