locked
Running prerequisites then installer program. RRS feed

  • Question

  • 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

    Wednesday, September 9, 2020 2:03 AM

All replies

  • A professional method is to use a certificate yet many developer seem reluctant to pay for one. There are cases where this is the only way many organizations will permit an install done by active directory policies.

    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    Wednesday, September 9, 2020 3:01 AM
  • Actually, administrators of the domain can install Certificate Services role (can use this way on Win2003+), and use it to create certificates that will be trusted within the domain. You may ask them to create a certificate for you to sign any PowerShell script you need to deploy inside the domain.

    https://devblogs.microsoft.com/scripting/hey-scripting-guy-how-can-i-sign-windows-powershell-scripts-with-an-enterprise-windows-pki-part-1-of-2/

    http://www.ntweekly.com/2014/12/24/how-to-sign-your-powershell-script-using-domain-trusted-ca-certificate/

    ======

    Btw, AFAIK unattended installations on domain runs on Session 0 and is not subject to UAC restriction. IMO there must be something else that cause your problem.


    Wednesday, September 9, 2020 6:31 AM
    Answerer