none
Windows Installer Project/Package - create read/write folder RRS feed

  • Question

  • Hi,

    I have written a WinForms app and I'm putting together the Inataller Package....

    All is going well to a point!

    I have defined the prerequsisits and they are loading oksy... I have a Folder named Data under the root app folder and I am createing a SQL databse in this folder...  I am getting teh following error...

    E:\script.vbs(46, 1) Microsoft OLE DB Provider for SQL Server: CREATE FILE encou
    ntered operating system error 5(Access is denied.) while attempting to open or c
    reate the physical file 'C:\Program Files\Phillip J Seaman\YachtLog\Data\YachtLo
    gSQL.mdf'.

    How do I make (ths above) a folder I am creating Read/Write?

    Thanks


    SquireDude
    Tuesday, September 6, 2011 2:06 AM

Answers

  • Hi Guys and Gals,

    Well ir seems I was a bit off base with the original inquiry.  The permissions is NOT for the folder or files level it turns out it is purely a SQL permissions issue.  I needed to change the folders SQL permissions from NT AUTHORITY\NETWORKSERVICE to Local System account.  And all my permissions problems went away.

    Thanks to Prakash Karia at Microsoft for that solution.


    SquireDude
    • Marked as answer by SquireDude Wednesday, September 7, 2011 2:50 PM
    Wednesday, September 7, 2011 2:50 PM

All replies

  • If it is for windows 7 you cannot, starting with window 7 it is forbidden to write with a program in the programs folder

     


    Success
    Cor
    Tuesday, September 6, 2011 5:08 AM
  • Are setting permissions on your "Data" folder to make it writable to the user?

    From Windows Vista onwards, the program directory and many, many others are no longer writable by a regular user. 

    This is by design and it's actually a Good Thing.

    It's more usual (i.e. possible) to create "user" files under the User's "hive", i.e. .../Documents and Settings/username (Vista) or .../User/username (Win7+).

     


    Regards, Phill W.
    • Proposed as answer by Neddy Ren Wednesday, September 7, 2011 7:45 AM
    • Unproposed as answer by SquireDude Wednesday, September 7, 2011 2:50 PM
    Tuesday, September 6, 2011 11:40 AM
  • Hi Guys,

    Thanks for the version information.  I was NOT aware of this change.

    I had created the \Data\ Folder so I could keep tabs on the SQL Database install path.  I had discovered that with differen versions of Windows the Users mapping has changed and it makes it very difficult to locate an write a generic Connection String... hence the creation of the \Data\ folder... Since I first created this folder over a year ago there was other mitigating reasons for it but they ilude me for the time being.

    If I change to the \User\ path I will be set back weeks of testing and coding.  Which I am not about to do at this time.

    I have found so far that if I manually change the write attribute of the Window 7 folder my app wors great.  Currently I have an issue witha Windows 98 test machine that will not let me manually change the \Data\ folder to read\write...

    Either way I need to change the attribute of folder to read\write. 

     


    SquireDude

     

    UPDATE:

    I just did some checking and have found the following regarding folders under the Program Files structure...

    • Folders can have any attribute
    • Files within these folders are Read Only

    • Edited by SquireDude Tuesday, September 6, 2011 3:22 PM
    Tuesday, September 6, 2011 2:57 PM
  • Hi SquireDude,

    Welcome to the MSDN Forum.

    Here is the article shows the permissions here

    Understanding Windows File And Registry Permissions:
    http://msdn.microsoft.com/en-us/magazine/cc982153.aspx 

    And here is how to make the applicaion UAC aware:

     Making Your Application UAC Aware:
    http://www.codeproject.com/KB/vista-security/MakingAppsUACAware.aspx 

    Best Regards

     

     


    Neddy Ren [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, September 7, 2011 8:15 AM
  • Hi Guys and Gals,

    Well ir seems I was a bit off base with the original inquiry.  The permissions is NOT for the folder or files level it turns out it is purely a SQL permissions issue.  I needed to change the folders SQL permissions from NT AUTHORITY\NETWORKSERVICE to Local System account.  And all my permissions problems went away.

    Thanks to Prakash Karia at Microsoft for that solution.


    SquireDude
    • Marked as answer by SquireDude Wednesday, September 7, 2011 2:50 PM
    Wednesday, September 7, 2011 2:50 PM