Reputation: 10704
I have created setup for my windows form application . My OS is Windows7
On load of first form I have created folder with below code
bool IsExists = System.IO.Directory.Exists("Orders");
if (!IsExists)
System.IO.Directory.CreateDirectory("Orders");
But when i install setup project on machine this folder is created at following path.
C:\Users\ADMIN\AppData\Local\VirtualStore\Program Files\MySetup
Is there any workaround so that folders i create is stored on
C:\Program Files\MySetup
Anything related to permission or rights to user?
Any Solutions?
Upvotes: 1
Views: 924
Reputation: 1202
Look:
This path can be transformed to String
by using Environment.GetFolderPath.
For example:
String programFilesPath =
Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles);
Upvotes: 1