I've built an installer with WIX and have packaged it with the .NET 4.0 framework using the GenerateBootstrapper task. Now .NET 4.0 cannot be installed on XP SP2, but it appears to have no precondition check for this so its installer fails halfway through.
I'd like to add my own check to make sure the OS that the entire package is being installed on is supported by the .NET 4.0 framework. Is there a way to embed an OS/Service Pack check in the bootstrapper when you use GenerateBootstrapper? If not, how else can I accomplish this?
You could add a condition to the bootstrapper package definition file so that the bootstrapper will check for the Windows version. The description file is located at
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bootstrapper\
Packages\DotNetFX40\Product.xml
on a 64-bit Windows system or at
C:\Program Files\Microsoft SDKs\Windows\v7.0A\Bootstrapper\
Packages\DotNetFX40\Product.xml
on a 32-bit Windows system. The package.xml already contains such a check, see the line
<!-- Block install on less than Windows XP SP2 -->
<FailIf Property="VersionNT" Compare="VersionLessThan"
Value="5.1.2" String="InvalidPlatformWinNT" />
I couldn't find the relevant documentation, but it looks as if the third number of the VersionNT value is the service pack level, so probably changing the condition to check for a value of "5.1.3" will do the job.
Related
I'm creating an installer for a Windows desktop app, which has a dependency on another product that requires .NET 3.5
When installing this on Windows 10, .NET 3.5 is included and has to be enabled in Add/Remove Windows Features. I don't think it is valid to install a downloadable version of .NET 3.5 on Windows 10 (correct me if I'm wrong!).
So, is there a way to get WiX to enable the .NET 3.5 "feature" rather than downloading and installing it?
Not sure whether this is the correct way but you can try a custom action with the following command
dism.exe /online /enable-feature /featurename:NetFx3
You can get a list of all available features by dism /online /get-features if you want to try other windows features.
There is a way to install .NET 3.5 on Windows 10 and the latest Windows Server: to update a group policy value that will allow to download .NET 3.5 (blog post).
...open the command prompt and type "gpedit". The "Local Computer Policy Editor" opens where we can locate the necessary setting under the "Computer Configuration" > "Administrative Templates" > "System". On the left side, under "Settings", we can find a setting named "Specify settings for optional component installation and component repair"
This is what we are going to modify. Let's open it and check "Enabled" and then check the second option – "Download repair content and optional features directly from Windows Update instead of Windows Server Update Services (WSUS)" and click "OK":
Now, if we retry adding the .NET Framework 3.5, we can see that it succeeds...
I personally then revert this policy setting to its original value, if it was different.
WiX Samples: Some potentially helpful links in general:
WiX Quick Start Suggestions (with sample links).
https://helgeklein.com/blog/2014/09/real-world-example-wix-msi-application-installer/
Alternative Tools: Maybe keep in mind that commercial tools have features that are easier to use to get your product out there quickly. WiX is great though.
MSI Tools (comparing different MSI tools)
On WiX, setup GUI and Commercial tools
Prerequisites: I would suggest you add a LaunchCondition to the package to abort installation if the .NET framework is not there. You can bundle the .NET framework with your application, but I really do not recommend that: Outdated prerequisites in packages.
LaunchCondition: The concept of LaunchConditions checks for a certain condition to be true before installation is allowed to continue:
Check if prerequisites are installed before installing a windows installer package (please check this link at the very least - if you don't check other links)
An earlier answer on LaunchConditions.
Quick, inline sample:
<Condition Message="The .NET Framework 2.0 must be installed">
Installed OR NETFRAMEWORK20
</Condition>
WiX and .NET Framework: Some built-in measures to detect the .NET framwork.
How To: Check for .NET Framework Versions (official WiX documentation)
How to check for .net framework 4.7.1 with Wix 3.11
How can I detect whether .NET Framework 4.6.1 or higher is installed in WiX?
Link:
Wix IIS Version check launch condition not working
LaunchConditions and missing runtimes
I have moved to a new machine and upgraded with this MSVC 2015 to MSVC2017. Now I wanted to build a new (WiX) installer for our project. But I don't find current Bootstrapper location.
C:\Program Files (x86)\Microsoft SDKs\ClickOnce Bootstrapper does not include Engine/setup.bin, which WiX will have.
Windows 10 SDK (10.0.16299) is installed.
Any idea which software I have to install to obtain required setup.bin? (Searched my whole PC for a setup.bin, but not a single setup.bin exists, so it's not just on a "wrong" oath)
OK, not sure why you refer to ClickOnce and WiX together - I am not aware of any connections here - they are different technologies - but maybe there are connections I am not aware of (something relating to AppX maybe).
The file you refer to: setup.bin is installed via two MSI files on my system:
Microsoft.ClickOnce.BootStrapper.Msi.msi (installed from source at C:\ProgramData\Microsoft\VisualStudio\Packages\Microsoft.ClickOnce.BootStrapper.Msi,version=15.0.27005.2)
Microsoft.ClickOnce.SignTool.Msi.msi (installed from source at C:\ProgramData\Microsoft\VisualStudio\Packages\Microsoft.ClickOnce.SignTool.Msi,version=15.0.27005.2)
Did you go to Tools => Get Tools and Features => Individual Components and select "ClickOnce Publishing"? I would try that first. There is no clear match between the actual MSI names and these "Individual Components" that I can see.
I believe "Microsoft Visual Studio 2017 Installer Projects", "WiX Toolset Visual Studio 2017 Extensions" and "IsWiX" (front end for WiX) can be installed from the Tools => Extension and Updates. Or you can install the WiX 2017 extension from here.
You also obviously need to install the WiX toolkit itself to be able to make WiX installers. Here is the download location: http://wixtoolset.org/releases/ (and a WiX quick start suggestion answer).
I need to distribute my WPF application. I am using WIX for building the Setup.exe.
But I also need to ensure that the .net framework 4.0 is first installed on the user's PC. I have downloaded dotNetFx40_Full_x86_x64.exe but how do I create a WIX installation that will contain MyApp.Msi and the .net framework redistribution file?
What I really want is to have just 1 Setup.exe that contains and runs both installs(my.msi and the .exe) in order.
Can this be done with WIX? Is there a better solution?
You can use the WiX bootstrapper technology (referred to as Burn) to create a single bootstrapper to install .NET and your .msi. Burn will enable you to embed the .NET redistributable and your .msi into a single setup.exe as well.
A setup bootstrapper is the file that could install the .NET framework. You can read about the WiX bootstrapper here. If you want the final output to be one .EXE file, you can pack the bootstrapper and the .MSI file into a new .EXE file using IExpress. IExpress is included in your Windows installation.
With WiX + IExpress you can create an installation package contained in one .EXE file.
I want to add some .net 4.0 dlls to the gac, I know that the new gac is C:\Windows\Microsoft.NET\assembly
I cannot use the gacutil because visual studio in not installed on the deployment machine, and i cannot simply drag/drop the dll to the folder as i usually do in the previous versions.
How can I install the dlls to the GAC.
It is part of Windows SDK and can be download separately at http://www.microsoft.com/downloads/en/details.aspx?FamilyID=6B6C21D2-2006-4AFA-9702-529FA782D63B. This installation will have gacutil.exe included. But first check it here: C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin you might have it installed
where is gacutil.exe?
UPDATE : Modified the link. Windows SDK for .Net 4.0
Using Microsoft Installer Package. You can get download of installer from
http://www.microsoft.com.
I am not confirmed but ideally Gacutil must be part of framework and you can find it out in .net framework folder
I have created a setup project with VS2008 for a .NET Windows Forms application using .NET Framework 3.5.
But I want to create an installation with WiX 3.5. Since I have VS2008 installed, I expected I can use the instructions in the help section How To: Install the .NET Framework Using a Bootstrapper. Unfortunately this includes a reference to the directory
C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bootstrapper\
that I cannot find on my PC although this should be present if VS2008 is installed. Should I find it somewhere on my PC or do I have to install this manually? Why should this be necessary?
What are other opportunities to automatically install the .NET framework when required?
Edit:
The WiX documentation describes the path for VS2005 on a 32 bit operating system. I found the boostrapper at
C:\Program Files (x86)\Microsoft SDKs\Windows\v6.0A\Bootstrapper
There are a few related questions to yours, check out WiX: Where can I download the bootstrapper?