views:

70

answers:

1

I am building a Windows Service which will be deployed on four servers. My user wants to have the service read a configuration file from a common location, and load it OnStart.

I want the installation to prompt the user for the file path and file name to the configuration file when the service is installed, and then save that data in My.Settings.

I have figured out how to set the EDITA1 and EDITA2 variables in the Deployment project's UI, so that the user will be prompted for path and file name, but I don't know how to get those values out and into the settings of the service.

Help, please.

-Jennifer

A: 

Did you try passing it to the custom action using CustomActionData Property in the Custom Action property window. syntax is /param=[EDITA1]

Context.Parameters will contain a dictionary with 1 entry key being "param" (in my example above that's the key I gave it).

I'm having a problem with passing in parameters which contain spaces. the guidelines say:

For custom actions that are installation components (ProjectInstaller classes), the CustomActionData property takes a format of /name=value. Multiple values must be separated by a single space: /name1=value1 /name2=value2.

If the value has a space in it, it must be surrounded by quotes: /name="a value". Windows Installer properties can be passed using the bracketed syntax: /name=[PROPERTYNAME].

For Windows Installer properties such as [TARGETDIR] that return a directory, in addition to the brackets you must include quotes and a trailing backslash: /name="[TARGETDIR]\".

When I try the "[EDITA1]\" for the file path I need.. I get the 'FileNotFound' error for "C..\Microsoft..." while my path didn't have Microsoft

Vincent