N
nigelwright7557
Guest
I found with a .net core 3.1 program it requires installing .net core first before my installer .net core 3.1 program could run.
So autorun.inf with .net core 3.1 installer first then simply run setup.exe for my program.
Doesn't work as my installer changes registry and for this I need admin rights.
With a batch file you cant have admin rights.
So I found the way around it was to create a third program which simply runs my installer with admin rights.
This works a treat.
////////////////////////////////////////////////////////////////
ProcessStartInfo proc2 = new ProcessStartInfo();
proc2.UseShellExecute = true;
proc2.WorkingDirectory = Environment.CurrentDirectory;
proc2.FileName = "setup720.exe";
proc2.Verb = "runas";
try
{
this.Hide();
Process.Start(proc2).WaitForExit();
this.Show();
}
catch
{
// The user refused the elevation.
// Do nothing and return directly ...
System.Windows.Forms.MessageBox.Show("Couldnt find setup720.exe");
Application.Exit();
}
n.Wright
Continue reading...
So autorun.inf with .net core 3.1 installer first then simply run setup.exe for my program.
Doesn't work as my installer changes registry and for this I need admin rights.
With a batch file you cant have admin rights.
So I found the way around it was to create a third program which simply runs my installer with admin rights.
This works a treat.
////////////////////////////////////////////////////////////////
ProcessStartInfo proc2 = new ProcessStartInfo();
proc2.UseShellExecute = true;
proc2.WorkingDirectory = Environment.CurrentDirectory;
proc2.FileName = "setup720.exe";
proc2.Verb = "runas";
try
{
this.Hide();
Process.Start(proc2).WaitForExit();
this.Show();
}
catch
{
// The user refused the elevation.
// Do nothing and return directly ...
System.Windows.Forms.MessageBox.Show("Couldnt find setup720.exe");
Application.Exit();
}
n.Wright
Continue reading...