views:

66

answers:

2

Good day all,

I have written an application that i require to have a certain directory structure/. Nothing complex but it will need an "Images" Folder which contains two other folders "Temp" and "Complete".

These folders are in my solution however upon publishing all the folders are gone and i can not find any way in which to cause these certain folders to persist.

Will i have to write some code that checks if these exist and create them or can i make an application directory structure exist from the very beginning.

Dont know if this is relevant but i am using WPF and deploying through click-once.

Thanks, Kohan

+2  A: 

Regardless of whether you find a solution to the installation part of your question it would be prudent to check that the folders exist either on application start up or when you need to access them. After all, someone could come along and delete them without realising that they're needed. You might want to report or log this as an error, but recreate them anyway.

ChrisF
Makes sense, thanks. This is what i will do.
Kohan
+1  A: 

I assume you are using Visual Studio to create your ClickOnce deployments. If so, you can get around this issue by using MageUI instead.

Create your desired folder structure separate from you project's source code and bin folders. Copy in all the files you want deployed. Use MageUI and when you create the application manifest, point it to the root folder you created. It will take care of all the subfolders.

Also, I wouldn't worry too much about what ChrisF said. ClickOnce files are deployed to a very obfuscated location that users should never be in. And if they are in there deleting stuff, you'll likely have much bigger problems that a missing subfolder.

whatknott
Thanks, very true. This is something i will consider for future applications.
Kohan