Jader Dias
Jader Dias

Reputation: 90465

How to deploy database files with Visual Studio Setup Project?

How to write to that folder?

Upvotes: 2

Views: 5553

Answers (2)

Leniel Maccaferri
Leniel Maccaferri

Reputation: 102368

Check this out:

Specifying c:\ProgramData folder in Setup project?

Winforms Deployment

string path = Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData);

CommonApplicationData is C:\ProgramData on Windows > Vista, and something like C:\Documents and Settings\All Users on XP.

Upvotes: 1

Christopher Painter
Christopher Painter

Reputation: 55571

Actually this question is a duplicate. Here is the real way tell VDPROJ to deploy to that location:

Writing to AppData from a Setup & Deployment Project

But that will leave another problem: Standard Users won't have write privs to that directory. You'll either have to write a custom action to open it up or you'll have to use a better MSI authoring tool such as Windows Installer XML (open source) or InstallShield 2010LE ( free ) that has proper support for defining resource permissions.

Upvotes: 1

Related Questions