Skip to main content

Setup Client Download Page

This document describes how to set up a download page for the client application which can be used to configure automatic updates of the client application from said page.

Prerequisites

We suggest creating an IIS Web Application to make the Client Application accessible for downloading. This Web Application can be hosted on the same server as the other components of EWA.

For more information on IIS, please refer to the Installation Guide for EWA System.

Server Setup

  1. Create a directory were you would like to host the IIS Web Application.

    Note: This example will use C:\WebSites\pr.ewa.bliksund.com\6636\Download

  2. Add Application into the existing Virtual Directory for EWA.
    Add Application to IIS

  3. Add Alias and Physical path for application.
    IIS Application Screen

  4. Insert the following web.config into the Web Application directory:

    <!-- C:\WebSites\pr.ewa.bliksund.com\6636\Download\web.config -->

    <?xml version="1.0" encoding="utf-8"?>
    <configuration>
    <system.webServer>
    <!--This is to allow the web server to serve resources with the appropriate file extension-->
    <staticContent>
    <remove fileExtension=".appx" />
    <remove fileExtension=".msix" />
    <remove fileExtension=".appxbundle" />
    <remove fileExtension=".msixbundle" />
    <remove fileExtension=".appinstaller" />
    <mimeMap fileExtension=".appx" mimeType="application/appx" />
    <mimeMap fileExtension=".msix" mimeType="application/msix" />
    <mimeMap fileExtension=".appxbundle" mimeType="application/appxbundle" />
    <mimeMap fileExtension=".msixbundle" mimeType="application/msixbundle" />
    <mimeMap fileExtension=".appinstaller" mimeType="application/appinstaller" />
    </staticContent>
    </system.webServer>
    </configuration>
  5. Insert the EWA Application files including the Bliksund EWA.appinstaller in the Web Application directory.
    Application Directory on Server

Updating .appinstaller file

Uri

Edit the "Uri" in the Bliksund EWA.appinstaller file, the file will contain the Uri https://dev.ewa.bliksund.com/client, this must be changed into the URL to your Web Application.

Version

With every version of the EWA Client there will be an accompany .appinstaller file with the correct version number + subdirectory. It's recommended using the file from the supplied artifact as this have been tested.

Example file

  • EWA Client version < 24.3.580:
<?xml version="1.0" encoding="utf-8"?>
<AppInstaller
Uri="https://dev.ewa.bliksund.com/client/Bliksund EWA.appinstaller"
Version="23.2.55176.0" xmlns="http://schemas.microsoft.com/appx/appinstaller/2017/2">
<MainBundle
Name="BliksundAS.BliksundPEPJ"
Version="23.2.55176.0"
Publisher="CN=Bliksund AS, O=Bliksund AS, L=Grimstad, S=Agder, C=NO"
Uri="https://dev.ewa.bliksund.com/client/Bliksund EWA_23.2.55176.0_Test/Bliksund EWA_23.2.55176.0_x64_ARM.msixbundle" />
<Dependencies>
<Package
Name="Microsoft.UI.Xaml.2.8"
Publisher="CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US"
ProcessorArchitecture="x64"
Uri="https://dev.ewa.bliksund.com/client/Bliksund EWA_23.2.55176.0_Test/Dependencies/x64/Microsoft.UI.Xaml.2.8.appx"
Version="8.2208.12001.0" />
<!-- More Package definitions. Cut for brevity. -->
</Dependencies>
<UpdateSettings>
<OnLaunch
HoursBetweenUpdateChecks="0" />
</UpdateSettings>
</AppInstaller>
  • EWA Client version >= 24.3.580:
<?xml version="1.0" encoding="utf-8"?>
<AppInstaller
Uri="https://dev.ewa.bliksund.com/client/Bliksund EWA.appinstaller"
Version="24.3.580.0" xmlns="http://schemas.microsoft.com/appx/appinstaller/2018">
<MainBundle
Name="BliksundAS.BliksundPEPJ"
Version="24.3.580.0"
Publisher="CN=Bliksund AS, O=Bliksund AS, L=GRIMSTAD, S=Agder, C=NO"
Uri="https://dev.ewa.bliksund.com/client/Bliksund EWA_24.3.580.0_Test/Bliksund EWA_24.3.580.0_x64_ARM.msixbundle" />
<Dependencies>
<Package
Name="Microsoft.UI.Xaml.2.8"
Publisher="CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US"
ProcessorArchitecture="x64" Uri="https://dev.ewa.bliksund.com/client/Bliksund EWA_24.3.580.0_Test/Dependencies/x64/Microsoft.UI.Xaml.2.8.appx"
Version="8.2306.22001.0" />
<!-- More Package definitions. Cut for brevity. -->
</Dependencies>
<UpdateSettings>
<OnLaunch HoursBetweenUpdateChecks="0" ShowPrompt="true" />
</UpdateSettings>
</AppInstaller>

The UpdateSettings section of the .appinstaller file should also be updated to reflect the update parameters used in Set-AppxPackageAutoUpdateSettings command.

Setup Clients to Auto Update

It's possible to set up installed client applications to auto-update using the .appinstaller file from the Server Setup section.

The client can be installed as normal using for example DISM with Add-AppxProvisionedPackage PowerShell command, then setup to auto-update using the Set-AppxPackageAutoUpdateSettings PowerShell command.

The Set-AppxPackageAutoUpdateSettings must be run after the client is installed to set it up for automatic updates. It should be noted that he Set-AppxPackageAutoUpdateSettings command only affects the user, so if the tablet/PC has multiple users it needs to be run once for every user that the client application is provisioned for.

See Set-AppxPackageAutoUpdateSettings Documentation for full documentation of the command.

Set-AppxPackageAutoUpdateSettings Parameters

Below is a list of known parameter values for the Set-AppxPackageAutoUpdateSettings command.
Other parameters should also be set to customize your update strategy (see documentation link), but these are known values.

ParameterValue
-AppInstallerUriUse the URL for the .appinstaller file that was set up in Server Setup
-PackageFamilyName of EWA Client version < 24.3.580BliksundAS.BliksundPEPJ_e0w65zkaafen6
-PackageFamilyName of EWA Client version >= 24.3.580BliksundAS.BliksundPEPJ_p0tfvamdv7bj6

Example DISM Add-AppxProvisionedPackage script

Below is an example of how a DISM Add-AppxProvisionedPackage script without the auto-update setup:

function FindAppBundleRoot($Folder) {
return (Get-ChildItem -Path $Folder -Filter \*.msixbundle -Recurse).Directory
}

function FindAllDependencies($Folder) {
$DependencyDir = (Join-Path $Folder "Dependencies")
$DependencyPackages = @()
$DependencyPackages += Get-ChildItem (Join-Path $DependencyDir "\*.appx")

if (($Env:Processor_Architecture -eq "x86" -or $Env:Processor_Architecture -eq "amd64") -and (Test-Path (Join-Path $DependencyDir "x86"))) {
$DependencyPackages += Get-ChildItem (Join-Path $DependencyDir "x86\\\*.appx")
}

if (($Env:Processor_Architecture -eq "amd64") -and (Test-Path (Join-Path $DependencyDir "x64"))) {
$DependencyPackages += Get-ChildItem (Join-Path $DependencyDir "x64\\\*.appx")
}

if (($Env:Processor_Architecture -eq "arm") -and (Test-Path (Join-Path $DependencyDir "arm"))) {
$DependencyPackages += Get-ChildItem (Join-Path $DependencyDir "arm\\\*.appx")
}

return $DependencyPackages
}

$Folder = FindAppBundleRoot($folderName)

Write-Host "Looking for dependencies"
$Dependencies = FindAllDependencies($Folder)
Write-Host "Found " $Dependencies.Count " dependencies"

$Bundle = Get-ChildItem (Join-Path $Folder "\*.msixbundle")

if (Test-Path ("settings.json")) {
Write-Host "Found custom settings to attach"
$CustomData = Get-ChildItem ("settings.json")
}

$arguments = @('/Online')
$arguments += '/Add-ProvisionedAppxPackage'
$arguments += '/PackagePath:"' - $Bundle - '"'

ForEach($dependency in $Dependencies) {
$arguments += '/DependencyPackagePath:"' - $dependency - '"'
}

if ($CustomData) {
$arguments += '/CustomDataPath:' - $CustomData
}

$arguments += '/SkipLicense'

DISM $arguments

Example Set-AppxPackageAutoUpdateSettings command

Below is an example of the Set-AppxPackageAutoUpdateSettings command which will set up the application to be updated from EWA Client Download Page when the app is launch, and showing a prompt to the user before update.

  • EWA Client version < 24.3.580:
Set-AppxPackageAutoUpdateSettings -AppInstallerUri https://dev.ewa.bliksund.com/client/Bliksund%20EWA.appinstaller -PackageFamilyName BliksundAS.BliksundPEPJ_e0w65zkaafen6 -CheckOnLaunch 1 -HoursBetweenUpdateChecks 0 -ShowPrompt 1
  • EWA Client version >= 24.3.580:
Set-AppxPackageAutoUpdateSettings -AppInstallerUri https://dev.ewa.bliksund.com/client/Bliksund%20EWA.appinstaller -PackageFamilyName BliksundAS.BliksundPEPJ_p0tfvamdv7bj6 -CheckOnLaunch 1 -HoursBetweenUpdateChecks 0 -ShowPrompt 1