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. General Programming
  3. C / C++ / MFC
  4. Getting rid of security questions when accessing registry Vista, Win 7 [modified]

Getting rid of security questions when accessing registry Vista, Win 7 [modified]

Scheduled Pinned Locked Moved C / C++ / MFC
questioncsharpc++windows-adminsecurity
10 Posts 4 Posters 0 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.
  • T Offline
    T Offline
    tibiz
    wrote on last edited by
    #1

    Dear developers I'm finishing a simple but useful tool and have a serious problem - when I start my app and access windows registry to create value in RUN key or check if already created (for registering my app to startup) in Vista or 7 it always show a "Do you want to allow...to make changes to your computer?" message which must be confirmed. How can I get rid of this confirmation boxes? When I confirm the needs, the app registeres itself into startup but after restart it don't run. The key and value is already in registry. This problem occurs on Win 7 and Vista, XP is fine. I'm writing to hkey_local_machine/software/microsoft/.../run Need I upgrade my compiler to build versions for Vista or Win 7 which can run as Administrator? I'm using my old but legal VC++ ver7 / 2003 and have C++ 2008 Express too. Thank you

    tibiZ.net homepage

    modified on Monday, March 8, 2010 9:23 PM

    C I 2 Replies Last reply
    0
    • T tibiz

      Dear developers I'm finishing a simple but useful tool and have a serious problem - when I start my app and access windows registry to create value in RUN key or check if already created (for registering my app to startup) in Vista or 7 it always show a "Do you want to allow...to make changes to your computer?" message which must be confirmed. How can I get rid of this confirmation boxes? When I confirm the needs, the app registeres itself into startup but after restart it don't run. The key and value is already in registry. This problem occurs on Win 7 and Vista, XP is fine. I'm writing to hkey_local_machine/software/microsoft/.../run Need I upgrade my compiler to build versions for Vista or Win 7 which can run as Administrator? I'm using my old but legal VC++ ver7 / 2003 and have C++ 2008 Express too. Thank you

      tibiZ.net homepage

      modified on Monday, March 8, 2010 9:23 PM

      C Offline
      C Offline
      Chris Losinger
      wrote on last edited by
      #2

      tibiz wrote:

      Need I upgrade my compiler to build versions for Vista or Win 7 which can run as Administrator?

      you need to run the EXE as administrator (or at least with elevated permissions). or, turn off the UAC. but don't expect your users to do either.

      image processing toolkits | batch image processing

      T 1 Reply Last reply
      0
      • T tibiz

        Dear developers I'm finishing a simple but useful tool and have a serious problem - when I start my app and access windows registry to create value in RUN key or check if already created (for registering my app to startup) in Vista or 7 it always show a "Do you want to allow...to make changes to your computer?" message which must be confirmed. How can I get rid of this confirmation boxes? When I confirm the needs, the app registeres itself into startup but after restart it don't run. The key and value is already in registry. This problem occurs on Win 7 and Vista, XP is fine. I'm writing to hkey_local_machine/software/microsoft/.../run Need I upgrade my compiler to build versions for Vista or Win 7 which can run as Administrator? I'm using my old but legal VC++ ver7 / 2003 and have C++ 2008 Express too. Thank you

        tibiZ.net homepage

        modified on Monday, March 8, 2010 9:23 PM

        I Offline
        I Offline
        Iain Clarke Warrior Programmer
        wrote on last edited by
        #3

        Well, the UAC stuff is there SPECIFICALLY to make sure a user gives permission for such activities. Let's assume that your application DoWonderfulThings.exe does something, erm, wonderful. Let's also assume that you have a backdoor to bypass UAC, so wonderful things can happen a lot. eg, an API called I_Am_Wonderful (). Let's also assume that I write an application called DoEvilStuff. What's to stop me telling lies (I am evil, after all) and also using the I_Am_Wonderful () API? This sort of control rightly belongs to the user - not to application developers who can't be trusted. If all you are doing is checking if a registry value is already there, open the key with read access, not read and write. If you want to write there, then open the key again with write access, and cope with the warnings. This sort of thing should be done at setup time anyway. Or you could install a service that sits quietly consuming negligible resources, just to act as a background actor for you. Or... But all this stuff should require permission from the user... Did you pay for their machine? Didn't think so. I'm probably a heretic, but I *like* UAC. It forces software writers to shape up, or look bad. My only regret is that it didn't exist earlier. I started 32 bit development and immediately started using HKLM/HKCU properly, and have very rarely hit any security issues. Iain. ps, rant over...

        I have now moved to Sweden for love (awwww).

        T 1 Reply Last reply
        0
        • I Iain Clarke Warrior Programmer

          Well, the UAC stuff is there SPECIFICALLY to make sure a user gives permission for such activities. Let's assume that your application DoWonderfulThings.exe does something, erm, wonderful. Let's also assume that you have a backdoor to bypass UAC, so wonderful things can happen a lot. eg, an API called I_Am_Wonderful (). Let's also assume that I write an application called DoEvilStuff. What's to stop me telling lies (I am evil, after all) and also using the I_Am_Wonderful () API? This sort of control rightly belongs to the user - not to application developers who can't be trusted. If all you are doing is checking if a registry value is already there, open the key with read access, not read and write. If you want to write there, then open the key again with write access, and cope with the warnings. This sort of thing should be done at setup time anyway. Or you could install a service that sits quietly consuming negligible resources, just to act as a background actor for you. Or... But all this stuff should require permission from the user... Did you pay for their machine? Didn't think so. I'm probably a heretic, but I *like* UAC. It forces software writers to shape up, or look bad. My only regret is that it didn't exist earlier. I started 32 bit development and immediately started using HKLM/HKCU properly, and have very rarely hit any security issues. Iain. ps, rant over...

          I have now moved to Sweden for love (awwww).

          T Offline
          T Offline
          tibiz
          wrote on last edited by
          #4

          ok, I disabled any registry checking but my app still won't run at windows startup on Vista and W7 :confused: On XP works properly. Any ideas?

          tibiZ.net homepage

          M 1 Reply Last reply
          0
          • C Chris Losinger

            tibiz wrote:

            Need I upgrade my compiler to build versions for Vista or Win 7 which can run as Administrator?

            you need to run the EXE as administrator (or at least with elevated permissions). or, turn off the UAC. but don't expect your users to do either.

            image processing toolkits | batch image processing

            T Offline
            T Offline
            tibiz
            wrote on last edited by
            #5

            no, I can't require from users to turn off the UAC. my app must run at startup like anything other (antivirus, mouse or bluetooth resident, ...). But it won't ...

            tibiZ.net homepage

            1 Reply Last reply
            0
            • T tibiz

              ok, I disabled any registry checking but my app still won't run at windows startup on Vista and W7 :confused: On XP works properly. Any ideas?

              tibiZ.net homepage

              M Offline
              M Offline
              Mohan Ramachandra
              wrote on last edited by
              #6

              Does you application consist of Manifest?

              T 1 Reply Last reply
              0
              • M Mohan Ramachandra

                Does you application consist of Manifest?

                T Offline
                T Offline
                tibiz
                wrote on last edited by
                #7

                it's without manifests

                tibiZ.net homepage

                M 1 Reply Last reply
                0
                • T tibiz

                  it's without manifests

                  tibiZ.net homepage

                  M Offline
                  M Offline
                  Mohan Ramachandra
                  wrote on last edited by
                  #8

                  If application is running under vista or winows 7 it require manifiest to be added. Check out the link [^] A sample Manifest file

                  <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
                  <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
                  <assemblyIdentity
                  version="1.0.0.0"
                  processorArchitecture="X86"
                  name="Microsoft.Winweb.appname"
                  type="win32"
                  />
                  <description>Your app description here</description>
                  <dependency>
                  <dependentAssembly>
                  <assemblyIdentity
                  type="win32"
                  name="Microsoft.Windows.Common-Controls"
                  version="6.0.0.0"
                  processorArchitecture="X86"
                  publicKeyToken="6595b64144ccf1df"
                  language="*"
                  />
                  </dependentAssembly>
                  </dependency>
                  <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
                  <security>
                  <requestedPrivileges>
                  <requestedExecutionLevel
                  level="requireAdministrator"
                  uiAccess="false"/>
                  </requestedPrivileges>
                  </security>
                  </trustInfo>
                  </assembly>

                  level="requireAdministrator" makes the application to be launched with administrative previlages.

                  T 1 Reply Last reply
                  0
                  • M Mohan Ramachandra

                    If application is running under vista or winows 7 it require manifiest to be added. Check out the link [^] A sample Manifest file

                    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
                    <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
                    <assemblyIdentity
                    version="1.0.0.0"
                    processorArchitecture="X86"
                    name="Microsoft.Winweb.appname"
                    type="win32"
                    />
                    <description>Your app description here</description>
                    <dependency>
                    <dependentAssembly>
                    <assemblyIdentity
                    type="win32"
                    name="Microsoft.Windows.Common-Controls"
                    version="6.0.0.0"
                    processorArchitecture="X86"
                    publicKeyToken="6595b64144ccf1df"
                    language="*"
                    />
                    </dependentAssembly>
                    </dependency>
                    <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
                    <security>
                    <requestedPrivileges>
                    <requestedExecutionLevel
                    level="requireAdministrator"
                    uiAccess="false"/>
                    </requestedPrivileges>
                    </security>
                    </trustInfo>
                    </assembly>

                    level="requireAdministrator" makes the application to be launched with administrative previlages.

                    T Offline
                    T Offline
                    tibiz
                    wrote on last edited by
                    #9

                    the content of manifest file is linked to executabe by linker or must be distributed into the same folder where the app's executable is running from?

                    tibiZ.net homepage

                    M 1 Reply Last reply
                    0
                    • T tibiz

                      the content of manifest file is linked to executabe by linker or must be distributed into the same folder where the app's executable is running from?

                      tibiZ.net homepage

                      M Offline
                      M Offline
                      Mohan Ramachandra
                      wrote on last edited by
                      #10

                      tibiz wrote:

                      the content of manifest file is linked to executabe by linker or must be distributed into the same folder where the app's executable is running from?

                      Since, you are using VS2003, the manifest file can be linked to the executable.

                      modified on Wednesday, March 10, 2010 12:19 AM

                      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