Why windows 7 is rubbish
-
Apparently, the person reading the registry key I need to write, has found that his code works in Weven ( he's in C++ ) and it just writes to CurrentUser instead of LocalMachine. In C#, the code crashes if I try to write to LocalMachine, unless the user right clicks and runs as admin. Not much good for an auto run installer app, or even just a general user app. So, now my app will need to be registered by every user who uses it, or we need to change the registration mechanism.
Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
:sigh: Time to use Unix or Apple and let let me tell you, you'll be begging to come back. In windows YOU CAN NOT write to local machine unless you are Admin, this is by design and a security feature to stop malicous code.
-
That's a good question, I guess I should look at my installer package to see if it supports that. Is such a setting permanent, because in my case, someone could install, and run the registration app later. My big fear would be that trying to do this, might cause the installer to just not run at all.
Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
You'd still have to run 'As Administrator' when launching the install program.
-
Apparently, the person reading the registry key I need to write, has found that his code works in Weven ( he's in C++ ) and it just writes to CurrentUser instead of LocalMachine. In C#, the code crashes if I try to write to LocalMachine, unless the user right clicks and runs as admin. Not much good for an auto run installer app, or even just a general user app. So, now my app will need to be registered by every user who uses it, or we need to change the registration mechanism.
Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
Wouldn't you have the same issue logged in as a limited XP user? I'm pretty sure you can't write to HKLM in that case either.
-
You'd still have to run 'As Administrator' when launching the install program.
Then it's useless. I tried creating a manifest that runs as admin and it did not help.
Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
-
Wouldn't you have the same issue logged in as a limited XP user? I'm pretty sure you can't write to HKLM in that case either.
Well, I guess it's possible, although not common, for an XP machine to be locked down so that software needs to be installed again for each user.
Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
-
Christian Graus wrote:
but it worries me, because it's all obviously flaky to start with
I understand your concern, but in this particular case I think it works well. This technique is what stopped the rioting of the UAC wars. :)
Best wishes, Hans
No, it does not work. The msi ran fine, but I still can't write to that key.
Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
-
Well, I guess it's possible, although not common, for an XP machine to be locked down so that software needs to be installed again for each user.
Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
-
Apparently, the person reading the registry key I need to write, has found that his code works in Weven ( he's in C++ ) and it just writes to CurrentUser instead of LocalMachine. In C#, the code crashes if I try to write to LocalMachine, unless the user right clicks and runs as admin. Not much good for an auto run installer app, or even just a general user app. So, now my app will need to be registered by every user who uses it, or we need to change the registration mechanism.
Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
The registry is evil, don't use it.
-
Well, I guess it's possible, although not common, for an XP machine to be locked down so that software needs to be installed again for each user.
Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
We see limited-user XP setups all the time, especially with larger customers who have thousands of desktops (I work in the automotive industry so I'm talking about companies like Mercedes-Benz, BMW, etc.) I don't use the registry any more tbh - I've gone back to using INI files! Much less hassle and easier to support because they can be sent via email and edited by hand without danger of breaking something else.
-
Apparently, the person reading the registry key I need to write, has found that his code works in Weven ( he's in C++ ) and it just writes to CurrentUser instead of LocalMachine. In C#, the code crashes if I try to write to LocalMachine, unless the user right clicks and runs as admin. Not much good for an auto run installer app, or even just a general user app. So, now my app will need to be registered by every user who uses it, or we need to change the registration mechanism.
Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
That's not new at all; in fact writing to HKLM from a user app has been deprecated behaviour since at least Windows 2000 (along with writing to Program Files etc.). It's just that it wasn't enforced until 2006 when Vista arrived (the redirect to HKCU is for backward compatibility for badly behaved apps). I'm a bit surprised you're only discovering this now, to be honest.
Anna :rose: Tech Blog | Visual Lint "Why would anyone prefer to wield a weapon that takes both hands at once, when they could use a lighter (and obviously superior) weapon that allows you to wield multiple ones at a time, and thus supports multi-paradigm carnage?"
-
We see limited-user XP setups all the time, especially with larger customers who have thousands of desktops (I work in the automotive industry so I'm talking about companies like Mercedes-Benz, BMW, etc.) I don't use the registry any more tbh - I've gone back to using INI files! Much less hassle and easier to support because they can be sent via email and edited by hand without danger of breaking something else.
Rob Caldecott wrote:
I've gone back to using INI files!
Whats old is new again - isn't a config file just an ini file on xml! I don't understand anyone using the registry these days, me thinks CG is going to have to change his rego regime.
Never underestimate the power of human stupidity RAH
-
Then it's useless. I tried creating a manifest that runs as admin and it did not help.
Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
The manifest should work; we've used this technique ourself. Alternatively, if the installer has "setup" in the name the system will assume it's an installer and automatically elevate it (for backward compatibility with installers without manifests).
Anna :rose: Tech Blog | Visual Lint "Why would anyone prefer to wield a weapon that takes both hands at once, when they could use a lighter (and obviously superior) weapon that allows you to wield multiple ones at a time, and thus supports multi-paradigm carnage?"
-
We see limited-user XP setups all the time, especially with larger customers who have thousands of desktops (I work in the automotive industry so I'm talking about companies like Mercedes-Benz, BMW, etc.) I don't use the registry any more tbh - I've gone back to using INI files! Much less hassle and easier to support because they can be sent via email and edited by hand without danger of breaking something else.
Yeah, I know. I do the same, but in this case, I am doing what I was told to pass info from my program to theirs. I've suggested we revert to using an ini file.
Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
-
That's not new at all; in fact writing to HKLM from a user app has been deprecated behaviour since at least Windows 2000 (along with writing to Program Files etc.). It's just that it wasn't enforced until 2006 when Vista arrived (the redirect to HKCU is for backward compatibility for badly behaved apps). I'm a bit surprised you're only discovering this now, to be honest.
Anna :rose: Tech Blog | Visual Lint "Why would anyone prefer to wield a weapon that takes both hands at once, when they could use a lighter (and obviously superior) weapon that allows you to wield multiple ones at a time, and thus supports multi-paradigm carnage?"
Anna-Jayne Metcalfe wrote:
I'm a bit surprised you're only discovering this now, to be honest.
*grin* I've known for a long time that the registry is not the recommended way to do things, this is the first time I've touched it in ages ( I had to look up the code for accessing the registry in .NET ). In that sense, I'm not surprised there are issues, it's just frustrating, I mean, again, what's HKLM for, if not to store something machine wide ?
Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
-
Anna-Jayne Metcalfe wrote:
I'm a bit surprised you're only discovering this now, to be honest.
*grin* I've known for a long time that the registry is not the recommended way to do things, this is the first time I've touched it in ages ( I had to look up the code for accessing the registry in .NET ). In that sense, I'm not surprised there are issues, it's just frustrating, I mean, again, what's HKLM for, if not to store something machine wide ?
Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
Christian Graus wrote:
I mean, again, what's HKLM for
It's to tempt you, like the tree in the Garden of Eden.
Best wishes, Hans
-
Apparently, the person reading the registry key I need to write, has found that his code works in Weven ( he's in C++ ) and it just writes to CurrentUser instead of LocalMachine. In C#, the code crashes if I try to write to LocalMachine, unless the user right clicks and runs as admin. Not much good for an auto run installer app, or even just a general user app. So, now my app will need to be registered by every user who uses it, or we need to change the registration mechanism.
Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
Add a manifest to the package that requests admin rights.
"It is a remarkable fact that despite the worldwide expenditure of perhaps US$50 billion since 1990, and the efforts of tens of thousands of scientists worldwide, no human climate signal has yet been detected that is distinct from natural variation." Bob Carter, Research Professor of Geology, James Cook University, Townsville
-
Anna-Jayne Metcalfe wrote:
I'm a bit surprised you're only discovering this now, to be honest.
*grin* I've known for a long time that the registry is not the recommended way to do things, this is the first time I've touched it in ages ( I had to look up the code for accessing the registry in .NET ). In that sense, I'm not surprised there are issues, it's just frustrating, I mean, again, what's HKLM for, if not to store something machine wide ?
Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
The preferred place to store machine wide stuff has been the application's app data folder (we use CSIDL_COMMON_APPDATA) for over 10 years now, so it's not like this is something new. :doh: It's all in Data and Settings Management[^].
Anna :rose: Tech Blog | Visual Lint "Why would anyone prefer to wield a weapon that takes both hands at once, when they could use a lighter (and obviously superior) weapon that allows you to wield multiple ones at a time, and thus supports multi-paradigm carnage?"