Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / March 2007

Tip: Looking for answers? Try searching our database.

ntfs on deploy

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
JB - 20 Mar 2007 16:34 GMT
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.
Bryan Phillips - 20 Mar 2007 17:42 GMT
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.

--
Bryan Phillips
MCSD, MCDBA, MCSE
Blog:  http://bphillips76.spaces.live.com

> Using VS2005 I have created a setup project and added a database file
> to be included as part of the installation process.  This database
[quoted text clipped - 9 lines]
>
> Thanks.
Rad [Visual C# MVP] - 20 Mar 2007 17:50 GMT
> Using VS2005 I have created a setup project and added a database file
> to be included as part of the installation process.  This database
[quoted text clipped - 9 lines]
>
> Thanks.

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

Bits.Bytes
http://bytes.thinkersroom.com

JB - 20 Mar 2007 20:14 GMT
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.

> > Using VS2005 I have created a setup project and added a database file
> > to be included as part of the installation process.  This database
[quoted text clipped - 14 lines]
> --
> Bits.Byteshttp://bytes.thinkersroom.com
Bryan Phillips - 21 Mar 2007 01:58 GMT
Take a look at this blog entry for more information about Acl's and .Net
2.0:

http://west-wind.com/weblog/posts/4072.aspx

--
Bryan Phillips
MCSD, MCDBA, MCSE
Blog:  http://bphillips76.spaces.live.com

> 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
[quoted text clipped - 25 lines]
> > --
> > Bits.Byteshttp://bytes.thinkersroom.com
JB - 21 Mar 2007 16:19 GMT
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.
Bryan Phillips - 21 Mar 2007 20:11 GMT
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!

--
Bryan Phillips
MCSD, MCDBA, MCSE
Blog:  http://bphillips76.spaces.live.com

> OK,
>
[quoted text clipped - 6 lines]
> Anyway the first method worked fine (and it is the neater solution),
> so thanks for your help.
Andy - 22 Mar 2007 21:51 GMT
> 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.

You shouldn't put the database there, that violates MS development
guidelines.  You'll have security problems on Vista.

Instead, put the database file in the Users\All Users\Application Data
folder structure.
RobinS - 23 Mar 2007 06:42 GMT
Thanks for posting that, and the other link. I'm looking at developing
something, and want to make sure it will run on Vista, and had heard we
were no longer going to be able to store user config files in
C:\ProgramFiles\my application\.

Can we still store information in Isolated Storage?

Robin S.
--------------------------
>> SQL Compact get's
>> installed wherever the installation installs it, but the single
[quoted text clipped - 6 lines]
> Instead, put the database file in the Users\All Users\Application Data
> folder structure.
Andy - 23 Mar 2007 16:47 GMT
> Thanks for posting that, and the other link. I'm looking at developing
> something, and want to make sure it will run on Vista, and had heard we
> were no longer going to be able to store user config files in
> C:\ProgramFiles\my application\.
>
> Can we still store information in Isolated Storage?

I believe so.. I think IS gets put someone under the App Settings or
Local Settings\App Settings folders of the user's profile (or All
Users profile, if IS can be stored per computer).
RobinS - 23 Mar 2007 22:32 GMT
Thanks.
Robin S.
---------------------
>> Thanks for posting that, and the other link. I'm looking at developing
>> something, and want to make sure it will run on Vista, and had heard we
[quoted text clipped - 6 lines]
> Local Settings\App Settings folders of the user's profile (or All
> Users profile, if IS can be stored per computer).
Andy - 22 Mar 2007 21:54 GMT
For reference, see http://msdn2.microsoft.com/en-us/library/aa480150.aspx#accprotvista_topic7

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.