Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#
Hi,
 
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!
 
~Dody
 
// code block:
public override void Install(IDictionary stateSaver)
{
    base.Install(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(sUserInput);
            oURLWriter.WriteLine("end of user input");
            oURLWriter.Flush();
            oURLWriter.Close();
 

    // 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 12:09pm
Edited 18-Dec-12 12:36pm
48.3K
v2
Comments
Nelek at 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
0 OriginalGriff 310
1 Sergey Alexandrovich Kryukov 166
2 PhilLenoir 164
3 Richard MacCutchan 160
4 Sharmanuj 146
0 Sergey Alexandrovich Kryukov 6,077
1 OriginalGriff 5,115
2 CPallini 2,473
3 Richard MacCutchan 1,597
4 Abhinav S 1,505


Advertise | Privacy | Mobile
Web01 | 2.8.140814.1 | Last Updated 18 Dec 2012
Copyright © CodeProject, 1999-2014
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