ntfs on deploy

J

JB

Using VS2005 I have created a setup project and added a database file
to be included as part of the installation process. This database
file gets installed on the target PC in the application folder.

To install the application the user is requried to log off and log
back on as administrator (their own internal procedures do not give
them full rights), unfortunately when they log back on as their normal
restricted user the database file has restricted ntfs access, i.e.
read only. Is there any way to tell the setup project to give the
database full read/write permissions to all users of the PC when it is
installed?

Thanks.
 
B

Bryan Phillips

You will need to create a custom action that assigns these permissions.
The custom action can be either an Installer class written in C# or
VB.Net or a command line executable to call.

If you write the installer class, you will have to the ACL classes to
modify the NTFS permissions. Otherwise, you can call cacls.exe from the
command line.
 
R

Rad [Visual C# MVP]

Using VS2005 I have created a setup project and added a database file
to be included as part of the installation process. This database
file gets installed on the target PC in the application folder.

To install the application the user is requried to log off and log
back on as administrator (their own internal procedures do not give
them full rights), unfortunately when they log back on as their normal
restricted user the database file has restricted ntfs access, i.e.
read only. Is there any way to tell the setup project to give the
database full read/write permissions to all users of the PC when it is
installed?

Thanks.

Where does the database get installed to? The program files folder? And
also, what sort of database is it? SQL Server? Access?
 
J

JB

It's an SQL Server Compact Edition database, and the database in
question is one I have pre populated with data. SQL Compact get's
installed wherever the installation installs it, but the single
database file itself I put in the application folder in the program
files folder.

I'll google the ACL approach, but if either of you have any useful
links that would be helpful.

Thanks.
 
J

JB

OK,

I managed to get this working fine using the ACL class in .NET.

I also tried the cacls method but it just refused to change the
permissions, eventhough it worked fine if I typed it manually into the
command prompt.

Anyway the first method worked fine (and it is the neater solution),
so thanks for your help.
 
B

Bryan Phillips

You're welcome. I had to write a managed C++ wrapper for the ACL API's
to be able to do this in .Net 1.1. What a headache that was!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top