简体   繁体   中英

ARM64 support in WiX Toolset for building for Surface Pro X?

With Microsoft's release of the Surface Pro X, I am looking to create an MSI setup installer for ARM systems. I have been looking around and it appears that WiX Toolset v3 does not have support for ARM setup projects. However, it looks like WiX v4 does have support as documented here .

I installed WiX Toolset v4 by using the installer found here on the offical WiX site. However, despite me having the WiX Toolset Visual Studio 2017 Extension installed, Visual Studio 2017 still does not give me the option to select a WiX Toolset v4 Setup Project. I only have the option for v3: 没有 wix v4 选项

I did verify through the Visual Studio Installer that I do have the WiX v4 Schemas installed: 安装了 Visual Studio 的 WiX v4 架构

I know that the v4 option is available as documented through other's Visual Studio setup. For example, Nick Nolan's answer to this question on StackOverflow links to a screenshot where you can see he has both v3 and v4 options listed under the " New Project " dialog box explorer.

How do I add WiX Toolset v4 support to Visual Studio 2017? In other words, how do I add the v4 option under " WiX Toolset " in the " New Project " explorer window as shown here ?

According to Christopher Painter , it appears that WiX v4 was actually removed from the Visual Studio Extension:

WiX 4.0 is years away to be honest. I wouldn't worry about it at all right now. In fact the WiX v4 templates were recently removed from Votive (Visual Studio Extension) so that should give you an idea how far out it is.

After further investigation, this is confirmed by the commit history of the Visual Studio Extension. The commit #886a974 removes the v4 option.

I will see if I can re-enable it to see if I can create a setup *.MSI for ARM systems.


Edit 1 - 2/24/2020

If you install a previous version of the WiX extension, you will be able to gain access to the v4 option again without having to re-compile the entire extension. The most recent version to have the v4 option enabled is v0.9.28.58839 . But, before you install this, make sure you uninstall any existing extension you may have installed.

Once this old extension has been installed, you will have to install the v4 build tools located here . The only thing left to do is to open up Visual Studio and create a new WiX v4 project.

Now , I was playing around with WiX v4 and even though the Platform field in the <Package .../> tag allows the value arm , it will not compile successfully. I kept getting the following error:

ICE39: PID_TEMPLATE value in Summary Information Stream is not valid. It must be of the form "Platform,Platform,...;LangID,LangID,...".

( I made sure to set the InstallerVersion to 500 as described here . )

I am chalking this up to WiX v4 not having ARM support completely implemented yet and I think it might stay that way for awhile. In the mean time, just compile your installers as x86 as Windows for ARM has x86 emulation built right in.

Edit 2 - 5/27/2020

ARM Support Finally Added to WiX v3 Toolset

Support for ARM (32-bit) and ARM64 (64-bit) looks to have just been added into WiX v3 as noted by issue #6137 and PR #503 . As noted in the issue, you have to install WiX v3.14.0.3910 . If you have any opened Visual Studio projects, make sure they are all closed. In addition, once you install WiX v3.14, make sure to click the " Update Available " button to get any newer updates too.

Now, the build configuration still won't allow you to choose arm or arm64 . You have to manually add the platform configuration(s) to your *.wixproj file. For some reason, " Windows for ARM " on Surface Pro X will throw an error at your installer if you build it for arm (ie 32-bit arm) and won't for arm64 . Therefore, here is the arm64 build configuration I added to my *.wixproj file:

<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|arm64' ">
    <DefineConstants>Debug</DefineConstants>
    <OutputPath>bin\$(Platform)\$(Configuration)\</OutputPath>
    <IntermediateOutputPath>obj\$(Platform)\$(Configuration)\</IntermediateOutputPath>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|arm64' ">
    <OutputPath>bin\$(Platform)\$(Configuration)\</OutputPath>
    <IntermediateOutputPath>obj\$(Platform)\$(Configuration)\</IntermediateOutputPath>
</PropertyGroup>

Now, a few notes before I conclude. There doesn't seem to be a working ProgramFilesArm64Folder or ProgramFilesArmFolder global constant like how there is for x64 and x86 builds (eg ProgramFiles64Folder and ProgramFilesFolder respectively). As a result, you will have to manually define this like so:

<Directory Id="ProgramFilesArm64Folder" Name="Program Files (Arm)">
    <Directory Id="INSTALLFOLDER" Name="!(loc.ProductNameFolder)" />
</Directory>

(Where !(loc.ProductNameFolder) is a locale constant defined in my WiX Localization File and defines the name of the install folder for my program.)

On Surface Pro X, the new ARM64 program files folder is named " Program Files (Arm) ".

Lastly, in your <Project /> definition, make sure to set the InstallerVersion to 500 . Platform can be left as $(var.Platform) or you can type arm64 manually. For both Platform inputs, intellisense will underline it, but this can be ignored.

After all of this, you should now be able to create ARM64 MSI installers for Surface Pro X machines!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM