Click here to Skip to main content
15,896,111 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hi,

As part of .NET setup project i need to create a empty directory C:\test\log .
This directory will be used by some other process to create logs.

This folder has to be created irrespective of installtion folder as installtion in program files.

How can a create an empty folder in .NET setup project at a specified location ?

Thanks in advance.

Thanks,
Shreyas
Posted
Updated 1-Oct-13 11:44am
v3
Comments
Matt T Heffron 1-Oct-13 17:21pm    
Is there a question here?
With what are you having difficulty?
srastogi85 1-Oct-13 17:26pm    
how can i add an empty folder to setup to be installed at specific location
Sergey Alexandrovich Kryukov 1-Oct-13 17:39pm    
It depends on setup framework you are using.
—SA

1 solution

I depends on the setup framework you are using. The answers would be very different.

I don't advise you to do so. First, there are standard places where you can write data generated by your application. Please see my past answer:
How to find my programs directory[^].

Also, there is a standard method of logging: http://msdn.microsoft.com/en-us/library/system.diagnostics.eventlog.aspx[^].

Essentially, the problem is this: the directory you are going to create and use is illegal for newer Windows versions, Windows 7 and later (I don't want to mention Vista, consider it failed). Therefore, you would need to take care about making it writable, by modification of its permission in the installer. If you use the approaches standardized in Windows, you won't need it and hence the creation of the directory would be put in the code of application itself, where it truly belongs. You would create this directory when you are writing the very first log. As simple as that.

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900