开发者

Building an MSI/Setup with VS2008 - How to Create Sub-Folders for Logs and Temporary Files

开发者 https://www.devze.com 2023-01-21 07:28 出处:网络
I have built a C#.NET WinForms App. I now need to build a MSI installer for the same so that I can ship it to my clients.

I have built a C#.NET WinForms App. I now need to build a MSI installer for the same so that I can ship it to my clients.

I am stuck at the following place.

  1. I use log4net for Logging. How do I write my App.Config in such a way that the LogFile folder is based on where my end user installs the Application. That is, if my end user installs it on the Default Location of C:\Program Files\\, then the LogFile folder will be C:\Program Files\\*LogFiles*.

If they chose to install it elsewhere, the LogFiles folder will be a sub-folder of the MyApp folder.

  1. Similarly, I have a TemporaryFiles Folder where I store the temporary files while I am modifying the original files. This again should be a sub-folder of the MyApp Folder.

I also understand that the Application Fol开发者_开发百科der points to the [ProgramFilesFolder][Manufacturer][ProductName], where does the CommonFiles folder point to? And typically what goes inside that?

I use VS2008 for Building the Setup.


I would simply not have the log files in the program files folder. The process needs write permissions on it and generally you would only want administrators to have write permissions on the program files folder or any of its subfolders. I would rather consider using e.g. %appdata%/yourapplication/logfiles. Then you could easily have your log4net config point to that location, regardless of where this will be set up. I would do the same thing for the temporary files.

(I don't have an answer to that CommonFiles question.)

0

精彩评论

暂无评论...
验证码 换一张
取 消