Windows Develop Bookmark and Share   
 index > ClickOnce and Setup & Deployment Projects > Install Content Files In A Directory Structure
 

Install Content Files In A Directory Structure

I am using c# Express.

I have created an application that searches for content files(images and sounds) infolders located in the same directory as the application's .exe file.

Is it possible to have Clickonce install my application's content files as part of a directory structure rather than a bunch of loose files in the same place as the exefile?

such as:

Appfolder <<Dont Care if this is unknown I'musing Directory.GetCurrentDirectory()

App.Exe

MediaFolder

SoundsFolder

ImagesFolder

Can I even use the IOclasses with a Clickonce App<<I assumed I could using a full trust application.

My installed application is producing a System.IO.Directorynotfound exception when it exectues and I am assuming this is because the directory structure I want my installed application to have(regardless ofabsolute path whichI determine at runtime)is not the case on the target machine.

Thanks in advance for your time.

immotus  Wednesday, March 22, 2006 8:13 PM

Did you include the content file in the project?

Make sure you also need to pick "Copy Always" in the "Copy To Output Directory" attribute.

In addition, if you go to the properties of the project, go to the "Publish" tab, and click the "Application Files" button. It would bring up a dialog. For all the content files, make sure you pick "Include" instead of "Data File"

See if that helps?

I have included some content files in my project under some sub-folders of the app folder, and they did get copied over when I do the setup.

Hei  Wednesday, March 22, 2006 10:06 PM

I appologize for my lack of understanding.

After some basic testing it appears that you CAN have any type of directory structure you want, but you have to add the content files one at a time to each folder you createin the project. Not that big a deal.

My directory error is resulting from some other problem I have yet to track down, but I am starting to see what is happening to a clickonce application on thelocal machine. Although I cant tell a clickonce application where to install I can still tell it exactly what to install at the endpoint... very nice.

Thank you for your time and prompt answers.

immotus  Wednesday, March 22, 2006 10:59 PM

Do you mean... you want to create some file structure inside the app folder?

If those directories are empty initialliy, could you create them on the fly?

Another easy fix is to add a fake file in each of those directories (Like readme.txt), and ignore them when your app browses through the directory.

I don't know if there's a way to ask ClickOnce to create an empty directory within the app folder like you do in a *regular* Setup project.

Thanks,
Hei

Hei  Wednesday, March 22, 2006 9:10 PM

I am basically stumbling around blind when it comes to this Clickonce technology.

It looks like you just cant do what I want to do in C# express using clickonce. Which is basically, to install my files marked as content into some kind of hierarchical folder structure that resides in the same directory location as my .exe file.

It does look like I might be able to just slop all the content files into the same place as the .exe, but I havent really tried too hard to do that yet. And, Ireally dont want to.

Thanks for your time.

immotus  Wednesday, March 22, 2006 9:58 PM

Did you include the content file in the project?

Make sure you also need to pick "Copy Always" in the "Copy To Output Directory" attribute.

In addition, if you go to the properties of the project, go to the "Publish" tab, and click the "Application Files" button. It would bring up a dialog. For all the content files, make sure you pick "Include" instead of "Data File"

See if that helps?

I have included some content files in my project under some sub-folders of the app folder, and they did get copied over when I do the setup.

Hei  Wednesday, March 22, 2006 10:06 PM

I appologize for my lack of understanding.

After some basic testing it appears that you CAN have any type of directory structure you want, but you have to add the content files one at a time to each folder you createin the project. Not that big a deal.

My directory error is resulting from some other problem I have yet to track down, but I am starting to see what is happening to a clickonce application on thelocal machine. Although I cant tell a clickonce application where to install I can still tell it exactly what to install at the endpoint... very nice.

Thank you for your time and prompt answers.

immotus  Wednesday, March 22, 2006 10:59 PM

You can use google to search for other answers

Custom Search

More Threads

• Temp path
• How to register a COM object during installation
• Bootstrapping .Net framework 3.5 from VS2005
• Deployment of Database Applications Questions/ Discussion
• Adding offline NET Framework 3.5 (DotNetFxClient35.exe) to the VS2008 installation?
• Anyone having problems w/ ClickOnce in the July CTP?
• Include Multiple Applications in Setup
• mage.exe -Update and error MSB3113: Could not find file '***.config'
• Setup project in Visual Studio 2005 - what happens if a newer version is available
• ClickOnce Deployment Fails to Load Library after Impersonation