Results 1 to 13 of 13

Thread: Read-only accessing files from Vista's Program Files (bypassing Virtual Store)

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,373
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    3
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: Read-only accessing files from Vista's Program Files (bypassing Virtual Store)

    Maybe the problem is related to the whitespace in the name "Program Files"? Check if the same happens if you store the application inside a "Some Directory" folder (containing a space as well).

  2. #2
    Join Date
    Jul 2008
    Posts
    24
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    2
    Thanked 1 Time in 1 Post

    Default Re: Read-only accessing files from Vista's Program Files (bypassing Virtual Store)

    wysota: I don't think this is related, as other vista users (those who run with their administrator account, probably) reported no problem. Others who had problems installing into "Program Files" reported success when installing under "My Documents".

  3. #3
    Join Date
    Oct 2008
    Posts
    17
    Thanked 1 Time in 1 Post

    Default Re: Read-only accessing files from Vista's Program Files (bypassing Virtual Store)

    An application of mine had the same problem about using the VirtualStore, because it asked, on uninstallation, if the user would like to keep his database info. If it was running on Vista and the user selected "No", the Program Files copy was erased and the VirtualStore one was kept, what resulted, on further installations, in a "virtually restored" database, even if the original one was a brand new database.

    One intermediary solution was to use a manifest file with the fields you showed. The actual solution is to save the database at the user folder, which, by the way, enables using one database per user.

  4. #4
    Join Date
    Jul 2008
    Posts
    24
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    2
    Thanked 1 Time in 1 Post

    Default Re: Read-only accessing files from Vista's Program Files (bypassing Virtual Store)

    Quote Originally Posted by tinsuke View Post
    One intermediary solution was to use a manifest file with the fields you showed.
    Well, unfortunately the manifest file thing did not work. Maybe I did something wrong though. My manifest file content is as follows:

    Qt Code:
    1. <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    2. <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
    3. <assemblyIdentity version="1.0.0.0" processorArchitecture="X86" name="tagainijisho" type="win32"/>
    4. <description>A free Japanese dictionary and study assistant</description>
    5. <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
    6. <security>
    7. <requestedPrivileges>
    8. <requestedExecutionLevel level="asInvoker" uiAccess="false"/>
    9. </requestedPrivileges>
    10. </security>
    11. </trustInfo>
    12. </assembly>
    To copy to clipboard, switch view to plain text mode 

    To include it, I just added the following line into the .rc file:

    Qt Code:
    1. CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "tagainijisho.exe.manifest"
    To copy to clipboard, switch view to plain text mode 

    Which is processed by windres through qmake as my project file includes this line:

    Qt Code:
    1. RC_FILE = tagainijisho.rc
    To copy to clipboard, switch view to plain text mode 

    Everything is processed by mingw32 under Linux (cross-compilation environment).

    The RC file also includes the program icon which is visible, so I think it is correctly used here. But maybe I did something wrong here. Can windows experts give me some comments?

    Quote Originally Posted by tinsuke View Post
    The actual solution is to save the database at the user folder, which, by the way, enables using one database per user.
    I think this is clearly not the solution here. These databases are read-only - no user is ever going to change them, so there is no reason for them to have their own copy. Moreover they are rather large (around 100Mb total). The user also has his settings stored into a private database, which is stored in the directory returned by QDesktopServices::storageLocation(QDesktopServices :: DataLocation). Here things are working perfectly, as the storage is done in the user profile and Vista does not abusively get into the way.

  5. #5
    Join Date
    Oct 2008
    Posts
    17
    Thanked 1 Time in 1 Post

    Default Re: Read-only accessing files from Vista's Program Files (bypassing Virtual Store)

    I really don't know whats going wrong with your app. It should be able to see and even write (on a virtually stored copy) at the database file. You could give a try to changing
    Qt Code:
    1. <requestedExecutionLevel level="asInvoker" uiAccess="false"/>
    To copy to clipboard, switch view to plain text mode 
    to
    Qt Code:
    1. <requestedExecutionLevel level="requireAdministrator" />
    To copy to clipboard, switch view to plain text mode 
    And test if it works fine. But this a weird thing to do. I can't be of more help on just trying to figure things out... But I have a Vista test environment and, if your project isn't a proprietary software (or if it is and you trust me (I know you don't have reasons to do so, but...)), you could send it to me, so i could try to figure out what's wrong. =]

    Cheers,
    tinsukE

  6. #6
    Join Date
    Jul 2008
    Posts
    24
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    2
    Thanked 1 Time in 1 Post

    Default Re: Read-only accessing files from Vista's Program Files (bypassing Virtual Store)

    Quote Originally Posted by tinsuke View Post
    I really don't know whats going wrong with your app. It should be able to see and even write (on a virtually stored copy) at the database file.
    Yeah, I feel like maybe something else is broken, but as the program works perfectly in XP I see no other culprit than the virtualization mechanism...

    Quote Originally Posted by tinsuke View Post
    But this a weird thing to do. I can't be of more help on just trying to figure things out... But I have a Vista test environment and, if your project isn't a proprietary software (or if it is and you trust me (I know you don't have reasons to do so, but...)), you could send it to me, so i could try to figure out what's wrong. =]
    It's nothing secret - my project is open source and available at https://launchpad.net/tagaini-jisho .

    However, I'm using scons on top of qmake to build it, and the build process is not feasible on Windows yet (I know, a Windows program that does not compile on Windows, what a weird thing to do!). One of my users agreed to help me figuring this out by running special binaries and sending me the output, so I guess I can do it this way. Thanks anyway for proposing to help - I really appreciate it.

    I will keep you informed if I can track this down.

  7. #7
    Join Date
    Apr 2006
    Location
    San Francisco, CA
    Posts
    186
    Qt products
    Qt4
    Platforms
    MacOS X Windows
    Thanks
    55
    Thanked 12 Times in 11 Posts

    Default Re: Read-only accessing files from Vista's Program Files (bypassing Virtual Store)

    It's most definitely the virtualization system. I spent considerable pains dealing with it on a previous project. Vista is quite the adversary when trying to do things that it's been designed to discourage (like a centralized database for all users).
    Software Engineer



  8. #8
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Wiki edits
    17

    Default Re: Read-only accessing files from Vista's Program Files (bypassing Virtual Store)

    This could be Sqlite creating (at least attempting to) temporary files in the same directory as the database you are opening. Rollback and master journal files are possibilities.
    http://www.sqlite.org/tempfiles.html

  9. #9
    Join Date
    Jul 2008
    Posts
    24
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    2
    Thanked 1 Time in 1 Post

    Default Re: Read-only accessing files from Vista's Program Files (bypassing Virtual Store)

    This is another possibility, indeed. In that case, I'd be in bigger trouble than expected, since these temporary files are necessary.

    But on the other hand, I kind of doubt this: on other platforms, the directory where the databases are contained is not writeable neither, and no problem occur. The real problem seems to be Vista returning a file descriptor that do not corresponds to the requested file.

  10. #10
    Join Date
    Jul 2008
    Posts
    24
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    2
    Thanked 1 Time in 1 Post

    Default Re: Read-only accessing files from Vista's Program Files (bypassing Virtual Store)

    Hello everyone,

    Just a follow-up to explain how I solved this problem. After doing some trial-and-error, I realized that the files installed in Program Files had read-write access. Therefore, upon opening these files Vista guessed I could write them and therefore made a copy into the virtual store. The solution was pretty straightforward: ensure the files have read-only attribute when they are installed. I just witnessed that with this attribute, virtual store files are not created anymore.

    Thanks to you all for the pointers and tips. I'm really glad this major issue is solved.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.