Click here to Skip to main content
12,755,775 members (35,808 online)
Rate this:
Please Sign up or sign in to vote.
See more: C#

I create a installer (setup) for my WM application. The purpose of this installer is to allow user to enter a server URL and save it to the app config file. Here is what I have done:
1) Add "Textboxes (A)" below the "Welcome" folder
2) In the custom installer project, add the following code to "Install" event. There is no error but the config file does not get updated.

Question - what is the proper way to get this done? Thank you in advance!


// code block:
public override void Install(IDictionary stateSaver)

    // Just to test whether this get executed, I use a temp text file
    // but it does not get created.
            // save user input
            string sUserInput = this.Context.Parameters["EDITA1"];
            string TEMP_FILE = @"tempFile.txt";
            // installPath has the correct value from Registry
            string sUserInputFile = Path.Combine(installPath, TEMP_FILE);
            StreamWriter oURLWriter = File.CreateText(sUserInputFile);
            oURLWriter.WriteLine("end of user input");

    // It seems to complete the installation with the following okay:
    // Get the path to ceappmgr.exe, ini file and pass them to
    // System.Diagnostics.Process.Start(...)


[edit]code block added[/edit]
Posted 18-Dec-12 13:09pm
Updated 18-Dec-12 13:36pm
Nelek 18-Dec-12 18:39pm
Just for your information, when you are composing a message you can select your code block and use the widget "code" at the tool bar of the edit board, it will open a list where you can choose the most adecuated language for your code snippet. So it will appear formated and with colors that make it easier to read. I have done it for you.

If you need to change/add anything, please use the widget "improve question" in the low right corner of your question.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

    Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170217.1 | Last Updated 18 Dec 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100