Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Write an inaccessible registry

Write an inaccessible registry

Scheduled Pinned Locked Moved QML and Qt Quick
4 Posts 4 Posters 968 Views 2 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
    twovrcmr
    wrote on last edited by twovrcmr
    #1

    Hi everyone, I am from Taiwan.
    I am trying to write a registry which my application doesn't have write permission.
    My application runs under User's account and that registry is read-only for the user.

    Here are snippets of my codes:

    // write a registry on windows
    QSettings settings("HKEY_LOCAL_MACHINE\\SOFTWARE\\WOW6432Node\\kkbox", QSettings::NativeFormat);
    settings.setValue("kkSerial", serialNum);   //always fails
    

    I don't find any Qsetting constructor could meet my requirement.

    raven-worxR 1 Reply Last reply
    0
    • T twovrcmr

      Hi everyone, I am from Taiwan.
      I am trying to write a registry which my application doesn't have write permission.
      My application runs under User's account and that registry is read-only for the user.

      Here are snippets of my codes:

      // write a registry on windows
      QSettings settings("HKEY_LOCAL_MACHINE\\SOFTWARE\\WOW6432Node\\kkbox", QSettings::NativeFormat);
      settings.setValue("kkSerial", serialNum);   //always fails
      

      I don't find any Qsetting constructor could meet my requirement.

      raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by raven-worx
      #2

      @twovrcmr
      just think about it: wouldn't the whole access protection mechanism be pointless when you could write it anyway?!?!
      You can try to run the application with admin privileges, but thats not an option anyway in your case i guess.

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      1 Reply Last reply
      1
      • J Offline
        J Offline
        Jagh
        wrote on last edited by
        #3

        @raven-worx what I think he is asking here, is how to request permissions from UAC to do this operation.
        Like you know, some other programs that show you "this program requires administrator privileges" window at the start.

        I guess the permissions needed are encoded in the .exe metadata, but I'm quite interested to learn the details myself

        1 Reply Last reply
        0
        • HojjatJafaryH Offline
          HojjatJafaryH Offline
          HojjatJafary
          wrote on last edited by HojjatJafary
          #4

          This is how you can run your whole application as admin:
          run as admin

          1 Reply Last reply
          2

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved