I have a c# application. I need to copy my database file from the CD to a destination folder and then use it for login and other purposes. For this I have written an installer class as follows.
public partial class Installer1 : Installer
{
public Installer1()
{
InitializeComponent();
Copy_our_Files();
}
private void Copy_our_Files()
{
System.IO.DriveInfo[] drives = System.IO.DriveInfo.GetDrives();
var d = "";
foreach (System.IO.DriveInfo drive in drives)
{
if (drive.DriveType == System.IO.DriveType.CDRom)
{
d = drive.Name;
break;
}
}
string addre = @"C:\Windows\\System32";
System.IO.File.Copy(d + @"Database5.accdb", addre + "\\Database5.accdb");
}
}
But during installation of my application the database file is not copied to the location mentioned which is c:\Windwos\System32 folder.
C:\Windows\SysWow64instead? Why are you putting anything in the system directories anyway?