I'm having trouble creating folders within program files.
Where I work there is an application that only works if files are within program files and the process of creating folders today is completely manual.
Nobody was ready to make an installer that would automate this, so, as I graduated in computer science, I decided to take this task even as a challenge.
The problem I'm encountering is the Windows permission to create the folders inside program files, because if it were somewhere else it would be good.
I need to prioritize folders to have access as administrator to create the folders on the computer.
I'm using the following code:
// Verifica qual radio button está selecionado.
if (rd_golden.Checked)
{
//Cria o diretorio para o Golden e faz o procedimentos locais
string Golden = @"C:\Program Files\Comercial\Golden";
if (!Directory.Exists(Golden))
{
Directory.CreateDirectory(Golden);
MessageBox.Show("Diretório Criado com Sucesso!!");
}
else
{
MessageBox.Show("Diretório já Existe");
}
}