Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. Why windows 7 is rubbish

Why windows 7 is rubbish

Scheduled Pinned Locked Moved The Lounge
csharpc++comwindows-admintools
27 Posts 10 Posters 4 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    Christian Graus
    wrote on last edited by
    #1

    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.

    H D P N L 8 Replies Last reply
    0
    • C Christian Graus

      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.

      H Offline
      H Offline
      Hans Dietrich
      wrote on last edited by
      #2

      Isn't it possible (during installation) to set the access level of a key? So that anyone can read/write the HKLM key without interacting with UAC?

      Best wishes, Hans


      [Hans Dietrich Software]

      C 1 Reply Last reply
      0
      • H Hans Dietrich

        Isn't it possible (during installation) to set the access level of a key? So that anyone can read/write the HKLM key without interacting with UAC?

        Best wishes, Hans


        [Hans Dietrich Software]

        C Offline
        C Offline
        Christian Graus
        wrote on last edited by
        #3

        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.

        H N 2 Replies Last reply
        0
        • C Christian Graus

          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.

          D Offline
          D Offline
          Dave Parker
          wrote on last edited by
          #4

          Can the key be deployed out as an MSI via the group policy? I think they run as the SYSTEM user.

          1 Reply Last reply
          0
          • C Christian Graus

            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.

            H Offline
            H Offline
            Hans Dietrich
            wrote on last edited by
            #5

            I believe you can change the access level later, but I don't know what privilege you would need. I'm pretty sure setting the access level at install time would solve your problem.

            Best wishes, Hans


            [Hans Dietrich Software]

            C 1 Reply Last reply
            0
            • H Hans Dietrich

              I believe you can change the access level later, but I don't know what privilege you would need. I'm pretty sure setting the access level at install time would solve your problem.

              Best wishes, Hans


              [Hans Dietrich Software]

              C Offline
              C Offline
              Christian Graus
              wrote on last edited by
              #6

              If an msi can do that, without having to right click and run as admin, then that seems counter intuitive to me, given that my app can't. If there's a way I can test for every possible Windows 7 configuration to make sure my users can use the msi, then I'll probably do it, but it worries me, because it's all obviously flaky to start with.

              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.

              H K 3 Replies Last reply
              0
              • C Christian Graus

                If an msi can do that, without having to right click and run as admin, then that seems counter intuitive to me, given that my app can't. If there's a way I can test for every possible Windows 7 configuration to make sure my users can use the msi, then I'll probably do it, but it worries me, because it's all obviously flaky to start with.

                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.

                H Offline
                H Offline
                Hans Dietrich
                wrote on last edited by
                #7

                I can't access MSDN right now, but I believe there are exceptions made for installers.

                Best wishes, Hans


                [Hans Dietrich Software]

                1 Reply Last reply
                0
                • C Christian Graus

                  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.

                  P Offline
                  P Offline
                  peterchen
                  wrote on last edited by
                  #8

                  Christian Graus wrote:

                  In C#, the code throws an exception indicating insufficient access rights if I try to write to LocalMachine

                  FTFY (I assume)

                  FILETIME to time_t
                  | FoldWithUs! | sighist | WhoIncludes - Analyzing C++ include file hierarchy

                  1 Reply Last reply
                  0
                  • C Christian Graus

                    If an msi can do that, without having to right click and run as admin, then that seems counter intuitive to me, given that my app can't. If there's a way I can test for every possible Windows 7 configuration to make sure my users can use the msi, then I'll probably do it, but it worries me, because it's all obviously flaky to start with.

                    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.

                    K Offline
                    K Offline
                    kinar
                    wrote on last edited by
                    #9

                    what installer are you using? I know that NSIS can do this with a simple "RequestExecutionLevel admin" at the top. scratch that, I misread the suggestion. However, with my dealings in C++, I know that my app certainly gets errors in Vista/Weven when I try to write or read from a registry setting the user doesn't have access to.

                    1 Reply Last reply
                    0
                    • C Christian Graus

                      If an msi can do that, without having to right click and run as admin, then that seems counter intuitive to me, given that my app can't. If there's a way I can test for every possible Windows 7 configuration to make sure my users can use the msi, then I'll probably do it, but it worries me, because it's all obviously flaky to start with.

                      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.

                      H Offline
                      H Offline
                      Hans Dietrich
                      wrote on last edited by
                      #10

                      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


                      [Hans Dietrich Software]

                      C 1 Reply Last reply
                      0
                      • C Christian Graus

                        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.

                        N Offline
                        N Offline
                        NormDroid
                        wrote on last edited by
                        #11

                        :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.

                        Software Kinetics - The home of good software

                        1 Reply Last reply
                        0
                        • C Christian Graus

                          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.

                          N Offline
                          N Offline
                          NormDroid
                          wrote on last edited by
                          #12

                          You'd still have to run 'As Administrator' when launching the install program.

                          Software Kinetics - The home of good software

                          C 1 Reply Last reply
                          0
                          • C Christian Graus

                            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.

                            L Offline
                            L Offline
                            Lost User
                            wrote on last edited by
                            #13

                            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.

                            Blogging about Qt Creator

                            C 1 Reply Last reply
                            0
                            • N NormDroid

                              You'd still have to run 'As Administrator' when launching the install program.

                              Software Kinetics - The home of good software

                              C Offline
                              C Offline
                              Christian Graus
                              wrote on last edited by
                              #14

                              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.

                              A 1 Reply Last reply
                              0
                              • L Lost User

                                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.

                                Blogging about Qt Creator

                                C Offline
                                C Offline
                                Christian Graus
                                wrote on last edited by
                                #15

                                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.

                                H L 2 Replies Last reply
                                0
                                • H Hans Dietrich

                                  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


                                  [Hans Dietrich Software]

                                  C Offline
                                  C Offline
                                  Christian Graus
                                  wrote on last edited by
                                  #16

                                  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.

                                  1 Reply Last reply
                                  0
                                  • C Christian Graus

                                    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.

                                    H Offline
                                    H Offline
                                    Hans Dietrich
                                    wrote on last edited by
                                    #17

                                    Wow. It looks like you have a uni-follower.

                                    Best wishes, Hans


                                    [Hans Dietrich Software]

                                    1 Reply Last reply
                                    0
                                    • C Christian Graus

                                      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.

                                      P Offline
                                      P Offline
                                      PIEBALDconsult
                                      wrote on last edited by
                                      #18

                                      The registry is evil, don't use it.

                                      1 Reply Last reply
                                      0
                                      • C Christian Graus

                                        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.

                                        L Offline
                                        L Offline
                                        Lost User
                                        wrote on last edited by
                                        #19

                                        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.

                                        Blogging about Qt Creator

                                        M C 2 Replies Last reply
                                        0
                                        • C Christian Graus

                                          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.

                                          A Offline
                                          A Offline
                                          Anna Jayne Metcalfe
                                          wrote on last edited by
                                          #20

                                          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?"

                                          C 1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • World
                                          • Users
                                          • Groups