Supply path variable during setup

28 Views Asked by At

I apologize if this is the wrong place to ask this. I am new to creating installation packages for my programs. I have a small file system watch program I wrote when they took out all the fax machines and now everything arrives electronically to a folder on a file server. The program works great and notifies the proper people when a fax arrives, or if a fax exists when they start the program, and if a fax that has already been reviewed is still in the folder where they arrive. I have been asked if they can make this program available to other departments in the local government where I work. I have the watching folder hard coded now and I would like to let them change that path during installation. I cannot for the life of me find out how to do this digging into visual studio install project so it asks for the location to be watched.

My code:

     public partial class MainWindow : Window
     {
        FileSystemWatcher fs;
        DateTime fsLastRaised;
        public string watchingFolder;
        public string [] filearray;
        bool paintopen;
        bool wordopen;
        bool excelopen;
        public MainWindow()
        {
            InitializeComponent(); 
        }

        private void BtnStart_Click(object sender, RoutedEventArgs e)
        {
            listBox1.Items.Add("Fax Watch has started.");
            //the folder to be watched
            watchingFolder = @"S:\Fax\APCDFrontDeskFax";
            //initialize the filesystem watcher
            fs = new FileSystemWatcher(watchingFolder, "*.*");

watchingFolder is the variable I want them to be able to supply during install for the program.

I haven't been able to find this question anywhere, (stackoverflow, google, MS community forums, etc...) and it is probably that I don't know how to properly ask the question. I have tried to start the create an installer project for the program but I cannot see where I could input the variable dialog box to allow me to change the variable in the coding at installation time. I have seen references to other installers other than the VS installer project extension. If I need to go that route(Different installer) I will check into it if advised to do so.

I would like for the person doing the install to provide the path for the program to watch during the installation process so it can be changed during install.

Thank you in advance for your assistance.

0

There are 0 best solutions below