Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 631887
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T20:00:58+00:00 2026-05-13T20:00:58+00:00

Background – I’m starting to use click-once deploy for a WinForms application that has

  • 0

Background – I’m starting to use click-once deploy for a WinForms application that has a sqlite database file, which holds the blank database structure ready to go.

Question – How do I set things up so that the click-once deploy (via Publish, in VS2008) will ensure that when the user downloads it will:

  • a) If does not already exist then COPY the file in, else
  • b) Do NOT copy the file in, BUT check to see whehter there is an upgrade script that should be run

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T20:00:58+00:00Added an answer on May 13, 2026 at 8:00 pm

    This does not answer your question directly, but I thought the information would be of use to you in planning how you want to handle your situation. Read here (particularly the section titled “Data Directory and Application Versions”) for a description of how ClickOnce handles files in the data directory. Also, to treat your database as a data file, make sure your database file is labeled as a data file (Inside VS.Net – Go to Project Properties -> Project -> Application Files – make sure “Publish Status” is “Data File”). Below I have pasted the section in that article I am referring to. One thing you may want to explore is using the IsFirstRun property – then checking to see if the database exists, if not create at runtime, if needs update then update, etc…. (using this method, you may want to create the database “outside” of the clickonce data directory or create a new database at runtime inside of the data directory that does not exist in the deployment so that you can control how the database is effected by updates).

    “Data Directory and Application Versions

    Each version of an application has its own Data Directory, which is isolated from other versions. ClickOnce creates this directory regardless of whether any data files are included in the deployment so that the application has a location to create new data files at run time. When a new version of an application is installed, ClickOnce will copy all the existing data files from the previous version’s Data Directory into the new version’s Data Directory—whether they were included in the original deployment or created by the application.

    ClickOnce will replace the older version of the file with the newer version of the server if a data file has a different hash value in the old version of the application as in the new version. Also, if the earlier version of the application created a new file that has the same name as a file included in the new version’s deployment, ClickOnce will overwrite the old version’s file with the new file. In both cases, the old files will be included in a subdirectory inside the data directory named .pre, so that the application can still access the old data for migration purposes.

    If you need finer-grained migration of data, you can use the ClickOnce Deployment API to perform custom migration from the old Data Directory to the new Data Directory. You will have to test for an available download by using IsFirstRun, download the update using Update or UpdateAsync, and do any custom data migration work in your own after the update is finished.”

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Background: We're building an application that allows our customers to supply data in a
Background A lot of work has gone into optimizing database design, especially in the
Background This is only my second PyQt4 project. Developing a Windows app that has
Background My project is urgent and requires that I iterate a large XML file
Background I have a form that PHP generates from my database. The page is
Background I am currently creating an XNA application that utilizes LuaInterface so that I
BACKGROUND: Co-worker Adam has been using Google refine to process database downloads with much
Background: I would like to dismiss a modalView that I have presented earlier and
Background The main application where I work is based heavily on the MUMPS-esque Caché
Background: I have a css and a js that is used only by the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.