Solved

Updating Windows environment variables using ClickOnce

Posted on 2006-06-29
2
796 Views
Last Modified: 2009-12-16
I am deploying a .NET Windows Application, written in C#. As part of the installation process, I would like to set some Windows environment variables to values that the user specifies. I could use Windows Installer to do this, but is it possible in ClickOnce? If so, could you point me to a tutorial or give me a hint on how to do it?

Thanks.
0
Comment
Question by:xelia
2 Comments
 
LVL 7

Accepted Solution

by:
whatsit2002 earned 500 total points
ID: 17077451
Unfortunately, you just don't have that kind of control with a ClickOnce application. As you seem to know, an MSI based installation could fire off a custom Installer class, but ClickOnce has no such capabilities.

Another hitch is that when a ClickOnce app is installed, it isn't installed on the machine level. It is only installed on the user level, so every user that logs into a machine must install the application separately.

My only suggestion is to put code into your ClickOnce app to do the following:
When your application loads, check to see if this is the first time the user has run it (use a registry key or something). If so, prompt them for the required information and set the variables then. Also, after setting the variables, set your registry key (or whatever you checked to see if this was the first time the app was run) so that the user doesn't have to go through the setup process again.

Other than something like that, I don't know of a way to get a ClickOnce install to do what you're looking for.
0
 

Author Comment

by:xelia
ID: 17106416
Thanks whatsit2002. Your suggestion will be very useful.
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

IP addresses can be stored in a database in any of several ways.  These ways may vary based on the volume of the data.  I was dealing with quite a large amount of data for user authentication purpose, and needed a way to minimize the storage.   …
Summary Displaying images in RichTextBox is a common requirement with limited solutions available. Pasting through clipboard or embedding into RTF content only support static images.  This article describes how to insert Windows control objects int…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question