VS 2015 Prerequisites dotnetfx parameters

244 views Asked by At

I created s small C# tool and a Installer Project for the tool, my tool uses the .net framework 4.6. The client uses the version 3.5 (Windows 7 SP1 32-bit) - everything works fine.

The Setup-Project detects the prerequisites version and start installing the dotNetFx45_Full_x86_x64.exe

But after installing the dotnetfx, the setup project doesn't start restart. Is it possible to restart the Setup.exe after installing dotnetfx?

I guess yes, maybe with the following parameters /norestart /ChainingPackage

But how do I pass this parameters to the dotnetfx.exe?

My current Setup-Folder:

/Setup.exe
/DotNetFX45/dotNetFx45_Full_x86_x64.exe
/DotNetFX45/dotNetFx45LP_Full_x86_x64de.exe

Or should I use the following Setup-Folder:

/Setup.exe
/dotNetFx45_Full_x86_x64.exe
/dotNetFx45LP_Full_x86_x64de.exe

Thanks.

2

There are 2 answers

3
Sara Liu - MSFT On BEST ANSWER

For your requirement, you can have a look at this: .NET Framework Deployment Guide for Developers

There are three methods to deployment the .NET Framework version on the target machine, you can directly specify the .NET Framework as a prerequisite in your app’s installation, or chain the .NET Framework setup process in your app’s setup.

When you try to chain the .NET Framework redistributable to your app’s setup, some useful command-line options are described, like /chainingpackage packageName, /norestart, /q …. You can have a test with those parameters and your setup folder structure, check it matches your idea or not.

0
PhilDW On

This might be something to do with the OS settings or anti-virus software because I believe it should restart the setup.exe after the reboot, which again goes through the prerequisite check and continues. Sometimes Windows and AV software is set to prevent auto-running after a reboot. So after the NETFx install and while the installer is asking for a reboot take a look at the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run and HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce keys (and the equivalents in HKCU) to see if there are any entries there, because that's typically the way it will try to restart after the reboot. If the entries are there, then it looks like there's something in your OS preventing the automatic restart, which is an understandable security feature.

Changing the command line to do the /norestart option requires you to open the setup.exe code file in Visual Studio (open as a file) and go into the resources setting where there is an embedded manifest containing the command line for the NET Framework - you'd alter it and save the code file. Postponing the reboot could be an issue if you have managed code custom actions in your setup because strictly speaking the framework installation is not fully installed until after its required reboot.