private static void UpdateConfigFile(Session session, UpdateDetectionVariables updateDetectionVariables, string appToken) { string configFileName = GetConfigFileName(session, updateDetectionVariables); // Connection string DatabaseSetupInfo databaseSetupInfo = DatabaseSetupInfo.CreateFromFeature(session, updateDetectionVariables.DatabaseFeatureName); CprBroker.Installers.Installation.SetConnectionStringInConfigFile( configFileName, updateDetectionVariables.ConnectionStringName, databaseSetupInfo.CreateConnectionString(false, true) ); // Service url CprBroker.Installers.Installation.SetApplicationSettingInConfigFile( configFileName, "UpdateLib.Properties.Settings", "CPRBrokerPartServiceUrl", session.GetPropertyValue("PARTSERVICEURL") ); // App token CprBroker.Installers.Installation.SetApplicationSettingInConfigFile( configFileName, "UpdateLib.Properties.Settings", "ApplicationToken", appToken ); }
private static Dictionary <string, WebInstallationOptions> GetWebInstallationOptions(Session session) { DatabaseSetupInfo databaseSetupInfo = DatabaseSetupInfo.CreateFromFeature(session, "PM"); Dictionary <string, string> connectionStrings = new Dictionary <string, string>(); connectionStrings["CPRMapperDB"] = databaseSetupInfo.CreateConnectionString(false, true); WebInstallationOptions options = new WebInstallationOptions() { ConnectionStrings = connectionStrings, ConfigSectionGroupEncryptionOptions = new ConfigSectionGroupEncryptionOptions[0], EncryptConnectionStrings = false, InitializeFlatFileLogging = false, FrameworkVersion = new Version("4.0") }; var allOptions = new Dictionary <string, WebInstallationOptions>(); allOptions["PM"] = options; return(allOptions); }