Note that there are some explanatory texts on larger screens.

plurals
  1. POapp.Config file entries are cleared on Repair installed Setup
    primarykey
    data
    text
    <p>I have created a Setup Project for my Project. This project connects to a live DB server through asmx services. That URL will be determined after the client will deploy the web services on some server. So in setup project i have added a "TextBoxes" dialog in User Interface Editor section of the Setup Project where i have enabled only one TextBox to get the URL of the deployed Services. In my project i have added a file to be executed during Setup installation and i have defined it as follows:</p> <pre><code>[RunInstaller(true)] public class InstallerHelper : System.Configuration.Install.Installer { // Other Code also exists that is not needed to be shown here&lt;br/&gt; //..... // The following method gets executed during setup installation public override void Install(IDictionary stateSaver) { try { base.Install(stateSaver); //Proceed only if the Context object has some parameters if (Context.Parameters.Count != 0 &amp;&amp; !string.IsNullOrEmpty(Context.Parameters["WEBSITEURL"])) { //Get the installation Folder's Path string installationFolder = Context.Parameters["INSTALLFOLDER"]; // Get the Site's URL entered by Client string websiteUrl = Context.Parameters["WEBSITEURL"]; //Create different Key Value pairs based on entered URL string[][] keyValues = { new string[] {"SiteUrl",websiteUrl}, new string[] {"WebServiceURL", websiteUrl + "Users.asmx" }, new string[] {"TicketsServiceURL", websiteUrl + "Tickets.asmx"}, new string[] {"CampaignsAndProjetcsServiceURL", websiteUrl + "CampaignsAndProjetcs.asmx"}, new string[] {"EntitiesURL", websiteUrl + "Entities.asmx"}, new string[] {"AccountsURL", websiteUrl + "Accounts.asmx"}, new string[] {"TransactionsURL", websiteUrl + "Transactions.asmx"}, new string[] {"RelatedReportsURL", websiteUrl + "RelatedReports.asmx"}, new string[] {"GiftAidsURL", websiteUrl + "GiftAids.asmx"} }; // Load the app.Config file and store these values in it. //******************************************** string configFilePath = installationFolder + @"\MyProject.exe.config"; XmlDocument configuration = new XmlDocument(); // Load App.Config File configuration.Load(configFilePath); //Add the values in it Utility.UpdateValue(keyValues, configuration); //Save configuration File configuration.Save(configFilePath); //********************************************&lt;br/&gt; } } catch (Exception ex) { throw new InstallException("The following Error(s) occured during installation. \n " + ex.Message); } } </code></pre> <p>}</p> <p>Here i Store the entered URL and some other generated URLs of different web services in App.Config of the Project to be used in Project for accessing data. </p> <p>It works fine when i install a fresh copy of the Setup, but problem occurs when i try to Repair the installed project by again executing the Setup.exe file.</p> <p>Repair process does not asks me to enter the URL again and also the Items stored in App.Config during first time installation are lost. So the whole application stops working.</p> <p>Any help is greatly appreciated</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload