microsoft / msix-packaging

MSIX SDK
MIT License
978 stars 165 forks source link

[Question] MSIX application (WinForms) not updating on startup #425

Closed ghost closed 2 years ago

ghost commented 3 years ago

I'm running into a problem where the application refuses to update on start-up. I've got my .appinstaller and .msix files hosted on a IIS server and I can visit and download my files from there. I'm using Azure Devops to build a new MSIX file and a release pipeline to deploy it to the IIS server.

If I have version 2 installed and I get the appinstaller file for version 3 and click it, I will be prompted whether or not I want to update. However, if I just start the application (from start menu) I will briefly see the "Checking for updates" screen and then the application will simply start, skipping any updates.

Now, I've seen docs online that mention that you can programmatically try to update, but ideally I'd like to do this on start-up.

I'm using non-store distribution.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<AppInstaller xmlns="http://schemas.microsoft.com/appx/appinstaller/2018" Version="1.0.0.162" Uri="https://application.company.com/MyApplication.appinstaller">
  <MainPackage Name="Applicationname" Publisher="CN=PRIVACY" Version="1.0.0.162" ProcessorArchitecture="x64" Uri="https://application.company.com/MyApplication.msix"/>
  <UpdateSettings>
    <OnLaunch HoursBetweenUpdateChecks="0" ShowPrompt="true" UpdateBlocksActivation="true"/>
  </UpdateSettings>
</AppInstaller>
ghost commented 3 years ago

It's been a while since this ticket received any attention, so I've occasionally tried to look into this myself. Right now the application is only checking for updates when you start it using the "Start pop-up" from Windows. Not when launched using the taskbar of a shortcut on desktop.

I've also acquired the following log

[Wed Jun  2 11:58:37 2021] Log File is located under: C:\Users\MY_NAME\AppData\Local\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\TempState\AILog.txt
[Wed Jun  2 11:58:37 2021]{17088} ConvertVersionToUINT64(String) -> Version [2814750835277824]
[Wed Jun  2 11:58:37 2021]{17088} ConvertVersionToUINT64(String) -> Version [2814750835343360]
[Wed Jun  2 11:58:37 2021]{17088} ConvertVersionToUINT64(String) -> Version [2814750890000384]
[Wed Jun  2 11:58:37 2021]{17088} ConvertVersionToUINT64(String) -> Version [2814750890065920]
[Wed Jun  2 11:58:37 2021]{17088} ConvertVersionToUINT64(String) -> Version [2814750931222528]
[Wed Jun  2 11:58:37 2021]{17088} ConvertVersionToUINT64(String) -> Version [2814750931288064]
[Wed Jun  2 11:58:37 2021]{17088} ConvertVersionToUINT64(String) -> Version [2814751014977536]
[Wed Jun  2 11:58:37 2021]{17088} ConvertVersionToUINT64(String) -> Version [2814751015043072]
[Wed Jun  2 11:58:37 2021]{17088} App::OnActivated: Activated via other means (protocol/protocol for results/toast notification)
[Wed Jun  2 11:58:37 2021]{17088} RegisterBackgroundTask -> Checking if  Background Task is already registered.
[Wed Jun  2 11:58:37 2021]{17088} RegisterBackgroundTask ->  Background Task is already registered.
[Wed Jun  2 11:58:37 2021]{17088} RegisterBackgroundTask -> Checking if  Background Task is already registered.
[Wed Jun  2 11:58:37 2021]{17088} RegisterBackgroundTask ->  Background Task is already registered.
[Wed Jun  2 11:58:37 2021]{17088} GoToState -> WindowButtonsPresentState
[Wed Jun  2 11:58:37 2021]{17088} Activated with ProtocolForResults contract.
[Wed Jun  2 11:58:37 2021]{17088} Argument is a Uri: [ms-appinstaller:?checkForUpdates=MY_APPLICATION_117.0.0.16796_x64__7a4m9c63373k2]
[Wed Jun  2 11:58:37 2021]{17088} Setting launch intent to MSAPPINSTALLER_UPDATE_ON_APP_ACTIVATION
[Wed Jun  2 11:58:37 2021]{17088} GoToState -> LoadingState
[Wed Jun  2 11:58:37 2021]{17088} CheckForAppInstallerExtensionUpdatesOnAppActivationClickAsync.
[Wed Jun  2 11:58:37 2021]{17088} GetIsCheckForUpdateApiSupported -> True
[Wed Jun  2 11:58:37 2021]{17088} AppInstallerUri constructor, URI: [ms-appinstaller:?checkForUpdates=MY_APPLICATION_117.0.0.16796_x64__7a4m9c63373k2]
[Wed Jun  2 11:58:37 2021]{17088} Parsed AppInstaller URI: source: [N/A], activationUri: [N/A], checkForUdpates: [MY_APPLICATION_117.0.0.16796_x64__7a4m9c63373k2]
[Wed Jun  2 11:58:37 2021]{17088} Retrieving installed package for user with full name: [MY_APPLICATION_117.0.0.16796_x64__7a4m9c63373k2]
[Wed Jun  2 11:58:37 2021]{17088} GetAppInstallerUriForInstalledPackage -> location of .appinstaller file is: [https://application.MY_SERVER.nl/MY_FOLDER/DEV/MY_APPLICATION.appinstaller]
[Wed Jun  2 11:58:37 2021]{17088} GetIsMSIXBundleExtensionSupported -> True
[Wed Jun  2 11:58:37 2021]{17088} AppsInfo->CreateAsync, URI: [https://application.MY_SERVER.nl/MY_FOLDER/DEV/MY_APPLICATION.appinstaller]
[Wed Jun  2 11:58:37 2021]{17088} AppsInfo, File Type: [AppInstaller]
[Wed Jun  2 11:58:37 2021]{17088} AppDataSource::CreateAsync
[Wed Jun  2 11:58:39 2021]{17088} AppInstaller XML content:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<AppInstaller xmlns="http://schemas.microsoft.com/appx/appinstaller/2018" Version="117.0.0.16797" Uri="https://application.MY_SERVER.nl/MY_FOLDER/DEV/MY_APPLICATION.appinstaller">
  <MainPackage Name="MY_APPLICATION" Publisher="CN=Company B.V., OU=IT, O=Company B.V., L=CITY, C=NL" Version="117.0.0.16797" ProcessorArchitecture="x64" Uri="https://application.MY_SERVER.nl/MY_FOLDER/DEV/MY_APPLICATION.msix"/>
  <UpdateSettings>
    <OnLaunch HoursBetweenUpdateChecks="0" ShowPrompt="true" UpdateBlocksActivation="true"/>
  </UpdateSettings>
</AppInstaller>
[Wed Jun  2 11:58:39 2021]{17088} GetIsAppInstallerExtensionApiWithHttpReferencesSupported -> True
[Wed Jun  2 11:58:39 2021]{17088} AppInstallerExtension::CreateAsync -> .appinstaller URI is [https://application.MY_SERVER.nl/MY_FOLDER/DEV/MY_APPLICATION.appinstaller]
[Wed Jun  2 11:58:39 2021]{17088} AppDataSource::CreateAsync
[Wed Jun  2 11:58:39 2021]{17088} AppInstaller XML content:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<AppInstaller xmlns="http://schemas.microsoft.com/appx/appinstaller/2018" Version="117.0.0.16797" Uri="https://application.MY_SERVER.nl/MY_FOLDER/DEV/MY_APPLICATION.appinstaller">
  <MainPackage Name="MY_APPLICATION" Publisher="CN=Company B.V., OU=IT, O=Company B.V., L=CITY, C=NL" Version="117.0.0.16797" ProcessorArchitecture="x64" Uri="https://application.MY_SERVER.nl/MY_FOLDER/DEV/MY_APPLICATION.msix"/>
  <UpdateSettings>
    <OnLaunch HoursBetweenUpdateChecks="0" ShowPrompt="true" UpdateBlocksActivation="true"/>
  </UpdateSettings>
</AppInstaller>
[Wed Jun  2 11:58:39 2021]{17088} AppInstallerExtension -> Retrieving the redirection URI from the XML
[Wed Jun  2 11:58:39 2021]{17088} AppInstallerExtension -> Populating primary package information
[Wed Jun  2 11:58:39 2021]{17088} GetIsMSIXBundleExtensionSupported -> True
[Wed Jun  2 11:58:39 2021]{17088} AppInstaller - Primary Package:
    Name: [MY_APPLICATION]
    Uri: [https://application.MY_SERVER.nl/MY_FOLDER/DEV/MY_APPLICATION.msix]
    Publisher: [CN=Company B.V., OU=IT, O=Company B.V., L=CITY, C=NL]
    Version: [117.0.0.16797]
[Wed Jun  2 11:58:39 2021]{17088} GetIsAppInstallerExtensionWithHttpAndLocalReferenceParsingSupported -> True
[Wed Jun  2 11:58:39 2021]{17088} AppDataSource::CreateAsync
[Wed Jun  2 11:58:39 2021]{17088} AppPackageInfo::CreateAsync -> Populating package info
[Wed Jun  2 11:58:39 2021]{17088} Manifest Info -> Package Name is: MY_APPLICATION
[Wed Jun  2 11:58:39 2021]{17088} Manifest Info -> Package Full Name is: MY_APPLICATION_117.0.0.16797_x64__7a4m9c63373k2
[Wed Jun  2 11:58:39 2021]{17088} Manifest Info -> Package Family Name is: MY_APPLICATION_7a4m9c63373k2
[Wed Jun  2 11:58:39 2021]{17088} Manifest Info -> Publisher is: CN=Company B.V., OU=IT, O=Company B.V., L=CITY, C=NL
[Wed Jun  2 11:58:39 2021]{17088} Manifest Info -> Processor architecture is: x64
[Wed Jun  2 11:58:39 2021]{17088} Manifest Info -> Package Version is: 117.0.0.16797
[Wed Jun  2 11:58:39 2021]{17088} Manifest Info -> App DisplayName is: Company Desktop - Development
[Wed Jun  2 11:58:39 2021]{17088} Manifest Info -> App PublisherDisplayName  is: Company B.V.
[Wed Jun  2 11:58:39 2021]{17088} Manifest Info -> App Logo  is: Images\DEV\StoreLogo.png
[Wed Jun  2 11:58:39 2021]{17088} Manifest Info -> First Application AppUserModelId MY_APPLICATION_7a4m9c63373k2!App 
[Wed Jun  2 11:58:39 2021]{17088} Manifest Info -> Populating package dependencies
[Wed Jun  2 11:58:39 2021]{17088} Manifest Info -> Package is Not a Modification Package
[Wed Jun  2 11:58:39 2021]{17088} Signature Info -> Cert Subject: [NL, CITY, Company B.V., IT, Company B.V.]
[Wed Jun  2 11:58:39 2021]{17088} Signature Info -> DoesSignatureCertContainStoreEKU returned FALSE
[Wed Jun  2 11:58:39 2021]{17088} Signature Info -> IsTrustedChain (isMicrosoftTrustedChain = False) returned TRUE
[Wed Jun  2 11:58:39 2021]{17088} Signature Info for Package -> Package Cert Origin: [TRUSTED] Package Cert Subject: [NL, CITY, Company B.V., IT, Company B.V.]
[Wed Jun  2 11:58:39 2021]{17088} Retrieving installed application package for user with package name: [MY_APPLICATION] and publisher name: [CN=Company B.V., OU=IT, O=Company B.V., L=CITY, C=NL] with package types: [33]
[Wed Jun  2 11:58:39 2021]{17088} Found package [MY_APPLICATION_117.0.0.16796_x64__7a4m9c63373k2] but VerifyIsOK returned false (ignoring)
[Wed Jun  2 11:58:39 2021]{17088} ConvertVersionToUINT64(PackageVersion) -> Version [32932572275163548]
[Wed Jun  2 11:58:39 2021]{17088} Retrieving installed application package for user with package name: [MY_APPLICATION] and publisher name: [CN=Company B.V., OU=IT, O=Company B.V., L=CITY, C=NL] with package types: [8]
[Wed Jun  2 11:58:39 2021]{17088} PopulateAppInstallationStatus -> App Already Installed! App Package Full Name: MY_APPLICATION_117.0.0.16796_x64__7a4m9c63373k2
[Wed Jun  2 11:58:39 2021]{17088} Installation Status [Package] -> Older version of the App is already installed
[Wed Jun  2 11:58:39 2021]{17088} AppInstallerExtension -> Populating optional packages information
[Wed Jun  2 11:58:39 2021]{17088} AppInstallerExtension -> Populating related packages information
[Wed Jun  2 11:58:39 2021]{17088} AppInstallerExtension -> Populating optional and related packages that should be installed
[Wed Jun  2 11:58:39 2021]{17088} AppInstallerExtension -> Populating Overall Installation Status
[Wed Jun  2 11:58:39 2021]{17088} Installation Status: INSTALLED_OLDER_VERSION
[Wed Jun  2 11:58:39 2021]{17088} Overall AppInstallerExtension Installation Status: 1
[Wed Jun  2 11:58:39 2021]{17088} AppInstallerExtension -> Populating dependency packages information
[Wed Jun  2 11:58:39 2021]{17088} AppInstaller - ForceUpdateFromAnyVersion setting: [Not Present]
[Wed Jun  2 11:58:39 2021]{17088} AppInstaller - xmlns: [[Wed Jun  2 11:58:39 2021]{17088} AppInstaller - UpdateBlocksActivation XML Value: [true]
[Wed Jun  2 11:58:39 2021]{17088} AppInstaller - UpdateBlocksActivation setting: [True]
[Wed Jun  2 11:58:39 2021]{17088} AppInstaller - UpdateSettings XML node found.
[Wed Jun  2 11:58:39 2021]{17088} GetIsAppInstallerFile2018Supported -> True
[Wed Jun  2 11:58:39 2021]{17088} AppsInfo -> PopulateFromAppInstallerExtensionAsync
[Wed Jun  2 11:58:39 2021]{17088} Already Installed App Package Version: 117.0.0.16796
[Wed Jun  2 11:58:39 2021]{17088} Signature Info Overall -> Overall Cert Origin: [TRUSTED] Cert Subject: [NL, CITY, Company B.V., IT, Company B.V.]
[Wed Jun  2 11:58:39 2021]{17088} PopulateAppInstallerUpdateAvailabilityAsync
[Wed Jun  2 11:58:39 2021]{17088} GetIsCheckForUpdateApiSupported -> True
[Wed Jun  2 11:58:39 2021]{17088} Retrieving installed application package for user with package name: [MY_APPLICATION] and publisher name: [CN=Company B.V., OU=IT, O=Company B.V., L=CITY, C=NL] with package types: [33]
[Wed Jun  2 11:58:39 2021]{17088} Found package [MY_APPLICATION_117.0.0.16796_x64__7a4m9c63373k2] but VerifyIsOK returned false (ignoring)
[Wed Jun  2 11:58:39 2021]{17088} PopulateAppInstallerUpdateAvailabilityAsync -> location of already installed .appinstaller file is: [https://application.MY_SERVER.nl/MY_FOLDER/DEV/MY_APPLICATION.appinstaller]
[Wed Jun  2 11:58:40 2021]{17088} PopulateAppInstallerUpdateAvailabilityAsync -> m_appInstallerUpdateAvailability is Error
[Wed Jun  2 11:58:40 2021]{17088} m_appInstallationStatus is INSTALLED_OLDER_VERSION but m_appInstallerUpdateAvailability is Error
[Wed Jun  2 11:58:40 2021]{17088} This indicates an error on the IT admin where the user had installed an older version of this app that doesn't link to the new .appinstaller file
[Wed Jun  2 11:58:40 2021]{17088} CheckForAppInstallerExtensionUpdatesOnAppActivationClickAsync -> [Error] found.
[Wed Jun  2 11:58:40 2021]{17088} MainPage -> Completing the update-on-launch operation

The following jumps out to me

[Wed Jun  2 11:58:40 2021]{17088} m_appInstallationStatus is INSTALLED_OLDER_VERSION but m_appInstallerUpdateAvailability is Error
[Wed Jun  2 11:58:40 2021]{17088} This indicates an error on the IT admin where the user had installed an older version of this app that doesn't link to the new .appinstaller file
[Wed Jun  2 11:58:40 2021]{17088} CheckForAppInstallerExtensionUpdatesOnAppActivationClickAsync -> [Error] found.

I've tried looking online for ways to solve this, but no luck. The error message stated also makes no sense, I've only ever used 1 .appinstaller location. It doesn't change.

RDMacLachlan commented 3 years ago

Hi @MaikelScheffer,

I am happy to help you with your inquiry. Apologies for the delayed response.

Thank you, Roy

RDMacLachlan commented 3 years ago

If you can confirm that you've updated the MIME-Types of your IIS Server website to include the .MSIX, .MSIXBUNDLE, .APPX, .APPXBUNDLE, and *.APPINSTALLER file extensions?

MIME-Type Configurations

ghost commented 3 years ago

I've included the two I used, .MSIX and .APPINSTALLER. Initially using the web.config file of my hosting application, but later on IIS level

ghost commented 3 years ago

I don't wanna seem impatient, but any update on this? I really want MSIX to work out, but at this point a revert back to ClickOnce might be preferable.

RDMacLachlan commented 3 years ago

Thank you for reaching out and asking for a status on this. We are working on identifying your issue.

We appreciate your patience.