Click here to Skip to main content
15,920,896 members
Home / Discussions / C#
   

C#

 
GeneralRe: UserControl and how to add controls to it Pin
Boaz V13-May-04 2:09
Boaz V13-May-04 2:09 
GeneralRe: UserControl and how to add controls to it Pin
sreejith ss nair13-May-04 2:50
sreejith ss nair13-May-04 2:50 
GeneralRe: UserControl and how to add controls to it Pin
Heath Stewart13-May-04 3:38
protectorHeath Stewart13-May-04 3:38 
GeneralRe: UserControl and how to add controls to it Pin
Boaz V13-May-04 3:48
Boaz V13-May-04 3:48 
GeneralCreating Installation Package for a C# Application with web reference Pin
koosala13-May-04 1:22
koosala13-May-04 1:22 
GeneralRe: Creating Installation Package for a C# Application with web reference Pin
Aryadip13-May-04 1:49
Aryadip13-May-04 1:49 
GeneralRe: Creating Installation Package for a C# Application with web reference Pin
koosala14-May-04 0:31
koosala14-May-04 0:31 
GeneralRe: Creating Installation Package for a C# Application with web reference Pin
Heath Stewart13-May-04 2:00
protectorHeath Stewart13-May-04 2:00 
You can add the URL to the Web Service to your .config file, for example. You can actually do this in the PropertyGrid of VS.NET under Bindings, (Advanced); or programmatically by setting the Url property of the Web Service proxy.

As far as changing that, you could extend the Installer class and in your derivative get the path to the .config file as well as the URL from the Context.Parameters property (Context is an inheritted property from the Installer class). You would have your Installer derivative use the XML DOM to change/add the URL to your .config file (perhaps in the appSettings section). You'd pass the two parameters by adding your assembly with the Installer class (attributed with the RunInstallerAttribute) as a Custom Action, and modify the command-line with the switches you specified as the keys to get the parameter values from Context.Parameters. To get the path to your .config file, pass something like [INSTALLDIR]MyApp.exe.config. [INSTALLDIR] will be replaced by the installation directory and the trailing \. In decent Windows Installers development environments, you could actually specify the path to the file itself using a file key property, but VS.NET's project automatically generates these at compile time so you'd have to make such a change with a tool like Orca after it's compiled, which requires knowledge of the MSI database.

Another option - though I don't recommend it - may be easier. Just write the URL to the registry (a UI for registry entries is provided in the VS.NET Windows Installer project editor) and read it in your application. I don't recommend this since .NET applications really shouldn't use the registry. It makes touchless deployments impossible. In your case, however, this really doesn't seem to be a problem (though you should consider defaulting to some URL, like a public instance of this Web Service, if available).

So, how does the user put this URL in? In both cases, go to the UI editor and add a new form to the installation with a single text box. Give this text box a property name in the PropertyGrid. It's this property name (as [MYPROPNAME] - use the square backets) that you'd pass to your Installer derivative or write to the registry key. Again, you should consider a default (or make sure your app handles the absence of a URL correctly and in a user-friendly manner.

 

Microsoft MVP, Visual C#
My Articles
GeneralRe: Creating Installation Package for a C# Application with web reference Pin
Anonymous18-May-04 4:35
Anonymous18-May-04 4:35 
GeneralThread problem Pin
michael.wikstrom13-May-04 1:08
michael.wikstrom13-May-04 1:08 
GeneralUsercontrol Problem Pin
Anfernius12-May-04 23:43
Anfernius12-May-04 23:43 
GeneralRe: Usercontrol Problem Pin
Aryadip13-May-04 0:10
Aryadip13-May-04 0:10 
GeneralRe: Usercontrol Problem Pin
Anfernius13-May-04 0:55
Anfernius13-May-04 0:55 
GeneralRe: Usercontrol Problem Pin
Heath Stewart13-May-04 3:15
protectorHeath Stewart13-May-04 3:15 
GeneralRe: Usercontrol Problem Pin
Anfernius13-May-04 6:19
Anfernius13-May-04 6:19 
GeneralRe: Usercontrol Problem Pin
Heath Stewart13-May-04 3:05
protectorHeath Stewart13-May-04 3:05 
GeneralDragDrop registration failed Pin
michael.wikstrom12-May-04 22:32
michael.wikstrom12-May-04 22:32 
GeneralRe: DragDrop registration failed Pin
Heath Stewart13-May-04 3:03
protectorHeath Stewart13-May-04 3:03 
GeneralGDI+ Image from Graphics Pin
mhmoud rawas12-May-04 22:10
mhmoud rawas12-May-04 22:10 
GeneralRe: GDI+ Image from Graphics Pin
sprout7412-May-04 22:31
sprout7412-May-04 22:31 
GeneralRe: GDI+ Image from Graphics Pin
mhmoud rawas12-May-04 23:35
mhmoud rawas12-May-04 23:35 
GeneralRe: GDI+ Image from Graphics Pin
Heath Stewart13-May-04 3:01
protectorHeath Stewart13-May-04 3:01 
GeneralRe: GDI+ Image from Graphics Pin
mhmoud rawas13-May-04 4:19
mhmoud rawas13-May-04 4:19 
GeneralRe: GDI+ Image from Graphics Pin
Heath Stewart13-May-04 4:50
protectorHeath Stewart13-May-04 4:50 
GeneralRe: GDI+ Image from Graphics Pin
mhmoud rawas14-May-04 19:45
mhmoud rawas14-May-04 19:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.