Windows Develop Bookmark and Share   
 index > ClickOnce and Setup & Deployment Projects > Best way to include application files in deployment
 

Best way to include application files in deployment

My project requires a bunch of .txt templates to be stored somewhere in the user's computer. When the application is run for the first time, I will have to transfer these files into %APPDATA%\myapp\ folder. What's the best way to include these files in the clickonce deployment? There are a lot of these .txt files in nested folders so including them in the solution/project is out of the question.
I.R. Baboon  Wednesday, August 19, 2009 6:02 AM
Here's some ideas.

1) Include them in the project and mark each file with build action = "content" and copy to output= "copy always". This is obviously the easiest, most effective way.

2) Zip them up and include them in the project and mark the file as noted above. (Second easiest way).

3) Create your application, then use Mage or MageUI to add the files to the deployment and re-sign it. (p.i.t.a.)

And here's an interesting idea:

4) Create an application that has the files included in the project, and a small UI that copies them from this app's ClickOnce cache to where they go on the user's computer. Depending on how many files there are, this could run so fast the user never sees the UI screen, or you can just set visible = false. You have multiple choices here:

4a) Send the user the link to run this application to load the content.

4b) Have the main application fire the link to get the content (process.start(iexplore.exe, "link to application file")) if the content is not found. You'll have to loop and see when the content is all there.

For 4b, you could also send something down to the main application telling it *when* to fire the link, like when there's an update, but this depends on if your app has communication back and forth with a server or something. For example, if your application does authentication and gets back a reuslt, you might return a flag telling whether or not there's been an update to that content. OR you could just fire it every time, but you can NOT suppress the ClickOnce upgrade dialog (just telling you before you ask).

Hope this helps.

RobinDotNet
Click here to visit my ClickOnce blog!
  • Marked As Answer byI.R. Baboon Wednesday, August 19, 2009 6:29 AM
  •  
RobinDotNet  Wednesday, August 19, 2009 6:21 AM
Here's some ideas.

1) Include them in the project and mark each file with build action = "content" and copy to output= "copy always". This is obviously the easiest, most effective way.

2) Zip them up and include them in the project and mark the file as noted above. (Second easiest way).

3) Create your application, then use Mage or MageUI to add the files to the deployment and re-sign it. (p.i.t.a.)

And here's an interesting idea:

4) Create an application that has the files included in the project, and a small UI that copies them from this app's ClickOnce cache to where they go on the user's computer. Depending on how many files there are, this could run so fast the user never sees the UI screen, or you can just set visible = false. You have multiple choices here:

4a) Send the user the link to run this application to load the content.

4b) Have the main application fire the link to get the content (process.start(iexplore.exe, "link to application file")) if the content is not found. You'll have to loop and see when the content is all there.

For 4b, you could also send something down to the main application telling it *when* to fire the link, like when there's an update, but this depends on if your app has communication back and forth with a server or something. For example, if your application does authentication and gets back a reuslt, you might return a flag telling whether or not there's been an update to that content. OR you could just fire it every time, but you can NOT suppress the ClickOnce upgrade dialog (just telling you before you ask).

Hope this helps.

RobinDotNet
Click here to visit my ClickOnce blog!
  • Marked As Answer byI.R. Baboon Wednesday, August 19, 2009 6:29 AM
  •  
RobinDotNet  Wednesday, August 19, 2009 6:21 AM
Thanks. this is exactly what I was looking for.
I.R. Baboon  Wednesday, August 19, 2009 6:54 AM
You're welcome. :-)

RobinDotNet
Click here to visit my ClickOnce blog!
RobinDotNet  Thursday, August 20, 2009 9:58 AM

You can use google to search for other answers

Custom Search

More Threads

• Deploying changed User.Config or App.Config via VS2005
• Deploying VS2008 Help
• ClickOnce: Problem with COM object and Manifest
• How to define the launch conditions order?
• Click Once to install prerequisites for third party install
• issue changing config files of clickonce setup deployment.
• Updater Application Block
• Patching advertised Installation
• Deployment of Database Applications Questions/ Discussion
• Custom Action not run during upgrade