MSIX Core solution build errors

前端 未结 1 752
灰色年华
灰色年华 2021-01-15 22:36

I have an MSIX package that I need to be able to allow users to install from a web page on versions of Windows older than Windows 10 build 1709. This is possible with MSIX C

相关标签:
1条回答
  • 2021-01-15 23:29

    EDIT: Microsoft is going to continue support of ClickOnce in .NET 5.

    You can deploy .NET Core and .NET 5 applications internally in an organization by sideloading msix packages.

    I have been successfully using Clickonce for deploying .NET line of business applications for years.

    Now that I’m updating my apps to .NET Core I wanted something similar to Clickonce. In other words: publishing your installer in a network share and deploying your autoupdating app to your clients by simply coping a shortcut to your installer.

    You can achieve this with msix packages. The problem is that you are limited to Windows 10 version 1709, and later

    The solution came on December 19th with MSIX Core 1.1. Packaging your app with msix core support you can target Windows 7 SP1 and later, and this is something I needed because at work we are slowly transitioning to Windows 10 from Windows 7 and I still have to support old versions of windows.

    The steps for packaging your .net core app using msix core are:

    1. Create a Windows application packaging project in your solution.

    2. Right click on the Applications subfolder of your Windows application packaging project and select Add Reference. Then select your target project.

    3. Change your Package.manifest (reference: msix-packaging/MsixCore at master · microsoft/msix-packaging · GitHub) Right click your Package.manifest file and select View code Change your to:

        <Dependencies>
          <TargetDeviceFamily Name="MSIXCore.Desktop" MinVersion="6.1.7601.0" MaxVersionTested="10.0.10240.0" />
          <TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.16299.0" MaxVersionTested="10.0.18362.0" />
        </Dependencies>
      

      With this you stablish your min version to MSIXCore.Desktop in other words Windows 7 sp1.

    4. Right click your Windows application packaging project and select Publish then Create App Packages.

    5. Choose Sideloading then check Enable automatic updates.

      Select

    6. In order to install the package in the client machine you must sign it. I recommend you to create a self-signed certificate. You must install the certificate in the client machine so that the package is trusted and you can install it. If you are in a domain you can deploy your self-signed certificate with a group policy. The optimal situation is to sign the package with a trusted certificate provided by a trusted root certification authority. My personal choice is to create a certificate in my own windows certification authority (which is trusted in my local domain). If you decide to sign your package with a trusted cert this is the command line:

    
      .\SignTool.exe sign /fd SHA256 /a /f yourcert.pfx /p yourpassword *.appx
    
    
    1. Select Generate app bundle to Never.

    image-20200521005823248

    1. Select your network share for publishing the package

    image-20200521003324900

    In order to execute your package installer in Windows 7 sp1 machines you must previously install msixmgrSetup-1.1.0.0-x64.msi or msixmgrSetup-1.1.0.0-x86.msi accordingly. You can find the installer here

    Windows 10 machines will recognize the installer right away.

    If you want to know more about msix packages you have a good explanation here

    I hope this guide helps you to get your deployment system working.

    0 讨论(0)
提交回复
热议问题