G
Guest
How can I set or create a registry key during the installation of our .net
projects?
Thanks.
projects?
Thanks.
.net projects?
Rory Becker said:That would depend on how you're installing said products.
I use NSIS, others use Installshield and there are many others.
You might also consider creating the key on the first run of the app
itself if if doesn't find it in place when it runs
First run of what? there are many projects that might need it, including MS
Office files outside the project.
Whenever I install the solution, I must create it manually. If I create it
as part of the runtime I would have to replicate the code in every project
basically. I don't think that works.
Sorry I missed the "MSI" bit in your subject.But the idea of creating said keys on first run is still a potential
solution
rowe_newsgroups said:First run of what? there are many projects that might need it, including
MS
Office files outside the project.
Whenever I install the solution, I must create it manually. If I create
it
as part of the runtime I would have to replicate the code in every
project
basically. I don't think that works.
Sorry I missed the "MSI" bit in your subject.But the idea of creating said keys on first run is still a potential
solution
IMO Best practice dictates that when you use a Registry value you
first inspect to see if it exists. If it does not exist, this is the
time you should initialize the key with the appropriate value. This is
what Rory is referring to.
After all, suppose a user installs your application and the values is
initialized during setup. A week later the user's computer starts
acting up (from no fault of yours) and the user does a restore that
resets all the registry values back to there state previous to your
programs installation. The user starts your application and *bam* is
greated by a JIT debugging window stating a null reference exception
occurred. The point is, prerequisites are often deleted after the
install - so your code should be ready and able to handle these
occurrences. This is why I believe the registry parts of an
application should initialize themselves, and not rely on a setup
utility.
Thanks,
Seth Rowe
I get it, but this is a non-issue in our environment. We control the
software at the client and the only time this registry key could be
overwritten would be by us.
Am I to assume then, based on the opposition to my original stated question,
that a registry key cannot be set by the msi installation process?
including MS Office files outside the project.
Whenever I install the solution, I must create it manually. If I
create it as part of the runtime I would have to replicate the code in
every project basically. I don't think that works.