Section 2.5. Application Files


2.5. Application Files

Clicking the Application Files button will open a window that displays all of the files in your application (see Figure 1-8).

Figure 1-8. All of the files in your application


There are three publish statuses you can set for all the files in your application. They are:

  • Include: Lets you include the file in the manifest and copy to the publish location.

  • Data File: Lets you include the file in the manifest and copy to the publish location. Files with the extensions .mdf, .ldf, .mdb, and .xml are set to Data File by default.

  • Exclude: Lets you exclude the file from the manifest and not copy to the publish location.


Tip: Any non-assembly file for which the Build Action property is set to Content can have the Data File publish status. Files with the extensions .mdf, .ldf, and .xml are set to Data File by default.

Figure 1.9 shows that, by default, the two database files Database1.mdf and Database1_log.ldf will always download to your users' machines when you install the application via ClickOnce. However, they will not be stored in the application directory. Instead, they will be stored in the data directory. So how can you programmatically find the data directory for your installed application? You can do so using:

 Dim dataPath As String = Application.LocalUserAppDataPath 

On my machine, a typical data directory looks like this:

 C:\Documents and Settings\Wei-Meng Lee\Local Settings\Apps\2.0\Data\98HM3VZV.OK7\V4JVEH8D.37Y\myap..tion_692c12755750aeaa_0001.0000 _aead9e7ff36b675c\Data 

Keep in mind that when you update an application, the database files in the data directory do not download again. This is logical, since when you update an application, only its business logic should upgrade, not its data files.


Note: The database files will download again only if the original database files on the server have been modified.



Use ClickOnce to Deploy Windows Applications2006
Use ClickOnce to Deploy Windows Applications2006
ISBN: N/A
EAN: N/A
Year: 2005
Pages: 38

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net