Write to config file from deployment project

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a deployment project where I collect the paths to 4 user defined
directories using user interface textboxes that are then mapped to folders in
the file system editor that are always created. This all works fine.

What I want to do is update the config file for the application so that if
any are changed the application will know what those folders are. I have
tried to use a Custom action to write the config file but the install
override does not seem to be called at all.

If you write an override in an installer class, how and where is this called?

I have looked at the Walkthrough for Passing Data to a Custom Action but the
method never seems to get fired.

Any help is appreciated.

PeterW
 
Thanks Gregory.

I did find the article and tried to get this working. I have another post
todau that deals with this under the subject "Windows service Deployment
problems"

I added a Custom Action with CustomActionData of /WATCH="[WATCHED]\"
/UPLOADED="[UPLOADED]\" /ERRORS="[ERRORS]\" /ERRORFILE="[ERRORFILE]\"

This gets to the point where it presents a login dialog and one tabs away
from it, at this stage the application has been created under the Program
Files\Manufacturer\project\ folder and the data directories have been created
using CustomFolders at different paths from the root based on information
collected by the installer from a UserInterfaceTextBox page using all four
textboxes for the CustomActionData keys above.

I have a ProjectInstaller class in which I override the Install method call
the base method and then call another method which accesses the vales in
this.Context.Parameters["WATCH"] and use this to update the config file based
on the sample code. To this I added some logging to the EventLog just to
prove that it is alll working. The override Install method does not appear
to be being called.

On entering the credentials of custom user defined specificallly for this
service the installer shows a dialog box with "Object reference not set to an
instance of an object" as its sole text and the installation rolls back.

Without the custom action and using installutil directly on the windows
service, it installs using the same credentials above and starts and does
what is required. Its just that the config file is out of step if different
paths are used and I would prefer to be able to get it right.
 
Back
Top