oleg-shilo / wixsharp

Framework for building a complete MSI or WiX source code by using script files written with C# syntax.
MIT License
1.09k stars 174 forks source link

how to check and install dotnet Framework with WixSharp #438

Closed abouAlAbass closed 5 years ago

abouAlAbass commented 6 years ago

i have tried to use wixhsarp to check if dotnet framewok is installed or not with this code below project.Include(WixExtension.NetFx); project.SetNetFxPrerequisite("WIX_IS_NETFRAMEWORK_461_OR_LATER_INSTALLED >= '#394254'", "requires .NET Framework 4.6.1 or higher."); the second problem it's that i don't find how to install dotnet framwork if it's not installed

oleg-shilo commented 6 years ago

Have a look at 'NsisBootstrapper' and 'WixBootstrapper' samples. They both show how to distribute .NET

abouAlAbass commented 6 years ago

no i want to install my version of dotnetFramework with this code `
try {

            Process process = new Process();

            process.StartInfo.FileName = "/dotNetFx40_Full_x86_x64.exe";

            process.StartInfo.UseShellExecute = false;

            process.Start();

            process.WaitForExit();

        }
        catch(Exception e)
        {

            MessageBox.Show(e.Message);

        }

` but it show the exception -> File note found exception i put the msi installer and the DotNetFramework installer in the same file, if they are a function to get the current path of the msi?

geghamyan commented 6 years ago

You can't run .net framework installation during the MSI installation, parallel installations are not supported by the windows msi engine. .Net should be installed before you MSI, as it was indicated by Oleg, use one of the bootstrappers.

abouAlAbass commented 6 years ago

i find the solution to get the current path of the MSI ` static void project_UIInit(SetupEventArgs e) {

        MsiFile = e.MsiFile;
    }

`