I've been using Inno Setup to check for and install the .NET 2.0 framework for one of my applications. It's worked pretty faultessly by checking for a Registry Key and simply downloading the .NET installer and installing prior to installing my application.
From what I understand this isn't working in Windows 8. Windows 8 bundles .NET 2.0 in the .NET 3.5 package which is enabled via the W8 "Install Windows Features" applet thingamy. Rather than downloading the .NET 2.0 installer I'd rather have Inno trigger the installation of the Windows feature applet to enable .NET 3.5 support. Any ideas how this could be done?
According to Microsoft, trying to run the redistributable should automatically trigger internal activation of the feature on Windows 8. So if you're bundling the dotnetfx35 redistributable with your installer then you should not need to change anything.
However if you're downloading the redistributable on demand then it is more efficient to detect Windows 8 or later and trigger the install via the following command line:
Dism /online /enable-feature /featurename:NetFx3 /All
In Inno, you should do this via Exec
from within the PrepareToInstall
event function.
SOLUTION
Thanks for @Miral for the suggestion.
Added an additional check to determine if Windows 8 was running:
GetWindowsVersionEx(Version);
if (Version.Major=6) and (Version.Minor=2) then
begin
Windows8:=true;
end;
Then included this code in the NextButtonClick event and checking if the CurPage is wpReady:
if dotNetNeeded and Windows8 then
begin
Exec('Dism', ' /online /enable-feature /featurename:NetFx3 /All /NoRestart', '', SW_SHOW, ewWaitUntilTerminated, ResultCode)
end;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With